ARM: add __aeabi_d2h for truncation on AEABI systems
authorTim Northover <tnorthover@apple.com>
Tue, 29 Jul 2014 09:56:45 +0000 (09:56 +0000)
committerTim Northover <tnorthover@apple.com>
Tue, 29 Jul 2014 09:56:45 +0000 (09:56 +0000)
ARM does actually define the name for this conversion, so we should use it on
"-eabi" platforms.

llvm-svn: 214176

llvm/lib/Target/ARM/ARMISelLowering.cpp
llvm/test/CodeGen/ARM/fp16.ll

index 49ed022..f10394a 100644 (file)
@@ -312,6 +312,7 @@ ARMTargetLowering::ARMTargetLowering(TargetMachine &TM)
       // Conversions between floating types.
       // RTABI chapter 4.1.2, Table 7
       { RTLIB::FPROUND_F64_F32, "__aeabi_d2f", CallingConv::ARM_AAPCS, ISD::SETCC_INVALID },
+      { RTLIB::FPROUND_F64_F16, "__aeabi_d2h", CallingConv::ARM_AAPCS, ISD::SETCC_INVALID },
       { RTLIB::FPEXT_F32_F64,   "__aeabi_f2d", CallingConv::ARM_AAPCS, ISD::SETCC_INVALID },
 
       // Integer to floating-point conversions.
index 501c2ba..93cf2f4 100644 (file)
@@ -73,7 +73,7 @@ define arm_aapcs_vfpcc i16 @test_to_fp16(double %in) {
 ; CHECK-ARMV8: vcvtb.f16.f64 [[TMP:s[0-9]+]], d0
 ; CHECK-ARMV8: vmov r0, [[TMP]]
 
-; CHECK-SOFTFLOAT: bl __truncdfhf2
+; CHECK-SOFTFLOAT: bl __aeabi_d2h
   ret i16 %val
 }