Add support for AVX2 instead of SSE2

Must compile with -mavx2 in clang/gcc or
 /arch:AVX2 in clang-cl
This commit is contained in:
2026-02-28 19:44:43 +01:00
parent b89526d724
commit e591dbf347
2 changed files with 3 additions and 2 deletions

View File

@@ -31,7 +31,8 @@
#include <unistd.h>
#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"

View File

@@ -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