summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@gmail.com>2011-12-29 19:25:56 +0000
committerCraig Topper <craig.topper@gmail.com>2011-12-29 19:25:56 +0000
commit5ebee4494b8bcf8d1d969110dae5b5f971305367 (patch)
treec6f2320bd91852db2fbd19555d5145860f1f443f /lib
parent8493e3901446ef9177e12090f3b06d57d7bc1fd9 (diff)
downloadllvm-5ebee4494b8bcf8d1d969110dae5b5f971305367.tar.gz
llvm-5ebee4494b8bcf8d1d969110dae5b5f971305367.tar.bz2
llvm-5ebee4494b8bcf8d1d969110dae5b5f971305367.tar.xz
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')
-rw-r--r--lib/Target/X86/X86Subtarget.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp
index 6e092c755a..4f0309bc56 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);
+ }
}
}
}