From: Yann Collet Date: Thu, 1 Mar 2018 23:02:18 +0000 (-0800) Subject: limit DYNAMIC_BMI2 to gcc >= 4.8 X-Git-Tag: v1.3.4~1^2~43^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=45b09e7625ae3d121aa8586b65db906a8da3ec93;p=thirdparty%2Fzstd.git limit DYNAMIC_BMI2 to gcc >= 4.8 attribute bmi2 not supported by gcc 4.4 --- diff --git a/lib/common/compiler.h b/lib/common/compiler.h index 24f353280..63d32258a 100644 --- a/lib/common/compiler.h +++ b/lib/common/compiler.h @@ -71,10 +71,11 @@ #endif /* 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 - #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 #else # define DYNAMIC_BMI2 0