From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 11 14:52:54 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E804455 for ; Thu, 11 Jun 2015 14:52:54 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) by mx1.freebsd.org (Postfix) with SMTP id 3B764151C for ; Thu, 11 Jun 2015 14:52:53 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from ilsoft.org (unknown [73.34.117.227]) by outbound2.ore.mailhop.org (Halon Mail Gateway) with ESMTPSA; Thu, 11 Jun 2015 14:51:58 +0000 (UTC) Received: from revolution.hippie.lan (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id t5BEpopf006679; Thu, 11 Jun 2015 08:51:50 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1434034310.1415.2.camel@freebsd.org> Subject: Re: allow ffs & co. a binary search From: Ian Lepore To: Erich Dollansky Cc: Hans Petter Selasky , "freebsd-hackers@freebsd.org" Date: Thu, 11 Jun 2015 08:51:50 -0600 In-Reply-To: <20150611224347.64372a76@B85M-HD3-0.alogt.com> References: <20150607081315.7c0f09fb@B85M-HD3-0.alogt.com> <5573EA5E.40806@selasky.org> <20150611152107.61f85189@B85M-HD3-0.alogt.com> <1434027471.1200.401.camel@freebsd.org> <20150611224347.64372a76@B85M-HD3-0.alogt.com> Content-Type: text/plain; charset="us-ascii" X-Mailer: Evolution 3.12.10 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2015 14:52:54 -0000 On Thu, 2015-06-11 at 22:43 +0800, Erich Dollansky wrote: > Hi, > > On Thu, 11 Jun 2015 06:57:51 -0600 > Ian Lepore wrote: > > > On Thu, 2015-06-11 at 15:21 +0800, Erich Dollansky wrote: > > > On Sun, 07 Jun 2015 08:53:18 +0200 > > > Hans Petter Selasky wrote: > > > > > Is there any reason that this whole change, userland and kernel, isn't > > just: > > > > #define ffs(n) __builtin_ffs(n) > > I did not see this. Where is it? > > Of course, if this is already done, it does not have to be done again. > > Erich I'm not quite sure what you're asking. Both clang and gcc support __builtin_ffs(), so I'm saying why don't we just use it and call the whole problem solved? -- Ian