Skip to content

Commit 6402ad2

Browse files
committed
[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
1 parent 9a43d5b commit 6402ad2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

llvm/lib/CodeGen/TargetLoweringBase.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,14 @@ static void InitLibcallNames(const char **Names, const Triple &TT) {
420420
// These are generally not available.
421421
Names[RTLIB::STACKPROTECTOR_CHECK_FAIL] = nullptr;
422422
}
423+
424+
// For f16/f32 conversions, Darwin uses the standard naming scheme, instead
425+
// of the gnueabi-style __gnu_*_ieee.
426+
// FIXME: What about other targets?
427+
if (TT.isOSDarwin()) {
428+
Names[RTLIB::FPEXT_F16_F32] = "__extendhfsf2";
429+
Names[RTLIB::FPROUND_F32_F16] = "__truncsfhf2";
430+
}
423431
}
424432

425433
/// InitLibcallCallingConvs - Set default libcall CallingConvs.

llvm/test/CodeGen/ARM/half.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ define void @test_bitcast_to_half(half* %addr, i16 %in) {
3030
define float @test_extend32(half* %addr) {
3131
; CHECK-LABEL: test_extend32:
3232

33-
; CHECK-OLD: b.w ___gnu_h2f_ieee
33+
; CHECK-OLD: b.w ___extendhfsf2
3434
; CHECK-F16: vcvtb.f32.f16
3535
; CHECK-V8: vcvtb.f32.f16
3636
%val16 = load half, half* %addr
@@ -41,7 +41,7 @@ define float @test_extend32(half* %addr) {
4141
define double @test_extend64(half* %addr) {
4242
; CHECK-LABEL: test_extend64:
4343

44-
; CHECK-OLD: blx ___gnu_h2f_ieee
44+
; CHECK-OLD: blx ___extendhfsf2
4545
; CHECK-OLD: vcvt.f64.f32
4646
; CHECK-F16: vcvtb.f32.f16
4747
; CHECK-F16: vcvt.f64.f32
@@ -54,7 +54,7 @@ define double @test_extend64(half* %addr) {
5454
define void @test_trunc32(float %in, half* %addr) {
5555
; CHECK-LABEL: test_trunc32:
5656

57-
; CHECK-OLD: blx ___gnu_f2h_ieee
57+
; CHECK-OLD: blx ___truncsfhf2
5858
; CHECK-F16: vcvtb.f16.f32
5959
; CHECK-V8: vcvtb.f16.f32
6060
%val16 = fptrunc float %in to half

0 commit comments

Comments
 (0)