summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorRoman Divacky <rdivacky@freebsd.org>2011-10-30 13:47:56 +0000
committerRoman Divacky <rdivacky@freebsd.org>2011-10-30 13:47:56 +0000
commitce253d89a29022cb8ad4b517dfa300f46fb27e2d (patch)
tree90fd0648f88178780cc56613e55a94c22a5380ce /clang/lib
parentc602b2c4de771b1996a7a9d34f0e933b728b6cab (diff)
downloadbcm5719-llvm-ce253d89a29022cb8ad4b517dfa300f46fb27e2d.tar.gz
bcm5719-llvm-ce253d89a29022cb8ad4b517dfa300f46fb27e2d.zip
Add support for sse4a and enable it for amdfam10 cpu.
llvm-svn: 143312
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/Targets.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 035fec59584..60642b383a9 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -1466,12 +1466,10 @@ void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
Features["ssse3"] = false;
Features["sse41"] = false;
Features["sse42"] = false;
+ Features["sse4a"] = false;
Features["aes"] = false;
Features["avx"] = false;
- // LLVM does not currently recognize this.
- // Features["sse4a"] = false;
-
// FIXME: This *really* should not be here.
// X86_64 always has SSE2.
@@ -1565,8 +1563,12 @@ void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
case CK_K8SSE3:
case CK_OpteronSSE3:
case CK_Athlon64SSE3:
+ setFeatureEnabled(Features, "sse3", true);
+ setFeatureEnabled(Features, "3dnowa", true);
+ break;
case CK_AMDFAM10:
setFeatureEnabled(Features, "sse3", true);
+ setFeatureEnabled(Features, "sse4a", true);
setFeatureEnabled(Features, "3dnowa", true);
break;
case CK_C3_2:
@@ -1612,6 +1614,8 @@ bool X86TargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
else if (Name == "avx")
Features["avx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
Features["ssse3"] = Features["sse41"] = Features["sse42"] = true;
+ else if (Name == "sse4a")
+ Features["sse4a"] = true;
} else {
if (Name == "mmx")
Features["mmx"] = Features["3dnow"] = Features["3dnowa"] = false;
@@ -1638,6 +1642,8 @@ bool X86TargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
Features["aes"] = false;
else if (Name == "avx")
Features["avx"] = false;
+ else if (Name == "sse4a")
+ Features["sse4a"] = false;
}
return true;
OpenPOWER on IntegriCloud