Lines Matching defs:bits
32 #define hash_long(val, bits) hash_32(val, bits)
35 #define hash_long(val, bits) hash_64(val, bits)
200 #define DEFINE_HASHTABLE(name, bits) \
201 struct hlist_head name[1 << (bits)] = \
202 { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT }
204 #define DECLARE_HASHTABLE(name, bits) \
205 struct hlist_head name[1 << (bits)]
280 #define hash_min(val, bits) \
281 (sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits))
324 static inline RK_U32 hash_32(RK_U32 val, unsigned int bits)
329 /* High bits are more random, so use them. */
330 return hash >> (32 - bits); // (32 - bits)
338 static inline RK_U32 hash_64(RK_U64 val, unsigned int bits)
342 return (val * GOLDEN_RATIO_64) >> (64 - bits);
344 /* Hash 64 bits using only 32x32-bit multiply. */
345 return hash_32((RK_U32)val ^ ((val >> 32) * GOLDEN_RATIO_32), bits);
349 static inline RK_U32 hash_ptr(const void *ptr, unsigned int bits)
351 return hash_long((unsigned long)ptr, bits);