From 81e11d991bfbba017a9cc3888fc34f4ea29fa4fa Mon Sep 17 00:00:00 2001 From: "easyaspi314 (Devin)" Date: Mon, 19 Oct 2020 10:25:03 -0400 Subject: [PATCH] Disable disabled dispatch paths in xxhash.h Now, when `XXH_DISPATCH_AVX*` is zero, the codepaths will be properly disabled, preventing any issues from old compilers. Fixes #464 (again). --- xxhash.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xxhash.h b/xxhash.h index 5e65fea..6be5466 100644 --- a/xxhash.h +++ b/xxhash.h @@ -3678,7 +3678,8 @@ XXH_FORCE_INLINE void XXH_writeLE64(void* dst, xxh_u64 v64) * Both XXH3_64bits and XXH3_128bits use this subroutine. */ -#if (XXH_VECTOR == XXH_AVX512) || defined(XXH_X86DISPATCH) +#if (XXH_VECTOR == XXH_AVX512) \ + || (defined(XXH_DISPATCH_AVX512) && XXH_DISPATCH_AVX512 != 0) #ifndef XXH_TARGET_AVX512 # define XXH_TARGET_AVX512 /* disable attribute target */ @@ -3784,7 +3785,8 @@ XXH3_initCustomSecret_avx512(void* XXH_RESTRICT customSecret, xxh_u64 seed64) #endif -#if (XXH_VECTOR == XXH_AVX2) || defined(XXH_X86DISPATCH) +#if (XXH_VECTOR == XXH_AVX2) \ + || (defined(XXH_DISPATCH_AVX2) && XXH_DISPATCH_AVX2 != 0) #ifndef XXH_TARGET_AVX2 # define XXH_TARGET_AVX2 /* disable attribute target */ @@ -3890,6 +3892,7 @@ XXH_FORCE_INLINE XXH_TARGET_AVX2 void XXH3_initCustomSecret_avx2(void* XXH_RESTR #endif +/* x86dispatch always generates SSE2 */ #if (XXH_VECTOR == XXH_SSE2) || defined(XXH_X86DISPATCH) #ifndef XXH_TARGET_SSE2