-
-
Notifications
You must be signed in to change notification settings - Fork 178
/
CityTest.cpp
41 lines (33 loc) · 1.2 KB
/
CityTest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "City.h"
#include "CityCrc.h"
void CityHash32_test(const void *key, int len, uint32_t seed, void *out) {
// objsize 0-527: 1319
*(uint32_t *)out = CityHash32WithSeed((const char *)key, len, seed);
}
void CityHash64_test(const void *key, int len, uint32_t seed, void *out) {
// objsize 1038 + a20-a72: 82 = 1120
*(uint64_t *)out = CityHash64WithSeed((const char *)key, len, seed);
}
void CityHash64noSeed_test(const void *key, int len, uint32_t seed, void *out) {
// objsize 530-93e: 1038
*(uint64_t *)out = CityHash64((const char *)key, len);
(void)seed;
}
#if defined(HAVE_SSE42) && defined(__x86_64__)
void CityHash128_test(const void *key, int len, uint32_t seed, void *out) {
uint128 s(0, 0);
s.first = seed;
// objsize ad0-1201: 1841
*(uint128 *)out = CityHash128WithSeed((const char *)key, len, s);
}
void CityHashCrc128_test(const void *key, int len, uint32_t seed, void *out) {
uint128 s(0, 0);
s.first = seed;
// objsize 1940-1a67: 295
*(uint128 *)out = CityHashCrc128WithSeed((const char *)key, len, s);
}
void CityHashCrc256_test(const void *key, int len, uint32_t seed, void *out) {
CityHashCrc256((const char *)key, len, (uint64_t *)out);
(void)seed;
}
#endif