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@...>
Date: Thursday, April 3, 2008 - 1:19 pm

On Mar. 15, 2008, 19:29 +0200, Alexander van Heukelum <heukelum@mailshack.com> wrote:

I strongly support this.

I wish we'd also have a consistent naming convention for all
the bitops functions so it will be clearer what data type the
function is working on and is the result 0 or 1 based.

It seems like what we currently have is:

name	type	first bit#
----	----	----------
ffs	int	1
fls	int	1
__ffs	ulong	0
__fls	ulong	0	# in your proposal
ffz	ulong	0
fls64	__u64	1

so it seems like
- ffz is misnamed and is rather confusing.
  Apprently is should be renamed to __ffz.

- (new) ffz(x) can be defined to ffs(~(x))

- It'd be nice to have ffs64, and maybe ffz64.

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