Skip to content

Commit

Permalink
Fix emhash8 compilation for MinGW.
Browse files Browse the repository at this point in the history
  • Loading branch information
Steinar H. Gunderson committed Nov 5, 2024
1 parent f1a2f42 commit 22a0eba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/third_party/emhash/README.ninja
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ URL: https://github.com/ktprime/emhash
Copyright: Copyright (c) 2021-2024 Huang Yuanbing & bailuzhou AT 163.com
SPDX-License-Identifier: MIT
Local changes:
- None.
- Added includes for _mm_prefetch on MinGW.
6 changes: 5 additions & 1 deletion src/third_party/emhash/hash_table8.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
_etail = bucket; \
_index[bucket] = {bucket, _num_filled++ | ((size_type)(key_hash) & ~_mask)}

#if _WIN32 && defined(_M_IX86)
#include <xmmintrin.h>
#endif

namespace emhash8 {

struct DefaultPolicy {
Expand Down Expand Up @@ -1237,7 +1241,7 @@ class HashMap
// misses. This is intended to overlap with execution of calculating the hash for a key.
#if __linux__
__builtin_prefetch(static_cast<const void*>(ctrl));
#elif _WIN32
#elif _WIN32 && defined(_M_IX86)
_mm_prefetch((const char*)ctrl, _MM_HINT_T0);
#endif
}
Expand Down

0 comments on commit 22a0eba

Please sign in to comment.