Lines Matching defs:bits
33 #define hash_long(val, bits) hash_32(val, bits)
36 #define hash_long(val, bits) hash_64(val, bits)
191 #define DEFINE_HASHTABLE(name, bits) \
192 struct hlist_head name[1 << (bits)] = \
193 { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT }
195 #define DECLARE_HASHTABLE(name, bits) \
196 struct hlist_head name[1 << (bits)]
271 #define hash_min(val, bits) \
272 (sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits))
315 static inline RK_U32 hash_32(RK_U32 val, unsigned int bits)
320 /* High bits are more random, so use them. */
321 return hash >> (32 - bits);
329 static inline RK_U32 hash_64(RK_U64 val, unsigned int bits)
333 return val * GOLDEN_RATIO_64 >> (64 - bits);
335 /* Hash 64 bits using only 32x32-bit multiply. */
336 return hash_32((RK_U32)val ^ ((val >> 32) * GOLDEN_RATIO_32), bits);
340 static inline RK_U32 hash_ptr(const void *ptr, unsigned int bits)
342 return hash_long((unsigned long)ptr, bits);