Browse Source

xxhash: Disable prefetch on Linux.

Jeroen van Rijn 4 years ago
parent
commit
5f920414d7
2 changed files with 5 additions and 2 deletions
  1. 4 1
      core/hash/xxhash/common.odin
  2. 1 1
      tests/core/Makefile

+ 4 - 1
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) {

+ 1 - 1
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
+	$(ODIN) run hash -out=test_hash -o:speed -no-bounds-check