[llvm] r206874 - ARM: disable emission of __XYZvfp in soft-float environment.

Tim Northover tnorthover at apple.com
Tue Apr 22 03:10:09 PDT 2014


Author: tnorthover
Date: Tue Apr 22 05:10:09 2014
New Revision: 206874

URL: http://llvm.org/viewvc/llvm-project?rev=206874&view=rev
Log:
ARM: disable emission of __XYZvfp in soft-float environment.

The point of these calls is to allow Thumb-1 code to make use of the VFP unit
to perform its operations. This is not desirable with -msoft-float, since most
of the reasons you'd want that apply equally to the runtime library.

rdar://problem/13766161

Added:
    llvm/trunk/test/CodeGen/ARM/vfp-libcalls.ll
Modified:
    llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp?rev=206874&r1=206873&r2=206874&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMISelLowering.cpp Tue Apr 22 05:10:09 2014
@@ -172,7 +172,7 @@ ARMTargetLowering::ARMTargetLowering(Tar
   if (Subtarget->isTargetMachO()) {
     // Uses VFP for Thumb libfuncs if available.
     if (Subtarget->isThumb() && Subtarget->hasVFP2() &&
-        Subtarget->hasARMOps()) {
+        Subtarget->hasARMOps() && !TM.Options.UseSoftFloat) {
       // Single-precision floating-point arithmetic.
       setLibcallName(RTLIB::ADD_F32, "__addsf3vfp");
       setLibcallName(RTLIB::SUB_F32, "__subsf3vfp");

Added: llvm/trunk/test/CodeGen/ARM/vfp-libcalls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/vfp-libcalls.ll?rev=206874&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/vfp-libcalls.ll (added)
+++ llvm/trunk/test/CodeGen/ARM/vfp-libcalls.ll Tue Apr 22 05:10:09 2014
@@ -0,0 +1,11 @@
+; RUN: llc -mtriple=armv6-apple-ios -mcpu=arm1136jf-s -o - %s | FileCheck %s --check-prefix=CHECK-HARD
+; RUN: llc -mtriple=thumbv6-apple-ios -mcpu=arm1136jf-s -o - %s | FileCheck %s --check-prefix=CHECK-SOFTISH
+; RUN: llc -mtriple=armv7s-apple-ios -soft-float -mcpu=arm1136jf-s -o - %s | FileCheck %s --check-prefix=CHECK-SOFT
+
+define float @test_call(float %a, float %b) {
+; CHECK-HARD: vadd.f32 {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
+; CHECK-SOFTISH: blx ___addsf3vfp
+; CHECK-SOFT: bl ___addsf3{{$}}
+  %sum = fadd float %a, %b
+  ret float %sum
+}
\ No newline at end of file





More information about the llvm-commits mailing list