diff options
author | van Hauser <vh@thc.org> | 2020-06-17 15:05:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-17 15:05:14 +0200 |
commit | 0dc9967984df3f9c250d4c27b6de1cbd4cac3eb3 (patch) | |
tree | ca6096f1d22ba87c262bdeaf57455520ef3143e2 /include/hash.h | |
parent | 12bdefe00e38cdc3dd8cb028eeac325ab2e94e16 (diff) | |
parent | 889e54eab858b1928f74a8c179b32275b62f2286 (diff) | |
download | afl++-0dc9967984df3f9c250d4c27b6de1cbd4cac3eb3.tar.gz |
Merge pull request #403 from AFLplusplus/dev
push to master
Diffstat (limited to 'include/hash.h')
-rw-r--r-- | include/hash.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/hash.h b/include/hash.h index cec51eac..6910e0e2 100644 --- a/include/hash.h +++ b/include/hash.h @@ -30,9 +30,16 @@ #include "types.h" -#ifdef __x86_64__ +u32 hash32(const void *key, u32 len, u32 seed); +u64 hash64(const void *key, u32 len, u64 seed); - #define ROL64(_x, _r) ((((u64)(_x)) << (_r)) | (((u64)(_x)) >> (64 - (_r)))) +#if 0 + +The following code is disabled because xxh3 is 30% faster + + #ifdef __x86_64__ + + #define ROL64(_x, _r) ((((u64)(_x)) << (_r)) | (((u64)(_x)) >> (64 - (_r)))) static inline u32 hash32(const void *key, u32 len, u32 seed) { @@ -65,9 +72,9 @@ static inline u32 hash32(const void *key, u32 len, u32 seed) { } -#else + #else - #define ROL32(_x, _r) ((((u32)(_x)) << (_r)) | (((u32)(_x)) >> (32 - (_r)))) + #define ROL32(_x, _r) ((((u32)(_x)) << (_r)) | (((u32)(_x)) >> (32 - (_r)))) static inline u32 hash32(const void *key, u32 len, u32 seed) { @@ -100,7 +107,8 @@ static inline u32 hash32(const void *key, u32 len, u32 seed) { } -#endif /* ^__x86_64__ */ + #endif /* ^__x86_64__ */ +#endif #endif /* !_HAVE_HASH_H */ |