18# define ROTL32(x, y) _rotl(x, y)
19# define ROTL64(x, y) _rotl64(x, y)
20# define BIG_CONSTANT(x) (x)
24 return (
x << r) | (
x >> (32 - r));
26# define ROTL32(x, y) rotl32(x, y)
27# define BIG_CONSTANT(x) (x##LLU)
52 const uint8_t *
data = (
const uint8_t *)key;
53 const int nblocks =
len / 4;
57 const uint32_t c1 = 0xcc9e2d51;
58 const uint32_t c2 = 0x1b873593;
60 const uint32_t *blocks = (
const uint32_t *)(
data + nblocks * 4);
62 for (
int i = -nblocks;
i;
i++) {
71 h1 = h1 * 5 + 0xe6546b64;
74 const uint8_t *tail = (
const uint8_t *)(
data + nblocks * 4);
104 const uint32_t mantissa =
hash & ((1 << 23) - 1);
105 uint32_t exponent = (
hash >> 23) & ((1 << 8) - 1);
106 exponent =
max(exponent, (uint32_t)1);
107 exponent =
min(exponent, (uint32_t)254);
108 exponent = exponent << 23;
111 uint32_t float_bits =
sign | exponent | mantissa;
113 memcpy(&f, &float_bits,
sizeof(uint32_t));
BMesh const char void * data
#define ccl_device_inline
#define CCL_NAMESPACE_END
ccl_device_inline float len(const float2 a)
ccl_device_inline uint32_t rotl32(const uint32_t x, int8_t r)
uint32_t util_murmur_hash3(const void *key, const int len, const uint32_t seed)
CCL_NAMESPACE_BEGIN ccl_device_inline uint32_t mm_hash_getblock32(const uint32_t *p, const int i)
float util_hash_to_float(const uint32_t hash)
ccl_device_inline uint32_t mm_hash_fmix32(uint32_t h)