From 6402ad27c01c9503a12d41d7e40646cf0d1f919f Mon Sep 17 00:00:00 2001 From: Ahmed Bougacha Date: Thu, 14 May 2015 01:00:51 +0000 Subject: [PATCH] [CodeGen] Use standard -not gnueabi- naming for f16 libcalls on Darwin. Other targets probably should as well. Since r237161, compiler-rt has both, but I don't see why anything other than gnueabi would use a gnueabi naming scheme. llvm-svn: 237324 --- llvm/lib/CodeGen/TargetLoweringBase.cpp | 8 ++++++++ llvm/test/CodeGen/ARM/half.ll | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 4dd279e..1ca453a 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -420,6 +420,14 @@ static void InitLibcallNames(const char **Names, const Triple &TT) { // These are generally not available. Names[RTLIB::STACKPROTECTOR_CHECK_FAIL] = nullptr; } + + // For f16/f32 conversions, Darwin uses the standard naming scheme, instead + // of the gnueabi-style __gnu_*_ieee. + // FIXME: What about other targets? + if (TT.isOSDarwin()) { + Names[RTLIB::FPEXT_F16_F32] = "__extendhfsf2"; + Names[RTLIB::FPROUND_F32_F16] = "__truncsfhf2"; + } } /// InitLibcallCallingConvs - Set default libcall CallingConvs. diff --git a/llvm/test/CodeGen/ARM/half.ll b/llvm/test/CodeGen/ARM/half.ll index 777aff2..b40eaf6 100644 --- a/llvm/test/CodeGen/ARM/half.ll +++ b/llvm/test/CodeGen/ARM/half.ll @@ -30,7 +30,7 @@ define void @test_bitcast_to_half(half* %addr, i16 %in) { define float @test_extend32(half* %addr) { ; CHECK-LABEL: test_extend32: -; CHECK-OLD: b.w ___gnu_h2f_ieee +; CHECK-OLD: b.w ___extendhfsf2 ; CHECK-F16: vcvtb.f32.f16 ; CHECK-V8: vcvtb.f32.f16 %val16 = load half, half* %addr @@ -41,7 +41,7 @@ define float @test_extend32(half* %addr) { define double @test_extend64(half* %addr) { ; CHECK-LABEL: test_extend64: -; CHECK-OLD: blx ___gnu_h2f_ieee +; CHECK-OLD: blx ___extendhfsf2 ; CHECK-OLD: vcvt.f64.f32 ; CHECK-F16: vcvtb.f32.f16 ; CHECK-F16: vcvt.f64.f32 @@ -54,7 +54,7 @@ define double @test_extend64(half* %addr) { define void @test_trunc32(float %in, half* %addr) { ; CHECK-LABEL: test_trunc32: -; CHECK-OLD: blx ___gnu_f2h_ieee +; CHECK-OLD: blx ___truncsfhf2 ; CHECK-F16: vcvtb.f16.f32 ; CHECK-V8: vcvtb.f16.f32 %val16 = fptrunc float %in to half -- 2.7.4