[PATCH] [ARM] Fix NEON being enabled with soft-float

Amara Emerson amara.emerson at arm.com
Tue Feb 11 02:45:24 PST 2014


Hi t.p.northover,

Fix NEON wrongly being enabled with soft-float when targeting armv8/Cortex-A53/A57.

This was caused by r200708 which enabled the crypto feature for these cores.

http://llvm-reviews.chandlerc.com/D2736

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

Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp
+++ lib/Driver/Tools.cpp
@@ -722,8 +722,11 @@
 
   // Setting -msoft-float effectively disables NEON because of the GCC
   // implementation, although the same isn't true of VFP or VFP3.
-  if (FloatABI == "soft")
+  if (FloatABI == "soft") {
     Features.push_back("-neon");
+    // Also need to explicitly disable features which imply NEON.
+    Features.push_back("-crypto");
+  }
 
   // En/disable crc
   if (Arg *A = Args.getLastArg(options::OPT_mcrc,
Index: test/Driver/arm-mfpu.c
===================================================================
--- test/Driver/arm-mfpu.c
+++ test/Driver/arm-mfpu.c
@@ -63,11 +63,16 @@
 // RUN:   | FileCheck --check-prefix=CHECK-SOFT-FLOAT %s
 // CHECK-SOFT-FLOAT: "-target-feature" "-neon"
 
+// RUN: %clang -target armv8 %s -### 2>&1 \
+// RUN:   | FileCheck --check-prefix=CHECK-ARMV8-DEFAULT-SOFT-FP %s
+// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-neon"
+// CHECK-ARMV8-DEFAULT-SOFT-FP: "-target-feature" "-crypto"
+
 // RUN: %clang -target armv8 -mfpu=fp-armv8 %s -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-ARMV8-SOFT-FLOAT %s
 // CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "+fp-armv8"
-// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto"
 // CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-neon"
+// CHECK-ARMV8-SOFT-FLOAT: "-target-feature" "-crypto"
 
 // RUN: %clang -target armv8-linux-gnueabihf -mfpu=fp-armv8 %s -### 2>&1 \
 // RUN:   | FileCheck --check-prefix=CHECK-FP-ARMV8 %s
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2736.1.patch
Type: text/x-patch
Size: 1578 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140211/f66ad081/attachment.bin>


More information about the cfe-commits mailing list