summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/Targets.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-08-23 20:21:37 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-08-23 20:21:37 +0000
commit890498236bca0a2b1a91e4c94499c6c1733f383c (patch)
tree3997fe173a1180ad619486b1160179c413430dab /clang/lib/Basic/Targets.cpp
parent94a2c5642d03669bbf8b3d01c061ab6e55630e74 (diff)
downloadbcm5719-llvm-890498236bca0a2b1a91e4c94499c6c1733f383c.tar.gz
bcm5719-llvm-890498236bca0a2b1a91e4c94499c6c1733f383c.zip
Update now that llvm uses the same feature names as the driver.
llvm-svn: 189142
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
-rw-r--r--clang/lib/Basic/Targets.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp
index fd3cfa6eff3..658476f2416 100644
--- a/clang/lib/Basic/Targets.cpp
+++ b/clang/lib/Basic/Targets.cpp
@@ -1976,7 +1976,7 @@ void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
setFeatureEnabled(Features, "ssse3", true);
break;
case CK_Corei7:
- setFeatureEnabled(Features, "sse4", true);
+ setFeatureEnabled(Features, "sse4.2", true);
break;
case CK_Corei7AVX:
setFeatureEnabled(Features, "avx", true);
@@ -2105,9 +2105,9 @@ void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features,
case AVX:
Features["avx"] = true;
case SSE42:
- Features["popcnt"] = Features["sse42"] = true;
+ Features["popcnt"] = Features["sse4.2"] = true;
case SSE41:
- Features["sse41"] = true;
+ Features["sse4.1"] = true;
case SSSE3:
Features["ssse3"] = true;
case SSE3:
@@ -2136,9 +2136,9 @@ void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features,
case SSSE3:
Features["ssse3"] = false;
case SSE41:
- Features["sse41"] = false;
+ Features["sse4.1"] = false;
case SSE42:
- Features["popcnt"] = Features["sse42"] = false;
+ Features["popcnt"] = Features["sse4.2"] = false;
case AVX:
Features["fma"] = Features["avx"] = false;
setXOPLevel(Features, FMA4, false);
@@ -2211,12 +2211,8 @@ void X86TargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
bool Enabled) const {
// FIXME: This *really* should not be here. We need some way of translating
// options into llvm subtarget features.
- if (Name == "sse4" || Name == "sse4.2")
- Name = "sse42";
- if (Name == "sse4.1")
- Name = "sse41";
- if (Name == "rdrnd")
- Name = "rdrand";
+ if (Name == "sse4")
+ Name = "sse4.2";
Features[Name] = Enabled;
@@ -2230,9 +2226,9 @@ void X86TargetInfo::setFeatureEnabled(llvm::StringMap<bool> &Features,
setSSELevel(Features, SSE3, Enabled);
else if (Name == "ssse3")
setSSELevel(Features, SSSE3, Enabled);
- else if (Name == "sse42")
+ else if (Name == "sse4.2")
setSSELevel(Features, SSE42, Enabled);
- else if (Name == "sse41")
+ else if (Name == "sse4.1")
setSSELevel(Features, SSE41, Enabled);
else if (Name == "3dnow")
setMMXLevel(Features, AMD3DNow, Enabled);
@@ -2292,7 +2288,7 @@ bool X86TargetInfo::HandleTargetFeatures(std::vector<std::string> &Features,
continue;
}
- if (Feature == "rdrand") {
+ if (Feature == "rdrnd") {
HasRDRND = true;
continue;
}
@@ -2357,8 +2353,8 @@ bool X86TargetInfo::HandleTargetFeatures(std::vector<std::string> &Features,
.Case("avx512f", AVX512F)
.Case("avx2", AVX2)
.Case("avx", AVX)
- .Case("sse42", SSE42)
- .Case("sse41", SSE41)
+ .Case("sse4.2", SSE42)
+ .Case("sse4.1", SSE41)
.Case("ssse3", SSSE3)
.Case("sse3", SSE3)
.Case("sse2", SSE2)
@@ -2699,8 +2695,8 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const {
.Case("sse2", SSELevel >= SSE2)
.Case("sse3", SSELevel >= SSE3)
.Case("ssse3", SSELevel >= SSSE3)
- .Case("sse41", SSELevel >= SSE41)
- .Case("sse42", SSELevel >= SSE42)
+ .Case("sse4.1", SSELevel >= SSE41)
+ .Case("sse4.2", SSELevel >= SSE42)
.Case("sse4a", XOPLevel >= SSE4A)
.Case("x86", true)
.Case("x86_32", getTriple().getArch() == llvm::Triple::x86)
OpenPOWER on IntegriCloud