r354166 - [Driver] Default all Android ARM targets to NEON.

Dan Albert via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 15 12:31:54 PST 2019


Author: danalbert
Date: Fri Feb 15 12:31:54 2019
New Revision: 354166

URL: http://llvm.org/viewvc/llvm-project?rev=354166&view=rev
Log:
[Driver] Default all Android ARM targets to NEON.

Summary:
There are an insignificant number of ARM Android devices that don't
support NEON. Default to using NEON since that will improve
performance on the majority of devices. Users that need to target
non-NEON devices can still explicitly disable NEON.

Reviewers: srhines, pirama, kristof.beyls

Reviewed By: pirama

Subscribers: efriedma, javed.absar, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D58153

Modified:
    cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp
    cfe/trunk/test/Driver/arm-mfpu.c

Modified: cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp?rev=354166&r1=354165&r2=354166&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Arch/ARM.cpp Fri Feb 15 12:31:54 2019
@@ -378,9 +378,7 @@ void arm::getARMTargetFeatures(const Too
   } else if (FPUArg) {
     getARMFPUFeatures(D, FPUArg, Args, FPUArg->getValue(), Features);
   } else if (Triple.isAndroid() && getARMSubArchVersionNumber(Triple) >= 7) {
-    // Android mandates minimum FPU requirements based on OS version.
-    const char *AndroidFPU =
-        Triple.isAndroidVersionLT(23) ? "vfpv3-d16" : "neon";
+    const char *AndroidFPU = "neon";
     if (!llvm::ARM::getFPUFeatures(llvm::ARM::parseFPU(AndroidFPU), Features))
       D.Diag(clang::diag::err_drv_clang_unsupported)
           << std::string("-mfpu=") + AndroidFPU;

Modified: cfe/trunk/test/Driver/arm-mfpu.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/arm-mfpu.c?rev=354166&r1=354165&r2=354166&view=diff
==============================================================================
--- cfe/trunk/test/Driver/arm-mfpu.c (original)
+++ cfe/trunk/test/Driver/arm-mfpu.c Fri Feb 15 12:31:54 2019
@@ -376,55 +376,23 @@
 // CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+neon"
 // CHECK-ARM5-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+crypto"
 
-// RUN: %clang -target arm-linux-androideabi21 -march=armv7-a %s -### -c 2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-MARCH-ARM7-ANDROID-FP %s
-// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+soft-float"
-// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+soft-float-abi"
-// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+d16"
-// CHECK-MARCH-ARM7-ANDROID-FP: "-target-feature" "+vfp3"
-// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+vfp4"
-// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+fp-armv8"
-// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+neon"
-// CHECK-MARCH-ARM7-ANDROID-FP-NOT: "-target-feature" "+crypto"
-
 // RUN: %clang -target armv7-linux-androideabi21 %s -### -c 2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-ARM-ANDROID-L-FP-DEFAULT %s
-// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+soft-float"
-// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+soft-float-abi"
-// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+d16"
-// CHECK-ARM-ANDROID-L-FP-DEFAULT: "-target-feature" "+vfp3"
-// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+vfp4"
-// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8"
-// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+neon"
-// CHECK-ARM-ANDROID-L-FP-DEFAULT-NOT: "-target-feature" "+crypto"
-
-// RUN: %clang -target armv7-linux-androideabi21 -mfpu=neon %s -### -c 2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-ARM-ANDROID-L-FP-NEON %s
-// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+soft-float"
-// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+soft-float-abi"
-// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+vfp3"
-// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+vfp4"
-// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+fp-armv8"
-// CHECK-ARM-ANDROID-L-FP-NEON: "-target-feature" "+neon"
-// CHECK-ARM-ANDROID-L-FP-NEON-NOT: "-target-feature" "+crypto"
-
-// RUN: %clang -target armv7-linux-androideabi23 %s -### -c 2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-ARM-ANDROID-M-FP-DEFAULT %s
-// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+soft-float"
-// CHECK-ARM-ANDROID-M-FP-DEFAULT: "-target-feature" "+soft-float-abi"
-// CHECK-ARM-ANDROID-M-FP-DEFAULT: "-target-feature" "+vfp3"
-// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+vfp4"
-// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8"
-// CHECK-ARM-ANDROID-M-FP-DEFAULT: "-target-feature" "+neon"
-// CHECK-ARM-ANDROID-M-FP-DEFAULT-NOT: "-target-feature" "+crypto"
+// RUN:   | FileCheck --check-prefix=CHECK-ARM7-ANDROID-FP-DEFAULT %s
+// CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+soft-float"
+// CHECK-ARM7-ANDROID-FP-DEFAULT: "-target-feature" "+soft-float-abi"
+// CHECK-ARM7-ANDROID-FP-DEFAULT: "-target-feature" "+vfp3"
+// CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+vfp4"
+// CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+fp-armv8"
+// CHECK-ARM7-ANDROID-FP-DEFAULT: "-target-feature" "+neon"
+// CHECK-ARM7-ANDROID-FP-DEFAULT-NOT: "-target-feature" "+crypto"
 
-// RUN: %clang -target armv7-linux-androideabi23 %s -mfpu=vfp3-d16 -### -c 2>&1 \
-// RUN:   | FileCheck --check-prefix=CHECK-ARM-ANDROID-M-FP-D16 %s
-// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+soft-float"
-// CHECK-ARM-ANDROID-M-FP-D16: "-target-feature" "+soft-float-abi"
-// CHECK-ARM-ANDROID-M-FP-D16: "-target-feature" "+d16"
-// CHECK-ARM-ANDROID-M-FP-D16: "-target-feature" "+vfp3"
-// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+vfp4"
-// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+fp-armv8"
-// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+neon"
-// CHECK-ARM-ANDROID-M-FP-D16-NOT: "-target-feature" "+crypto"
+// RUN: %clang -target armv7-linux-androideabi21 %s -mfpu=vfp3-d16 -### -c 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-ARM7-ANDROID-FP-D16 %s
+// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+soft-float"
+// CHECK-ARM7-ANDROID-FP-D16: "-target-feature" "+soft-float-abi"
+// CHECK-ARM7-ANDROID-FP-D16: "-target-feature" "+d16"
+// CHECK-ARM7-ANDROID-FP-D16: "-target-feature" "+vfp3"
+// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+vfp4"
+// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+fp-armv8"
+// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+neon"
+// CHECK-ARM7-ANDROID-FP-D16-NOT: "-target-feature" "+crypto"




More information about the cfe-commits mailing list