summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2014-05-05 16:32:10 +0000
committerKaelyn Takata <rikka@google.com>2014-05-05 16:32:10 +0000
commita39d2a0050e9e293b5cf6537f3fb77f08a00a803 (patch)
tree45a2292ab7b563305b98f788e15589243701141a
parent665bd05095898e29196160cf8038acb1f34b6669 (diff)
downloadbcm5719-llvm-a39d2a0050e9e293b5cf6537f3fb77f08a00a803.tar.gz
bcm5719-llvm-a39d2a0050e9e293b5cf6537f3fb77f08a00a803.zip
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. llvm-svn: 207973
-rw-r--r--llvm/lib/Support/Host.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/Host.cpp b/llvm/lib/Support/Host.cpp
index 83f25463a14..e0e85630be6 100644
--- a/llvm/lib/Support/Host.cpp
+++ b/llvm/lib/Support/Host.cpp
@@ -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:
OpenPOWER on IntegriCloud