xref: /aosp_15_r20/external/llvm/test/CodeGen/SystemZ/branch-04.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test all condition-code masks that are relevant for floating-point
2*9880d681SAndroid Build Coastguard Worker; comparisons.
3*9880d681SAndroid Build Coastguard Worker;
4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine void @f1(float *%src, float %target) {
7*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f1:
8*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
9*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
10*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
11*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: je .L[[LABEL]]
12*9880d681SAndroid Build Coastguard Worker  br label %loop
13*9880d681SAndroid Build Coastguard Workerloop:
14*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
15*9880d681SAndroid Build Coastguard Worker  %cond = fcmp oeq float %target, %val
16*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
17*9880d681SAndroid Build Coastguard Workerexit:
18*9880d681SAndroid Build Coastguard Worker  ret void
19*9880d681SAndroid Build Coastguard Worker}
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard Workerdefine void @f2(float *%src, float %target) {
22*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f2:
23*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
24*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
25*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
26*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jlh .L[[LABEL]]
27*9880d681SAndroid Build Coastguard Worker  br label %loop
28*9880d681SAndroid Build Coastguard Workerloop:
29*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
30*9880d681SAndroid Build Coastguard Worker  %cond = fcmp one float %target, %val
31*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
32*9880d681SAndroid Build Coastguard Workerexit:
33*9880d681SAndroid Build Coastguard Worker  ret void
34*9880d681SAndroid Build Coastguard Worker}
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard Workerdefine void @f3(float *%src, float %target) {
37*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f3:
38*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
39*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
40*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
41*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jle .L[[LABEL]]
42*9880d681SAndroid Build Coastguard Worker  br label %loop
43*9880d681SAndroid Build Coastguard Workerloop:
44*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
45*9880d681SAndroid Build Coastguard Worker  %cond = fcmp ole float %target, %val
46*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
47*9880d681SAndroid Build Coastguard Workerexit:
48*9880d681SAndroid Build Coastguard Worker  ret void
49*9880d681SAndroid Build Coastguard Worker}
50*9880d681SAndroid Build Coastguard Worker
51*9880d681SAndroid Build Coastguard Workerdefine void @f4(float *%src, float %target) {
52*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f4:
53*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
54*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
55*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
56*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jl .L[[LABEL]]
57*9880d681SAndroid Build Coastguard Worker  br label %loop
58*9880d681SAndroid Build Coastguard Workerloop:
59*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
60*9880d681SAndroid Build Coastguard Worker  %cond = fcmp olt float %target, %val
61*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
62*9880d681SAndroid Build Coastguard Workerexit:
63*9880d681SAndroid Build Coastguard Worker  ret void
64*9880d681SAndroid Build Coastguard Worker}
65*9880d681SAndroid Build Coastguard Worker
66*9880d681SAndroid Build Coastguard Workerdefine void @f5(float *%src, float %target) {
67*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f5:
68*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
69*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
70*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
71*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jh .L[[LABEL]]
72*9880d681SAndroid Build Coastguard Worker  br label %loop
73*9880d681SAndroid Build Coastguard Workerloop:
74*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
75*9880d681SAndroid Build Coastguard Worker  %cond = fcmp ogt float %target, %val
76*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
77*9880d681SAndroid Build Coastguard Workerexit:
78*9880d681SAndroid Build Coastguard Worker  ret void
79*9880d681SAndroid Build Coastguard Worker}
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Workerdefine void @f6(float *%src, float %target) {
82*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f6:
83*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
84*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
85*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
86*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jhe .L[[LABEL]]
87*9880d681SAndroid Build Coastguard Worker  br label %loop
88*9880d681SAndroid Build Coastguard Workerloop:
89*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
90*9880d681SAndroid Build Coastguard Worker  %cond = fcmp oge float %target, %val
91*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
92*9880d681SAndroid Build Coastguard Workerexit:
93*9880d681SAndroid Build Coastguard Worker  ret void
94*9880d681SAndroid Build Coastguard Worker}
95*9880d681SAndroid Build Coastguard Worker
96*9880d681SAndroid Build Coastguard Workerdefine void @f7(float *%src, float %target) {
97*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f7:
98*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
99*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
100*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
101*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jnlh .L[[LABEL]]
102*9880d681SAndroid Build Coastguard Worker  br label %loop
103*9880d681SAndroid Build Coastguard Workerloop:
104*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
105*9880d681SAndroid Build Coastguard Worker  %cond = fcmp ueq float %target, %val
106*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
107*9880d681SAndroid Build Coastguard Workerexit:
108*9880d681SAndroid Build Coastguard Worker  ret void
109*9880d681SAndroid Build Coastguard Worker}
110*9880d681SAndroid Build Coastguard Worker
111*9880d681SAndroid Build Coastguard Workerdefine void @f8(float *%src, float %target) {
112*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f8:
113*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
114*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
115*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
116*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jne .L[[LABEL]]
117*9880d681SAndroid Build Coastguard Worker  br label %loop
118*9880d681SAndroid Build Coastguard Workerloop:
119*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
120*9880d681SAndroid Build Coastguard Worker  %cond = fcmp une float %target, %val
121*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
122*9880d681SAndroid Build Coastguard Workerexit:
123*9880d681SAndroid Build Coastguard Worker  ret void
124*9880d681SAndroid Build Coastguard Worker}
125*9880d681SAndroid Build Coastguard Worker
126*9880d681SAndroid Build Coastguard Workerdefine void @f9(float *%src, float %target) {
127*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f9:
128*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
129*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
130*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
131*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jnh .L[[LABEL]]
132*9880d681SAndroid Build Coastguard Worker  br label %loop
133*9880d681SAndroid Build Coastguard Workerloop:
134*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
135*9880d681SAndroid Build Coastguard Worker  %cond = fcmp ule float %target, %val
136*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
137*9880d681SAndroid Build Coastguard Workerexit:
138*9880d681SAndroid Build Coastguard Worker  ret void
139*9880d681SAndroid Build Coastguard Worker}
140*9880d681SAndroid Build Coastguard Worker
141*9880d681SAndroid Build Coastguard Workerdefine void @f10(float *%src, float %target) {
142*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f10:
143*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
144*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
145*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
146*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jnhe .L[[LABEL]]
147*9880d681SAndroid Build Coastguard Worker  br label %loop
148*9880d681SAndroid Build Coastguard Workerloop:
149*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
150*9880d681SAndroid Build Coastguard Worker  %cond = fcmp ult float %target, %val
151*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
152*9880d681SAndroid Build Coastguard Workerexit:
153*9880d681SAndroid Build Coastguard Worker  ret void
154*9880d681SAndroid Build Coastguard Worker}
155*9880d681SAndroid Build Coastguard Worker
156*9880d681SAndroid Build Coastguard Workerdefine void @f11(float *%src, float %target) {
157*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f11:
158*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
159*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
160*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
161*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jnle .L[[LABEL]]
162*9880d681SAndroid Build Coastguard Worker  br label %loop
163*9880d681SAndroid Build Coastguard Workerloop:
164*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
165*9880d681SAndroid Build Coastguard Worker  %cond = fcmp ugt float %target, %val
166*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
167*9880d681SAndroid Build Coastguard Workerexit:
168*9880d681SAndroid Build Coastguard Worker  ret void
169*9880d681SAndroid Build Coastguard Worker}
170*9880d681SAndroid Build Coastguard Worker
171*9880d681SAndroid Build Coastguard Workerdefine void @f12(float *%src, float %target) {
172*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f12:
173*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
174*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
175*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
176*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jnl .L[[LABEL]]
177*9880d681SAndroid Build Coastguard Worker  br label %loop
178*9880d681SAndroid Build Coastguard Workerloop:
179*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
180*9880d681SAndroid Build Coastguard Worker  %cond = fcmp uge float %target, %val
181*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
182*9880d681SAndroid Build Coastguard Workerexit:
183*9880d681SAndroid Build Coastguard Worker  ret void
184*9880d681SAndroid Build Coastguard Worker}
185*9880d681SAndroid Build Coastguard Worker
186*9880d681SAndroid Build Coastguard Worker; "jno" == "jump if no overflow", which corresponds to "jump if ordered"
187*9880d681SAndroid Build Coastguard Worker; rather than "jump if not ordered" after a floating-point comparison.
188*9880d681SAndroid Build Coastguard Workerdefine void @f13(float *%src, float %target) {
189*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f13:
190*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
191*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
192*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
193*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jno .L[[LABEL]]
194*9880d681SAndroid Build Coastguard Worker  br label %loop
195*9880d681SAndroid Build Coastguard Workerloop:
196*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
197*9880d681SAndroid Build Coastguard Worker  %cond = fcmp ord float %target, %val
198*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
199*9880d681SAndroid Build Coastguard Workerexit:
200*9880d681SAndroid Build Coastguard Worker  ret void
201*9880d681SAndroid Build Coastguard Worker}
202*9880d681SAndroid Build Coastguard Worker
203*9880d681SAndroid Build Coastguard Worker; "jo" == "jump if overflow", which corresponds to "jump if not ordered"
204*9880d681SAndroid Build Coastguard Worker; rather than "jump if ordered" after a floating-point comparison.
205*9880d681SAndroid Build Coastguard Workerdefine void @f14(float *%src, float %target) {
206*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f14:
207*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
208*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
209*9880d681SAndroid Build Coastguard Worker; CHECK: ceb %f0, 0(%r2)
210*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jo .L[[LABEL]]
211*9880d681SAndroid Build Coastguard Worker  br label %loop
212*9880d681SAndroid Build Coastguard Workerloop:
213*9880d681SAndroid Build Coastguard Worker  %val = load volatile float , float *%src
214*9880d681SAndroid Build Coastguard Worker  %cond = fcmp uno float %target, %val
215*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
216*9880d681SAndroid Build Coastguard Workerexit:
217*9880d681SAndroid Build Coastguard Worker  ret void
218*9880d681SAndroid Build Coastguard Worker}
219