summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@apple.com>2010-03-04 02:26:37 +0000
committerEric Christopher <echristo@apple.com>2010-03-04 02:26:37 +0000
commit399ffa55d27f95eefb0a1bdcb91e77f4ab086021 (patch)
tree5445919cd24caa2d41050be4e77ecf84b0761f86 /clang/lib
parentc58aea00864352fde1654f8ff43d5810a2643eaf (diff)
downloadbcm5719-llvm-399ffa55d27f95eefb0a1bdcb91e77f4ab086021.tar.gz
bcm5719-llvm-399ffa55d27f95eefb0a1bdcb91e77f4ab086021.zip
Add in -msse4.1 and -msse4.2 options and continuing a rather
hacky solution for translating. Expanded on comment explaining the hack a bit. llvm-svn: 97714
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Basic/Targets.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index 96ae4b7fc1b..608a4f02795 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -734,8 +734,10 @@ void X86TargetInfo::getDefaultFeatures(const std::string &CPU,
bool X86TargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
const std::string &Name,
bool Enabled) const {
- // FIXME: This *really* should not be here.
- if (!Features.count(Name) && Name != "sse4")
+ // FIXME: This *really* should not be here. We need some way of translating
+ // options into llvm subtarget features.
+ if (!Features.count(Name) &&
+ (Name != "sse4" && Name != "sse4.2" && Name != "sse4.1"))
return false;
if (Enabled) {
@@ -751,9 +753,12 @@ bool X86TargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
else if (Name == "ssse3")
Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
Features["ssse3"] = true;
- else if (Name == "sse4")
+ else if (Name == "sse4" || Name == "sse4.2")
Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
Features["ssse3"] = Features["sse41"] = Features["sse42"] = true;
+ else if (Name == "sse4.1")
+ Features["mmx"] = Features["sse"] = Features["sse2"] = Features["sse3"] =
+ Features["ssse3"] = Features["sse41"] = true;
else if (Name == "3dnow")
Features["3dnowa"] = true;
else if (Name == "3dnowa")
OpenPOWER on IntegriCloud