diff options
| author | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2013-09-24 19:00:58 +0000 |
|---|---|---|
| committer | Yunzhong Gao <Yunzhong_Gao@playstation.sony.com> | 2013-09-24 19:00:58 +0000 |
| commit | 1f6aeebe7691024d05b914a96003ff11df5f861a (patch) | |
| tree | f95c36afb5755b3c563b4121fe53480093ebdcd2 /clang/lib/Basic/Targets.cpp | |
| parent | d59bf255d5fb069bba5d8972120ceaf484a15c1e (diff) | |
| download | bcm5719-llvm-1f6aeebe7691024d05b914a96003ff11df5f861a.tar.gz bcm5719-llvm-1f6aeebe7691024d05b914a96003ff11df5f861a.zip | |
Adding -mtbm and -mno-tbm command line options to the clang front end for the
x86 TBM instruction set. Also adding a __TBM__ macro if the TBM feature is
enabled. Otherwise there should be no functionality change to existing features.
Phabricator code review is located here: http://llvm-reviews.chandlerc.com/D1693
llvm-svn: 191326
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index a9512d2fe1f..f1a14544104 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -1586,6 +1586,7 @@ class X86TargetInfo : public TargetInfo { bool HasRTM; bool HasPRFCHW; bool HasRDSEED; + bool HasTBM; bool HasFMA; bool HasF16C; bool HasAVX512CD, HasAVX512ER, HasAVX512PF; @@ -1748,8 +1749,8 @@ public: : TargetInfo(Triple), SSELevel(NoSSE), MMX3DNowLevel(NoMMX3DNow), XOPLevel(NoXOP), HasAES(false), HasPCLMUL(false), HasLZCNT(false), HasRDRND(false), HasBMI(false), HasBMI2(false), HasPOPCNT(false), - HasRTM(false), HasPRFCHW(false), HasRDSEED(false), HasFMA(false), - HasF16C(false), HasAVX512CD(false), HasAVX512ER(false), + HasRTM(false), HasPRFCHW(false), HasRDSEED(false), HasTBM(false), + HasFMA(false), HasF16C(false), HasAVX512CD(false), HasAVX512ER(false), HasAVX512PF(false), HasSHA(false), CPU(CK_Generic), FPMath(FP_Default) { BigEndian = false; LongDoubleFormat = &llvm::APFloat::x87DoubleExtended; @@ -2127,6 +2128,7 @@ void X86TargetInfo::getDefaultFeatures(llvm::StringMap<bool> &Features) const { setFeatureEnabledImpl(Features, "bmi", true); setFeatureEnabledImpl(Features, "fma", true); setFeatureEnabledImpl(Features, "f16c", true); + setFeatureEnabledImpl(Features, "tbm", true); break; case CK_C3_2: setFeatureEnabledImpl(Features, "sse", true); @@ -2367,6 +2369,11 @@ bool X86TargetInfo::HandleTargetFeatures(std::vector<std::string> &Features, continue; } + if (Feature == "tbm") { + HasTBM = true; + continue; + } + if (Feature == "fma") { HasFMA = true; continue; @@ -2642,6 +2649,9 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts, if (HasRDSEED) Builder.defineMacro("__RDSEED__"); + if (HasTBM) + Builder.defineMacro("__TBM__"); + switch (XOPLevel) { case XOP: Builder.defineMacro("__XOP__"); @@ -2749,6 +2759,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const { .Case("bmi2", HasBMI2) .Case("fma", HasFMA) .Case("fma4", XOPLevel >= FMA4) + .Case("tbm", HasTBM) .Case("lzcnt", HasLZCNT) .Case("rdrnd", HasRDRND) .Case("mm3dnow", MMX3DNowLevel >= AMD3DNow) |

