[parisc-linux] a fast fls also for 2.6?

Grant Grundler grundler@parisc-linux.org
Fri, 5 Sep 2003 13:29:27 -0600


On Fri, Sep 05, 2003 at 12:26:21PM -0600, Grant Grundler wrote:
> > Without any remark, I don't know if you could also be interested to 
> > include it in 2.6.
> 
> no - becuase fls() and ffs() return the same values for given input.
> (I see comments in include/asm-ppc/bitops.h to that effect).

James Bottomley privately corrected me. fls() != ffs().
fls() returns most significant bit set.

The examples provided:
	* Note fls(0) = 0, fls(1) = 1, fls(0x80000000) = 32.

have the same value for ffs() and fls(). I didn't read the rest.
Good examples for showing bit numbering though.

I'll work on adding 64-bit support to your __fls() and commit that.

sorry for the confusion,
grant