summaryrefslogtreecommitdiffhomepage
path: root/hash/hash-impl.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-06-10 00:00:54 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-06-30 21:52:01 +0200
commit014fc7ab7762890c44ad3885668696300ceed25e (patch)
tree5b87cc8a343e07e54a87f93c33f67f720a62a20d /hash/hash-impl.hpp
parent9af205873f7e7342da56e2e66b7249e1fca4d907 (diff)
hash: more work (also add meowhash)
Diffstat (limited to 'hash/hash-impl.hpp')
-rw-r--r--hash/hash-impl.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/hash/hash-impl.hpp b/hash/hash-impl.hpp
index 3e33b38b..f752a889 100644
--- a/hash/hash-impl.hpp
+++ b/hash/hash-impl.hpp
@@ -1,4 +1,20 @@
#pragma once
+#include "compat/defs.hpp"
+
+#if (defined __x86_64__ || defined __i386__ || defined _M_AMD64 || defined _M_IX86) && \
+ (defined __AES__ || defined _MSC_VER && defined __AVX__)
+#define FM_HASH_HAVE_MEOWHASH 1
+#else
+#define FM_HASH_HAVE_MEOWHASH 0
+#endif
+
+#if FM_HASH_HAVE_MEOWHASH
+namespace floormat::meow_hash {
+size_t hash_buf(const void* __restrict buf, size_t size) noexcept;
+size_t hash_int(uint32_t x) noexcept;
+size_t hash_int(uint64_t x) noexcept;
+} // namespace floormat::meow_hash
+#endif
namespace floormat::xxHash {
size_t hash_buf(const void* __restrict buf, size_t size) noexcept;