limit DYNAMIC_BMI2 to gcc >= 4.8

attribute bmi2 not supported by gcc 4.4
This commit is contained in:
Yann Collet 2018-03-01 15:02:18 -08:00
parent b01552a07a
commit 45b09e7625

View File

@ -71,10 +71,11 @@
#endif #endif
/* Enable runtime BMI2 dispatch based on the CPU. /* Enable runtime BMI2 dispatch based on the CPU.
* Enabled for clang/gcc on x86 when BMI2 isn't enabled by default. * Enabled for clang & gcc >=4.8 on x86 when BMI2 isn't enabled by default.
*/ */
#ifndef DYNAMIC_BMI2 #ifndef DYNAMIC_BMI2
#if defined(__GNUC__) && (defined(__x86_64__) || defined(_M_X86)) && !defined(__BMI2__) #if defined(__GNUC__) && (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)) \
&& (defined(__x86_64__) || defined(_M_X86)) && !defined(__BMI2__)
# define DYNAMIC_BMI2 1 # define DYNAMIC_BMI2 1
#else #else
# define DYNAMIC_BMI2 0 # define DYNAMIC_BMI2 0