Skip to content

Commit

Permalink
Do not use 128bit arithmetics on not optimal targets
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Aug 14, 2023
1 parent 1afbf47 commit abd0395
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion include/sdb/cwisstable.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,14 @@
#endif
#endif

#ifdef __aarch64__
#define USE_128_MIX 0
#elif DCWISS_HAVE_MUL128
#define USE_128_MIX 1
#else
#define USE_128_MIX 0
#endif

/// `CWISS_ALIGN` is a cross-platform `alignas()`: specifically, MSVC doesn't
/// quite believe in it.
#if CWISS_IS_MSVC
Expand Down Expand Up @@ -1221,7 +1229,7 @@ CWISS_BEGIN
CWISS_BEGIN_EXTERN

static inline uint64_t CWISS_AbslHash_LowLevelMix(uint64_t v0, uint64_t v1) {
#ifndef __aarch64__
#if USE_128_MIX
// The default bit-mixer uses 64x64->128-bit multiplication.
CWISS_U128 p = CWISS_Mul128(v0, v1);
return p.hi ^ p.lo;
Expand Down

0 comments on commit abd0395

Please sign in to comment.