add global definitions for CHUNKSIZE/VECTORSIZE, define HAVE_AVX512* only when BUILD_AVX512 is also enabled

This commit is contained in:
Konstantinos Margaritis 2021-05-12 13:26:42 +03:00
parent 831091db9e
commit 52661f35e8

View File

@ -58,15 +58,26 @@
#define HAVE_SIMD_256_BITS #define HAVE_SIMD_256_BITS
#endif #endif
#if defined(__AVX512BW__) #if defined(__AVX512BW__) && defined(BUILD_AVX512)
#define HAVE_AVX512 #define HAVE_AVX512
#define HAVE_SIMD_512_BITS #define HAVE_SIMD_512_BITS
#endif #endif
#if defined(__AVX512VBMI__) #if defined(__AVX512VBMI__) && defined(BUILD_AVX512)
#define HAVE_AVX512VBMI #define HAVE_AVX512VBMI
#endif #endif
#if defined(HAVE_SIMD_512_BITS)
#define CHUNKSIZE 512
#define VECTORSIZE 64
#elif defined(HAVE_SIMD_256_BITS)
#define CHUNKSIZE 256
#define VECTORSIZE 32
#elif defined(HAVE_SIMD_128_BITS)
#define CHUNKSIZE 128
#define VECTORSIZE 16
#endif
/* /*
* ICC and MSVC don't break out POPCNT or BMI/2 as separate pre-def macros * ICC and MSVC don't break out POPCNT or BMI/2 as separate pre-def macros
*/ */