14#if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__)
15#define _likely_(x) __builtin_expect(x, 1)
16#define _unlikely_(x) __builtin_expect(x, 0)
18#define _likely_(x) (x)
19#define _unlikely_(x) (x)
23static inline void _wymum(uint64_t*
A, uint64_t*
B) {
24#if defined(__SIZEOF_INT128__)
28 *
B = (uint64_t)(r >> 64);
29#elif defined(_MSC_VER) && defined(_M_X64)
30 *
A = _umul128(*
A, *
B,
B);
32 uint64_t ha = *
A >> 32, hb = *
B >> 32, la = (uint32_t)*
A, lb = (uint32_t)*
B, hi, lo;
33 uint64_t rh = ha * hb, rm0 = ha * lb, rm1 = hb * la, rl = la * lb, t = rl + (rm0 << 32),
37 hi = rh + (rm0 >> 32) + (rm1 >> 32) + c;
44static inline uint64_t
_wymix(uint64_t
A, uint64_t
B) {
50static inline uint64_t
_wyr8(
const uint8_t*
p) {
56static inline uint64_t
_wyr4(
const uint8_t*
p) {
62static inline uint64_t
_wyr3(
const uint8_t*
p,
size_t k) {
63 return (((uint64_t)
p[0]) << 16) | (((uint64_t)
p[k >> 1]) << 8) |
p[k - 1];
67static inline uint64_t
wyhash(
const void*
key,
size_t len, uint64_t seed,
const uint64_t* secret) {
68 const uint8_t*
p = (
const uint8_t*)
key;
69 seed ^=
_wymix(seed ^ secret[0], secret[1]);
83 uint64_t see1 = seed, see2 = seed;
108static const uint64_t
_wyp[4] = {
109 0xa0761d6478bd642full, 0xe7037ed1a0b428dbull, 0x8ebc6af09c88c6e3ull, 0x589965cc75374cc3ull};
113uint32_t
Hash32(
const void *
data,
size_t bytes, uint32_t seed) {
117uint64_t
Hash64(
const void *
data,
size_t bytes, uint64_t seed) {
static const uint64_t _wyp[4]
static uint64_t _wyr4(const uint8_t *p)
static uint64_t _wyr3(const uint8_t *p, size_t k)
static uint64_t _wymix(uint64_t A, uint64_t B)
static uint64_t wyhash(const void *key, size_t len, uint64_t seed, const uint64_t *secret)
static void _wymum(uint64_t *A, uint64_t *B)
static uint64_t _wyr8(const uint8_t *p)
uint64_t Hash64(const void *data, size_t bytes, uint64_t seed)
uint32_t Hash32(const void *data, size_t bytes, uint32_t seed)
std::shared_ptr< const fml::Mapping > data