Select bdver2 instead of bdver1 if TBM support is present on models < 0x10.

Tested that the right -target-cpu is set in the clang -cc1 command line
when running "clang -march=native -E -v - </dev/null" on both an FX-8150
and an FX-8350. Both are family 15h; the FX-8150 (Bulldozer processor)
reports a model number of 1, and the FX-8350 (Piledriver processor)
reports a model number of 2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207973 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Kaelyn Takata 2014-05-05 16:32:10 +00:00
parent bd7cb3a62d
commit 54d2b33222

View File

@ -223,6 +223,7 @@ StringRef sys::getHostCPUName() {
(EBX & 0x20);
GetX86CpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
bool Em64T = (EDX >> 29) & 0x1;
bool HasTBM = (ECX >> 21) & 0x1;
if (memcmp(text.c, "GenuineIntel", 12) == 0) {
switch (Family) {
@ -439,7 +440,7 @@ StringRef sys::getHostCPUName() {
return "bdver4"; // 50h-6Fh: Excavator
if (Model >= 0x30)
return "bdver3"; // 30h-3Fh: Steamroller
if (Model >= 0x10)
if (Model >= 0x10 || HasTBM)
return "bdver2"; // 10h-1Fh: Piledriver
return "bdver1"; // 00h-0Fh: Bulldozer
case 22: