<div class="gmail_quote">A few follow-up comments in-line....</div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Jan 11, 2012 at 3:21 AM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugeni.stepanov@gmail.com">eugeni.stepanov@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: eugenis<br>
Date: Wed Jan 11 05:21:31 2012<br>
New Revision: 147943<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=147943&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=147943&view=rev</a><br>
Log:<br>
Fix -mfpu parsing on ARM.<br>
<br>
- Support gcc-compatible vfpv3 name in addition to vfp3.<br>
- Support vfpv3-d16.<br>
- Disable neon feature for -mfpu=vfp* (yes, we were emitting Neon instructions<br>
  for those!).<br>
<br>
<br>
Added:<br>
    cfe/trunk/test/Driver/arm-mfpu.c   (with props)<br>
Modified:<br>
    cfe/trunk/lib/Basic/Targets.cpp<br>
    cfe/trunk/lib/Driver/Tools.cpp<br>
<br>
Modified: cfe/trunk/lib/Basic/Targets.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=147943&r1=147942&r2=147943&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=147943&r1=147942&r2=147943&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Basic/Targets.cpp (original)<br>
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jan 11 05:21:31 2012<br>
@@ -2658,7 +2658,7 @@<br>
                                  const std::string &Name,<br>
                                  bool Enabled) const {<br>
     if (Name == "soft-float" || Name == "soft-float-abi" ||<br>
-        Name == "vfp2" || Name == "vfp3" || Name == "neon") {<br>
+        Name == "vfp2" || Name == "vfp3" || Name == "neon" || Name == "d16") {<br>
       Features[Name] = Enabled;<br>
     } else<br>
       return false;<br>
<br>
Modified: cfe/trunk/lib/Driver/Tools.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=147943&r1=147942&r2=147943&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=147943&r1=147942&r2=147943&view=diff</a><br>

==============================================================================<br>
--- cfe/trunk/lib/Driver/Tools.cpp (original)<br>
+++ cfe/trunk/lib/Driver/Tools.cpp Wed Jan 11 05:21:31 2012<br>
@@ -660,12 +660,23 @@<br>
       CmdArgs.push_back("-vfp3");<br>
       CmdArgs.push_back("-target-feature");<br>
       CmdArgs.push_back("-neon");<br>
+    } else if (FPU == "vfp3-d16" || FPU == "vfpv3-d16") {<br>
+      CmdArgs.push_back("-target-feature");<br>
+      CmdArgs.push_back("+vfp3");<br>
+      CmdArgs.push_back("-target-feature");<br>
+      CmdArgs.push_back("+d16");<br>
+      CmdArgs.push_back("-target-feature");<br>
+      CmdArgs.push_back("-neon");<br>
     } else if (FPU == "vfp") {<br>
       CmdArgs.push_back("-target-feature");<br>
       CmdArgs.push_back("+vfp2");<br>
-    } else if (FPU == "vfp3") {<br>
+      CmdArgs.push_back("-target-feature");<br>
+      CmdArgs.push_back("-neon");<br>
+    } else if (FPU == "vfp3" || FPU == "vfpv3") {<br>
       CmdArgs.push_back("-target-feature");<br>
       CmdArgs.push_back("+vfp3");<br>
+      CmdArgs.push_back("-target-feature");<br>
+      CmdArgs.push_back("-neon");<br>
     } else if (FPU == "neon") {<br>
       CmdArgs.push_back("-target-feature");<br>
       CmdArgs.push_back("+neon");<br>
<br>
Added: cfe/trunk/test/Driver/arm-mfpu.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-mfpu.c?rev=147943&view=auto" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-mfpu.c?rev=147943&view=auto</a><br>

==============================================================================<br>
--- cfe/trunk/test/Driver/arm-mfpu.c (added)<br>
+++ cfe/trunk/test/Driver/arm-mfpu.c Wed Jan 11 05:21:31 2012<br>
@@ -0,0 +1,36 @@<br></blockquote><div><br></div><div>I really like having a brief note about what is expected to be tested in this test file at the top with the comments. It helps readers orient themselves.</div><div><br>
</div><div>Also, you've got great tests for each argument to '-mfpu', but it would be good to add tests for the default, and the default with different variations of the arm triple (if that default changes for any variations).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=fpa %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-FPA %s<br>
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=fpe2 %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-FPA %s<br>
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=fpe3 %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-FPA %s<br>
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=maverick %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-FPA %s<br>
+// CHECK-FPA: "-target-feature" "-vfp2"<br>
+// CHECK-FPA: "-target-feature" "-vfp3"<br>
+// CHECK-FPA: "-target-feature" "-neon"<br></blockquote><div><br></div><div>Thank you for using FileCheck so well! =D</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

+<br>
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfp3-d16 %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-VFP3-D16 %s<br>
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfpv3-d16 %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-VFP3-D16 %s<br>
+// CHECK-VFP3-D16: "-target-feature" "+vfp3"<br>
+// CHECK-VFP3-D16: "-target-feature" "+d16"<br>
+// CHECK-VFP3-D16: "-target-feature" "-neon"<br>
+<br>
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfp %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-VFP %s<br>
+// CHECK-VFP: "-target-feature" "+vfp2"<br>
+// CHECK-VFP: "-target-feature" "-neon"<br>
+<br>
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfp3 %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-VFP3 %s<br>
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=vfpv3 %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-VFP3 %s<br>
+// CHECK-VFP3: "-target-feature" "+vfp3"<br>
+// CHECK-VFP3: "-target-feature" "-neon"<br>
+<br>
+// RUN: %clang -ccc-host-triple arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \<br>
+// RUN:   | FileCheck --check-prefix=CHECK-NEON %s<br>
+// CHECK-NEON: "-target-feature" "+neon"<br>
+<br>
<br>
Propchange: cfe/trunk/test/Driver/arm-mfpu.c<br>
------------------------------------------------------------------------------<br>
    svn:eol-style = LF<br></blockquote><div><br></div><div>Ew, can you not fix EOL styles here? your subversion client may well be misconfigured if its doing this to you by default. I would expect the EOL style to be 'native' which is supposed to be the default, and causes the subversion tools to translate the line endings for the platform onto which they are checking out the source code.</div>
</div>