diff options
| author | Erich Keane <erich.keane@intel.com> | 2017-12-21 23:27:36 +0000 |
|---|---|---|
| committer | Erich Keane <erich.keane@intel.com> | 2017-12-21 23:27:36 +0000 |
| commit | e8192cc15f1d81182e1d84468320cd5b01f136d2 (patch) | |
| tree | b9060e061fa67402759736b561fc7f9c36f141f3 /clang/lib/Basic | |
| parent | 1db24196d1f96a47f2de317d0abca9ed24a67b32 (diff) | |
| download | bcm5719-llvm-e8192cc15f1d81182e1d84468320cd5b01f136d2.tar.gz bcm5719-llvm-e8192cc15f1d81182e1d84468320cd5b01f136d2.zip | |
Correct hasFeature/isValidFeatureName's handling of shstk/adx/mwaitx
https://bugs.llvm.org/show_bug.cgi?id=35721 reports that x86intrin.h
is issuing a few warnings. This is because attribute target is using
isValidFeatureName for its source. It was also discovered that two of
these were missing from hasFeature.
Additionally, shstk is and ibu are reordered alphabetically, as came
up during code review.
llvm-svn: 321324
Diffstat (limited to 'clang/lib/Basic')
| -rw-r--r-- | clang/lib/Basic/Targets/X86.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp index 7fd9fd04781..103916cf047 100644 --- a/clang/lib/Basic/Targets/X86.cpp +++ b/clang/lib/Basic/Targets/X86.cpp @@ -1131,6 +1131,7 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) const { return llvm::StringSwitch<bool>(Name) .Case("3dnow", true) .Case("3dnowa", true) + .Case("adx", true) .Case("aes", true) .Case("avx", true) .Case("avx2", true) @@ -1160,6 +1161,7 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) const { .Case("mmx", true) .Case("movbe", true) .Case("mpx", true) + .Case("mwaitx", true) .Case("pclmul", true) .Case("pku", true) .Case("popcnt", true) @@ -1170,6 +1172,7 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) const { .Case("rtm", true) .Case("sgx", true) .Case("sha", true) + .Case("shstk", true) .Case("sse", true) .Case("sse2", true) .Case("sse3", true) @@ -1190,6 +1193,7 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) const { bool X86TargetInfo::hasFeature(StringRef Feature) const { return llvm::StringSwitch<bool>(Feature) + .Case("adx", HasADX) .Case("aes", HasAES) .Case("avx", SSELevel >= AVX) .Case("avx2", SSELevel >= AVX2) @@ -1214,6 +1218,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const { .Case("fma4", XOPLevel >= FMA4) .Case("fsgsbase", HasFSGSBASE) .Case("fxsr", HasFXSR) + .Case("ibt", HasIBT) .Case("lwp", HasLWP) .Case("lzcnt", HasLZCNT) .Case("mm3dnow", MMX3DNowLevel >= AMD3DNow) @@ -1221,8 +1226,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const { .Case("mmx", MMX3DNowLevel >= MMX) .Case("movbe", HasMOVBE) .Case("mpx", HasMPX) - .Case("shstk", HasSHSTK) - .Case("ibt", HasIBT) + .Case("mwaitx", HasMWAITX) .Case("pclmul", HasPCLMUL) .Case("pku", HasPKU) .Case("popcnt", HasPOPCNT) @@ -1233,6 +1237,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const { .Case("rtm", HasRTM) .Case("sgx", HasSGX) .Case("sha", HasSHA) + .Case("shstk", HasSHSTK) .Case("sse", SSELevel >= SSE1) .Case("sse2", SSELevel >= SSE2) .Case("sse3", SSELevel >= SSE3) |

