From 1400d5b9da320359808fb2fcfe3d6dc7b9b03029 Mon Sep 17 00:00:00 2001 From: Oliver Stannard Date: Fri, 21 Feb 2014 10:39:15 +0000 Subject: [PATCH] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201846 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 5 +++++ test/Driver/arm-mfpu.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index f014822fa4..3671880581 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -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"); diff --git a/test/Driver/arm-mfpu.c b/test/Driver/arm-mfpu.c index 0f9d99593d..89c2035422 100644 --- a/test/Driver/arm-mfpu.c +++ b/test/Driver/arm-mfpu.c @@ -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 -- 2.40.0