diff options
| author | Bernard Ogden <bogden@arm.com> | 2013-10-29 09:47:51 +0000 |
|---|---|---|
| committer | Bernard Ogden <bogden@arm.com> | 2013-10-29 09:47:51 +0000 |
| commit | 18b5701a6853f6b4a5b3a05ba5c79105a805b61b (patch) | |
| tree | c574929b1a37e96e04213e2977c478c65f0b0761 /clang/lib/Basic/Targets.cpp | |
| parent | ee87e85505bb2b9b5057187785e82715ecbf71f2 (diff) | |
| download | bcm5719-llvm-18b5701a6853f6b4a5b3a05ba5c79105a805b61b.tar.gz bcm5719-llvm-18b5701a6853f6b4a5b3a05ba5c79105a805b61b.zip | |
ARM: Add -m[no-]crc to dis/enable CRC subtargetfeature from clang
Allow users to disable or enable CRC subtarget feature.
Differential Revision: http://llvm-reviews.chandlerc.com/D2037
llvm-svn: 193600
Diffstat (limited to 'clang/lib/Basic/Targets.cpp')
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 429e699a37a..a2a1cb2cc86 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -3633,6 +3633,8 @@ class ARMTargetInfo : public TargetInfo { unsigned SoftFloat : 1; unsigned SoftFloatABI : 1; + unsigned CRC : 1; + static const Builtin::Info BuiltinInfo[]; static bool shouldUseInlineAtomic(const llvm::Triple &T) { @@ -3784,6 +3786,7 @@ public: Features["neon"] = true; Features["hwdiv"] = true; Features["hwdiv-arm"] = true; + Features["crc"] = true; } else if (CPU == "cortex-r5" || CPU == "cortex-m3" || CPU == "cortex-m4" || // Enable the hwdiv extension for all v8a AArch32 cores by @@ -3798,6 +3801,7 @@ public: virtual bool handleTargetFeatures(std::vector<std::string> &Features, DiagnosticsEngine &Diags) { FPU = 0; + CRC = 0; SoftFloat = SoftFloatABI = false; HWDiv = 0; for (unsigned i = 0, e = Features.size(); i != e; ++i) { @@ -3819,6 +3823,8 @@ public: HWDiv |= HWDivThumb; else if (Features[i] == "+hwdiv-arm") HWDiv |= HWDivARM; + else if (Features[i] == "+crc") + CRC = 1; } if (!(FPU & NeonFPU) && FPMath == FP_Neon) { @@ -3970,7 +3976,7 @@ public: if ((FPU & NeonFPU) && !SoftFloat && CPUArchVer >= 7) Builder.defineMacro("__ARM_NEON__"); - if (CPUArchVer == 8) + if (CRC) Builder.defineMacro("__ARM_FEATURE_CRC32"); if (CPUArchVer >= 6 && CPUArch != "6M") { |

