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 < %s | FileCheck %s
4 ; RUN: llc -mtriple=riscv64 -mattr=+zfh -verify-machineinstrs \
5 ; RUN: -target-abi lp64f < %s | FileCheck %s
6 ; RUN: llc -mtriple=riscv32 -mattr=+zhinx -verify-machineinstrs \
7 ; RUN: -target-abi ilp32 < %s | FileCheck -check-prefix=CHECKIZHINX %s
8 ; RUN: llc -mtriple=riscv64 -mattr=+zhinx -verify-machineinstrs \
9 ; RUN: -target-abi lp64 < %s | FileCheck -check-prefix=CHECKIZHINX %s
10 ; RUN: llc -mtriple=riscv32 -mattr=+zfhmin -verify-machineinstrs < %s \
11 ; RUN: -target-abi=ilp32f | FileCheck -check-prefix=CHECKIZFHMIN %s
12 ; RUN: llc -mtriple=riscv64 -mattr=+zfhmin -verify-machineinstrs < %s \
13 ; RUN: -target-abi=lp64f | FileCheck -check-prefix=CHECKIZFHMIN %s
14 ; RUN: llc -mtriple=riscv32 -mattr=+zhinxmin -verify-machineinstrs < %s \
15 ; RUN: -target-abi=ilp32 | FileCheck -check-prefix=CHECKIZHINXMIN %s
16 ; RUN: llc -mtriple=riscv64 -mattr=+zhinxmin -verify-machineinstrs < %s \
17 ; RUN: -target-abi=lp64 | FileCheck -check-prefix=CHECKIZHINXMIN %s
19 define half @select_fcmp_false(half %a, half %b) nounwind {
20 ; CHECK-LABEL: select_fcmp_false:
22 ; CHECK-NEXT: fmv.h fa0, fa1
25 ; CHECKIZHINX-LABEL: select_fcmp_false:
26 ; CHECKIZHINX: # %bb.0:
27 ; CHECKIZHINX-NEXT: mv a0, a1
28 ; CHECKIZHINX-NEXT: ret
30 ; CHECKIZFHMIN-LABEL: select_fcmp_false:
31 ; CHECKIZFHMIN: # %bb.0:
32 ; CHECKIZFHMIN-NEXT: fmv.s fa0, fa1
33 ; CHECKIZFHMIN-NEXT: ret
35 ; CHECKIZHINXMIN-LABEL: select_fcmp_false:
36 ; CHECKIZHINXMIN: # %bb.0:
37 ; CHECKIZHINXMIN-NEXT: mv a0, a1
38 ; CHECKIZHINXMIN-NEXT: ret
39 %1 = fcmp false half %a, %b
40 %2 = select i1 %1, half %a, half %b
44 define half @select_fcmp_oeq(half %a, half %b) nounwind {
45 ; CHECK-LABEL: select_fcmp_oeq:
47 ; CHECK-NEXT: feq.h a0, fa0, fa1
48 ; CHECK-NEXT: bnez a0, .LBB1_2
49 ; CHECK-NEXT: # %bb.1:
50 ; CHECK-NEXT: fmv.h fa0, fa1
51 ; CHECK-NEXT: .LBB1_2:
54 ; CHECKIZHINX-LABEL: select_fcmp_oeq:
55 ; CHECKIZHINX: # %bb.0:
56 ; CHECKIZHINX-NEXT: feq.h a2, a0, a1
57 ; CHECKIZHINX-NEXT: bnez a2, .LBB1_2
58 ; CHECKIZHINX-NEXT: # %bb.1:
59 ; CHECKIZHINX-NEXT: mv a0, a1
60 ; CHECKIZHINX-NEXT: .LBB1_2:
61 ; CHECKIZHINX-NEXT: ret
63 ; CHECKIZFHMIN-LABEL: select_fcmp_oeq:
64 ; CHECKIZFHMIN: # %bb.0:
65 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
66 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
67 ; CHECKIZFHMIN-NEXT: feq.s a0, fa5, fa4
68 ; CHECKIZFHMIN-NEXT: bnez a0, .LBB1_2
69 ; CHECKIZFHMIN-NEXT: # %bb.1:
70 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
71 ; CHECKIZFHMIN-NEXT: .LBB1_2:
72 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
73 ; CHECKIZFHMIN-NEXT: ret
75 ; CHECKIZHINXMIN-LABEL: select_fcmp_oeq:
76 ; CHECKIZHINXMIN: # %bb.0:
77 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
78 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
79 ; CHECKIZHINXMIN-NEXT: feq.s a2, a0, a1
80 ; CHECKIZHINXMIN-NEXT: bnez a2, .LBB1_2
81 ; CHECKIZHINXMIN-NEXT: # %bb.1:
82 ; CHECKIZHINXMIN-NEXT: mv a0, a1
83 ; CHECKIZHINXMIN-NEXT: .LBB1_2:
84 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
85 ; CHECKIZHINXMIN-NEXT: ret
86 %1 = fcmp oeq half %a, %b
87 %2 = select i1 %1, half %a, half %b
91 define half @select_fcmp_ogt(half %a, half %b) nounwind {
92 ; CHECK-LABEL: select_fcmp_ogt:
94 ; CHECK-NEXT: flt.h a0, fa1, fa0
95 ; CHECK-NEXT: bnez a0, .LBB2_2
96 ; CHECK-NEXT: # %bb.1:
97 ; CHECK-NEXT: fmv.h fa0, fa1
98 ; CHECK-NEXT: .LBB2_2:
101 ; CHECKIZHINX-LABEL: select_fcmp_ogt:
102 ; CHECKIZHINX: # %bb.0:
103 ; CHECKIZHINX-NEXT: flt.h a2, a1, a0
104 ; CHECKIZHINX-NEXT: bnez a2, .LBB2_2
105 ; CHECKIZHINX-NEXT: # %bb.1:
106 ; CHECKIZHINX-NEXT: mv a0, a1
107 ; CHECKIZHINX-NEXT: .LBB2_2:
108 ; CHECKIZHINX-NEXT: ret
110 ; CHECKIZFHMIN-LABEL: select_fcmp_ogt:
111 ; CHECKIZFHMIN: # %bb.0:
112 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
113 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
114 ; CHECKIZFHMIN-NEXT: flt.s a0, fa4, fa5
115 ; CHECKIZFHMIN-NEXT: bnez a0, .LBB2_2
116 ; CHECKIZFHMIN-NEXT: # %bb.1:
117 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
118 ; CHECKIZFHMIN-NEXT: .LBB2_2:
119 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
120 ; CHECKIZFHMIN-NEXT: ret
122 ; CHECKIZHINXMIN-LABEL: select_fcmp_ogt:
123 ; CHECKIZHINXMIN: # %bb.0:
124 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
125 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
126 ; CHECKIZHINXMIN-NEXT: flt.s a2, a1, a0
127 ; CHECKIZHINXMIN-NEXT: bnez a2, .LBB2_2
128 ; CHECKIZHINXMIN-NEXT: # %bb.1:
129 ; CHECKIZHINXMIN-NEXT: mv a0, a1
130 ; CHECKIZHINXMIN-NEXT: .LBB2_2:
131 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
132 ; CHECKIZHINXMIN-NEXT: ret
133 %1 = fcmp ogt half %a, %b
134 %2 = select i1 %1, half %a, half %b
138 define half @select_fcmp_oge(half %a, half %b) nounwind {
139 ; CHECK-LABEL: select_fcmp_oge:
141 ; CHECK-NEXT: fle.h a0, fa1, fa0
142 ; CHECK-NEXT: bnez a0, .LBB3_2
143 ; CHECK-NEXT: # %bb.1:
144 ; CHECK-NEXT: fmv.h fa0, fa1
145 ; CHECK-NEXT: .LBB3_2:
148 ; CHECKIZHINX-LABEL: select_fcmp_oge:
149 ; CHECKIZHINX: # %bb.0:
150 ; CHECKIZHINX-NEXT: fle.h a2, a1, a0
151 ; CHECKIZHINX-NEXT: bnez a2, .LBB3_2
152 ; CHECKIZHINX-NEXT: # %bb.1:
153 ; CHECKIZHINX-NEXT: mv a0, a1
154 ; CHECKIZHINX-NEXT: .LBB3_2:
155 ; CHECKIZHINX-NEXT: ret
157 ; CHECKIZFHMIN-LABEL: select_fcmp_oge:
158 ; CHECKIZFHMIN: # %bb.0:
159 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
160 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
161 ; CHECKIZFHMIN-NEXT: fle.s a0, fa4, fa5
162 ; CHECKIZFHMIN-NEXT: bnez a0, .LBB3_2
163 ; CHECKIZFHMIN-NEXT: # %bb.1:
164 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
165 ; CHECKIZFHMIN-NEXT: .LBB3_2:
166 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
167 ; CHECKIZFHMIN-NEXT: ret
169 ; CHECKIZHINXMIN-LABEL: select_fcmp_oge:
170 ; CHECKIZHINXMIN: # %bb.0:
171 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
172 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
173 ; CHECKIZHINXMIN-NEXT: fle.s a2, a1, a0
174 ; CHECKIZHINXMIN-NEXT: bnez a2, .LBB3_2
175 ; CHECKIZHINXMIN-NEXT: # %bb.1:
176 ; CHECKIZHINXMIN-NEXT: mv a0, a1
177 ; CHECKIZHINXMIN-NEXT: .LBB3_2:
178 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
179 ; CHECKIZHINXMIN-NEXT: ret
180 %1 = fcmp oge half %a, %b
181 %2 = select i1 %1, half %a, half %b
185 define half @select_fcmp_olt(half %a, half %b) nounwind {
186 ; CHECK-LABEL: select_fcmp_olt:
188 ; CHECK-NEXT: flt.h a0, fa0, fa1
189 ; CHECK-NEXT: bnez a0, .LBB4_2
190 ; CHECK-NEXT: # %bb.1:
191 ; CHECK-NEXT: fmv.h fa0, fa1
192 ; CHECK-NEXT: .LBB4_2:
195 ; CHECKIZHINX-LABEL: select_fcmp_olt:
196 ; CHECKIZHINX: # %bb.0:
197 ; CHECKIZHINX-NEXT: flt.h a2, a0, a1
198 ; CHECKIZHINX-NEXT: bnez a2, .LBB4_2
199 ; CHECKIZHINX-NEXT: # %bb.1:
200 ; CHECKIZHINX-NEXT: mv a0, a1
201 ; CHECKIZHINX-NEXT: .LBB4_2:
202 ; CHECKIZHINX-NEXT: ret
204 ; CHECKIZFHMIN-LABEL: select_fcmp_olt:
205 ; CHECKIZFHMIN: # %bb.0:
206 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
207 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
208 ; CHECKIZFHMIN-NEXT: flt.s a0, fa5, fa4
209 ; CHECKIZFHMIN-NEXT: bnez a0, .LBB4_2
210 ; CHECKIZFHMIN-NEXT: # %bb.1:
211 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
212 ; CHECKIZFHMIN-NEXT: .LBB4_2:
213 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
214 ; CHECKIZFHMIN-NEXT: ret
216 ; CHECKIZHINXMIN-LABEL: select_fcmp_olt:
217 ; CHECKIZHINXMIN: # %bb.0:
218 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
219 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
220 ; CHECKIZHINXMIN-NEXT: flt.s a2, a0, a1
221 ; CHECKIZHINXMIN-NEXT: bnez a2, .LBB4_2
222 ; CHECKIZHINXMIN-NEXT: # %bb.1:
223 ; CHECKIZHINXMIN-NEXT: mv a0, a1
224 ; CHECKIZHINXMIN-NEXT: .LBB4_2:
225 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
226 ; CHECKIZHINXMIN-NEXT: ret
227 %1 = fcmp olt half %a, %b
228 %2 = select i1 %1, half %a, half %b
232 define half @select_fcmp_ole(half %a, half %b) nounwind {
233 ; CHECK-LABEL: select_fcmp_ole:
235 ; CHECK-NEXT: fle.h a0, fa0, fa1
236 ; CHECK-NEXT: bnez a0, .LBB5_2
237 ; CHECK-NEXT: # %bb.1:
238 ; CHECK-NEXT: fmv.h fa0, fa1
239 ; CHECK-NEXT: .LBB5_2:
242 ; CHECKIZHINX-LABEL: select_fcmp_ole:
243 ; CHECKIZHINX: # %bb.0:
244 ; CHECKIZHINX-NEXT: fle.h a2, a0, a1
245 ; CHECKIZHINX-NEXT: bnez a2, .LBB5_2
246 ; CHECKIZHINX-NEXT: # %bb.1:
247 ; CHECKIZHINX-NEXT: mv a0, a1
248 ; CHECKIZHINX-NEXT: .LBB5_2:
249 ; CHECKIZHINX-NEXT: ret
251 ; CHECKIZFHMIN-LABEL: select_fcmp_ole:
252 ; CHECKIZFHMIN: # %bb.0:
253 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
254 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
255 ; CHECKIZFHMIN-NEXT: fle.s a0, fa5, fa4
256 ; CHECKIZFHMIN-NEXT: bnez a0, .LBB5_2
257 ; CHECKIZFHMIN-NEXT: # %bb.1:
258 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
259 ; CHECKIZFHMIN-NEXT: .LBB5_2:
260 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
261 ; CHECKIZFHMIN-NEXT: ret
263 ; CHECKIZHINXMIN-LABEL: select_fcmp_ole:
264 ; CHECKIZHINXMIN: # %bb.0:
265 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
266 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
267 ; CHECKIZHINXMIN-NEXT: fle.s a2, a0, a1
268 ; CHECKIZHINXMIN-NEXT: bnez a2, .LBB5_2
269 ; CHECKIZHINXMIN-NEXT: # %bb.1:
270 ; CHECKIZHINXMIN-NEXT: mv a0, a1
271 ; CHECKIZHINXMIN-NEXT: .LBB5_2:
272 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
273 ; CHECKIZHINXMIN-NEXT: ret
274 %1 = fcmp ole half %a, %b
275 %2 = select i1 %1, half %a, half %b
279 define half @select_fcmp_one(half %a, half %b) nounwind {
280 ; CHECK-LABEL: select_fcmp_one:
282 ; CHECK-NEXT: flt.h a0, fa0, fa1
283 ; CHECK-NEXT: flt.h a1, fa1, fa0
284 ; CHECK-NEXT: or a0, a1, a0
285 ; CHECK-NEXT: bnez a0, .LBB6_2
286 ; CHECK-NEXT: # %bb.1:
287 ; CHECK-NEXT: fmv.h fa0, fa1
288 ; CHECK-NEXT: .LBB6_2:
291 ; CHECKIZHINX-LABEL: select_fcmp_one:
292 ; CHECKIZHINX: # %bb.0:
293 ; CHECKIZHINX-NEXT: flt.h a2, a0, a1
294 ; CHECKIZHINX-NEXT: flt.h a3, a1, a0
295 ; CHECKIZHINX-NEXT: or a2, a3, a2
296 ; CHECKIZHINX-NEXT: bnez a2, .LBB6_2
297 ; CHECKIZHINX-NEXT: # %bb.1:
298 ; CHECKIZHINX-NEXT: mv a0, a1
299 ; CHECKIZHINX-NEXT: .LBB6_2:
300 ; CHECKIZHINX-NEXT: ret
302 ; CHECKIZFHMIN-LABEL: select_fcmp_one:
303 ; CHECKIZFHMIN: # %bb.0:
304 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
305 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
306 ; CHECKIZFHMIN-NEXT: flt.s a0, fa5, fa4
307 ; CHECKIZFHMIN-NEXT: flt.s a1, fa4, fa5
308 ; CHECKIZFHMIN-NEXT: or a0, a1, a0
309 ; CHECKIZFHMIN-NEXT: bnez a0, .LBB6_2
310 ; CHECKIZFHMIN-NEXT: # %bb.1:
311 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
312 ; CHECKIZFHMIN-NEXT: .LBB6_2:
313 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
314 ; CHECKIZFHMIN-NEXT: ret
316 ; CHECKIZHINXMIN-LABEL: select_fcmp_one:
317 ; CHECKIZHINXMIN: # %bb.0:
318 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
319 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
320 ; CHECKIZHINXMIN-NEXT: flt.s a2, a0, a1
321 ; CHECKIZHINXMIN-NEXT: flt.s a3, a1, a0
322 ; CHECKIZHINXMIN-NEXT: or a2, a3, a2
323 ; CHECKIZHINXMIN-NEXT: bnez a2, .LBB6_2
324 ; CHECKIZHINXMIN-NEXT: # %bb.1:
325 ; CHECKIZHINXMIN-NEXT: mv a0, a1
326 ; CHECKIZHINXMIN-NEXT: .LBB6_2:
327 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
328 ; CHECKIZHINXMIN-NEXT: ret
329 %1 = fcmp one half %a, %b
330 %2 = select i1 %1, half %a, half %b
334 define half @select_fcmp_ord(half %a, half %b) nounwind {
335 ; CHECK-LABEL: select_fcmp_ord:
337 ; CHECK-NEXT: feq.h a0, fa1, fa1
338 ; CHECK-NEXT: feq.h a1, fa0, fa0
339 ; CHECK-NEXT: and a0, a1, a0
340 ; CHECK-NEXT: bnez a0, .LBB7_2
341 ; CHECK-NEXT: # %bb.1:
342 ; CHECK-NEXT: fmv.h fa0, fa1
343 ; CHECK-NEXT: .LBB7_2:
346 ; CHECKIZHINX-LABEL: select_fcmp_ord:
347 ; CHECKIZHINX: # %bb.0:
348 ; CHECKIZHINX-NEXT: feq.h a2, a1, a1
349 ; CHECKIZHINX-NEXT: feq.h a3, a0, a0
350 ; CHECKIZHINX-NEXT: and a2, a3, a2
351 ; CHECKIZHINX-NEXT: bnez a2, .LBB7_2
352 ; CHECKIZHINX-NEXT: # %bb.1:
353 ; CHECKIZHINX-NEXT: mv a0, a1
354 ; CHECKIZHINX-NEXT: .LBB7_2:
355 ; CHECKIZHINX-NEXT: ret
357 ; CHECKIZFHMIN-LABEL: select_fcmp_ord:
358 ; CHECKIZFHMIN: # %bb.0:
359 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa1
360 ; CHECKIZFHMIN-NEXT: feq.s a0, fa5, fa5
361 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa0
362 ; CHECKIZFHMIN-NEXT: feq.s a1, fa4, fa4
363 ; CHECKIZFHMIN-NEXT: and a0, a1, a0
364 ; CHECKIZFHMIN-NEXT: bnez a0, .LBB7_2
365 ; CHECKIZFHMIN-NEXT: # %bb.1:
366 ; CHECKIZFHMIN-NEXT: fmv.s fa4, fa5
367 ; CHECKIZFHMIN-NEXT: .LBB7_2:
368 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa4
369 ; CHECKIZFHMIN-NEXT: ret
371 ; CHECKIZHINXMIN-LABEL: select_fcmp_ord:
372 ; CHECKIZHINXMIN: # %bb.0:
373 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
374 ; CHECKIZHINXMIN-NEXT: feq.s a2, a1, a1
375 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
376 ; CHECKIZHINXMIN-NEXT: feq.s a3, a0, a0
377 ; CHECKIZHINXMIN-NEXT: and a2, a3, a2
378 ; CHECKIZHINXMIN-NEXT: bnez a2, .LBB7_2
379 ; CHECKIZHINXMIN-NEXT: # %bb.1:
380 ; CHECKIZHINXMIN-NEXT: mv a0, a1
381 ; CHECKIZHINXMIN-NEXT: .LBB7_2:
382 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
383 ; CHECKIZHINXMIN-NEXT: ret
384 %1 = fcmp ord half %a, %b
385 %2 = select i1 %1, half %a, half %b
389 define half @select_fcmp_ueq(half %a, half %b) nounwind {
390 ; CHECK-LABEL: select_fcmp_ueq:
392 ; CHECK-NEXT: flt.h a0, fa0, fa1
393 ; CHECK-NEXT: flt.h a1, fa1, fa0
394 ; CHECK-NEXT: or a0, a1, a0
395 ; CHECK-NEXT: beqz a0, .LBB8_2
396 ; CHECK-NEXT: # %bb.1:
397 ; CHECK-NEXT: fmv.h fa0, fa1
398 ; CHECK-NEXT: .LBB8_2:
401 ; CHECKIZHINX-LABEL: select_fcmp_ueq:
402 ; CHECKIZHINX: # %bb.0:
403 ; CHECKIZHINX-NEXT: flt.h a2, a0, a1
404 ; CHECKIZHINX-NEXT: flt.h a3, a1, a0
405 ; CHECKIZHINX-NEXT: or a2, a3, a2
406 ; CHECKIZHINX-NEXT: beqz a2, .LBB8_2
407 ; CHECKIZHINX-NEXT: # %bb.1:
408 ; CHECKIZHINX-NEXT: mv a0, a1
409 ; CHECKIZHINX-NEXT: .LBB8_2:
410 ; CHECKIZHINX-NEXT: ret
412 ; CHECKIZFHMIN-LABEL: select_fcmp_ueq:
413 ; CHECKIZFHMIN: # %bb.0:
414 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
415 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
416 ; CHECKIZFHMIN-NEXT: flt.s a0, fa5, fa4
417 ; CHECKIZFHMIN-NEXT: flt.s a1, fa4, fa5
418 ; CHECKIZFHMIN-NEXT: or a0, a1, a0
419 ; CHECKIZFHMIN-NEXT: beqz a0, .LBB8_2
420 ; CHECKIZFHMIN-NEXT: # %bb.1:
421 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
422 ; CHECKIZFHMIN-NEXT: .LBB8_2:
423 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
424 ; CHECKIZFHMIN-NEXT: ret
426 ; CHECKIZHINXMIN-LABEL: select_fcmp_ueq:
427 ; CHECKIZHINXMIN: # %bb.0:
428 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
429 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
430 ; CHECKIZHINXMIN-NEXT: flt.s a2, a0, a1
431 ; CHECKIZHINXMIN-NEXT: flt.s a3, a1, a0
432 ; CHECKIZHINXMIN-NEXT: or a2, a3, a2
433 ; CHECKIZHINXMIN-NEXT: beqz a2, .LBB8_2
434 ; CHECKIZHINXMIN-NEXT: # %bb.1:
435 ; CHECKIZHINXMIN-NEXT: mv a0, a1
436 ; CHECKIZHINXMIN-NEXT: .LBB8_2:
437 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
438 ; CHECKIZHINXMIN-NEXT: ret
439 %1 = fcmp ueq half %a, %b
440 %2 = select i1 %1, half %a, half %b
444 define half @select_fcmp_ugt(half %a, half %b) nounwind {
445 ; CHECK-LABEL: select_fcmp_ugt:
447 ; CHECK-NEXT: fle.h a0, fa0, fa1
448 ; CHECK-NEXT: beqz a0, .LBB9_2
449 ; CHECK-NEXT: # %bb.1:
450 ; CHECK-NEXT: fmv.h fa0, fa1
451 ; CHECK-NEXT: .LBB9_2:
454 ; CHECKIZHINX-LABEL: select_fcmp_ugt:
455 ; CHECKIZHINX: # %bb.0:
456 ; CHECKIZHINX-NEXT: fle.h a2, a0, a1
457 ; CHECKIZHINX-NEXT: beqz a2, .LBB9_2
458 ; CHECKIZHINX-NEXT: # %bb.1:
459 ; CHECKIZHINX-NEXT: mv a0, a1
460 ; CHECKIZHINX-NEXT: .LBB9_2:
461 ; CHECKIZHINX-NEXT: ret
463 ; CHECKIZFHMIN-LABEL: select_fcmp_ugt:
464 ; CHECKIZFHMIN: # %bb.0:
465 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
466 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
467 ; CHECKIZFHMIN-NEXT: fle.s a0, fa5, fa4
468 ; CHECKIZFHMIN-NEXT: beqz a0, .LBB9_2
469 ; CHECKIZFHMIN-NEXT: # %bb.1:
470 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
471 ; CHECKIZFHMIN-NEXT: .LBB9_2:
472 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
473 ; CHECKIZFHMIN-NEXT: ret
475 ; CHECKIZHINXMIN-LABEL: select_fcmp_ugt:
476 ; CHECKIZHINXMIN: # %bb.0:
477 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
478 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
479 ; CHECKIZHINXMIN-NEXT: fle.s a2, a0, a1
480 ; CHECKIZHINXMIN-NEXT: beqz a2, .LBB9_2
481 ; CHECKIZHINXMIN-NEXT: # %bb.1:
482 ; CHECKIZHINXMIN-NEXT: mv a0, a1
483 ; CHECKIZHINXMIN-NEXT: .LBB9_2:
484 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
485 ; CHECKIZHINXMIN-NEXT: ret
486 %1 = fcmp ugt half %a, %b
487 %2 = select i1 %1, half %a, half %b
491 define half @select_fcmp_uge(half %a, half %b) nounwind {
492 ; CHECK-LABEL: select_fcmp_uge:
494 ; CHECK-NEXT: flt.h a0, fa0, fa1
495 ; CHECK-NEXT: beqz a0, .LBB10_2
496 ; CHECK-NEXT: # %bb.1:
497 ; CHECK-NEXT: fmv.h fa0, fa1
498 ; CHECK-NEXT: .LBB10_2:
501 ; CHECKIZHINX-LABEL: select_fcmp_uge:
502 ; CHECKIZHINX: # %bb.0:
503 ; CHECKIZHINX-NEXT: flt.h a2, a0, a1
504 ; CHECKIZHINX-NEXT: beqz a2, .LBB10_2
505 ; CHECKIZHINX-NEXT: # %bb.1:
506 ; CHECKIZHINX-NEXT: mv a0, a1
507 ; CHECKIZHINX-NEXT: .LBB10_2:
508 ; CHECKIZHINX-NEXT: ret
510 ; CHECKIZFHMIN-LABEL: select_fcmp_uge:
511 ; CHECKIZFHMIN: # %bb.0:
512 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
513 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
514 ; CHECKIZFHMIN-NEXT: flt.s a0, fa5, fa4
515 ; CHECKIZFHMIN-NEXT: beqz a0, .LBB10_2
516 ; CHECKIZFHMIN-NEXT: # %bb.1:
517 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
518 ; CHECKIZFHMIN-NEXT: .LBB10_2:
519 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
520 ; CHECKIZFHMIN-NEXT: ret
522 ; CHECKIZHINXMIN-LABEL: select_fcmp_uge:
523 ; CHECKIZHINXMIN: # %bb.0:
524 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
525 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
526 ; CHECKIZHINXMIN-NEXT: flt.s a2, a0, a1
527 ; CHECKIZHINXMIN-NEXT: beqz a2, .LBB10_2
528 ; CHECKIZHINXMIN-NEXT: # %bb.1:
529 ; CHECKIZHINXMIN-NEXT: mv a0, a1
530 ; CHECKIZHINXMIN-NEXT: .LBB10_2:
531 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
532 ; CHECKIZHINXMIN-NEXT: ret
533 %1 = fcmp uge half %a, %b
534 %2 = select i1 %1, half %a, half %b
538 define half @select_fcmp_ult(half %a, half %b) nounwind {
539 ; CHECK-LABEL: select_fcmp_ult:
541 ; CHECK-NEXT: fle.h a0, fa1, fa0
542 ; CHECK-NEXT: beqz a0, .LBB11_2
543 ; CHECK-NEXT: # %bb.1:
544 ; CHECK-NEXT: fmv.h fa0, fa1
545 ; CHECK-NEXT: .LBB11_2:
548 ; CHECKIZHINX-LABEL: select_fcmp_ult:
549 ; CHECKIZHINX: # %bb.0:
550 ; CHECKIZHINX-NEXT: fle.h a2, a1, a0
551 ; CHECKIZHINX-NEXT: beqz a2, .LBB11_2
552 ; CHECKIZHINX-NEXT: # %bb.1:
553 ; CHECKIZHINX-NEXT: mv a0, a1
554 ; CHECKIZHINX-NEXT: .LBB11_2:
555 ; CHECKIZHINX-NEXT: ret
557 ; CHECKIZFHMIN-LABEL: select_fcmp_ult:
558 ; CHECKIZFHMIN: # %bb.0:
559 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
560 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
561 ; CHECKIZFHMIN-NEXT: fle.s a0, fa4, fa5
562 ; CHECKIZFHMIN-NEXT: beqz a0, .LBB11_2
563 ; CHECKIZFHMIN-NEXT: # %bb.1:
564 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
565 ; CHECKIZFHMIN-NEXT: .LBB11_2:
566 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
567 ; CHECKIZFHMIN-NEXT: ret
569 ; CHECKIZHINXMIN-LABEL: select_fcmp_ult:
570 ; CHECKIZHINXMIN: # %bb.0:
571 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
572 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
573 ; CHECKIZHINXMIN-NEXT: fle.s a2, a1, a0
574 ; CHECKIZHINXMIN-NEXT: beqz a2, .LBB11_2
575 ; CHECKIZHINXMIN-NEXT: # %bb.1:
576 ; CHECKIZHINXMIN-NEXT: mv a0, a1
577 ; CHECKIZHINXMIN-NEXT: .LBB11_2:
578 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
579 ; CHECKIZHINXMIN-NEXT: ret
580 %1 = fcmp ult half %a, %b
581 %2 = select i1 %1, half %a, half %b
585 define half @select_fcmp_ule(half %a, half %b) nounwind {
586 ; CHECK-LABEL: select_fcmp_ule:
588 ; CHECK-NEXT: flt.h a0, fa1, fa0
589 ; CHECK-NEXT: beqz a0, .LBB12_2
590 ; CHECK-NEXT: # %bb.1:
591 ; CHECK-NEXT: fmv.h fa0, fa1
592 ; CHECK-NEXT: .LBB12_2:
595 ; CHECKIZHINX-LABEL: select_fcmp_ule:
596 ; CHECKIZHINX: # %bb.0:
597 ; CHECKIZHINX-NEXT: flt.h a2, a1, a0
598 ; CHECKIZHINX-NEXT: beqz a2, .LBB12_2
599 ; CHECKIZHINX-NEXT: # %bb.1:
600 ; CHECKIZHINX-NEXT: mv a0, a1
601 ; CHECKIZHINX-NEXT: .LBB12_2:
602 ; CHECKIZHINX-NEXT: ret
604 ; CHECKIZFHMIN-LABEL: select_fcmp_ule:
605 ; CHECKIZFHMIN: # %bb.0:
606 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
607 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
608 ; CHECKIZFHMIN-NEXT: flt.s a0, fa4, fa5
609 ; CHECKIZFHMIN-NEXT: beqz a0, .LBB12_2
610 ; CHECKIZFHMIN-NEXT: # %bb.1:
611 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
612 ; CHECKIZFHMIN-NEXT: .LBB12_2:
613 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
614 ; CHECKIZFHMIN-NEXT: ret
616 ; CHECKIZHINXMIN-LABEL: select_fcmp_ule:
617 ; CHECKIZHINXMIN: # %bb.0:
618 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
619 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
620 ; CHECKIZHINXMIN-NEXT: flt.s a2, a1, a0
621 ; CHECKIZHINXMIN-NEXT: beqz a2, .LBB12_2
622 ; CHECKIZHINXMIN-NEXT: # %bb.1:
623 ; CHECKIZHINXMIN-NEXT: mv a0, a1
624 ; CHECKIZHINXMIN-NEXT: .LBB12_2:
625 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
626 ; CHECKIZHINXMIN-NEXT: ret
627 %1 = fcmp ule half %a, %b
628 %2 = select i1 %1, half %a, half %b
632 define half @select_fcmp_une(half %a, half %b) nounwind {
633 ; CHECK-LABEL: select_fcmp_une:
635 ; CHECK-NEXT: feq.h a0, fa0, fa1
636 ; CHECK-NEXT: beqz a0, .LBB13_2
637 ; CHECK-NEXT: # %bb.1:
638 ; CHECK-NEXT: fmv.h fa0, fa1
639 ; CHECK-NEXT: .LBB13_2:
642 ; CHECKIZHINX-LABEL: select_fcmp_une:
643 ; CHECKIZHINX: # %bb.0:
644 ; CHECKIZHINX-NEXT: feq.h a2, a0, a1
645 ; CHECKIZHINX-NEXT: beqz a2, .LBB13_2
646 ; CHECKIZHINX-NEXT: # %bb.1:
647 ; CHECKIZHINX-NEXT: mv a0, a1
648 ; CHECKIZHINX-NEXT: .LBB13_2:
649 ; CHECKIZHINX-NEXT: ret
651 ; CHECKIZFHMIN-LABEL: select_fcmp_une:
652 ; CHECKIZFHMIN: # %bb.0:
653 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa1
654 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa0
655 ; CHECKIZFHMIN-NEXT: feq.s a0, fa5, fa4
656 ; CHECKIZFHMIN-NEXT: beqz a0, .LBB13_2
657 ; CHECKIZFHMIN-NEXT: # %bb.1:
658 ; CHECKIZFHMIN-NEXT: fmv.s fa5, fa4
659 ; CHECKIZFHMIN-NEXT: .LBB13_2:
660 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa5
661 ; CHECKIZFHMIN-NEXT: ret
663 ; CHECKIZHINXMIN-LABEL: select_fcmp_une:
664 ; CHECKIZHINXMIN: # %bb.0:
665 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
666 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
667 ; CHECKIZHINXMIN-NEXT: feq.s a2, a0, a1
668 ; CHECKIZHINXMIN-NEXT: beqz a2, .LBB13_2
669 ; CHECKIZHINXMIN-NEXT: # %bb.1:
670 ; CHECKIZHINXMIN-NEXT: mv a0, a1
671 ; CHECKIZHINXMIN-NEXT: .LBB13_2:
672 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
673 ; CHECKIZHINXMIN-NEXT: ret
674 %1 = fcmp une half %a, %b
675 %2 = select i1 %1, half %a, half %b
679 define half @select_fcmp_uno(half %a, half %b) nounwind {
680 ; CHECK-LABEL: select_fcmp_uno:
682 ; CHECK-NEXT: feq.h a0, fa1, fa1
683 ; CHECK-NEXT: feq.h a1, fa0, fa0
684 ; CHECK-NEXT: and a0, a1, a0
685 ; CHECK-NEXT: beqz a0, .LBB14_2
686 ; CHECK-NEXT: # %bb.1:
687 ; CHECK-NEXT: fmv.h fa0, fa1
688 ; CHECK-NEXT: .LBB14_2:
691 ; CHECKIZHINX-LABEL: select_fcmp_uno:
692 ; CHECKIZHINX: # %bb.0:
693 ; CHECKIZHINX-NEXT: feq.h a2, a1, a1
694 ; CHECKIZHINX-NEXT: feq.h a3, a0, a0
695 ; CHECKIZHINX-NEXT: and a2, a3, a2
696 ; CHECKIZHINX-NEXT: beqz a2, .LBB14_2
697 ; CHECKIZHINX-NEXT: # %bb.1:
698 ; CHECKIZHINX-NEXT: mv a0, a1
699 ; CHECKIZHINX-NEXT: .LBB14_2:
700 ; CHECKIZHINX-NEXT: ret
702 ; CHECKIZFHMIN-LABEL: select_fcmp_uno:
703 ; CHECKIZFHMIN: # %bb.0:
704 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa1
705 ; CHECKIZFHMIN-NEXT: feq.s a0, fa5, fa5
706 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa0
707 ; CHECKIZFHMIN-NEXT: feq.s a1, fa4, fa4
708 ; CHECKIZFHMIN-NEXT: and a0, a1, a0
709 ; CHECKIZFHMIN-NEXT: beqz a0, .LBB14_2
710 ; CHECKIZFHMIN-NEXT: # %bb.1:
711 ; CHECKIZFHMIN-NEXT: fmv.s fa4, fa5
712 ; CHECKIZFHMIN-NEXT: .LBB14_2:
713 ; CHECKIZFHMIN-NEXT: fcvt.h.s fa0, fa4
714 ; CHECKIZFHMIN-NEXT: ret
716 ; CHECKIZHINXMIN-LABEL: select_fcmp_uno:
717 ; CHECKIZHINXMIN: # %bb.0:
718 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
719 ; CHECKIZHINXMIN-NEXT: feq.s a2, a1, a1
720 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
721 ; CHECKIZHINXMIN-NEXT: feq.s a3, a0, a0
722 ; CHECKIZHINXMIN-NEXT: and a2, a3, a2
723 ; CHECKIZHINXMIN-NEXT: beqz a2, .LBB14_2
724 ; CHECKIZHINXMIN-NEXT: # %bb.1:
725 ; CHECKIZHINXMIN-NEXT: mv a0, a1
726 ; CHECKIZHINXMIN-NEXT: .LBB14_2:
727 ; CHECKIZHINXMIN-NEXT: fcvt.h.s a0, a0
728 ; CHECKIZHINXMIN-NEXT: ret
729 %1 = fcmp uno half %a, %b
730 %2 = select i1 %1, half %a, half %b
734 define half @select_fcmp_true(half %a, half %b) nounwind {
735 ; CHECK-LABEL: select_fcmp_true:
739 ; CHECKIZHINX-LABEL: select_fcmp_true:
740 ; CHECKIZHINX: # %bb.0:
741 ; CHECKIZHINX-NEXT: ret
743 ; CHECKIZFHMIN-LABEL: select_fcmp_true:
744 ; CHECKIZFHMIN: # %bb.0:
745 ; CHECKIZFHMIN-NEXT: ret
747 ; CHECKIZHINXMIN-LABEL: select_fcmp_true:
748 ; CHECKIZHINXMIN: # %bb.0:
749 ; CHECKIZHINXMIN-NEXT: ret
750 %1 = fcmp true half %a, %b
751 %2 = select i1 %1, half %a, half %b
755 ; Ensure that ISel succeeds for a select+fcmp that has an i32 result type.
756 define i32 @i32_select_fcmp_oeq(half %a, half %b, i32 %c, i32 %d) nounwind {
757 ; CHECK-LABEL: i32_select_fcmp_oeq:
759 ; CHECK-NEXT: feq.h a2, fa0, fa1
760 ; CHECK-NEXT: bnez a2, .LBB16_2
761 ; CHECK-NEXT: # %bb.1:
762 ; CHECK-NEXT: mv a0, a1
763 ; CHECK-NEXT: .LBB16_2:
766 ; CHECKIZHINX-LABEL: i32_select_fcmp_oeq:
767 ; CHECKIZHINX: # %bb.0:
768 ; CHECKIZHINX-NEXT: feq.h a1, a0, a1
769 ; CHECKIZHINX-NEXT: mv a0, a2
770 ; CHECKIZHINX-NEXT: bnez a1, .LBB16_2
771 ; CHECKIZHINX-NEXT: # %bb.1:
772 ; CHECKIZHINX-NEXT: mv a0, a3
773 ; CHECKIZHINX-NEXT: .LBB16_2:
774 ; CHECKIZHINX-NEXT: ret
776 ; CHECKIZFHMIN-LABEL: i32_select_fcmp_oeq:
777 ; CHECKIZFHMIN: # %bb.0:
778 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa1
779 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa0
780 ; CHECKIZFHMIN-NEXT: feq.s a2, fa4, fa5
781 ; CHECKIZFHMIN-NEXT: bnez a2, .LBB16_2
782 ; CHECKIZFHMIN-NEXT: # %bb.1:
783 ; CHECKIZFHMIN-NEXT: mv a0, a1
784 ; CHECKIZFHMIN-NEXT: .LBB16_2:
785 ; CHECKIZFHMIN-NEXT: ret
787 ; CHECKIZHINXMIN-LABEL: i32_select_fcmp_oeq:
788 ; CHECKIZHINXMIN: # %bb.0:
789 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
790 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
791 ; CHECKIZHINXMIN-NEXT: feq.s a1, a0, a1
792 ; CHECKIZHINXMIN-NEXT: mv a0, a2
793 ; CHECKIZHINXMIN-NEXT: bnez a1, .LBB16_2
794 ; CHECKIZHINXMIN-NEXT: # %bb.1:
795 ; CHECKIZHINXMIN-NEXT: mv a0, a3
796 ; CHECKIZHINXMIN-NEXT: .LBB16_2:
797 ; CHECKIZHINXMIN-NEXT: ret
798 %1 = fcmp oeq half %a, %b
799 %2 = select i1 %1, i32 %c, i32 %d
803 define i32 @select_fcmp_oeq_1_2(half %a, half %b) {
804 ; CHECK-LABEL: select_fcmp_oeq_1_2:
806 ; CHECK-NEXT: feq.h a0, fa0, fa1
807 ; CHECK-NEXT: li a1, 2
808 ; CHECK-NEXT: sub a0, a1, a0
811 ; CHECKIZHINX-LABEL: select_fcmp_oeq_1_2:
812 ; CHECKIZHINX: # %bb.0:
813 ; CHECKIZHINX-NEXT: feq.h a0, a0, a1
814 ; CHECKIZHINX-NEXT: li a1, 2
815 ; CHECKIZHINX-NEXT: sub a0, a1, a0
816 ; CHECKIZHINX-NEXT: ret
818 ; CHECKIZFHMIN-LABEL: select_fcmp_oeq_1_2:
819 ; CHECKIZFHMIN: # %bb.0:
820 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa1
821 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa0
822 ; CHECKIZFHMIN-NEXT: feq.s a0, fa4, fa5
823 ; CHECKIZFHMIN-NEXT: li a1, 2
824 ; CHECKIZFHMIN-NEXT: sub a0, a1, a0
825 ; CHECKIZFHMIN-NEXT: ret
827 ; CHECKIZHINXMIN-LABEL: select_fcmp_oeq_1_2:
828 ; CHECKIZHINXMIN: # %bb.0:
829 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
830 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
831 ; CHECKIZHINXMIN-NEXT: feq.s a0, a0, a1
832 ; CHECKIZHINXMIN-NEXT: li a1, 2
833 ; CHECKIZHINXMIN-NEXT: sub a0, a1, a0
834 ; CHECKIZHINXMIN-NEXT: ret
835 %1 = fcmp fast oeq half %a, %b
836 %2 = select i1 %1, i32 1, i32 2
840 define signext i32 @select_fcmp_uge_negone_zero(half %a, half %b) nounwind {
841 ; CHECK-LABEL: select_fcmp_uge_negone_zero:
843 ; CHECK-NEXT: fle.h a0, fa0, fa1
844 ; CHECK-NEXT: addi a0, a0, -1
847 ; CHECKIZHINX-LABEL: select_fcmp_uge_negone_zero:
848 ; CHECKIZHINX: # %bb.0:
849 ; CHECKIZHINX-NEXT: fle.h a0, a0, a1
850 ; CHECKIZHINX-NEXT: addi a0, a0, -1
851 ; CHECKIZHINX-NEXT: ret
853 ; CHECKIZFHMIN-LABEL: select_fcmp_uge_negone_zero:
854 ; CHECKIZFHMIN: # %bb.0:
855 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa1
856 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa0
857 ; CHECKIZFHMIN-NEXT: fle.s a0, fa4, fa5
858 ; CHECKIZFHMIN-NEXT: addi a0, a0, -1
859 ; CHECKIZFHMIN-NEXT: ret
861 ; CHECKIZHINXMIN-LABEL: select_fcmp_uge_negone_zero:
862 ; CHECKIZHINXMIN: # %bb.0:
863 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a1, a1
864 ; CHECKIZHINXMIN-NEXT: fcvt.s.h a0, a0
865 ; CHECKIZHINXMIN-NEXT: fle.s a0, a0, a1
866 ; CHECKIZHINXMIN-NEXT: addi a0, a0, -1
867 ; CHECKIZHINXMIN-NEXT: ret
868 %1 = fcmp ugt half %a, %b
869 %2 = select i1 %1, i32 -1, i32 0
873 define signext i32 @select_fcmp_uge_1_2(half %a, half %b) nounwind {
874 ; CHECK-LABEL: select_fcmp_uge_1_2:
876 ; CHECK-NEXT: fle.h a0, fa0, fa1
877 ; CHECK-NEXT: addi a0, a0, 1
880 ; CHECKIZHINX-LABEL: select_fcmp_uge_1_2:
881 ; CHECKIZHINX: # %bb.0:
882 ; CHECKIZHINX-NEXT: fle.h a0, a0, a1
883 ; CHECKIZHINX-NEXT: addi a0, a0, 1
884 ; CHECKIZHINX-NEXT: ret
886 ; CHECKIZFHMIN-LABEL: select_fcmp_uge_1_2:
887 ; CHECKIZFHMIN: # %bb.0:
888 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa5, fa1
889 ; CHECKIZFHMIN-NEXT: fcvt.s.h fa4, fa0
890 ; CHECKIZFHMIN-NEXT: fle.s a0, fa4, fa5
891 ; CHECKIZFHMIN-NEXT: addi a0, a0, 1
892 ; CHECKIZFHMIN-NEXT: ret
894 ; CHECKIZHINXMIN-LABEL: select_fcmp_uge_1_2:
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: addi a0, a0, 1
900 ; CHECKIZHINXMIN-NEXT: ret
901 %1 = fcmp ugt half %a, %b
902 %2 = select i1 %1, i32 1, i32 2