diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-18 12:17:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-18 12:17:01 -0400 |
commit | cb41838bbc4403f7270a94b93a9a0d9fc9c2e7ea (patch) | |
tree | 0f359975ccad4ac72e86b8edf1924c076e74bd89 /arch/alpha | |
parent | 98f01720cbe3e2eb719682777049b6514e9db556 (diff) | |
parent | c59bd5688299cddb71183e156e7a3c1409b90df2 (diff) |
Merge branch 'core-hweight-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'core-hweight-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
x86, hweight: Use a 32-bit popcnt for __arch_hweight32()
arch, hweight: Fix compilation errors
x86: Add optimized popcnt variants
bitops: Optimize hweight() by making use of compile-time evaluation
Diffstat (limited to 'arch/alpha')
-rw-r--r-- | arch/alpha/include/asm/bitops.h | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/alpha/include/asm/bitops.h b/arch/alpha/include/asm/bitops.h index 15f3ae25c511..296da1d5ed57 100644 --- a/arch/alpha/include/asm/bitops.h +++ b/arch/alpha/include/asm/bitops.h | |||
@@ -405,29 +405,31 @@ static inline int fls(int x) | |||
405 | 405 | ||
406 | #if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) | 406 | #if defined(CONFIG_ALPHA_EV6) && defined(CONFIG_ALPHA_EV67) |
407 | /* Whee. EV67 can calculate it directly. */ | 407 | /* Whee. EV67 can calculate it directly. */ |
408 | static inline unsigned long hweight64(unsigned long w) | 408 | static inline unsigned long __arch_hweight64(unsigned long w) |
409 | { | 409 | { |
410 | return __kernel_ctpop(w); | 410 | return __kernel_ctpop(w); |
411 | } | 411 | } |
412 | 412 | ||
413 | static inline unsigned int hweight32(unsigned int w) | 413 | static inline unsigned int __arch_weight32(unsigned int w) |
414 | { | 414 | { |
415 | return hweight64(w); | 415 | return __arch_hweight64(w); |
416 | } | 416 | } |
417 | 417 | ||
418 | static inline unsigned int hweight16(unsigned int w) | 418 | static inline unsigned int __arch_hweight16(unsigned int w) |
419 | { | 419 | { |
420 | return hweight64(w & 0xffff); | 420 | return __arch_hweight64(w & 0xffff); |
421 | } | 421 | } |
422 | 422 | ||
423 | static inline unsigned int hweight8(unsigned int w) | 423 | static inline unsigned int __arch_hweight8(unsigned int w) |
424 | { | 424 | { |
425 | return hweight64(w & 0xff); | 425 | return __arch_hweight64(w & 0xff); |
426 | } | 426 | } |
427 | #else | 427 | #else |
428 | #include <asm-generic/bitops/hweight.h> | 428 | #include <asm-generic/bitops/arch_hweight.h> |
429 | #endif | 429 | #endif |
430 | 430 | ||
431 | #include <asm-generic/bitops/const_hweight.h> | ||
432 | |||
431 | #endif /* __KERNEL__ */ | 433 | #endif /* __KERNEL__ */ |
432 | 434 | ||
433 | #include <asm-generic/bitops/find.h> | 435 | #include <asm-generic/bitops/find.h> |