Pull in r143305 and r143312 from upstream clang trunk, so using "clang
-march=native" on AMD K10 family processors no longer errors out with "unknown target CPU 'amdfam10'". This also enables use of SSE4A. Reported by: David Marec <david.marec@davenulle.org> MFC after: 3 days
This commit is contained in:
parent
803e97938e
commit
d883a297a1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=226951
@ -1282,6 +1282,7 @@ class X86TargetInfo : public TargetInfo {
|
||||
CK_K8SSE3,
|
||||
CK_Opteron,
|
||||
CK_OpteronSSE3,
|
||||
CK_AMDFAM10,
|
||||
|
||||
/// This specification is deprecated and will be removed in the future.
|
||||
/// Users should prefer \see CK_K8.
|
||||
@ -1381,6 +1382,7 @@ class X86TargetInfo : public TargetInfo {
|
||||
.Case("k8-sse3", CK_K8SSE3)
|
||||
.Case("opteron", CK_Opteron)
|
||||
.Case("opteron-sse3", CK_OpteronSSE3)
|
||||
.Case("amdfam10", CK_AMDFAM10)
|
||||
.Case("x86-64", CK_x86_64)
|
||||
.Case("geode", CK_Geode)
|
||||
.Default(CK_Generic);
|
||||
@ -1441,6 +1443,7 @@ class X86TargetInfo : public TargetInfo {
|
||||
case CK_K8SSE3:
|
||||
case CK_Opteron:
|
||||
case CK_OpteronSSE3:
|
||||
case CK_AMDFAM10:
|
||||
case CK_x86_64:
|
||||
return true;
|
||||
}
|
||||
@ -1459,12 +1462,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.
|
||||
@ -1561,6 +1562,11 @@ void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const {
|
||||
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:
|
||||
setFeatureEnabled(Features, "mmx", true);
|
||||
setFeatureEnabled(Features, "sse", true);
|
||||
@ -1604,6 +1610,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;
|
||||
@ -1630,6 +1638,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;
|
||||
@ -1826,6 +1836,11 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
|
||||
Builder.defineMacro("__k8__");
|
||||
Builder.defineMacro("__tune_k8__");
|
||||
break;
|
||||
case CK_AMDFAM10:
|
||||
Builder.defineMacro("__amdfam10");
|
||||
Builder.defineMacro("__amdfam10__");
|
||||
Builder.defineMacro("__tune_amdfam10__");
|
||||
break;
|
||||
case CK_Geode:
|
||||
Builder.defineMacro("__geode");
|
||||
Builder.defineMacro("__geode__");
|
||||
|
Loading…
Reference in New Issue
Block a user