Skip to content
Snippets Groups Projects
Commit f685e442 authored by Hans Wennborg's avatar Hans Wennborg
Browse files

Merging r322245:

------------------------------------------------------------------------
r322245 | ctopper | 2018-01-11 02:37:59 +0100 (Thu, 11 Jan 2018) | 5 lines

[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.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_60@323741 91177308-0d34-0410-b5e6-96231b3b80d8
parent abf562a4
No related branches found
No related tags found
No related merge requests found
...@@ -409,7 +409,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features, ...@@ -409,7 +409,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features,
if (Enabled) { if (Enabled) {
switch (Level) { switch (Level) {
case AVX512F: case AVX512F:
Features["avx512f"] = true; Features["avx512f"] = Features["fma"] = Features["f16c"] = true;
LLVM_FALLTHROUGH; LLVM_FALLTHROUGH;
case AVX2: case AVX2:
Features["avx2"] = true; Features["avx2"] = true;
...@@ -623,6 +623,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features, ...@@ -623,6 +623,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
} else if (Name == "fma") { } else if (Name == "fma") {
if (Enabled) if (Enabled)
setSSELevel(Features, AVX, Enabled); setSSELevel(Features, AVX, Enabled);
else
setSSELevel(Features, AVX512F, Enabled);
} else if (Name == "fma4") { } else if (Name == "fma4") {
setXOPLevel(Features, FMA4, Enabled); setXOPLevel(Features, FMA4, Enabled);
} else if (Name == "xop") { } else if (Name == "xop") {
...@@ -632,6 +634,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features, ...@@ -632,6 +634,8 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features,
} else if (Name == "f16c") { } else if (Name == "f16c") {
if (Enabled) if (Enabled)
setSSELevel(Features, AVX, Enabled); setSSELevel(Features, AVX, Enabled);
else
setSSELevel(Features, AVX512F, Enabled);
} else if (Name == "sha") { } else if (Name == "sha") {
if (Enabled) if (Enabled)
setSSELevel(Features, SSE2, Enabled); setSSELevel(Features, SSE2, Enabled);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment