forked from OSchip/llvm-project
[X86] Make -mavx512f imply -mfma and -mf16c in the frontend like it does in the backend.
Similarly, make -mno-fma and -mno-f16c imply -mno-avx512f. Withou this "-mno-sse -mavx512f" ends up with avx512f being enabled in the frontend but disabled in the backend. llvm-svn: 322245
This commit is contained in:
parent
8e63fc70be
commit
a1ef12a051
|
@ -430,7 +430,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features,
|
|||
if (Enabled) {
|
||||
switch (Level) {
|
||||
case AVX512F:
|
||||
Features["avx512f"] = true;
|
||||
Features["avx512f"] = Features["fma"] = Features["f16c"] = true;
|
||||
LLVM_FALLTHROUGH;
|
||||
case AVX2:
|
||||
Features["avx2"] = true;
|
||||
|
@ -644,6 +644,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
|
|||
} else if (Name == "fma") {
|
||||
if (Enabled)
|
||||
setSSELevel(Features, AVX, Enabled);
|
||||
else
|
||||
setSSELevel(Features, AVX512F, Enabled);
|
||||
} else if (Name == "fma4") {
|
||||
setXOPLevel(Features, FMA4, Enabled);
|
||||
} else if (Name == "xop") {
|
||||
|
@ -653,6 +655,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
|
|||
} else if (Name == "f16c") {
|
||||
if (Enabled)
|
||||
setSSELevel(Features, AVX, Enabled);
|
||||
else
|
||||
setSSELevel(Features, AVX512F, Enabled);
|
||||
} else if (Name == "sha") {
|
||||
if (Enabled)
|
||||
setSSELevel(Features, SSE2, Enabled);
|
||||
|
|
Loading…
Reference in New Issue