Change XOP detection to use the correct CPUID bit instead of using the FMA4 bit.

llvm-svn: 147348
This commit is contained in:
Craig Topper 2011-12-29 19:25:56 +00:00
parent a060afb5ba
commit dd286a5201
1 changed files with 13 additions and 9 deletions

View File

@ -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);
}
}
}
}