Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9590,34 +9590,6 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
if (visitUnaryFloatCall(I, ISD::FABS))
return;
break;
case LibFunc_fmin:
case LibFunc_fminf:
case LibFunc_fminl:
// TODO: Remove this, already canonicalized by the middle-end.
if (visitBinaryFloatCall(I, ISD::FMINNUM))
return;
break;
case LibFunc_fmax:
case LibFunc_fmaxf:
case LibFunc_fmaxl:
// TODO: Remove this, already canonicalized by the middle-end.
if (visitBinaryFloatCall(I, ISD::FMAXNUM))
return;
break;
case LibFunc_fminimum_num:
case LibFunc_fminimum_numf:
case LibFunc_fminimum_numl:
// TODO: Remove this, already canonicalized by the middle-end.
if (visitBinaryFloatCall(I, ISD::FMINIMUMNUM))
return;
break;
case LibFunc_fmaximum_num:
case LibFunc_fmaximum_numf:
case LibFunc_fmaximum_numl:
// TODO: Remove this, already canonicalized by the middle-end.
if (visitBinaryFloatCall(I, ISD::FMAXIMUMNUM))
return;
break;
case LibFunc_sin:
case LibFunc_sinf:
case LibFunc_sinl:
Expand Down Expand Up @@ -9687,41 +9659,6 @@ void SelectionDAGBuilder::visitCall(const CallInst &I) {
if (visitUnaryFloatCall(I, ISD::FSQRT))
return;
break;
case LibFunc_floor:
case LibFunc_floorf:
case LibFunc_floorl:
// TODO: Remove this, already canonicalized by the middle-end.
if (visitUnaryFloatCall(I, ISD::FFLOOR))
return;
break;
case LibFunc_ceil:
case LibFunc_ceilf:
case LibFunc_ceill:
// TODO: Remove this, already canonicalized by the middle-end.
if (visitUnaryFloatCall(I, ISD::FCEIL))
return;
break;
case LibFunc_rint:
case LibFunc_rintf:
case LibFunc_rintl:
// TODO: Remove this, already canonicalized by the middle-end.
if (visitUnaryFloatCall(I, ISD::FRINT))
return;
break;
case LibFunc_round:
case LibFunc_roundf:
case LibFunc_roundl:
// TODO: Remove this, already canonicalized by the middle-end.
if (visitUnaryFloatCall(I, ISD::FROUND))
return;
break;
case LibFunc_trunc:
case LibFunc_truncf:
case LibFunc_truncl:
// TODO: Remove this, already canonicalized by the middle-end.
if (visitUnaryFloatCall(I, ISD::FTRUNC))
return;
break;
case LibFunc_log2:
case LibFunc_log2f:
case LibFunc_log2l:
Expand Down
56 changes: 18 additions & 38 deletions llvm/test/CodeGen/AArch64/arm64-rounding.ll
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,19 @@
; CHECK-NOT: frintx
define float @test1(float %a) #0 {
entry:
%call = tail call float @floorf(float %a) nounwind readnone
%call = tail call float @llvm.floor.f32(float %a) nounwind readnone
ret float %call
}

declare float @floorf(float) nounwind readnone

; CHECK-LABEL: test2:
; CHECK: frintm
; CHECK-NOT: frintx
define double @test2(double %a) #0 {
entry:
%call = tail call double @floor(double %a) nounwind readnone
%call = tail call double @llvm.floor.f64(double %a) nounwind readnone
ret double %call
}

declare double @floor(double) nounwind readnone

; CHECK-LABEL: test3:
; CHECK: frinti
define float @test3(float %a) #0 {
Expand All @@ -43,93 +39,77 @@ entry:
; CHECK-NOT: frintx
define float @test5(float %a) #0 {
entry:
%call = tail call float @ceilf(float %a) nounwind readnone
%call = tail call float @llvm.ceil.f32(float %a) nounwind readnone
ret float %call
}

declare float @ceilf(float) nounwind readnone

; CHECK-LABEL: test6:
; CHECK: frintp
; CHECK-NOT: frintx
define double @test6(double %a) #0 {
entry:
%call = tail call double @ceil(double %a) nounwind readnone
%call = tail call double @llvm.ceil.f64(double %a) nounwind readnone
ret double %call
}

declare double @ceil(double) nounwind readnone

; CHECK-LABEL: test7:
; CHECK: frintx
define float @test7(float %a) #0 {
entry:
%call = tail call float @rintf(float %a) nounwind readnone
%call = tail call float @llvm.rint.f32(float %a) nounwind readnone
ret float %call
}

declare float @rintf(float) nounwind readnone

; CHECK-LABEL: test8:
; CHECK: frintx
define double @test8(double %a) #0 {
entry:
%call = tail call double @rint(double %a) nounwind readnone
%call = tail call double @llvm.rint.f64(double %a) nounwind readnone
ret double %call
}

declare double @rint(double) nounwind readnone

; CHECK-LABEL: test9:
; CHECK: frintz
; CHECK-NOT: frintx
define float @test9(float %a) #0 {
entry:
%call = tail call float @truncf(float %a) nounwind readnone
%call = tail call float @llvm.trunc.f32(float %a) nounwind readnone
ret float %call
}

declare float @truncf(float) nounwind readnone

; CHECK-LABEL: test10:
; CHECK: frintz
; CHECK-NOT: frintx
define double @test10(double %a) #0 {
entry:
%call = tail call double @trunc(double %a) nounwind readnone
%call = tail call double @llvm.trunc.f64(double %a) nounwind readnone
ret double %call
}

declare double @trunc(double) nounwind readnone

