]> granicus.if.org Git - clang/commitdiff
Driver/ARM: Match GCC behavior in that -msoft-float disables NEON, despite this
authorDaniel Dunbar <daniel@zuster.org>
Thu, 17 Mar 2011 00:07:34 +0000 (00:07 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 17 Mar 2011 00:07:34 +0000 (00:07 +0000)
not being consistent at all with other parts of the GCC implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127777 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp
test/Driver/clang-translation.c

index 271f02d8944caa1106b25c9017acb807090ec16b..761e5f8b670ac06ab2a1e340782ad4558b10688b 100644 (file)
@@ -583,6 +583,13 @@ void Clang::AddARMTargetArgs(const ArgList &Args,
     } else
       D.Diag(clang::diag::err_drv_clang_unsupported) << A->getAsString(Args);
   }
+
+  // Setting -msoft-float effectively disables NEON because of the GCC
+  // implementation, although the same isn't true of VFP or VFP3.
+  if (FloatABI == "soft") {
+      CmdArgs.push_back("-target-feature");
+      CmdArgs.push_back("-neon");
+  }
 }
 
 void Clang::AddMIPSTargetArgs(const ArgList &Args,
index 2464f03b7a1e06a7bb38b17b8bc855ab57803d15..b2b358f0ebb8803189e6f70e6eae717053f73e02 100644 (file)
@@ -31,6 +31,8 @@
 // ARMV7_SOFTFLOAT: "-cc1"
 // ARMV7_SOFTFLOAT: "-msoft-float"
 // ARMV7_SOFTFLOAT: "-mfloat-abi" "soft"
+// ARMV7_SOFTFLOAT: "-target-feature"
+// ARMV7_SOFTFLOAT: "-neon"
 // ARMV7_SOFTFLOAT: "-x" "c"
 
 // RUN: %clang -ccc-host-triple x86_64-apple-darwin10 -### -S %s 2> %t.log \