From e591dbf347bdcebd4b91c075be5f23be6eaee97a Mon Sep 17 00:00:00 2001 From: amir Date: Sat, 28 Feb 2026 19:44:43 +0100 Subject: [PATCH] Add support for AVX2 instead of SSE2 Must compile with -mavx2 in clang/gcc or /arch:AVX2 in clang-cl --- platform.h | 3 ++- xxhash.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platform.h b/platform.h index 4a6cec7..c1c7a86 100644 --- a/platform.h +++ b/platform.h @@ -31,7 +31,8 @@ #include #endif -// #define XXH_VECTOR XXH_AVX2 // don't compile with gcc see xxhash.h line 4082 +#define XXH_VECTOR XXH_AVX2 // not recommanded to compile with gcc see xxhash.h line 4082 + // Must compile with /arch:AVX2 in clang-cl or -mavx2 in clang/gcc #define XXH_INLINE_ALL #include "xxhash.c" #include "xxhash.h" diff --git a/xxhash.h b/xxhash.h index 77fa932..f21ff1f 100644 --- a/xxhash.h +++ b/xxhash.h @@ -5101,7 +5101,7 @@ XXH3_accumulate_512_avx2( void* XXH_RESTRICT acc, const void* XXH_RESTRICT secret) { //DEBUG - printf("\nUsing AVX2\n"); + // printf("\nUsing AVX2\n"); XXH_ASSERT((((size_t)acc) & 31) == 0); { __m256i* const xacc = (__m256i *) acc; /* Unaligned. This is mainly for pointer arithmetic, and because