1 ; Test that floating-point instructions that set cc are *not* used to
2 ; eliminate *strict* signaling compares for load complement, load negative
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) #0 {
13 ; CHECK-NEXT: ber %r14
15 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(
16 float %neg, float 0.0,
18 metadata !"fpexcept.strict") #0
19 %res = select i1 %cond, float %a, float %b
24 define double @f2(double %a, double %b, double %f) #0 {
27 ; CHECK-NEXT: ber %r14
29 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(
30 double %neg, double 0.0,
32 metadata !"fpexcept.strict") #0
33 %res = select i1 %cond, double %a, double %b
37 ; Negation of floating-point absolute.
39 declare float @llvm.fabs.f32(float %f)
40 define float @f3(float %a, float %b, float %f) #0 {
43 ; CHECK-NEXT: ber %r14
44 %abs = call float @llvm.fabs.f32(float %f) #0
45 %neg = fneg float %abs
46 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(
47 float %neg, float 0.0,
49 metadata !"fpexcept.strict") #0
50 %res = select i1 %cond, float %a, float %b
55 declare double @llvm.fabs.f64(double %f)
56 define double @f4(double %a, double %b, double %f) #0 {
59 ; CHECK-NEXT: ber %r14
60 %abs = call double @llvm.fabs.f64(double %f) #0
61 %neg = fneg double %abs
62 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(
63 double %neg, double 0.0,
65 metadata !"fpexcept.strict") #0
66 %res = select i1 %cond, double %a, double %b
70 ; Absolute floating-point value.
72 define float @f5(float %a, float %b, float %f) #0 {
75 ; CHECK-NEXT: ber %r14
76 %abs = call float @llvm.fabs.f32(float %f) #0
77 %cond = call i1 @llvm.experimental.constrained.fcmps.f32(
78 float %abs, float 0.0,
80 metadata !"fpexcept.strict") #0
81 %res = select i1 %cond, float %a, float %b
86 define double @f6(double %a, double %b, double %f) #0 {
89 ; CHECK-NEXT: ber %r14
90 %abs = call double @llvm.fabs.f64(double %f) #0
91 %cond = call i1 @llvm.experimental.constrained.fcmps.f64(
92 double %abs, double 0.0,
94 metadata !"fpexcept.strict") #0
95 %res = select i1 %cond, double %a, double %b
99 attributes #0 = { strictfp }
101 declare i1 @llvm.experimental.constrained.fcmps.f32(float, float, metadata, metadata)
102 declare i1 @llvm.experimental.constrained.fcmps.f64(double, double, metadata, metadata)