From owner-freebsd-hackers@FreeBSD.ORG Fri Jun 12 00:49:24 2015 Return-Path: Delivered-To: freebsd-hackers@hub.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 B54CAF21; Fri, 12 Jun 2015 00:49:24 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 712901FE1; Fri, 12 Jun 2015 00:49:23 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id B068F1FE023; Fri, 12 Jun 2015 02:49:19 +0200 (CEST) Message-ID: <557A2CC0.9010409@selasky.org> Date: Fri, 12 Jun 2015 02:50:08 +0200 From: Hans Petter Selasky User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Erich Dollansky , Ian Lepore CC: freebsd-hackers@freebsd.org, freebsd-hackers@FreeBSD.org Subject: Re: allow ffs & co. a binary search 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> <1434034310.1415.2.camel@freebsd.org> <20150612081054.4589dcc7@B85M-HD3-0.alogt.com> In-Reply-To: <20150612081054.4589dcc7@B85M-HD3-0.alogt.com> Content-Type: text/plain; charset=windows-1252; format=flowed 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: Fri, 12 Jun 2015 00:49:24 -0000 On 06/12/15 02:10, Erich Dollansky wrote: > Hi, > > On Thu, 11 Jun 2015 08:51:50 -0600 > Ian Lepore wrote: > >> 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? >> > so, it is not in the sources yet. Yes, then use it and let the compiler > guys crack their heads. > > Erich Hi, Are we depending on that ffs() is a valid symbol when linking? --HPS