diff options
author | Craig Topper <craig.topper@gmail.com> | 2011-12-29 19:25:56 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2011-12-29 19:25:56 +0000 |
commit | 5ebee4494b8bcf8d1d969110dae5b5f971305367 (patch) | |
tree | c6f2320bd91852db2fbd19555d5145860f1f443f /lib/Target | |
parent | 8493e3901446ef9177e12090f3b06d57d7bc1fd9 (diff) | |
download | external_llvm-5ebee4494b8bcf8d1d969110dae5b5f971305367.zip external_llvm-5ebee4494b8bcf8d1d969110dae5b5f971305367.tar.gz external_llvm-5ebee4494b8bcf8d1d969110dae5b5f971305367.tar.bz2 |
Change XOP detection to use the correct CPUID bit instead of using the FMA4 bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/X86/X86Subtarget.cpp | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index 6e092c7..4f0309b 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -266,15 +266,19 @@ void X86Subtarget::AutoDetectSubtargetFeatures() { HasLZCNT = true; ToggleFeature(X86::FeatureLZCNT); } - if (IsAMD && ((ECX >> 6) & 0x1)) { - HasSSE4A = true; - ToggleFeature(X86::FeatureSSE4A); - } - if (IsAMD && ((ECX >> 16) & 0x1)) { - HasFMA4 = true; - ToggleFeature(X86::FeatureFMA4); - HasXOP = true; - ToggleFeature(X86::FeatureXOP); + if (IsAMD) { + if ((ECX >> 6) & 0x1) { + HasSSE4A = true; + ToggleFeature(X86::FeatureSSE4A); + } + if ((ECX >> 11) & 0x1) { + HasXOP = true; + ToggleFeature(X86::FeatureXOP); + } + if ((ECX >> 16) & 0x1) { + HasFMA4 = true; + ToggleFeature(X86::FeatureFMA4); + } } } } |