diff options
Diffstat (limited to 'gcc/config/i386/driver-i386.c')
-rw-r--r-- | gcc/config/i386/driver-i386.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/config/i386/driver-i386.c b/gcc/config/i386/driver-i386.c index 1f6fadfe90a..b7a1f523c13 100644 --- a/gcc/config/i386/driver-i386.c +++ b/gcc/config/i386/driver-i386.c @@ -393,7 +393,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) unsigned int has_lahf_lm = 0, has_sse4a = 0; unsigned int has_longmode = 0, has_3dnowp = 0, has_3dnow = 0; unsigned int has_movbe = 0, has_sse4_1 = 0, has_sse4_2 = 0; - unsigned int has_popcnt = 0, has_aes = 0, has_avx = 0; + unsigned int has_popcnt = 0, has_aes = 0, has_avx = 0, has_avx2 = 0; unsigned int has_pclmul = 0, has_abm = 0, has_lwp = 0; unsigned int has_fma = 0, has_fma4 = 0, has_xop = 0; unsigned int has_bmi = 0, has_tbm = 0, has_lzcnt = 0; @@ -474,6 +474,7 @@ const char *host_detect_local_cpu (int argc, const char **argv) __cpuid (0x7, eax, ebx, ecx, edx); has_bmi = ebx & bit_BMI; + has_avx2 = ebx & bit_AVX2; } if (!arch) @@ -716,13 +717,14 @@ const char *host_detect_local_cpu (int argc, const char **argv) const char *bmi = has_bmi ? " -mbmi" : " -mno-bmi"; const char *tbm = has_tbm ? " -mtbm" : " -mno-tbm"; const char *avx = has_avx ? " -mavx" : " -mno-avx"; + const char *avx2 = has_avx2 ? " -mavx2" : " -mno-avx2"; const char *sse4_2 = has_sse4_2 ? " -msse4.2" : " -mno-sse4.2"; const char *sse4_1 = has_sse4_1 ? " -msse4.1" : " -mno-sse4.1"; const char *lzcnt = has_lzcnt ? " -mlzcnt" : " -mno-lzcnt"; options = concat (options, cx16, sahf, movbe, ase, pclmul, popcnt, abm, lwp, fma, fma4, xop, bmi, tbm, - avx, sse4_2, sse4_1, lzcnt, NULL); + avx2, avx, sse4_2, sse4_1, lzcnt, NULL); } done: |