Add support for passing v8fp options via -mfpu.
authorJoey Gouly <joey.gouly@arm.com>
Thu, 27 Jun 2013 13:19:54 +0000 (13:19 +0000)
committerJoey Gouly <joey.gouly@arm.com>
Thu, 27 Jun 2013 13:19:54 +0000 (13:19 +0000)
llvm-svn: 185075

clang/lib/Basic/Targets.cpp
clang/lib/Driver/Tools.cpp
clang/test/Driver/arm-mfpu.c

index b5a5cbe..9c375cb 100644 (file)
@@ -3681,7 +3681,7 @@ public:
                                  bool Enabled) const {
     if (Name == "soft-float" || Name == "soft-float-abi" ||
         Name == "vfp2" || Name == "vfp3" || Name == "vfp4" || Name == "neon" ||
-        Name == "d16" || Name == "neonfp") {
+        Name == "d16" || Name == "neonfp" || Name == "v8fp") {
       Features[Name] = Enabled;
     } else
       return false;
index 925a18f..7d634f5 100644 (file)
@@ -590,6 +590,14 @@ static void addFPUArgs(const Driver &D, const Arg *A, const ArgList &Args,
     CmdArgs.push_back("+vfp3");
     CmdArgs.push_back("-target-feature");
     CmdArgs.push_back("-neon");
+  } else if (FPU == "fp-armv8") {
+    CmdArgs.push_back("-target-feature");
+    CmdArgs.push_back("+v8fp");
+  } else if (FPU == "neon-fp-armv8") {
+    CmdArgs.push_back("-target-feature");
+    CmdArgs.push_back("+v8fp");
+    CmdArgs.push_back("-target-feature");
+    CmdArgs.push_back("+neon");
   } else if (FPU == "neon") {
     CmdArgs.push_back("-target-feature");
     CmdArgs.push_back("+neon");
index f51c41e..3e579f1 100644 (file)
 // RUN: %clang -target arm-linux-eabi -msoft-float %s -### -o %t.o 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
 // CHECK-SOFT-FLOAT: "-target-feature" "-neon"
+
+// RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
+// CHECK-FP-ARMV8: "-target-feature" "+v8fp"
+
+// RUN: %clang -target armv8-linux-gnueabihf -mfpu=neon-fp-armv8 %s -### 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-NEON-FP-ARMV8 %s
+// CHECK-NEON-FP-ARMV8: "-target-feature" "+v8fp"
+// CHECK-NEON-FP-ARMV8: "-target-feature" "+neon"