]> granicus.if.org Git - clang/commitdiff
Add support for FPv4-SP to the clang driver
authorOliver Stannard <oliver.stannard@arm.com>
Fri, 21 Feb 2014 10:39:15 +0000 (10:39 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Fri, 21 Feb 2014 10:39:15 +0000 (10:39 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201846 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/arm-mfpu.c

index f014822fa41faa08549d7e6f38dea8e413d26588..3671880581b3ceb7c99f5c3a6c2e6c49ce962e7f 100644 (file)
@@ -567,6 +567,11 @@ static void getARMFPUFeatures(const Driver &D, const Arg *A,
   } 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");
index 0f9d99593daf8027d7600d7c76b5ead5484e9a43..89c2035422591a8261f7f240633e2bd647347dd1 100644 (file)
 // 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