Lines Matching defs:bits
32 #define hash_long(val, bits) hash_32(val, bits)
35 #define hash_long(val, bits) hash_64(val, bits)
195 #define DEFINE_HASHTABLE(name, bits) \
196 struct hlist_head name[1 << (bits)] = \
197 { [0 ... ((1 << (bits)) - 1)] = HLIST_HEAD_INIT }
199 #define DECLARE_HASHTABLE(name, bits) \
200 struct hlist_head name[1 << (bits)]
275 #define hash_min(val, bits) \
276 (sizeof(val) <= 4 ? hash_32(val, bits) : hash_long(val, bits))
319 static inline RK_U32 hash_32(RK_U32 val, unsigned int bits)
324 /* High bits are more random, so use them. */
325 return hash >> (32 - bits); // 32:32bits
333 static inline RK_U32 hash_64(RK_U64 val, unsigned int bits)
337 return val * (GOLDEN_RATIO_64 >> (64 - bits));
339 /* Hash 64 bits using only 32x32-bit multiply. */
340 return hash_32((RK_U32)val ^ ((val >> 32) * GOLDEN_RATIO_32), bits);
344 static inline RK_U32 hash_ptr(const void *ptr, unsigned int bits)
346 return hash_long((unsigned long)ptr, bits);
355 val ^= (val >> 32); // 32:Shift 32 bits right