X86: Add target description for btver2; make autodetection logic aware of AVX.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181005 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Benjamin Kramer 2013-05-03 10:20:08 +00:00
parent 555e8f606f
commit b9548d8ee3
2 changed files with 14 additions and 4 deletions

View File

@ -355,10 +355,15 @@ std::string sys::getHostCPUName() {
case 20:
return "btver1";
case 21:
if (Model <= 15)
return "bdver1";
else if (Model <= 31)
if (!HasAVX) // If the OS doesn't support AVX provide a sane fallback.
return "btver1";
if (Model > 15 && Model <= 31)
return "bdver2";
return "bdver1";
case 22:
if (!HasAVX) // If the OS doesn't support AVX provide a sane fallback.
return "btver1";
return "btver2";
default:
return "generic";
}

View File

@ -255,11 +255,16 @@ def : Proc<"amdfam10", [FeatureSSE4A,
// Bobcat
def : Proc<"btver1", [FeatureSSSE3, FeatureSSE4A, FeatureCMPXCHG16B,
FeatureLZCNT, FeaturePOPCNT]>;
// Jaguar
def : Proc<"btver2", [FeatureAVX, FeatureSSE4A, FeatureCMPXCHG16B,
FeatureAES, FeaturePCLMUL, FeatureBMI,
FeatureF16C, FeatureMOVBE, FeatureLZCNT,
FeaturePOPCNT]>;
// Bulldozer
def : Proc<"bdver1", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
FeatureAES, FeaturePCLMUL,
FeatureLZCNT, FeaturePOPCNT]>;
// Enhanced Bulldozer
// Piledriver
def : Proc<"bdver2", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B,
FeatureAES, FeaturePCLMUL,
FeatureF16C, FeatureLZCNT,