Hi Artyom,<br><br>Could you point me to the code review here? I can see a review thread but nowhere there does anyone approve the patch. In fact Peter raises concerns that seemingly aren't addressed. <br><br>Cheers,<br><br>James<br><div class="gmail_quote"><div dir="ltr">On Mon, 21 Sep 2015 at 05:44, Artyom Skrobov via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: askrobov<br>
Date: Mon Sep 21 07:43:10 2015<br>
New Revision: 248152<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=248152&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=248152&view=rev</a><br>
Log:<br>
[ARM] Handle +t2dsp feature as an ArchExtKind in ARMTargetParser.def<br>
<br>
Currently, the availability of DSP instructions (ACLE 6.4.7) is handled in a<br>
hand-rolled tricky condition block in tools/clang/lib/Basic/Targets.cpp, with<br>
a FIXME: attached.<br>
<br>
This patch changes the handling of +t2dsp to be in line with other<br>
architecture extensions.<br>
<br>
Following review comments, also updating the description of FeatureDSPThumb2<br>
in ARM.td.<br>
<br>
Differential Revision: <a href="http://reviews.llvm.org/D12937" rel="noreferrer" target="_blank">http://reviews.llvm.org/D12937</a><br>
<br>
<br>
Modified:<br>
    llvm/trunk/include/llvm/Support/ARMTargetParser.def<br>
    llvm/trunk/include/llvm/Support/TargetParser.h<br>
    llvm/trunk/lib/Support/TargetParser.cpp<br>
    llvm/trunk/lib/Target/ARM/ARM.td<br>
<br>
Modified: llvm/trunk/include/llvm/Support/ARMTargetParser.def<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ARMTargetParser.def?rev=248152&r1=248151&r2=248152&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/ARMTargetParser.def?rev=248152&r1=248151&r2=248152&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Support/ARMTargetParser.def (original)<br>
+++ llvm/trunk/include/llvm/Support/ARMTargetParser.def Mon Sep 21 07:43:10 2015<br>
@@ -61,35 +61,35 @@ ARM_ARCH("armv4t", AK_ARMV4T, "4T", "v4t<br>
 ARM_ARCH("armv5t", AK_ARMV5T, "5T", "v5", ARMBuildAttrs::CPUArch::v5T,<br>
           AEK_NONE)<br>
 ARM_ARCH("armv5te", AK_ARMV5TE, "5TE", "v5e", ARMBuildAttrs::CPUArch::v5TE,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv5tej", AK_ARMV5TEJ, "5TEJ", "v5e", ARMBuildAttrs::CPUArch::v5TEJ,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv6", AK_ARMV6, "6", "v6", ARMBuildAttrs::CPUArch::v6,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv6k", AK_ARMV6K, "6K", "v6k", ARMBuildAttrs::CPUArch::v6K,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv6t2", AK_ARMV6T2, "6T2", "v6t2", ARMBuildAttrs::CPUArch::v6T2,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv6z", AK_ARMV6Z, "6Z", "v6z", ARMBuildAttrs::CPUArch::v6KZ,<br>
-          AEK_SEC)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv6zk", AK_ARMV6ZK, "6ZK", "v6zk", ARMBuildAttrs::CPUArch::v6KZ,<br>
-          AEK_SEC)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv6-m", AK_ARMV6M, "6-M", "v6m", ARMBuildAttrs::CPUArch::v6_M,<br>
           AEK_NONE)<br>
 ARM_ARCH("armv6s-m", AK_ARMV6SM, "6S-M", "v6sm", ARMBuildAttrs::CPUArch::v6S_M,<br>
           AEK_NONE)<br>
 ARM_ARCH("armv7-a", AK_ARMV7A, "7-A", "v7", ARMBuildAttrs::CPUArch::v7,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv7-r", AK_ARMV7R, "7-R", "v7r", ARMBuildAttrs::CPUArch::v7,<br>
-          AEK_HWDIV)<br>
+          (AEK_HWDIV | AEK_T2DSP))<br>
 ARM_ARCH("armv7-m", AK_ARMV7M, "7-M", "v7m", ARMBuildAttrs::CPUArch::v7,<br>
           AEK_HWDIV)<br>
 ARM_ARCH("armv7e-m", AK_ARMV7EM, "7E-M", "v7em", ARMBuildAttrs::CPUArch::v7E_M,<br>
-          AEK_HWDIV)<br>
+          (AEK_HWDIV | AEK_T2DSP))<br>
 ARM_ARCH("armv8-a", AK_ARMV8A, "8-A", "v8", ARMBuildAttrs::CPUArch::v8,<br>
-         (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | AEK_HWDIV))<br>
+         (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | AEK_HWDIV | AEK_T2DSP))<br>
 ARM_ARCH("armv8.1-a", AK_ARMV8_1A, "8.1-A", "v8.1a", ARMBuildAttrs::CPUArch::v8,<br>
-         (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | AEK_HWDIV))<br>
+         (AEK_SEC | AEK_MP | AEK_VIRT | AEK_HWDIVARM | AEK_HWDIV | AEK_T2DSP))<br>
 // Non-standard Arch names.<br>
 ARM_ARCH("iwmmxt", AK_IWMMXT, "iwmmxt", "", ARMBuildAttrs::CPUArch::v5TE,<br>
           AEK_NONE)<br>
