]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - arch/ia64/include/asm/bitops.h
bitops: Optimize hweight() by making use of compile-time evaluation
[net-next-2.6.git] / arch / ia64 / include / asm / bitops.h
index 6ebc229a1c51fe97b4055e32ef89b09b39678f39..9da3df6f1a522b7ac46330918967776343d67652 100644 (file)
@@ -437,17 +437,18 @@ __fls (unsigned long x)
  * hweightN: returns the hamming weight (i.e. the number
  * of bits set) of a N-bit word
  */
-static __inline__ unsigned long
-hweight64 (unsigned long x)
+static __inline__ unsigned long __arch_hweight64(unsigned long x)
 {
        unsigned long result;
        result = ia64_popcnt(x);
        return result;
 }
 
-#define hweight32(x)   (unsigned int) hweight64((x) & 0xfffffffful)
-#define hweight16(x)   (unsigned int) hweight64((x) & 0xfffful)
-#define hweight8(x)    (unsigned int) hweight64((x) & 0xfful)
+#define __arch_hweight32(x) ((unsigned int) __arch_hweight64((x) & 0xfffffffful))
+#define __arch_hweight16(x) ((unsigned int) __arch_hweight64((x) & 0xfffful))
+#define __arch_hweight8(x)  ((unsigned int) __arch_hweight64((x) & 0xfful))
+
+#include <asm-generic/bitops/const_hweight.h>
 
 #endif /* __KERNEL__ */