1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=riscv32 -mattr=+zfh -verify-machineinstrs \
3 ; RUN: -target-abi ilp32f -disable-strictnode-mutation < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+zfh -verify-machineinstrs \
5 ; RUN: -target-abi lp64f -disable-strictnode-mutation < %s | FileCheck %s
6 ; RUN: llc -mtriple=riscv32 -mattr=+zhinx -verify-machineinstrs \
7 ; RUN: -target-abi ilp32 -disable-strictnode-mutation < %s \
8 ; RUN: | FileCheck -check-prefix=CHECKIZHINX %s
9 ; RUN: llc -mtriple=riscv64 -mattr=+zhinx -verify-machineinstrs \
10 ; RUN: -target-abi lp64 -disable-strictnode-mutation < %s \
11 ; RUN: | FileCheck -check-prefix=CHECKIZHINX %s
12 ; RUN: llc -mtriple=riscv32 -mattr=+zfh -verify-machineinstrs \
13 ; RUN: -target-abi ilp32f -disable-strictnode-mutation < %s \
14 ; RUN: | FileCheck -check-prefix=CHECKIZFHMIN %s
15 ; RUN: llc -mtriple=riscv64 -mattr=+zfh -verify-machineinstrs \
16 ; RUN: -target-abi lp64f -disable-strictnode-mutation < %s \
17 ; RUN: | FileCheck -check-prefix=CHECKIZFHMIN %s
18 ; RUN: llc -mtriple=riscv32 -mattr=+zhinxmin -verify-machineinstrs \
19 ; RUN: -target-abi ilp32 -disable-strictnode-mutation < %s \
20 ; RUN: | FileCheck -check-prefix=CHECKIZHINXMIN %s
21 ; RUN: llc -mtriple=riscv64 -mattr=+zhinxmin -verify-machineinstrs \
22 ; RUN: -target-abi lp64 -disable-strictnode-mutation < %s \
23 ; RUN: | FileCheck -check-prefix=CHECKIZHINXMIN %s
25 define i32 @fcmp_oeq(half %a, half %b) nounwind strictfp {
26 ; CHECK-LABEL: fcmp_oeq:
28 ; CHECK-NEXT: feq.h a0, fa0, fa1
31 ; CHECKIZHINX-LABEL: fcmp_oeq:
32 ; CHECKIZHINX: # %bb.0:
33 ; CHECKIZHINX-NEXT: feq.h a0, a0, a1
34 ; CHECKIZHINX-NEXT: ret
36 ; CHECKIZFHMIN-LABEL: fcmp_oeq:
37 ; CHECKIZFHMIN: # %bb.0:
38 ; CHECKIZFHMIN-NEXT: feq.h a0, fa0, fa1
39 ; CHECKIZFHMIN-NEXT: ret
41 ; CHECKIZHINXMIN-LABEL: fcmp_oeq:
42 ; CHECKIZHINXMIN: # %bb.0:
43 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
44 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
45 ; CHECKIZHINXMIN-NEXT: feq.s a0, a0, a1
46 ; CHECKIZHINXMIN-NEXT: ret
47 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"oeq", metadata !"fpexcept.strict") strictfp
48 %2 = zext i1 %1 to i32
51 declare i1 @llvm.experimental.constrained.fcmp.f16(half, half, metadata, metadata)
53 define i32 @fcmp_ogt(half %a, half %b) nounwind strictfp {
54 ; CHECK-LABEL: fcmp_ogt:
56 ; CHECK-NEXT: frflags a1
57 ; CHECK-NEXT: flt.h a0, fa1, fa0
58 ; CHECK-NEXT: fsflags a1
59 ; CHECK-NEXT: feq.h zero, fa1, fa0
62 ; CHECKIZHINX-LABEL: fcmp_ogt:
63 ; CHECKIZHINX: # %bb.0:
64 ; CHECKIZHINX-NEXT: csrr a3, fflags
65 ; CHECKIZHINX-NEXT: flt.h a2, a1, a0
66 ; CHECKIZHINX-NEXT: csrw fflags, a3
67 ; CHECKIZHINX-NEXT: feq.h zero, a1, a0
68 ; CHECKIZHINX-NEXT: mv a0, a2
69 ; CHECKIZHINX-NEXT: ret
71 ; CHECKIZFHMIN-LABEL: fcmp_ogt:
72 ; CHECKIZFHMIN: # %bb.0:
73 ; CHECKIZFHMIN-NEXT: frflags a1
74 ; CHECKIZFHMIN-NEXT: flt.h a0, fa1, fa0
75 ; CHECKIZFHMIN-NEXT: fsflags a1
76 ; CHECKIZFHMIN-NEXT: feq.h zero, fa1, fa0
77 ; CHECKIZFHMIN-NEXT: ret
79 ; CHECKIZHINXMIN-LABEL: fcmp_ogt:
80 ; CHECKIZHINXMIN: # %bb.0:
81 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
82 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
83 ; CHECKIZHINXMIN-NEXT: csrr a3, fflags
84 ; CHECKIZHINXMIN-NEXT: flt.s a0, a1, a2
85 ; CHECKIZHINXMIN-NEXT: csrw fflags, a3
86 ; CHECKIZHINXMIN-NEXT: feq.s zero, a1, a2
87 ; CHECKIZHINXMIN-NEXT: ret
88 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"ogt", metadata !"fpexcept.strict") strictfp
89 %2 = zext i1 %1 to i32
93 define i32 @fcmp_oge(half %a, half %b) nounwind strictfp {
94 ; CHECK-LABEL: fcmp_oge:
96 ; CHECK-NEXT: frflags a1
97 ; CHECK-NEXT: fle.h a0, fa1, fa0
98 ; CHECK-NEXT: fsflags a1
99 ; CHECK-NEXT: feq.h zero, fa1, fa0
102 ; CHECKIZHINX-LABEL: fcmp_oge:
103 ; CHECKIZHINX: # %bb.0:
104 ; CHECKIZHINX-NEXT: csrr a3, fflags
105 ; CHECKIZHINX-NEXT: fle.h a2, a1, a0
106 ; CHECKIZHINX-NEXT: csrw fflags, a3
107 ; CHECKIZHINX-NEXT: feq.h zero, a1, a0
108 ; CHECKIZHINX-NEXT: mv a0, a2
109 ; CHECKIZHINX-NEXT: ret
111 ; CHECKIZFHMIN-LABEL: fcmp_oge:
112 ; CHECKIZFHMIN: # %bb.0:
113 ; CHECKIZFHMIN-NEXT: frflags a1
114 ; CHECKIZFHMIN-NEXT: fle.h a0, fa1, fa0
115 ; CHECKIZFHMIN-NEXT: fsflags a1
116 ; CHECKIZFHMIN-NEXT: feq.h zero, fa1, fa0
117 ; CHECKIZFHMIN-NEXT: ret
119 ; CHECKIZHINXMIN-LABEL: fcmp_oge:
120 ; CHECKIZHINXMIN: # %bb.0:
121 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
122 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
123 ; CHECKIZHINXMIN-NEXT: csrr a3, fflags
124 ; CHECKIZHINXMIN-NEXT: fle.s a0, a1, a2
125 ; CHECKIZHINXMIN-NEXT: csrw fflags, a3
126 ; CHECKIZHINXMIN-NEXT: feq.s zero, a1, a2
127 ; CHECKIZHINXMIN-NEXT: ret
128 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"oge", metadata !"fpexcept.strict") strictfp
129 %2 = zext i1 %1 to i32
133 define i32 @fcmp_olt(half %a, half %b) nounwind strictfp {
134 ; CHECK-LABEL: fcmp_olt:
136 ; CHECK-NEXT: frflags a1
137 ; CHECK-NEXT: flt.h a0, fa0, fa1
138 ; CHECK-NEXT: fsflags a1
139 ; CHECK-NEXT: feq.h zero, fa0, fa1
142 ; CHECKIZHINX-LABEL: fcmp_olt:
143 ; CHECKIZHINX: # %bb.0:
144 ; CHECKIZHINX-NEXT: csrr a3, fflags
145 ; CHECKIZHINX-NEXT: flt.h a2, a0, a1
146 ; CHECKIZHINX-NEXT: csrw fflags, a3
147 ; CHECKIZHINX-NEXT: feq.h zero, a0, a1
148 ; CHECKIZHINX-NEXT: mv a0, a2
149 ; CHECKIZHINX-NEXT: ret
151 ; CHECKIZFHMIN-LABEL: fcmp_olt:
152 ; CHECKIZFHMIN: # %bb.0:
153 ; CHECKIZFHMIN-NEXT: frflags a1
154 ; CHECKIZFHMIN-NEXT: flt.h a0, fa0, fa1
155 ; CHECKIZFHMIN-NEXT: fsflags a1
156 ; CHECKIZFHMIN-NEXT: feq.h zero, fa0, fa1
157 ; CHECKIZFHMIN-NEXT: ret
159 ; CHECKIZHINXMIN-LABEL: fcmp_olt:
160 ; CHECKIZHINXMIN: # %bb.0:
161 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
162 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
163 ; CHECKIZHINXMIN-NEXT: csrr a3, fflags
164 ; CHECKIZHINXMIN-NEXT: flt.s a0, a2, a1
165 ; CHECKIZHINXMIN-NEXT: csrw fflags, a3
166 ; CHECKIZHINXMIN-NEXT: feq.s zero, a2, a1
167 ; CHECKIZHINXMIN-NEXT: ret
168 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"olt", metadata !"fpexcept.strict") strictfp
169 %2 = zext i1 %1 to i32
173 define i32 @fcmp_ole(half %a, half %b) nounwind strictfp {
174 ; CHECK-LABEL: fcmp_ole:
176 ; CHECK-NEXT: frflags a1
177 ; CHECK-NEXT: fle.h a0, fa0, fa1
178 ; CHECK-NEXT: fsflags a1
179 ; CHECK-NEXT: feq.h zero, fa0, fa1
182 ; CHECKIZHINX-LABEL: fcmp_ole:
183 ; CHECKIZHINX: # %bb.0:
184 ; CHECKIZHINX-NEXT: csrr a3, fflags
185 ; CHECKIZHINX-NEXT: fle.h a2, a0, a1
186 ; CHECKIZHINX-NEXT: csrw fflags, a3
187 ; CHECKIZHINX-NEXT: feq.h zero, a0, a1
188 ; CHECKIZHINX-NEXT: mv a0, a2
189 ; CHECKIZHINX-NEXT: ret
191 ; CHECKIZFHMIN-LABEL: fcmp_ole:
192 ; CHECKIZFHMIN: # %bb.0:
193 ; CHECKIZFHMIN-NEXT: frflags a1
194 ; CHECKIZFHMIN-NEXT: fle.h a0, fa0, fa1
195 ; CHECKIZFHMIN-NEXT: fsflags a1
196 ; CHECKIZFHMIN-NEXT: feq.h zero, fa0, fa1
197 ; CHECKIZFHMIN-NEXT: ret
199 ; CHECKIZHINXMIN-LABEL: fcmp_ole:
200 ; CHECKIZHINXMIN: # %bb.0:
201 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
202 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
203 ; CHECKIZHINXMIN-NEXT: csrr a3, fflags
204 ; CHECKIZHINXMIN-NEXT: fle.s a0, a2, a1
205 ; CHECKIZHINXMIN-NEXT: csrw fflags, a3
206 ; CHECKIZHINXMIN-NEXT: feq.s zero, a2, a1
207 ; CHECKIZHINXMIN-NEXT: ret
208 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"ole", metadata !"fpexcept.strict") strictfp
209 %2 = zext i1 %1 to i32
213 ; FIXME: We only need one frflags before the two flts and one fsflags after the
215 define i32 @fcmp_one(half %a, half %b) nounwind strictfp {
216 ; CHECK-LABEL: fcmp_one:
218 ; CHECK-NEXT: frflags a0
219 ; CHECK-NEXT: flt.h a1, fa0, fa1
220 ; CHECK-NEXT: fsflags a0
221 ; CHECK-NEXT: feq.h zero, fa0, fa1
222 ; CHECK-NEXT: frflags a0
223 ; CHECK-NEXT: flt.h a2, fa1, fa0
224 ; CHECK-NEXT: fsflags a0
225 ; CHECK-NEXT: or a0, a2, a1
226 ; CHECK-NEXT: feq.h zero, fa1, fa0
229 ; CHECKIZHINX-LABEL: fcmp_one:
230 ; CHECKIZHINX: # %bb.0:
231 ; CHECKIZHINX-NEXT: csrr a2, fflags
232 ; CHECKIZHINX-NEXT: flt.h a3, a0, a1
233 ; CHECKIZHINX-NEXT: csrw fflags, a2
234 ; CHECKIZHINX-NEXT: feq.h zero, a0, a1
235 ; CHECKIZHINX-NEXT: csrr a2, fflags
236 ; CHECKIZHINX-NEXT: flt.h a4, a1, a0
237 ; CHECKIZHINX-NEXT: csrw fflags, a2
238 ; CHECKIZHINX-NEXT: or a2, a4, a3
239 ; CHECKIZHINX-NEXT: feq.h zero, a1, a0
240 ; CHECKIZHINX-NEXT: mv a0, a2
241 ; CHECKIZHINX-NEXT: ret
243 ; CHECKIZFHMIN-LABEL: fcmp_one:
244 ; CHECKIZFHMIN: # %bb.0:
245 ; CHECKIZFHMIN-NEXT: frflags a0
246 ; CHECKIZFHMIN-NEXT: flt.h a1, fa0, fa1
247 ; CHECKIZFHMIN-NEXT: fsflags a0
248 ; CHECKIZFHMIN-NEXT: feq.h zero, fa0, fa1
249 ; CHECKIZFHMIN-NEXT: frflags a0
250 ; CHECKIZFHMIN-NEXT: flt.h a2, fa1, fa0
251 ; CHECKIZFHMIN-NEXT: fsflags a0
252 ; CHECKIZFHMIN-NEXT: or a0, a2, a1
253 ; CHECKIZFHMIN-NEXT: feq.h zero, fa1, fa0
254 ; CHECKIZFHMIN-NEXT: ret
256 ; CHECKIZHINXMIN-LABEL: fcmp_one:
257 ; CHECKIZHINXMIN: # %bb.0:
258 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
259 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
260 ; CHECKIZHINXMIN-NEXT: csrr a0, fflags
261 ; CHECKIZHINXMIN-NEXT: flt.s a3, a2, a1
262 ; CHECKIZHINXMIN-NEXT: csrw fflags, a0
263 ; CHECKIZHINXMIN-NEXT: feq.s zero, a2, a1
264 ; CHECKIZHINXMIN-NEXT: csrr a0, fflags
265 ; CHECKIZHINXMIN-NEXT: flt.s a4, a1, a2
266 ; CHECKIZHINXMIN-NEXT: csrw fflags, a0
267 ; CHECKIZHINXMIN-NEXT: or a0, a4, a3
268 ; CHECKIZHINXMIN-NEXT: feq.s zero, a1, a2
269 ; CHECKIZHINXMIN-NEXT: ret
270 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"one", metadata !"fpexcept.strict") strictfp
271 %2 = zext i1 %1 to i32
275 define i32 @fcmp_ord(half %a, half %b) nounwind strictfp {
276 ; CHECK-LABEL: fcmp_ord:
278 ; CHECK-NEXT: feq.h a0, fa1, fa1
279 ; CHECK-NEXT: feq.h a1, fa0, fa0
280 ; CHECK-NEXT: and a0, a1, a0
283 ; CHECKIZHINX-LABEL: fcmp_ord:
284 ; CHECKIZHINX: # %bb.0:
285 ; CHECKIZHINX-NEXT: feq.h a1, a1, a1
286 ; CHECKIZHINX-NEXT: feq.h a0, a0, a0
287 ; CHECKIZHINX-NEXT: and a0, a0, a1
288 ; CHECKIZHINX-NEXT: ret
290 ; CHECKIZFHMIN-LABEL: fcmp_ord:
291 ; CHECKIZFHMIN: # %bb.0:
292 ; CHECKIZFHMIN-NEXT: feq.h a0, fa1, fa1
293 ; CHECKIZFHMIN-NEXT: feq.h a1, fa0, fa0
294 ; CHECKIZFHMIN-NEXT: and a0, a1, a0
295 ; CHECKIZFHMIN-NEXT: ret
297 ; CHECKIZHINXMIN-LABEL: fcmp_ord:
298 ; CHECKIZHINXMIN: # %bb.0:
299 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
300 ; CHECKIZHINXMIN-NEXT: feq.s a1, a1, a1
301 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
302 ; CHECKIZHINXMIN-NEXT: feq.s a0, a0, a0
303 ; CHECKIZHINXMIN-NEXT: and a0, a0, a1
304 ; CHECKIZHINXMIN-NEXT: ret
305 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"ord", metadata !"fpexcept.strict") strictfp
306 %2 = zext i1 %1 to i32
310 ; FIXME: We only need one frflags before the two flts and one fsflags after the
312 define i32 @fcmp_ueq(half %a, half %b) nounwind strictfp {
313 ; CHECK-LABEL: fcmp_ueq:
315 ; CHECK-NEXT: frflags a0
316 ; CHECK-NEXT: flt.h a1, fa0, fa1
317 ; CHECK-NEXT: fsflags a0
318 ; CHECK-NEXT: feq.h zero, fa0, fa1
319 ; CHECK-NEXT: frflags a0
320 ; CHECK-NEXT: flt.h a2, fa1, fa0
321 ; CHECK-NEXT: fsflags a0
322 ; CHECK-NEXT: or a1, a2, a1
323 ; CHECK-NEXT: xori a0, a1, 1
324 ; CHECK-NEXT: feq.h zero, fa1, fa0
327 ; CHECKIZHINX-LABEL: fcmp_ueq:
328 ; CHECKIZHINX: # %bb.0:
329 ; CHECKIZHINX-NEXT: csrr a2, fflags
330 ; CHECKIZHINX-NEXT: flt.h a3, a0, a1
331 ; CHECKIZHINX-NEXT: csrw fflags, a2
332 ; CHECKIZHINX-NEXT: feq.h zero, a0, a1
333 ; CHECKIZHINX-NEXT: csrr a2, fflags
334 ; CHECKIZHINX-NEXT: flt.h a4, a1, a0
335 ; CHECKIZHINX-NEXT: csrw fflags, a2
336 ; CHECKIZHINX-NEXT: or a3, a4, a3
337 ; CHECKIZHINX-NEXT: xori a2, a3, 1
338 ; CHECKIZHINX-NEXT: feq.h zero, a1, a0
339 ; CHECKIZHINX-NEXT: mv a0, a2
340 ; CHECKIZHINX-NEXT: ret
342 ; CHECKIZFHMIN-LABEL: fcmp_ueq:
343 ; CHECKIZFHMIN: # %bb.0:
344 ; CHECKIZFHMIN-NEXT: frflags a0
345 ; CHECKIZFHMIN-NEXT: flt.h a1, fa0, fa1
346 ; CHECKIZFHMIN-NEXT: fsflags a0
347 ; CHECKIZFHMIN-NEXT: feq.h zero, fa0, fa1
348 ; CHECKIZFHMIN-NEXT: frflags a0
349 ; CHECKIZFHMIN-NEXT: flt.h a2, fa1, fa0
350 ; CHECKIZFHMIN-NEXT: fsflags a0
351 ; CHECKIZFHMIN-NEXT: or a1, a2, a1
352 ; CHECKIZFHMIN-NEXT: xori a0, a1, 1
353 ; CHECKIZFHMIN-NEXT: feq.h zero, fa1, fa0
354 ; CHECKIZFHMIN-NEXT: ret
356 ; CHECKIZHINXMIN-LABEL: fcmp_ueq:
357 ; CHECKIZHINXMIN: # %bb.0:
358 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
359 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
360 ; CHECKIZHINXMIN-NEXT: csrr a0, fflags
361 ; CHECKIZHINXMIN-NEXT: flt.s a3, a2, a1
362 ; CHECKIZHINXMIN-NEXT: csrw fflags, a0
363 ; CHECKIZHINXMIN-NEXT: feq.s zero, a2, a1
364 ; CHECKIZHINXMIN-NEXT: csrr a0, fflags
365 ; CHECKIZHINXMIN-NEXT: flt.s a4, a1, a2
366 ; CHECKIZHINXMIN-NEXT: csrw fflags, a0
367 ; CHECKIZHINXMIN-NEXT: or a3, a4, a3
368 ; CHECKIZHINXMIN-NEXT: xori a0, a3, 1
369 ; CHECKIZHINXMIN-NEXT: feq.s zero, a1, a2
370 ; CHECKIZHINXMIN-NEXT: ret
371 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"ueq", metadata !"fpexcept.strict") strictfp
372 %2 = zext i1 %1 to i32
376 define i32 @fcmp_ugt(half %a, half %b) nounwind strictfp {
377 ; CHECK-LABEL: fcmp_ugt:
379 ; CHECK-NEXT: frflags a0
380 ; CHECK-NEXT: fle.h a1, fa0, fa1
381 ; CHECK-NEXT: fsflags a0
382 ; CHECK-NEXT: xori a0, a1, 1
383 ; CHECK-NEXT: feq.h zero, fa0, fa1
386 ; CHECKIZHINX-LABEL: fcmp_ugt:
387 ; CHECKIZHINX: # %bb.0:
388 ; CHECKIZHINX-NEXT: csrr a2, fflags
389 ; CHECKIZHINX-NEXT: fle.h a3, a0, a1
390 ; CHECKIZHINX-NEXT: csrw fflags, a2
391 ; CHECKIZHINX-NEXT: xori a2, a3, 1
392 ; CHECKIZHINX-NEXT: feq.h zero, a0, a1
393 ; CHECKIZHINX-NEXT: mv a0, a2
394 ; CHECKIZHINX-NEXT: ret
396 ; CHECKIZFHMIN-LABEL: fcmp_ugt:
397 ; CHECKIZFHMIN: # %bb.0:
398 ; CHECKIZFHMIN-NEXT: frflags a0
399 ; CHECKIZFHMIN-NEXT: fle.h a1, fa0, fa1
400 ; CHECKIZFHMIN-NEXT: fsflags a0
401 ; CHECKIZFHMIN-NEXT: xori a0, a1, 1
402 ; CHECKIZFHMIN-NEXT: feq.h zero, fa0, fa1
403 ; CHECKIZFHMIN-NEXT: ret
405 ; CHECKIZHINXMIN-LABEL: fcmp_ugt:
406 ; CHECKIZHINXMIN: # %bb.0:
407 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
408 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
409 ; CHECKIZHINXMIN-NEXT: csrr a0, fflags
410 ; CHECKIZHINXMIN-NEXT: fle.s a3, a2, a1
411 ; CHECKIZHINXMIN-NEXT: csrw fflags, a0
412 ; CHECKIZHINXMIN-NEXT: xori a0, a3, 1
413 ; CHECKIZHINXMIN-NEXT: feq.s zero, a2, a1
414 ; CHECKIZHINXMIN-NEXT: ret
415 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"ugt", metadata !"fpexcept.strict") strictfp
416 %2 = zext i1 %1 to i32
420 define i32 @fcmp_uge(half %a, half %b) nounwind strictfp {
421 ; CHECK-LABEL: fcmp_uge:
423 ; CHECK-NEXT: frflags a0
424 ; CHECK-NEXT: flt.h a1, fa0, fa1
425 ; CHECK-NEXT: fsflags a0
426 ; CHECK-NEXT: xori a0, a1, 1
427 ; CHECK-NEXT: feq.h zero, fa0, fa1
430 ; CHECKIZHINX-LABEL: fcmp_uge:
431 ; CHECKIZHINX: # %bb.0:
432 ; CHECKIZHINX-NEXT: csrr a2, fflags
433 ; CHECKIZHINX-NEXT: flt.h a3, a0, a1
434 ; CHECKIZHINX-NEXT: csrw fflags, a2
435 ; CHECKIZHINX-NEXT: xori a2, a3, 1
436 ; CHECKIZHINX-NEXT: feq.h zero, a0, a1
437 ; CHECKIZHINX-NEXT: mv a0, a2
438 ; CHECKIZHINX-NEXT: ret
440 ; CHECKIZFHMIN-LABEL: fcmp_uge:
441 ; CHECKIZFHMIN: # %bb.0:
442 ; CHECKIZFHMIN-NEXT: frflags a0
443 ; CHECKIZFHMIN-NEXT: flt.h a1, fa0, fa1
444 ; CHECKIZFHMIN-NEXT: fsflags a0
445 ; CHECKIZFHMIN-NEXT: xori a0, a1, 1
446 ; CHECKIZFHMIN-NEXT: feq.h zero, fa0, fa1
447 ; CHECKIZFHMIN-NEXT: ret
449 ; CHECKIZHINXMIN-LABEL: fcmp_uge:
450 ; CHECKIZHINXMIN: # %bb.0:
451 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
452 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
453 ; CHECKIZHINXMIN-NEXT: csrr a0, fflags
454 ; CHECKIZHINXMIN-NEXT: flt.s a3, a2, a1
455 ; CHECKIZHINXMIN-NEXT: csrw fflags, a0
456 ; CHECKIZHINXMIN-NEXT: xori a0, a3, 1
457 ; CHECKIZHINXMIN-NEXT: feq.s zero, a2, a1
458 ; CHECKIZHINXMIN-NEXT: ret
459 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"uge", metadata !"fpexcept.strict") strictfp
460 %2 = zext i1 %1 to i32
464 define i32 @fcmp_ult(half %a, half %b) nounwind strictfp {
465 ; CHECK-LABEL: fcmp_ult:
467 ; CHECK-NEXT: frflags a0
468 ; CHECK-NEXT: fle.h a1, fa1, fa0
469 ; CHECK-NEXT: fsflags a0
470 ; CHECK-NEXT: xori a0, a1, 1
471 ; CHECK-NEXT: feq.h zero, fa1, fa0
474 ; CHECKIZHINX-LABEL: fcmp_ult:
475 ; CHECKIZHINX: # %bb.0:
476 ; CHECKIZHINX-NEXT: csrr a2, fflags
477 ; CHECKIZHINX-NEXT: fle.h a3, a1, a0
478 ; CHECKIZHINX-NEXT: csrw fflags, a2
479 ; CHECKIZHINX-NEXT: xori a2, a3, 1
480 ; CHECKIZHINX-NEXT: feq.h zero, a1, a0
481 ; CHECKIZHINX-NEXT: mv a0, a2
482 ; CHECKIZHINX-NEXT: ret
484 ; CHECKIZFHMIN-LABEL: fcmp_ult:
485 ; CHECKIZFHMIN: # %bb.0:
486 ; CHECKIZFHMIN-NEXT: frflags a0
487 ; CHECKIZFHMIN-NEXT: fle.h a1, fa1, fa0
488 ; CHECKIZFHMIN-NEXT: fsflags a0
489 ; CHECKIZFHMIN-NEXT: xori a0, a1, 1
490 ; CHECKIZFHMIN-NEXT: feq.h zero, fa1, fa0
491 ; CHECKIZFHMIN-NEXT: ret
493 ; CHECKIZHINXMIN-LABEL: fcmp_ult:
494 ; CHECKIZHINXMIN: # %bb.0:
495 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
496 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
497 ; CHECKIZHINXMIN-NEXT: csrr a0, fflags
498 ; CHECKIZHINXMIN-NEXT: fle.s a3, a1, a2
499 ; CHECKIZHINXMIN-NEXT: csrw fflags, a0
500 ; CHECKIZHINXMIN-NEXT: xori a0, a3, 1
501 ; CHECKIZHINXMIN-NEXT: feq.s zero, a1, a2
502 ; CHECKIZHINXMIN-NEXT: ret
503 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"ult", metadata !"fpexcept.strict") strictfp
504 %2 = zext i1 %1 to i32
508 define i32 @fcmp_ule(half %a, half %b) nounwind strictfp {
509 ; CHECK-LABEL: fcmp_ule:
511 ; CHECK-NEXT: frflags a0
512 ; CHECK-NEXT: flt.h a1, fa1, fa0
513 ; CHECK-NEXT: fsflags a0
514 ; CHECK-NEXT: xori a0, a1, 1
515 ; CHECK-NEXT: feq.h zero, fa1, fa0
518 ; CHECKIZHINX-LABEL: fcmp_ule:
519 ; CHECKIZHINX: # %bb.0:
520 ; CHECKIZHINX-NEXT: csrr a2, fflags
521 ; CHECKIZHINX-NEXT: flt.h a3, a1, a0
522 ; CHECKIZHINX-NEXT: csrw fflags, a2
523 ; CHECKIZHINX-NEXT: xori a2, a3, 1
524 ; CHECKIZHINX-NEXT: feq.h zero, a1, a0
525 ; CHECKIZHINX-NEXT: mv a0, a2
526 ; CHECKIZHINX-NEXT: ret
528 ; CHECKIZFHMIN-LABEL: fcmp_ule:
529 ; CHECKIZFHMIN: # %bb.0:
530 ; CHECKIZFHMIN-NEXT: frflags a0
531 ; CHECKIZFHMIN-NEXT: flt.h a1, fa1, fa0
532 ; CHECKIZFHMIN-NEXT: fsflags a0
533 ; CHECKIZFHMIN-NEXT: xori a0, a1, 1
534 ; CHECKIZFHMIN-NEXT: feq.h zero, fa1, fa0
535 ; CHECKIZFHMIN-NEXT: ret
537 ; CHECKIZHINXMIN-LABEL: fcmp_ule:
538 ; CHECKIZHINXMIN: # %bb.0:
539 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a2, a0
540 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
541 ; CHECKIZHINXMIN-NEXT: csrr a0, fflags
542 ; CHECKIZHINXMIN-NEXT: flt.s a3, a1, a2
543 ; CHECKIZHINXMIN-NEXT: csrw fflags, a0
544 ; CHECKIZHINXMIN-NEXT: xori a0, a3, 1
545 ; CHECKIZHINXMIN-NEXT: feq.s zero, a1, a2
546 ; CHECKIZHINXMIN-NEXT: ret
547 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"ule", metadata !"fpexcept.strict") strictfp
548 %2 = zext i1 %1 to i32
552 define i32 @fcmp_une(half %a, half %b) nounwind strictfp {
553 ; CHECK-LABEL: fcmp_une:
555 ; CHECK-NEXT: feq.h a0, fa0, fa1
556 ; CHECK-NEXT: xori a0, a0, 1
559 ; CHECKIZHINX-LABEL: fcmp_une:
560 ; CHECKIZHINX: # %bb.0:
561 ; CHECKIZHINX-NEXT: feq.h a0, a0, a1
562 ; CHECKIZHINX-NEXT: xori a0, a0, 1
563 ; CHECKIZHINX-NEXT: ret
565 ; CHECKIZFHMIN-LABEL: fcmp_une:
566 ; CHECKIZFHMIN: # %bb.0:
567 ; CHECKIZFHMIN-NEXT: feq.h a0, fa0, fa1
568 ; CHECKIZFHMIN-NEXT: xori a0, a0, 1
569 ; CHECKIZFHMIN-NEXT: ret
571 ; CHECKIZHINXMIN-LABEL: fcmp_une:
572 ; CHECKIZHINXMIN: # %bb.0:
573 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
574 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
575 ; CHECKIZHINXMIN-NEXT: feq.s a0, a0, a1
576 ; CHECKIZHINXMIN-NEXT: xori a0, a0, 1
577 ; CHECKIZHINXMIN-NEXT: ret
578 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"une", metadata !"fpexcept.strict") strictfp
579 %2 = zext i1 %1 to i32
583 define i32 @fcmp_uno(half %a, half %b) nounwind strictfp {
584 ; CHECK-LABEL: fcmp_uno:
586 ; CHECK-NEXT: feq.h a0, fa1, fa1
587 ; CHECK-NEXT: feq.h a1, fa0, fa0
588 ; CHECK-NEXT: and a0, a1, a0
589 ; CHECK-NEXT: xori a0, a0, 1
592 ; CHECKIZHINX-LABEL: fcmp_uno:
593 ; CHECKIZHINX: # %bb.0:
594 ; CHECKIZHINX-NEXT: feq.h a1, a1, a1
595 ; CHECKIZHINX-NEXT: feq.h a0, a0, a0
596 ; CHECKIZHINX-NEXT: and a0, a0, a1
597 ; CHECKIZHINX-NEXT: xori a0, a0, 1
598 ; CHECKIZHINX-NEXT: ret
600 ; CHECKIZFHMIN-LABEL: fcmp_uno:
601 ; CHECKIZFHMIN: # %bb.0:
602 ; CHECKIZFHMIN-NEXT: feq.h a0, fa1, fa1
603 ; CHECKIZFHMIN-NEXT: feq.h a1, fa0, fa0
604 ; CHECKIZFHMIN-NEXT: and a0, a1, a0
605 ; CHECKIZFHMIN-NEXT: xori a0, a0, 1
606 ; CHECKIZFHMIN-NEXT: ret
608 ; CHECKIZHINXMIN-LABEL: fcmp_uno:
609 ; CHECKIZHINXMIN: # %bb.0:
610 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
611 ; CHECKIZHINXMIN-NEXT: feq.s a1, a1, a1
612 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
613 ; CHECKIZHINXMIN-NEXT: feq.s a0, a0, a0
614 ; CHECKIZHINXMIN-NEXT: and a0, a0, a1
615 ; CHECKIZHINXMIN-NEXT: xori a0, a0, 1
616 ; CHECKIZHINXMIN-NEXT: ret
617 %1 = call i1 @llvm.experimental.constrained.fcmp.f16(half %a, half %b, metadata !"uno", metadata !"fpexcept.strict") strictfp
618 %2 = zext i1 %1 to i32
622 define i32 @fcmps_oeq(half %a, half %b) nounwind strictfp {
623 ; CHECK-LABEL: fcmps_oeq:
625 ; CHECK-NEXT: fle.h a0, fa1, fa0
626 ; CHECK-NEXT: fle.h a1, fa0, fa1
627 ; CHECK-NEXT: and a0, a1, a0
630 ; CHECKIZHINX-LABEL: fcmps_oeq:
631 ; CHECKIZHINX: # %bb.0:
632 ; CHECKIZHINX-NEXT: fle.h a2, a1, a0
633 ; CHECKIZHINX-NEXT: fle.h a0, a0, a1
634 ; CHECKIZHINX-NEXT: and a0, a0, a2
635 ; CHECKIZHINX-NEXT: ret
637 ; CHECKIZFHMIN-LABEL: fcmps_oeq:
638 ; CHECKIZFHMIN: # %bb.0:
639 ; CHECKIZFHMIN-NEXT: fle.h a0, fa1, fa0
640 ; CHECKIZFHMIN-NEXT: fle.h a1, fa0, fa1
641 ; CHECKIZFHMIN-NEXT: and a0, a1, a0
642 ; CHECKIZFHMIN-NEXT: ret
644 ; CHECKIZHINXMIN-LABEL: fcmps_oeq:
645 ; CHECKIZHINXMIN: # %bb.0:
646 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
647 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
648 ; CHECKIZHINXMIN-NEXT: fle.s a2, a1, a0
649 ; CHECKIZHINXMIN-NEXT: fle.s a0, a0, a1
650 ; CHECKIZHINXMIN-NEXT: and a0, a0, a2
651 ; CHECKIZHINXMIN-NEXT: ret
652 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"oeq", metadata !"fpexcept.strict") strictfp
653 %2 = zext i1 %1 to i32
656 declare i1 @llvm.experimental.constrained.fcmps.f16(half, half, metadata, metadata)
658 define i32 @fcmps_ogt(half %a, half %b) nounwind strictfp {
659 ; CHECK-LABEL: fcmps_ogt:
661 ; CHECK-NEXT: flt.h a0, fa1, fa0
664 ; CHECKIZHINX-LABEL: fcmps_ogt:
665 ; CHECKIZHINX: # %bb.0:
666 ; CHECKIZHINX-NEXT: flt.h a0, a1, a0
667 ; CHECKIZHINX-NEXT: ret
669 ; CHECKIZFHMIN-LABEL: fcmps_ogt:
670 ; CHECKIZFHMIN: # %bb.0:
671 ; CHECKIZFHMIN-NEXT: flt.h a0, fa1, fa0
672 ; CHECKIZFHMIN-NEXT: ret
674 ; CHECKIZHINXMIN-LABEL: fcmps_ogt:
675 ; CHECKIZHINXMIN: # %bb.0:
676 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
677 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
678 ; CHECKIZHINXMIN-NEXT: flt.s a0, a1, a0
679 ; CHECKIZHINXMIN-NEXT: ret
680 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"ogt", metadata !"fpexcept.strict") strictfp
681 %2 = zext i1 %1 to i32
685 define i32 @fcmps_oge(half %a, half %b) nounwind strictfp {
686 ; CHECK-LABEL: fcmps_oge:
688 ; CHECK-NEXT: fle.h a0, fa1, fa0
691 ; CHECKIZHINX-LABEL: fcmps_oge:
692 ; CHECKIZHINX: # %bb.0:
693 ; CHECKIZHINX-NEXT: fle.h a0, a1, a0
694 ; CHECKIZHINX-NEXT: ret
696 ; CHECKIZFHMIN-LABEL: fcmps_oge:
697 ; CHECKIZFHMIN: # %bb.0:
698 ; CHECKIZFHMIN-NEXT: fle.h a0, fa1, fa0
699 ; CHECKIZFHMIN-NEXT: ret
701 ; CHECKIZHINXMIN-LABEL: fcmps_oge:
702 ; CHECKIZHINXMIN: # %bb.0:
703 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
704 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
705 ; CHECKIZHINXMIN-NEXT: fle.s a0, a1, a0
706 ; CHECKIZHINXMIN-NEXT: ret
707 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"oge", metadata !"fpexcept.strict") strictfp
708 %2 = zext i1 %1 to i32
712 define i32 @fcmps_olt(half %a, half %b) nounwind strictfp {
713 ; CHECK-LABEL: fcmps_olt:
715 ; CHECK-NEXT: flt.h a0, fa0, fa1
718 ; CHECKIZHINX-LABEL: fcmps_olt:
719 ; CHECKIZHINX: # %bb.0:
720 ; CHECKIZHINX-NEXT: flt.h a0, a0, a1
721 ; CHECKIZHINX-NEXT: ret
723 ; CHECKIZFHMIN-LABEL: fcmps_olt:
724 ; CHECKIZFHMIN: # %bb.0:
725 ; CHECKIZFHMIN-NEXT: flt.h a0, fa0, fa1
726 ; CHECKIZFHMIN-NEXT: ret
728 ; CHECKIZHINXMIN-LABEL: fcmps_olt:
729 ; CHECKIZHINXMIN: # %bb.0:
730 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
731 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
732 ; CHECKIZHINXMIN-NEXT: flt.s a0, a0, a1
733 ; CHECKIZHINXMIN-NEXT: ret
734 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"olt", metadata !"fpexcept.strict") strictfp
735 %2 = zext i1 %1 to i32
739 define i32 @fcmps_ole(half %a, half %b) nounwind strictfp {
740 ; CHECK-LABEL: fcmps_ole:
742 ; CHECK-NEXT: fle.h a0, fa0, fa1
745 ; CHECKIZHINX-LABEL: fcmps_ole:
746 ; CHECKIZHINX: # %bb.0:
747 ; CHECKIZHINX-NEXT: fle.h a0, a0, a1
748 ; CHECKIZHINX-NEXT: ret
750 ; CHECKIZFHMIN-LABEL: fcmps_ole:
751 ; CHECKIZFHMIN: # %bb.0:
752 ; CHECKIZFHMIN-NEXT: fle.h a0, fa0, fa1
753 ; CHECKIZFHMIN-NEXT: ret
755 ; CHECKIZHINXMIN-LABEL: fcmps_ole:
756 ; CHECKIZHINXMIN: # %bb.0:
757 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
758 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
759 ; CHECKIZHINXMIN-NEXT: fle.s a0, a0, a1
760 ; CHECKIZHINXMIN-NEXT: ret
761 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"ole", metadata !"fpexcept.strict") strictfp
762 %2 = zext i1 %1 to i32
766 define i32 @fcmps_one(half %a, half %b) nounwind strictfp {
767 ; CHECK-LABEL: fcmps_one:
769 ; CHECK-NEXT: flt.h a0, fa0, fa1
770 ; CHECK-NEXT: flt.h a1, fa1, fa0
771 ; CHECK-NEXT: or a0, a1, a0
774 ; CHECKIZHINX-LABEL: fcmps_one:
775 ; CHECKIZHINX: # %bb.0:
776 ; CHECKIZHINX-NEXT: flt.h a2, a0, a1
777 ; CHECKIZHINX-NEXT: flt.h a0, a1, a0
778 ; CHECKIZHINX-NEXT: or a0, a0, a2
779 ; CHECKIZHINX-NEXT: ret
781 ; CHECKIZFHMIN-LABEL: fcmps_one:
782 ; CHECKIZFHMIN: # %bb.0:
783 ; CHECKIZFHMIN-NEXT: flt.h a0, fa0, fa1
784 ; CHECKIZFHMIN-NEXT: flt.h a1, fa1, fa0
785 ; CHECKIZFHMIN-NEXT: or a0, a1, a0
786 ; CHECKIZFHMIN-NEXT: ret
788 ; CHECKIZHINXMIN-LABEL: fcmps_one:
789 ; CHECKIZHINXMIN: # %bb.0:
790 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
791 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
792 ; CHECKIZHINXMIN-NEXT: flt.s a2, a0, a1
793 ; CHECKIZHINXMIN-NEXT: flt.s a0, a1, a0
794 ; CHECKIZHINXMIN-NEXT: or a0, a0, a2
795 ; CHECKIZHINXMIN-NEXT: ret
796 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"one", metadata !"fpexcept.strict") strictfp
797 %2 = zext i1 %1 to i32
801 define i32 @fcmps_ord(half %a, half %b) nounwind strictfp {
802 ; CHECK-LABEL: fcmps_ord:
804 ; CHECK-NEXT: fle.h a0, fa1, fa1
805 ; CHECK-NEXT: fle.h a1, fa0, fa0
806 ; CHECK-NEXT: and a0, a1, a0
809 ; CHECKIZHINX-LABEL: fcmps_ord:
810 ; CHECKIZHINX: # %bb.0:
811 ; CHECKIZHINX-NEXT: fle.h a1, a1, a1
812 ; CHECKIZHINX-NEXT: fle.h a0, a0, a0
813 ; CHECKIZHINX-NEXT: and a0, a0, a1
814 ; CHECKIZHINX-NEXT: ret
816 ; CHECKIZFHMIN-LABEL: fcmps_ord:
817 ; CHECKIZFHMIN: # %bb.0:
818 ; CHECKIZFHMIN-NEXT: fle.h a0, fa1, fa1
819 ; CHECKIZFHMIN-NEXT: fle.h a1, fa0, fa0
820 ; CHECKIZFHMIN-NEXT: and a0, a1, a0
821 ; CHECKIZFHMIN-NEXT: ret
823 ; CHECKIZHINXMIN-LABEL: fcmps_ord:
824 ; CHECKIZHINXMIN: # %bb.0:
825 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
826 ; CHECKIZHINXMIN-NEXT: fle.s a1, a1, a1
827 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
828 ; CHECKIZHINXMIN-NEXT: fle.s a0, a0, a0
829 ; CHECKIZHINXMIN-NEXT: and a0, a0, a1
830 ; CHECKIZHINXMIN-NEXT: ret
831 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"ord", metadata !"fpexcept.strict") strictfp
832 %2 = zext i1 %1 to i32
836 define i32 @fcmps_ueq(half %a, half %b) nounwind strictfp {
837 ; CHECK-LABEL: fcmps_ueq:
839 ; CHECK-NEXT: flt.h a0, fa0, fa1
840 ; CHECK-NEXT: flt.h a1, fa1, fa0
841 ; CHECK-NEXT: or a0, a1, a0
842 ; CHECK-NEXT: xori a0, a0, 1
845 ; CHECKIZHINX-LABEL: fcmps_ueq:
846 ; CHECKIZHINX: # %bb.0:
847 ; CHECKIZHINX-NEXT: flt.h a2, a0, a1
848 ; CHECKIZHINX-NEXT: flt.h a0, a1, a0
849 ; CHECKIZHINX-NEXT: or a0, a0, a2
850 ; CHECKIZHINX-NEXT: xori a0, a0, 1
851 ; CHECKIZHINX-NEXT: ret
853 ; CHECKIZFHMIN-LABEL: fcmps_ueq:
854 ; CHECKIZFHMIN: # %bb.0:
855 ; CHECKIZFHMIN-NEXT: flt.h a0, fa0, fa1
856 ; CHECKIZFHMIN-NEXT: flt.h a1, fa1, fa0
857 ; CHECKIZFHMIN-NEXT: or a0, a1, a0
858 ; CHECKIZFHMIN-NEXT: xori a0, a0, 1
859 ; CHECKIZFHMIN-NEXT: ret
861 ; CHECKIZHINXMIN-LABEL: fcmps_ueq:
862 ; CHECKIZHINXMIN: # %bb.0:
863 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
864 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
865 ; CHECKIZHINXMIN-NEXT: flt.s a2, a0, a1
866 ; CHECKIZHINXMIN-NEXT: flt.s a0, a1, a0
867 ; CHECKIZHINXMIN-NEXT: or a0, a0, a2
868 ; CHECKIZHINXMIN-NEXT: xori a0, a0, 1
869 ; CHECKIZHINXMIN-NEXT: ret
870 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"ueq", metadata !"fpexcept.strict") strictfp
871 %2 = zext i1 %1 to i32
875 define i32 @fcmps_ugt(half %a, half %b) nounwind strictfp {
876 ; CHECK-LABEL: fcmps_ugt:
878 ; CHECK-NEXT: fle.h a0, fa0, fa1
879 ; CHECK-NEXT: xori a0, a0, 1
882 ; CHECKIZHINX-LABEL: fcmps_ugt:
883 ; CHECKIZHINX: # %bb.0:
884 ; CHECKIZHINX-NEXT: fle.h a0, a0, a1
885 ; CHECKIZHINX-NEXT: xori a0, a0, 1
886 ; CHECKIZHINX-NEXT: ret
888 ; CHECKIZFHMIN-LABEL: fcmps_ugt:
889 ; CHECKIZFHMIN: # %bb.0:
890 ; CHECKIZFHMIN-NEXT: fle.h a0, fa0, fa1
891 ; CHECKIZFHMIN-NEXT: xori a0, a0, 1
892 ; CHECKIZFHMIN-NEXT: ret
894 ; CHECKIZHINXMIN-LABEL: fcmps_ugt:
895 ; CHECKIZHINXMIN: # %bb.0:
896 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
897 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
898 ; CHECKIZHINXMIN-NEXT: fle.s a0, a0, a1
899 ; CHECKIZHINXMIN-NEXT: xori a0, a0, 1
900 ; CHECKIZHINXMIN-NEXT: ret
901 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"ugt", metadata !"fpexcept.strict") strictfp
902 %2 = zext i1 %1 to i32
906 define i32 @fcmps_uge(half %a, half %b) nounwind strictfp {
907 ; CHECK-LABEL: fcmps_uge:
909 ; CHECK-NEXT: flt.h a0, fa0, fa1
910 ; CHECK-NEXT: xori a0, a0, 1
913 ; CHECKIZHINX-LABEL: fcmps_uge:
914 ; CHECKIZHINX: # %bb.0:
915 ; CHECKIZHINX-NEXT: flt.h a0, a0, a1
916 ; CHECKIZHINX-NEXT: xori a0, a0, 1
917 ; CHECKIZHINX-NEXT: ret
919 ; CHECKIZFHMIN-LABEL: fcmps_uge:
920 ; CHECKIZFHMIN: # %bb.0:
921 ; CHECKIZFHMIN-NEXT: flt.h a0, fa0, fa1
922 ; CHECKIZFHMIN-NEXT: xori a0, a0, 1
923 ; CHECKIZFHMIN-NEXT: ret
925 ; CHECKIZHINXMIN-LABEL: fcmps_uge:
926 ; CHECKIZHINXMIN: # %bb.0:
927 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
928 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
929 ; CHECKIZHINXMIN-NEXT: flt.s a0, a0, a1
930 ; CHECKIZHINXMIN-NEXT: xori a0, a0, 1
931 ; CHECKIZHINXMIN-NEXT: ret
932 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"uge", metadata !"fpexcept.strict") strictfp
933 %2 = zext i1 %1 to i32
937 define i32 @fcmps_ult(half %a, half %b) nounwind strictfp {
938 ; CHECK-LABEL: fcmps_ult:
940 ; CHECK-NEXT: fle.h a0, fa1, fa0
941 ; CHECK-NEXT: xori a0, a0, 1
944 ; CHECKIZHINX-LABEL: fcmps_ult:
945 ; CHECKIZHINX: # %bb.0:
946 ; CHECKIZHINX-NEXT: fle.h a0, a1, a0
947 ; CHECKIZHINX-NEXT: xori a0, a0, 1
948 ; CHECKIZHINX-NEXT: ret
950 ; CHECKIZFHMIN-LABEL: fcmps_ult:
951 ; CHECKIZFHMIN: # %bb.0:
952 ; CHECKIZFHMIN-NEXT: fle.h a0, fa1, fa0
953 ; CHECKIZFHMIN-NEXT: xori a0, a0, 1
954 ; CHECKIZFHMIN-NEXT: ret
956 ; CHECKIZHINXMIN-LABEL: fcmps_ult:
957 ; CHECKIZHINXMIN: # %bb.0:
958 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
959 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
960 ; CHECKIZHINXMIN-NEXT: fle.s a0, a1, a0
961 ; CHECKIZHINXMIN-NEXT: xori a0, a0, 1
962 ; CHECKIZHINXMIN-NEXT: ret
963 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"ult", metadata !"fpexcept.strict") strictfp
964 %2 = zext i1 %1 to i32
968 define i32 @fcmps_ule(half %a, half %b) nounwind strictfp {
969 ; CHECK-LABEL: fcmps_ule:
971 ; CHECK-NEXT: flt.h a0, fa1, fa0
972 ; CHECK-NEXT: xori a0, a0, 1
975 ; CHECKIZHINX-LABEL: fcmps_ule:
976 ; CHECKIZHINX: # %bb.0:
977 ; CHECKIZHINX-NEXT: flt.h a0, a1, a0
978 ; CHECKIZHINX-NEXT: xori a0, a0, 1
979 ; CHECKIZHINX-NEXT: ret
981 ; CHECKIZFHMIN-LABEL: fcmps_ule:
982 ; CHECKIZFHMIN: # %bb.0:
983 ; CHECKIZFHMIN-NEXT: flt.h a0, fa1, fa0
984 ; CHECKIZFHMIN-NEXT: xori a0, a0, 1
985 ; CHECKIZFHMIN-NEXT: ret
987 ; CHECKIZHINXMIN-LABEL: fcmps_ule:
988 ; CHECKIZHINXMIN: # %bb.0:
989 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
990 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
991 ; CHECKIZHINXMIN-NEXT: flt.s a0, a1, a0
992 ; CHECKIZHINXMIN-NEXT: xori a0, a0, 1
993 ; CHECKIZHINXMIN-NEXT: ret
994 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"ule", metadata !"fpexcept.strict") strictfp
995 %2 = zext i1 %1 to i32
999 define i32 @fcmps_une(half %a, half %b) nounwind strictfp {
1000 ; CHECK-LABEL: fcmps_une:
1002 ; CHECK-NEXT: fle.h a0, fa1, fa0
1003 ; CHECK-NEXT: fle.h a1, fa0, fa1
1004 ; CHECK-NEXT: and a0, a1, a0
1005 ; CHECK-NEXT: xori a0, a0, 1
1008 ; CHECKIZHINX-LABEL: fcmps_une:
1009 ; CHECKIZHINX: # %bb.0:
1010 ; CHECKIZHINX-NEXT: fle.h a2, a1, a0
1011 ; CHECKIZHINX-NEXT: fle.h a0, a0, a1
1012 ; CHECKIZHINX-NEXT: and a0, a0, a2
1013 ; CHECKIZHINX-NEXT: xori a0, a0, 1
1014 ; CHECKIZHINX-NEXT: ret
1016 ; CHECKIZFHMIN-LABEL: fcmps_une:
1017 ; CHECKIZFHMIN: # %bb.0:
1018 ; CHECKIZFHMIN-NEXT: fle.h a0, fa1, fa0
1019 ; CHECKIZFHMIN-NEXT: fle.h a1, fa0, fa1
1020 ; CHECKIZFHMIN-NEXT: and a0, a1, a0
1021 ; CHECKIZFHMIN-NEXT: xori a0, a0, 1
1022 ; CHECKIZFHMIN-NEXT: ret
1024 ; CHECKIZHINXMIN-LABEL: fcmps_une:
1025 ; CHECKIZHINXMIN: # %bb.0:
1026 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
1027 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
1028 ; CHECKIZHINXMIN-NEXT: fle.s a2, a1, a0
1029 ; CHECKIZHINXMIN-NEXT: fle.s a0, a0, a1
1030 ; CHECKIZHINXMIN-NEXT: and a0, a0, a2
1031 ; CHECKIZHINXMIN-NEXT: xori a0, a0, 1
1032 ; CHECKIZHINXMIN-NEXT: ret
1033 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"une", metadata !"fpexcept.strict") strictfp
1034 %2 = zext i1 %1 to i32
1038 define i32 @fcmps_uno(half %a, half %b) nounwind strictfp {
1039 ; CHECK-LABEL: fcmps_uno:
1041 ; CHECK-NEXT: fle.h a0, fa1, fa1
1042 ; CHECK-NEXT: fle.h a1, fa0, fa0
1043 ; CHECK-NEXT: and a0, a1, a0
1044 ; CHECK-NEXT: xori a0, a0, 1
1047 ; CHECKIZHINX-LABEL: fcmps_uno:
1048 ; CHECKIZHINX: # %bb.0:
1049 ; CHECKIZHINX-NEXT: fle.h a1, a1, a1
1050 ; CHECKIZHINX-NEXT: fle.h a0, a0, a0
1051 ; CHECKIZHINX-NEXT: and a0, a0, a1
1052 ; CHECKIZHINX-NEXT: xori a0, a0, 1
1053 ; CHECKIZHINX-NEXT: ret
1055 ; CHECKIZFHMIN-LABEL: fcmps_uno:
1056 ; CHECKIZFHMIN: # %bb.0:
1057 ; CHECKIZFHMIN-NEXT: fle.h a0, fa1, fa1
1058 ; CHECKIZFHMIN-NEXT: fle.h a1, fa0, fa0
1059 ; CHECKIZFHMIN-NEXT: and a0, a1, a0
1060 ; CHECKIZFHMIN-NEXT: xori a0, a0, 1
1061 ; CHECKIZFHMIN-NEXT: ret
1063 ; CHECKIZHINXMIN-LABEL: fcmps_uno:
1064 ; CHECKIZHINXMIN: # %bb.0:
1065 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
1066 ; CHECKIZHINXMIN-NEXT: fle.s a1, a1, a1
1067 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
1068 ; CHECKIZHINXMIN-NEXT: fle.s a0, a0, a0
1069 ; CHECKIZHINXMIN-NEXT: and a0, a0, a1
1070 ; CHECKIZHINXMIN-NEXT: xori a0, a0, 1
1071 ; CHECKIZHINXMIN-NEXT: ret
1072 %1 = call i1 @llvm.experimental.constrained.fcmps.f16(half %a, half %b, metadata !"uno", metadata !"fpexcept.strict") strictfp
1073 %2 = zext i1 %1 to i32