@@ -100,21 +100,21 @@ ARM_ARCH("xscale", AK_XSCALE, "xscale",<br>
 ARM_ARCH("armv5", AK_ARMV5, "5T", "v5", ARMBuildAttrs::CPUArch::v5T,<br>
           AEK_NONE)<br>
 ARM_ARCH("armv5e", AK_ARMV5E, "5TE", "v5e", ARMBuildAttrs::CPUArch::v5TE,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv6j", AK_ARMV6J, "6J", "v6", ARMBuildAttrs::CPUArch::v6,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv6hl", AK_ARMV6HL, "6-M", "v6hl", ARMBuildAttrs::CPUArch::v6_M,<br>
           AEK_NONE)<br>
 ARM_ARCH("armv7", AK_ARMV7, "7", "v7", ARMBuildAttrs::CPUArch::v7,<br>
           AEK_NONE)<br>
 ARM_ARCH("armv7l", AK_ARMV7L, "7-L", "v7l", ARMBuildAttrs::CPUArch::v7,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv7hl", AK_ARMV7HL, "7-L", "v7hl", ARMBuildAttrs::CPUArch::v7,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv7s", AK_ARMV7S, "7-S", "v7s", ARMBuildAttrs::CPUArch::v7,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 ARM_ARCH("armv7k", AK_ARMV7K, "7-K", "v7k", ARMBuildAttrs::CPUArch::v7,<br>
-          AEK_NONE)<br>
+          AEK_T2DSP)<br>
 #undef ARM_ARCH<br>
<br>
 #ifndef ARM_ARCH_EXT_NAME<br>
<br>
Modified: llvm/trunk/include/llvm/Support/TargetParser.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/TargetParser.h?rev=248152&r1=248151&r2=248152&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/TargetParser.h?rev=248152&r1=248151&r2=248152&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/Support/TargetParser.h (original)<br>
+++ llvm/trunk/include/llvm/Support/TargetParser.h Mon Sep 21 07:43:10 2015<br>
@@ -81,6 +81,7 @@ enum ArchExtKind : unsigned {<br>
   AEK_SIMD = 0x80,<br>
   AEK_SEC = 0x100,<br>
   AEK_VIRT = 0x200,<br>
+  AEK_T2DSP = 0x400,<br>
   // Unsupported extensions.<br>
   AEK_OS = 0x8000000,<br>
   AEK_IWMMXT = 0x10000000,<br>
<br>
Modified: llvm/trunk/lib/Support/TargetParser.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/TargetParser.cpp?rev=248152&r1=248151&r2=248152&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/TargetParser.cpp?rev=248152&r1=248151&r2=248152&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Support/TargetParser.cpp (original)<br>
+++ llvm/trunk/lib/Support/TargetParser.cpp Mon Sep 21 07:43:10 2015<br>
@@ -189,6 +189,9 @@ bool llvm::ARM::getExtensionFeatures(uns<br>
   else<br>
     Features.push_back("-crc");<br>
<br>
+  if (Extensions & ARM::AEK_T2DSP)<br>
+    Features.push_back("+t2dsp");<br>
+<br>
   return getHWDivFeatures(Extensions, Features);<br>
 }<br>
<br>
<br>
Modified: llvm/trunk/lib/Target/ARM/ARM.td<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARM.td?rev=248152&r1=248151&r2=248152&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARM.td?rev=248152&r1=248151&r2=248152&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Target/ARM/ARM.td (original)<br>
+++ llvm/trunk/lib/Target/ARM/ARM.td Mon Sep 21 07:43:10 2015<br>
@@ -119,9 +119,9 @@ def FeatureAvoidMOVsShOp : SubtargetFeat<br>
 def FeatureHasRAS : SubtargetFeature<"ras", "HasRAS", "true",<br>
                                      "Has return address stack">;<br>
<br>
-/// Some M architectures don't have the DSP extension (v7E-M vs. v7M)<br>
+/// Some architectures don't have the DSP extension<br>
 def FeatureDSPThumb2 : SubtargetFeature<"t2dsp", "Thumb2DSP", "true",<br>
-                                 "Supports v7 DSP instructions in Thumb2">;<br>
+                              "Supports DSP instructions in ARM and/or Thumb2">;<br>
<br>
 // Multiprocessing extension.<br>
 def FeatureMP : SubtargetFeature<"mp", "HasMPExtension", "true",<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>