1 ; Test that floating-point instructions that set cc are used to
2 ; eliminate compares for load complement, load negative and load
5 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
6 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
8 ; Load complement (sign-bit flipped).
10 define float @f1(float %a, float %b, float %f) {
13 ; CHECK-NEXT: ber %r14
15 %cond = fcmp oeq float %neg, 0.0
16 %res = select i1 %cond, float %a, float %b
21 define double @f2(double %a, double %b, double %f) {
24 ; CHECK-NEXT: ber %r14
26 %cond = fcmp oeq double %neg, 0.0
27 %res = select i1 %cond, double %a, double %b
31 ; Negation of floating-point absolute.
33 declare float @llvm.fabs.f32(float %f)
34 define float @f3(float %a, float %b, float %f) {
37 ; CHECK-NEXT: ber %r14
38 %abs = call float @llvm.fabs.f32(float %f)
39 %neg = fneg float %abs
40 %cond = fcmp oeq float %neg, 0.0
41 %res = select i1 %cond, float %a, float %b
46 declare double @llvm.fabs.f64(double %f)
47 define double @f4(double %a, double %b, double %f) {
50 ; CHECK-NEXT: ber %r14
51 %abs = call double @llvm.fabs.f64(double %f)
52 %neg = fneg double %abs
53 %cond = fcmp oeq double %neg, 0.0
54 %res = select i1 %cond, double %a, double %b
58 ; Absolute floating-point value.
60 define float @f5(float %a, float %b, float %f) {
63 ; CHECK-NEXT: ber %r14
64 %abs = call float @llvm.fabs.f32(float %f)
65 %cond = fcmp oeq float %abs, 0.0
66 %res = select i1 %cond, float %a, float %b
71 define double @f6(double %a, double %b, double %f) {
74 ; CHECK-NEXT: ber %r14
75 %abs = call double @llvm.fabs.f64(double %f)
76 %cond = fcmp oeq double %abs, 0.0
77 %res = select i1 %cond, double %a, double %b