From a5c3f063db443d049714c80f14f78419279d06a0 Mon Sep 17 00:00:00 2001 From: Amara Emerson Date: Wed, 12 Feb 2014 10:22:35 +0000 Subject: [PATCH] [ARM] 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@201223 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 5 ++++- test/Driver/arm-mfpu.c | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index 5087ce6816..9e71c31c62 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -718,8 +718,11 @@ static void getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple, // 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, diff --git a/test/Driver/arm-mfpu.c b/test/Driver/arm-mfpu.c index 020605b377..0f9d99593d 100644 --- a/test/Driver/arm-mfpu.c +++ b/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 -- 2.40.0