1 ; Test that floating-point instructions that set cc are used to
2 ; eliminate compares for load complement, load negative and load
3 ; positive. Right now, the WFL.DB (vector) instructions are not
4 ; handled by SystemZElimcompare, so for Z13 this is currently
7 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s -check-prefix=CHECK-Z10
9 ; Load complement (sign-bit flipped).
11 define float @f1(float %a, float %b, float %f) {
15 %neg = fsub float -0.0, %f
16 %cond = fcmp oeq float %neg, 0.0
17 %res = select i1 %cond, float %a, float %b
22 define double @f2(double %a, double %b, double %f) {
26 %neg = fsub double -0.0, %f
27 %cond = fcmp oeq double %neg, 0.0
28 %res = select i1 %cond, double %a, double %b
32 ; Negation of floating-point absolute.
34 declare float @llvm.fabs.f32(float %f)
35 define float @f3(float %a, float %b, float %f) {
39 %abs = call float @llvm.fabs.f32(float %f)
40 %neg = fsub float -0.0, %abs
41 %cond = fcmp oeq float %neg, 0.0
42 %res = select i1 %cond, float %a, float %b
47 declare double @llvm.fabs.f64(double %f)
48 define double @f4(double %a, double %b, double %f) {
52 %abs = call double @llvm.fabs.f64(double %f)
53 %neg = fsub double -0.0, %abs
54 %cond = fcmp oeq double %neg, 0.0
55 %res = select i1 %cond, double %a, double %b
59 ; Absolute floating-point value.
61 define float @f5(float %a, float %b, float %f) {
65 %abs = call float @llvm.fabs.f32(float %f)
66 %cond = fcmp oeq float %abs, 0.0
67 %res = select i1 %cond, float %a, float %b
72 define double @f6(double %a, double %b, double %f) {
76 %abs = call double @llvm.fabs.f64(double %f)
77 %cond = fcmp oeq double %abs, 0.0
78 %res = select i1 %cond, double %a, double %b