summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--absl/hash/internal/hash.h9
1 files changed, 2 insertions, 7 deletions
diff --git a/absl/hash/internal/hash.h b/absl/hash/internal/hash.h
index f8103334..45dfdd46 100644
--- a/absl/hash/internal/hash.h
+++ b/absl/hash/internal/hash.h
@@ -1090,15 +1090,10 @@ class ABSL_DLL MixingHashState : public HashStateBase<MixingHashState> {
}
ABSL_ATTRIBUTE_ALWAYS_INLINE static uint64_t Mix(uint64_t state, uint64_t v) {
-#if defined(__aarch64__)
- // On AArch64, calculating a 128-bit product is inefficient, because it
- // requires a sequence of two instructions to calculate the upper and lower
- // halves of the result.
- using MultType = uint64_t;
-#else
+ // Though the 128-bit product on AArch64 needs two instructions, it is
+ // still a good balance between speed and hash quality.
using MultType =
absl::conditional_t<sizeof(size_t) == 4, uint64_t, uint128>;
-#endif
// We do the addition in 64-bit space to make sure the 128-bit
// multiplication is fast. If we were to do it as MultType the compiler has
// to assume that the high word is non-zero and needs to perform 2