diff options
author | Alexander van Heukelum <heukelum@mailshack.com> | 2008-03-15 18:31:49 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-04-26 19:21:16 +0200 |
commit | 56a6b1eb7bfb5ace0b5cb9c149f502fbd101b8ab (patch) | |
tree | 46d3781050938b0649fc89cd8e7f612cacb66984 /include/asm-alpha | |
parent | generic: introduce a generic __fls implementation (diff) | |
download | linux-56a6b1eb7bfb5ace0b5cb9c149f502fbd101b8ab.tar.xz linux-56a6b1eb7bfb5ace0b5cb9c149f502fbd101b8ab.zip |
generic: implement __fls on all 64-bit archs
Implement __fls on all 64-bit archs:
alpha has an implementation of fls64.
Added __fls(x) = fls64(x) - 1.
ia64 has fls, but not __fls.
Added __fls based on code of fls.
mips and powerpc have __ilog2, which is the same as __fls.
Added __fls = __ilog2.
parisc, s390, sh and sparc64:
Include generic __fls.
x86_64 already has __fls.
Signed-off-by: Alexander van Heukelum <heukelum@fastmail.fm>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/asm-alpha')
-rw-r--r-- | include/asm-alpha/bitops.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asm-alpha/bitops.h b/include/asm-alpha/bitops.h index 9e19a704d484..15f3ae25c511 100644 --- a/include/asm-alpha/bitops.h +++ b/include/asm-alpha/bitops.h @@ -388,6 +388,11 @@ static inline int fls64(unsigned long x) } #endif +static inline unsigned long __fls(unsigned long x) +{ + return fls64(x) - 1; +} + static inline int fls(int x) { return fls64((unsigned int) x); |