login
Header Space

 
 

Re: [0/3] Improve generic fls64 for 64-bit machines

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Alexander van Heukelum <heukelum@...>
Cc: Andrew Morton <akpm@...>, linux-arch <linux-arch@...>, Ingo Molnar <mingo@...>, Andi Kleen <andi@...>, LKML <linux-kernel@...>, <heukelum@...>
Date: Sunday, April 6, 2008 - 11:03 am

On Apr. 04, 2008, 17:22 +0300, Alexander van Heukelum <heukelum@mailshack.com> wrote:

Yeah, very few architectures have an optimized version of ffz
that will perform noticeably better than __ffs(~x).
(e.g. h8300, sh)


Interesting idea.  ctz much better than __ffs with regards to the
return value's first bit number, but unless you expose clz
and convert the code how do you get rid of the __fls vs. fls
confusion?
(BTW for __fls, I'd use BITS_PER_LONG - 1, not 31 :)

I think that adopting libc's convention might make more sense,
i.e., define ffs, ffsl, ffsll, and fls, flsl, flsll, and have *all*
be 1-based.

Benny


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[0/3] Improve generic fls64 for 64-bit machines, Alexander van Heukelum, (Sat Mar 15, 1:29 pm)
Re: [0/3] Improve generic fls64 for 64-bit machines, Benny Halevy, (Thu Apr 3, 1:19 pm)
Re: [0/3] Improve generic fls64 for 64-bit machines, Alexander van Heukelum, (Fri Apr 4, 10:22 am)
Re: [0/3] Improve generic fls64 for 64-bit machines, Benny Halevy, (Sun Apr 6, 11:03 am)
Re: [0/3] Improve generic fls64 for 64-bit machines, Alexander van Heukelum, (Sun Apr 6, 3:10 pm)
Re: [0/3] Improve generic fls64 for 64-bit machines, Ingo Molnar, (Fri Mar 21, 9:10 am)
[3/3] Use __fls for fls64 on 64-bit archs, Alexander van Heukelum, (Sat Mar 15, 1:32 pm)
Re: [3/3] Use __fls for fls64 on 64-bit archs, Ricardo M. Correia, (Sat Jul 5, 12:56 pm)
[PATCH] x86: fix description of __fls(): __fls(0) is undefined, Alexander van Heukelum, (Sat Jul 5, 1:53 pm)
[2/3] Implement __fls on all 64-bit archs, Alexander van Heukelum, (Sat Mar 15, 1:31 pm)
[1/3] Introduce a generic __fls implementation, Alexander van Heukelum, (Sat Mar 15, 1:30 pm)
speck-geostationary