r201846 - Add support for FPv4-SP to the clang driver

Oliver Stannard oliver.stannard at arm.com
Fri Feb 21 02:39:16 PST 2014


Author: olista01
Date: Fri Feb 21 04:39:15 2014
New Revision: 201846

URL: http://llvm.org/viewvc/llvm-project?rev=201846&view=rev
Log:
Add support for FPv4-SP to the clang driver

Added two new options for -mfpu when targetting ARM:
* fpv4-sp-d16
* fp4-sp-d16

The first is the same spelling as gcc.

The lack of a leading `v' is correct, this is consistent with ARM's
documentation and gcc's spelling of the option.


Modified:
    cfe/trunk/lib/Driver/Tools.cpp
    cfe/trunk/test/Driver/arm-mfpu.c

Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=201846&r1=201845&r2=201846&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Feb 21 04:39:15 2014
@@ -567,6 +567,11 @@ static void getARMFPUFeatures(const Driv
   } else if (FPU == "vfp4" || FPU == "vfpv4") {
     Features.push_back("+vfp4");
     Features.push_back("-neon");
+  } else if (FPU == "fp4-sp-d16" || FPU == "fpv4-sp-d16") {
+    Features.push_back("+vfp4");
+    Features.push_back("+d16");
+    Features.push_back("+fp-only-sp");
+    Features.push_back("-neon");
   } else if (FPU == "fp-armv8") {
     Features.push_back("+fp-armv8");
     Features.push_back("-neon");

Modified: cfe/trunk/test/Driver/arm-mfpu.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-mfpu.c?rev=201846&r1=201845&r2=201846&view=diff
==============================================================================
--- cfe/trunk/test/Driver/arm-mfpu.c (original)
+++ cfe/trunk/test/Driver/arm-mfpu.c Fri Feb 21 04:39:15 2014
@@ -54,6 +54,14 @@
 // CHECK-VFP4-D16: "-target-feature" "+d16"
 // CHECK-VFP4-D16: "-target-feature" "-neon"
 
+// RUN: %clang -target arm-linux-eabi -mfpu=fp4-sp-d16 %s -### -o %t.o 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
+// RUN: %clang -target arm-linux-eabi -mfpu=fpv4-sp-d16 %s -### -o %t.o 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-FP4-SP-D16 %s
+// CHECK-FP4-SP-D16: "-target-feature" "+vfp4"
+// CHECK-FP4-SP-D16: "-target-feature" "+d16"
+// CHECK-FP4-SP-D16: "-target-feature" "+fp-only-sp"
+// CHECK-FP4-SP-D16: "-target-feature" "-neon"
 
 // RUN: %clang -target arm-linux-eabi -mfpu=neon %s -### -o %t.o 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-NEON %s





More information about the cfe-commits mailing list