ARM: Tweak usage of '*vfp' compiler_rt functions.
authorJim Grosbach <grosbach@apple.com>
Thu, 24 Oct 2013 23:07:11 +0000 (23:07 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 24 Oct 2013 23:07:11 +0000 (23:07 +0000)
Only use them if the subtarget has ARM mode, as these routines are implemented
as ARM code.

rdar://15302004

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

lib/Target/ARM/ARMISelLowering.cpp
test/CodeGen/ARM/darwin-eabi.ll

index 3deed78f33f50032b4bb2074a03243d48fddfbcd..10f26040e059016cbd1cf5a5e7f352cb6e0d027f 100644 (file)
@@ -177,7 +177,8 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
 
   if (Subtarget->isTargetIOS()) {
     // Uses VFP for Thumb libfuncs if available.
-    if (Subtarget->isThumb() && Subtarget->hasVFP2()) {
+    if (Subtarget->isThumb() && Subtarget->hasVFP2() &&
+        Subtarget->hasARMOps()) {
       // Single-precision floating-point arithmetic.
       setLibcallName(RTLIB::ADD_F32, "__addsf3vfp");
       setLibcallName(RTLIB::SUB_F32, "__subsf3vfp");
index e0c20373ba21facc1fa5729d9f9562961d14cc2e..f0696b3bd0584f8137ef659989cfb7d835d09d8f 100644 (file)
@@ -1,5 +1,5 @@
-; RUN: llc -mtriple=thumbv7m-apple-darwin-eabi -mcpu=cortex-m3 < %s | FileCheck %s --check-prefix=CHECK-M3
-; RUN: llc -mtriple=thumbv7em-apple-darwin-eabi -mcpu=cortex-m4 < %s | FileCheck %s --check-prefix=CHECK-M4
+; RUN: llc -mtriple=thumbv7m-apple-darwin -mcpu=cortex-m3 < %s | FileCheck %s --check-prefix=CHECK-M3
+; RUN: llc -mtriple=thumbv7em-apple-darwin -mcpu=cortex-m4 < %s | FileCheck %s --check-prefix=CHECK-M4
 
 define float @float_op(float %lhs, float %rhs) {
   %sum = fadd float %lhs, %rhs