[llvm] r193381 - ARM: Tweak usage of '*vfp' compiler_rt functions.

Jim Grosbach grosbach at apple.com
Thu Oct 24 16:07:11 PDT 2013


Author: grosbach
Date: Thu Oct 24 18:07:11 2013
New Revision: 193381

URL: http://llvm.org/viewvc/llvm-project?rev=193381&view=rev
Log:
ARM: Tweak usage of '*vfp' compiler_rt functions.

Only use them if the subtarget has ARM mode, as these routines are implemented
as ARM code.

rdar://15302004

Modified:
    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
    llvm/trunk/test/CodeGen/ARM/darwin-eabi.ll

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=193381&r1=193380&r2=193381&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Thu Oct 24 18:07:11 2013
@@ -177,7 +177,8 @@ ARMTargetLowering::ARMTargetLowering(Tar
 
   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");

Modified: llvm/trunk/test/CodeGen/ARM/darwin-eabi.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/darwin-eabi.ll?rev=193381&r1=193380&r2=193381&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/darwin-eabi.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/darwin-eabi.ll Thu Oct 24 18:07:11 2013
@@ -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





More information about the llvm-commits mailing list