diff options
author | Craig Topper <craig.topper@gmail.com> | 2012-04-26 06:40:15 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2012-04-26 06:40:15 +0000 |
commit | 1203f2f138ec8298ffcf6c6138e56ce6b2413b4b (patch) | |
tree | 799591aa71cf0dbff225adb6250b0bc264373b21 /lib/Target/X86/X86Subtarget.cpp | |
parent | 464bda3a167bb761eb3c9c178db3fa8ed26fe825 (diff) | |
download | llvm-1203f2f138ec8298ffcf6c6138e56ce6b2413b4b.tar.gz llvm-1203f2f138ec8298ffcf6c6138e56ce6b2413b4b.tar.bz2 llvm-1203f2f138ec8298ffcf6c6138e56ce6b2413b4b.tar.xz |
Enable detection of AVX and AVX2 support through CPUID. Add AVX/AVX2 to corei7-avx, core-avx-i, and core-avx2 cpu names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155618 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86Subtarget.cpp')
-rw-r--r-- | lib/Target/X86/X86Subtarget.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index 452dd7eba3..fbc5b8ca95 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -196,8 +196,7 @@ void X86Subtarget::AutoDetectSubtargetFeatures() { if ((ECX >> 9) & 1) { X86SSELevel = SSSE3; ToggleFeature(X86::FeatureSSSE3);} if ((ECX >> 19) & 1) { X86SSELevel = SSE41; ToggleFeature(X86::FeatureSSE41);} if ((ECX >> 20) & 1) { X86SSELevel = SSE42; ToggleFeature(X86::FeatureSSE42);} - // FIXME: AVX codegen support is not ready. - //if ((ECX >> 28) & 1) { X86SSELevel = AVX; ToggleFeature(X86::FeatureAVX); } + if ((ECX >> 28) & 1) { X86SSELevel = AVX; ToggleFeature(X86::FeatureAVX); } bool IsIntel = memcmp(text.c, "GenuineIntel", 12) == 0; bool IsAMD = !IsIntel && memcmp(text.c, "AuthenticAMD", 12) == 0; @@ -299,11 +298,10 @@ void X86Subtarget::AutoDetectSubtargetFeatures() { HasBMI = true; ToggleFeature(X86::FeatureBMI); } - // FIXME: AVX2 codegen support is not ready. - //if ((EBX >> 5) & 0x1) { - // X86SSELevel = AVX2; - // ToggleFeature(X86::FeatureAVX2); - //} + if ((EBX >> 5) & 0x1) { + X86SSELevel = AVX2; + ToggleFeature(X86::FeatureAVX2); + } if ((EBX >> 8) & 0x1) { HasBMI2 = true; ToggleFeature(X86::FeatureBMI2); |