Lines Matching +full:32 +full:- +full:bits
14 #if BITS_PER_LONG == 32
16 #define hash_long(val, bits) hash_32(val, bits) argument
18 #define hash_long(val, bits) hash_64(val, bits) argument
21 #error Wordsize not 32 or 64
26 * high bits. Since multiplication propagates changes to the most
27 * significant end only, it is essential that the high bits of the
31 * http://www.citi.umich.edu/techreports/reports/citi-tr-00-1.pdf
34 * ratio phi = (sqrt(5)-1)/2, or its negative, has particularly nice
37 * These are the negative, (1 - phi) = phi**2 = (3 - sqrt(5))/2,
51 * the arch-optimized versions with the generic.
55 * self-test will not false-positive.
65 static inline u32 hash_32(u32 val, unsigned int bits) in hash_32() argument
67 /* High bits are more random, so use them. */ in hash_32()
68 return __hash_32(val) >> (32 - bits); in hash_32()
74 static __always_inline u32 hash_64_generic(u64 val, unsigned int bits) in hash_64_generic() argument
77 /* 64x64-bit multiply is efficient on all 64-bit processors */ in hash_64_generic()
78 return val * GOLDEN_RATIO_64 >> (64 - bits); in hash_64_generic()
80 /* Hash 64 bits using only 32x32-bit multiply. */ in hash_64_generic()
81 return hash_32((u32)val ^ __hash_32(val >> 32), bits); in hash_64_generic()
85 static inline u32 hash_ptr(const void *ptr, unsigned int bits) in hash_ptr() argument
87 return hash_long((unsigned long)ptr, bits); in hash_ptr()
96 val ^= (val >> 32); in hash32_ptr()