summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86Subtarget.cpp
diff options
context:
space:
mode:
authorStefanus Du Toit <stefanus.dutoit@rapidmind.com>2009-05-26 21:04:35 +0000
committerStefanus Du Toit <stefanus.dutoit@rapidmind.com>2009-05-26 21:04:35 +0000
commit96180b53879f0a8016cff416dcfd78f50dec719e (patch)
treeea7eef9f244284a4aaa808b52452567fa63705f0 /llvm/lib/Target/X86/X86Subtarget.cpp
parent28ad4b5da1c56d7aa10399f83699657d23498d66 (diff)
downloadbcm5719-llvm-96180b53879f0a8016cff416dcfd78f50dec719e.tar.gz
bcm5719-llvm-96180b53879f0a8016cff416dcfd78f50dec719e.zip
Update CPU capabilities for AMD machines
- added processors k8-sse3, opteron-sse3, athlon64-sse3, amdfam10, and barcelona with appropriate sse3/4a levels - added FeatureSSE4A for amdfam10 processors in X86Subtarget: - added hasSSE4A - updated AutoDetectSubtargetFeatures to detect SSE4A - updated GetCurrentX86CPU to detect family 15 with sse3 as k8-sse3 and family 10h as amdfam10 New processor names match those used by gcc. Patch by Paul Redmond! llvm-svn: 72434
Diffstat (limited to 'llvm/lib/Target/X86/X86Subtarget.cpp')
-rw-r--r--llvm/lib/Target/X86/X86Subtarget.cpp18
1 files changed, 15 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86Subtarget.cpp b/llvm/lib/Target/X86/X86Subtarget.cpp
index d54ccb37e3b..03ce1aee0e8 100644
--- a/llvm/lib/Target/X86/X86Subtarget.cpp
+++ b/llvm/lib/Target/X86/X86Subtarget.cpp
@@ -216,6 +216,7 @@ void X86Subtarget::AutoDetectSubtargetFeatures() {
X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
HasX86_64 = (EDX >> 29) & 0x1;
+ HasSSE4A = IsAMD && ((ECX >> 6) & 0x1);
}
}
@@ -229,6 +230,7 @@ static const char *GetCurrentX86CPU() {
X86::GetCpuIDAndInfo(0x80000001, &EAX, &EBX, &ECX, &EDX);
bool Em64T = (EDX >> 29) & 0x1;
+ bool HasSSE3 = (ECX & 0x1);
union {
unsigned u[3];
@@ -311,10 +313,20 @@ static const char *GetCurrentX86CPU() {
default: return "athlon";
}
case 15:
+ if (HasSSE3) {
+ switch (Model) {
+ default: return "k8-sse3";
+ }
+ } else {
+ switch (Model) {
+ case 1: return "opteron";
+ case 5: return "athlon-fx"; // also opteron
+ default: return "athlon64";
+ }
+ }
+ case 16:
switch (Model) {
- case 1: return "opteron";
- case 5: return "athlon-fx"; // also opteron
- default: return "athlon64";
+ default: return "amdfam10";
}
default:
return "generic";
OpenPOWER on IntegriCloud