From 4a97bdb834bd0130b2f7a319392e43458e96d081 Mon Sep 17 00:00:00 2001
From: Cheng Shao <terrorjack@type.dance>
Date: Mon, 12 Feb 2024 14:57:30 +0000
Subject: [PATCH] rts: use XXH3_64bits hash on all 64-bit platforms

This commit enables XXH3_64bits hash to be used on all 64-bit
platforms. Previously it was only enabled on x86_64, so platforms like
aarch64 silently falls back to using XXH32 which degrades the hashing
function quality.
---
 rts/Hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rts/Hash.c b/rts/Hash.c
index 35ee26ce0b8f..e505d04fa041 100644
--- a/rts/Hash.c
+++ b/rts/Hash.c
@@ -99,7 +99,7 @@ int
 hashStr(const HashTable *table, StgWord w)
 {
     const char *key = (char*) w;
-#if defined(x86_64_HOST_ARCH)
+#if WORD_SIZE_IN_BITS == 64
     StgWord h = XXH3_64bits_withSeed (key, strlen(key), 1048583);
 #else
     StgWord h = XXH32 (key, strlen(key), 1048583);
-- 
GitLab