; CHECK-LABEL: test11:
; CHECK: frinta
; CHECK-NOT: frintx
define float @test11(float %a) #0 {
entry:
%call = tail call float @roundf(float %a) nounwind readnone
%call = tail call float @llvm.round.f32(float %a) nounwind readnone
ret float %call
}

declare float @roundf(float %a) nounwind readnone

; CHECK-LABEL: test12:
; CHECK: frinta
; CHECK-NOT: frintx
define double @test12(double %a) #0 {
entry:
%call = tail call double @round(double %a) nounwind readnone
%call = tail call double @llvm.round.f64(double %a) nounwind readnone
ret double %call
}

declare double @round(double %a) nounwind readnone

; CHECK-LABEL: test13:
; CHECK-NOT: frintx
; CHECK: frintm
define float @test13(float %a) #1 {
entry:
%call = tail call float @floorf(float %a) nounwind readnone
%call = tail call float @llvm.floor.f32(float %a) nounwind readnone
ret float %call
}

Expand All @@ -138,7 +118,7 @@ entry:
; CHECK: frintm
define double @test14(double %a) #1 {
entry:
%call = tail call double @floor(double %a) nounwind readnone
%call = tail call double @llvm.floor.f64(double %a) nounwind readnone
ret double %call
}

Expand All @@ -147,7 +127,7 @@ entry:
; CHECK: frintp
define float @test15(float %a) #1 {
entry:
%call = tail call float @ceilf(float %a) nounwind readnone
%call = tail call float @llvm.ceil.f32(float %a) nounwind readnone
ret float %call
}

Expand All @@ -156,7 +136,7 @@ entry:
; CHECK: frintp
define double @test16(double %a) #1 {
entry:
%call = tail call double @ceil(double %a) nounwind readnone
%call = tail call double @llvm.ceil.f64(double %a) nounwind readnone
ret double %call
}

Expand All @@ -165,7 +145,7 @@ entry:
; CHECK: frintz
define float @test17(float %a) #1 {
entry:
%call = tail call float @truncf(float %a) nounwind readnone
%call = tail call float @llvm.trunc.f32(float %a) nounwind readnone
ret float %call
}

Expand All @@ -174,7 +154,7 @@ entry:
; CHECK: frintz
define double @test18(double %a) #1 {
entry:
%call = tail call double @trunc(double %a) nounwind readnone
%call = tail call double @llvm.trunc.f64(double %a) nounwind readnone
ret double %call
}

Expand All @@ -183,7 +163,7 @@ entry:
; CHECK: frinta
define float @test19(float %a) #1 {
entry:
%call = tail call float @roundf(float %a) nounwind readnone
%call = tail call float @llvm.round.f32(float %a) nounwind readnone
ret float %call
}

Expand All @@ -192,7 +172,7 @@ entry:
; CHECK: frinta
define double @test20(double %a) #1 {
entry:
%call = tail call double @round(double %a) nounwind readnone
%call = tail call double @llvm.round.f64(double %a) nounwind readnone
ret double %call
}

Expand Down
28 changes: 8 additions & 20 deletions llvm/test/CodeGen/AArch64/floatdp_1source.ll
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ declare double @fabs(double) readonly
declare float @llvm.sqrt.f32(float %Val)
declare double @llvm.sqrt.f64(double %Val)

declare float @ceilf(float) readonly
declare double @ceil(double) readonly

declare float @floorf(float) readonly
declare double @floor(double) readonly

declare float @truncf(float) readonly
declare double @trunc(double) readonly

declare float @rintf(float) readonly
declare double @rint(double) readonly

define float @fabs_f(float %v) {
; CHECK-LABEL: fabs_f:
; CHECK: ; %bb.0:
Expand Down Expand Up @@ -51,7 +39,7 @@ define float @ceil_f(float %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintp s0, s0
; CHECK-NEXT: ret
%r = call float @ceilf(float %v)
%r = call float @llvm.ceil.f32(float %v)
ret float %r
}

Expand All @@ -60,7 +48,7 @@ define float @floor_f(float %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintm s0, s0
; CHECK-NEXT: ret
%r = call float @floorf(float %v)
%r = call float @llvm.floor.f32(float %v)
ret float %r
}

Expand All @@ -69,7 +57,7 @@ define float @trunc_f(float %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintz s0, s0
; CHECK-NEXT: ret
%r = call float @truncf(float %v)
%r = call float @llvm.trunc.f32(float %v)
ret float %r
}

Expand All @@ -78,7 +66,7 @@ define float @rint_f(float %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintx s0, s0
; CHECK-NEXT: ret
%r = call float @rintf(float %v)
%r = call float @llvm.rint.f32(float %v)
ret float %r
}

Expand Down Expand Up @@ -123,7 +111,7 @@ define double @ceil_d(double %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintp d0, d0
; CHECK-NEXT: ret
%r = call double @ceil(double %v)
%r = call double @llvm.ceil.f64(double %v)
ret double %r
}

Expand All @@ -132,7 +120,7 @@ define double @floor_d(double %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintm d0, d0
; CHECK-NEXT: ret
%r = call double @floor(double %v)
%r = call double @llvm.floor.f64(double %v)
ret double %r
}

Expand All @@ -141,7 +129,7 @@ define double @trunc_d(double %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintz d0, d0
; CHECK-NEXT: ret
%r = call double @trunc(double %v)
%r = call double @llvm.trunc.f64(double %v)
ret double %r
}

Expand All @@ -150,7 +138,7 @@ define double @rint_d(double %v) {
; CHECK: ; %bb.0:
; CHECK-NEXT: frintx d0, d0
; CHECK-NEXT: ret
%r = call double @rint(double %v)
%r = call double @llvm.rint.f64(double %v)
ret double %r
}

Expand Down
Loading