diff options
author | Coby Tayree <coby.tayree@intel.com> | 2017-12-27 09:00:31 +0000 |
---|---|---|
committer | Coby Tayree <coby.tayree@intel.com> | 2017-12-27 09:00:31 +0000 |
commit | cf96c876c643d4d966e0386e526899406c3c4135 (patch) | |
tree | c7d469c2266266409fee8740a0c1385cbc9fa068 /clang/lib/Basic/Targets/X86.cpp | |
parent | 6ec880d9b58177fe3001dcd92ad6830333fd6793 (diff) | |
download | bcm5719-llvm-cf96c876c643d4d966e0386e526899406c3c4135.tar.gz bcm5719-llvm-cf96c876c643d4d966e0386e526899406c3c4135.zip |
[x86][icelake][vpclmulqdq]
added vpclmulqdq feature recognition
added intrinsics support for vpclmulqdq instructions
_mm256_clmulepi64_epi128
_mm512_clmulepi64_epi128
matching a similar work on the backend (D40101)
Differential Revision: https://reviews.llvm.org/D41573
llvm-svn: 321480
Diffstat (limited to 'clang/lib/Basic/Targets/X86.cpp')
-rw-r--r-- | clang/lib/Basic/Targets/X86.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/clang/lib/Basic/Targets/X86.cpp b/clang/lib/Basic/Targets/X86.cpp index 1cf5a92594f..16099040171 100644 --- a/clang/lib/Basic/Targets/X86.cpp +++ b/clang/lib/Basic/Targets/X86.cpp @@ -134,6 +134,7 @@ bool X86TargetInfo::initFeatureMap( case CK_Icelake: setFeatureEnabledImpl(Features, "vaes", true); setFeatureEnabledImpl(Features, "gfni", true); + setFeatureEnabledImpl(Features, "vpclmulqdq", true); // TODO: Add icelake features here. LLVM_FALLTHROUGH; case CK_Cannonlake: @@ -462,7 +463,7 @@ void X86TargetInfo::setSSELevel(llvm::StringMap<bool> &Features, LLVM_FALLTHROUGH; case AVX: Features["fma"] = Features["avx"] = Features["f16c"] = Features["xsave"] = - Features["xsaveopt"] = Features["vaes"] = false; + Features["xsaveopt"] = Features["vaes"] = Features["vpclmulqdq"] = false; setXOPLevel(Features, FMA4, false); LLVM_FALLTHROUGH; case AVX2: @@ -584,6 +585,13 @@ void X86TargetInfo::setFeatureEnabledImpl(llvm::StringMap<bool> &Features, } else if (Name == "pclmul") { if (Enabled) setSSELevel(Features, SSE2, Enabled); + else + Features["vpclmulqdq"] = false; + } else if (Name == "vpclmulqdq") { + if (Enabled) { + setSSELevel(Features, AVX, Enabled); + Features["pclmul"] = true; + } } else if (Name == "gfni") { if (Enabled) setSSELevel(Features, SSE2, Enabled); @@ -652,6 +660,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features, HasVAES = true; } else if (Feature == "+pclmul") { HasPCLMUL = true; + } else if (Feature == "+vpclmulqdq") { + HasVPCLMULQDQ = true; } else if (Feature == "+lzcnt") { HasLZCNT = true; } else if (Feature == "+rdrnd") { @@ -956,6 +966,9 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts, if (HasPCLMUL) Builder.defineMacro("__PCLMUL__"); + if (HasVPCLMULQDQ) + Builder.defineMacro("__VPCLMULQDQ__"); + if (HasLZCNT) Builder.defineMacro("__LZCNT__"); @@ -1209,6 +1222,7 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) const { .Case("sse4a", true) .Case("tbm", true) .Case("vaes", true) + .Case("vpclmulqdq", true) .Case("x87", true) .Case("xop", true) .Case("xsave", true) @@ -1275,6 +1289,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const { .Case("sse4a", XOPLevel >= SSE4A) .Case("tbm", HasTBM) .Case("vaes", HasVAES) + .Case("vpclmulqdq", HasVPCLMULQDQ) .Case("x86", true) .Case("x86_32", getTriple().getArch() == llvm::Triple::x86) .Case("x86_64", getTriple().getArch() == llvm::Triple::x86_64) |