allow ffs & co. a binary search

Ian Lepore ian at freebsd.org
Thu Jun 11 14:52:54 UTC 2015


On Thu, 2015-06-11 at 22:43 +0800, Erich Dollansky wrote:
> Hi,
> 
> On Thu, 11 Jun 2015 06:57:51 -0600
> Ian Lepore <ian at freebsd.org> 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 <hps at selasky.org> 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



More information about the freebsd-hackers mailing list