From d3ae09bcc808988befda60b6488298ecfee4ce6a Mon Sep 17 00:00:00 2001 From: Artyom Skrobov Date: Thu, 24 Sep 2015 17:34:05 +0000 Subject: Recommit r248154: [ARM] Handle DSP feature as an ArchExtKind Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in a hand-rolled tricky condition block in lib/Basic/Targets.cpp, with a FIXME: attached. http://reviews.llvm.org/D12937 moved the handling of the DSP feature over to ARMTargetParser.def in LLVM, to be in line with other architecture extensions. This is the corresponding patch to clang, to clear the FIXME: and update the tests. Differential Revision: http://reviews.llvm.org/D12938 llvm-svn: 248521 --- clang/lib/Basic/Targets.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'clang/lib') diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 2269c83d496..d2d8a083004 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -4121,6 +4121,7 @@ class ARMTargetInfo : public TargetInfo { unsigned CRC : 1; unsigned Crypto : 1; + unsigned DSP : 1; unsigned Unaligned : 1; enum { @@ -4472,6 +4473,7 @@ public: FPU = 0; CRC = 0; Crypto = 0; + DSP = 0; Unaligned = 1; SoftFloat = SoftFloatABI = false; HWDiv = 0; @@ -4507,6 +4509,8 @@ public: CRC = 1; } else if (Feature == "+crypto") { Crypto = 1; + } else if (Feature == "+t2dsp") { + DSP = 1; } else if (Feature == "+fp-only-sp") { HW_FP_remove |= HW_FP_DP | HW_FP_HP; } else if (Feature == "+strict-align") { @@ -4742,25 +4746,19 @@ public: } // ACLE 6.4.7 DSP instructions - bool hasDSP = false; - bool is5EOrAbove = (ArchVersion >= 6 || - (ArchVersion == 5 && CPUAttr.count('E'))); - // FIXME: We are not getting all 32-bit ARM architectures - bool is32Bit = (!isThumb() || supportsThumb2()); - if (is5EOrAbove && is32Bit && (CPUProfile != "M" || CPUAttr == "7EM")) { + if (DSP) { Builder.defineMacro("__ARM_FEATURE_DSP", "1"); - hasDSP = true; } // ACLE 6.4.8 Saturation instructions - bool hasSAT = false; + bool SAT = false; if ((ArchVersion == 6 && CPUProfile != "M") || ArchVersion > 6 ) { Builder.defineMacro("__ARM_FEATURE_SAT", "1"); - hasSAT = true; + SAT = true; } // ACLE 6.4.6 Q (saturation) flag - if (hasDSP || hasSAT) + if (DSP || SAT) Builder.defineMacro("__ARM_FEATURE_QBIT", "1"); } -- cgit v1.2.3