From 5f920414d7989daa4029270a716d06505b4dfff9 Mon Sep 17 00:00:00 2001 From: Jeroen van Rijn Date: Sat, 11 Sep 2021 15:45:17 +0200 Subject: [PATCH] xxhash: Disable prefetch on Linux. --- core/hash/xxhash/common.odin | 5 ++++- tests/core/Makefile | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/core/hash/xxhash/common.odin b/core/hash/xxhash/common.odin index 537d2d772..aac5af7e1 100644 --- a/core/hash/xxhash/common.odin +++ b/core/hash/xxhash/common.odin @@ -47,7 +47,10 @@ Error :: enum { XXH_DISABLE_PREFETCH :: #config(XXH_DISABLE_PREFETCH, false) -when !XXH_DISABLE_PREFETCH { +/* + llvm.prefetch fails code generation on Linux. +*/ +when !XXH_DISABLE_PREFETCH && ODIN_OS == "windows" { import "core:sys/llvm" prefetch_address :: #force_inline proc(address: rawptr) { diff --git a/tests/core/Makefile b/tests/core/Makefile index 65f3ee36f..99b1efe87 100644 --- a/tests/core/Makefile +++ b/tests/core/Makefile @@ -16,4 +16,4 @@ strings_test: $(ODIN) run strings/test_core_strings.odin hash_test: - $(ODIN) run hash -out=test_hash -o:speed -no-bounds-check -define:XXH_DISABLE_PREFETCH=true \ No newline at end of file + $(ODIN) run hash -out=test_hash -o:speed -no-bounds-check \ No newline at end of file