1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc --mtriple=loongarch32 --mattr=+d < %s | FileCheck %s --check-prefix=LA32
3 ; RUN: llc --mtriple=loongarch64 --mattr=+d < %s | FileCheck %s --check-prefix=LA64
5 ;; Test integers selection after `fcmp`
7 define i32 @f32_fcmp_false(float %a, float %b, i32 %x, i32 %y) {
8 ; LA32-LABEL: f32_fcmp_false:
10 ; LA32-NEXT: move $a0, $a1
13 ; LA64-LABEL: f32_fcmp_false:
15 ; LA64-NEXT: move $a0, $a1
17 %cmp = fcmp false float %a, %b
18 %res = select i1 %cmp, i32 %x, i32 %y
22 define i32 @f32_fcmp_oeq(float %a, float %b, i32 %x, i32 %y) {
23 ; LA32-LABEL: f32_fcmp_oeq:
25 ; LA32-NEXT: fcmp.ceq.s $fcc0, $fa0, $fa1
26 ; LA32-NEXT: movcf2gr $a2, $fcc0
27 ; LA32-NEXT: masknez $a1, $a1, $a2
28 ; LA32-NEXT: maskeqz $a0, $a0, $a2
29 ; LA32-NEXT: or $a0, $a0, $a1
32 ; LA64-LABEL: f32_fcmp_oeq:
34 ; LA64-NEXT: fcmp.ceq.s $fcc0, $fa0, $fa1
35 ; LA64-NEXT: movcf2gr $a2, $fcc0
36 ; LA64-NEXT: masknez $a1, $a1, $a2
37 ; LA64-NEXT: maskeqz $a0, $a0, $a2
38 ; LA64-NEXT: or $a0, $a0, $a1
40 %cmp = fcmp oeq float %a, %b
41 %res = select i1 %cmp, i32 %x, i32 %y
45 define i32 @f32_fcmp_ogt(float %a, float %b, i32 %x, i32 %y) {
46 ; LA32-LABEL: f32_fcmp_ogt:
48 ; LA32-NEXT: fcmp.clt.s $fcc0, $fa1, $fa0
49 ; LA32-NEXT: movcf2gr $a2, $fcc0
50 ; LA32-NEXT: masknez $a1, $a1, $a2
51 ; LA32-NEXT: maskeqz $a0, $a0, $a2
52 ; LA32-NEXT: or $a0, $a0, $a1
55 ; LA64-LABEL: f32_fcmp_ogt:
57 ; LA64-NEXT: fcmp.clt.s $fcc0, $fa1, $fa0
58 ; LA64-NEXT: movcf2gr $a2, $fcc0
59 ; LA64-NEXT: masknez $a1, $a1, $a2
60 ; LA64-NEXT: maskeqz $a0, $a0, $a2
61 ; LA64-NEXT: or $a0, $a0, $a1
63 %cmp = fcmp ogt float %a, %b
64 %res = select i1 %cmp, i32 %x, i32 %y
68 define i32 @f32_fcmp_oge(float %a, float %b, i32 %x, i32 %y) {
69 ; LA32-LABEL: f32_fcmp_oge:
71 ; LA32-NEXT: fcmp.cle.s $fcc0, $fa1, $fa0
72 ; LA32-NEXT: movcf2gr $a2, $fcc0
73 ; LA32-NEXT: masknez $a1, $a1, $a2
74 ; LA32-NEXT: maskeqz $a0, $a0, $a2
75 ; LA32-NEXT: or $a0, $a0, $a1
78 ; LA64-LABEL: f32_fcmp_oge:
80 ; LA64-NEXT: fcmp.cle.s $fcc0, $fa1, $fa0
81 ; LA64-NEXT: movcf2gr $a2, $fcc0
82 ; LA64-NEXT: masknez $a1, $a1, $a2
83 ; LA64-NEXT: maskeqz $a0, $a0, $a2
84 ; LA64-NEXT: or $a0, $a0, $a1
86 %cmp = fcmp oge float %a, %b
87 %res = select i1 %cmp, i32 %x, i32 %y
91 define i32 @f32_fcmp_olt(float %a, float %b, i32 %x, i32 %y) {
92 ; LA32-LABEL: f32_fcmp_olt:
94 ; LA32-NEXT: fcmp.clt.s $fcc0, $fa0, $fa1
95 ; LA32-NEXT: movcf2gr $a2, $fcc0
96 ; LA32-NEXT: masknez $a1, $a1, $a2
97 ; LA32-NEXT: maskeqz $a0, $a0, $a2
98 ; LA32-NEXT: or $a0, $a0, $a1
101 ; LA64-LABEL: f32_fcmp_olt:
103 ; LA64-NEXT: fcmp.clt.s $fcc0, $fa0, $fa1
104 ; LA64-NEXT: movcf2gr $a2, $fcc0
105 ; LA64-NEXT: masknez $a1, $a1, $a2
106 ; LA64-NEXT: maskeqz $a0, $a0, $a2
107 ; LA64-NEXT: or $a0, $a0, $a1
109 %cmp = fcmp olt float %a, %b
110 %res = select i1 %cmp, i32 %x, i32 %y
114 define i32 @f32_fcmp_ole(float %a, float %b, i32 %x, i32 %y) {
115 ; LA32-LABEL: f32_fcmp_ole:
117 ; LA32-NEXT: fcmp.cle.s $fcc0, $fa0, $fa1
118 ; LA32-NEXT: movcf2gr $a2, $fcc0
119 ; LA32-NEXT: masknez $a1, $a1, $a2
120 ; LA32-NEXT: maskeqz $a0, $a0, $a2
121 ; LA32-NEXT: or $a0, $a0, $a1
124 ; LA64-LABEL: f32_fcmp_ole:
126 ; LA64-NEXT: fcmp.cle.s $fcc0, $fa0, $fa1
127 ; LA64-NEXT: movcf2gr $a2, $fcc0
128 ; LA64-NEXT: masknez $a1, $a1, $a2
129 ; LA64-NEXT: maskeqz $a0, $a0, $a2
130 ; LA64-NEXT: or $a0, $a0, $a1
132 %cmp = fcmp ole float %a, %b
133 %res = select i1 %cmp, i32 %x, i32 %y
137 define i32 @f32_fcmp_one(float %a, float %b, i32 %x, i32 %y) {
138 ; LA32-LABEL: f32_fcmp_one:
140 ; LA32-NEXT: fcmp.cne.s $fcc0, $fa0, $fa1
141 ; LA32-NEXT: movcf2gr $a2, $fcc0
142 ; LA32-NEXT: masknez $a1, $a1, $a2
143 ; LA32-NEXT: maskeqz $a0, $a0, $a2
144 ; LA32-NEXT: or $a0, $a0, $a1
147 ; LA64-LABEL: f32_fcmp_one:
149 ; LA64-NEXT: fcmp.cne.s $fcc0, $fa0, $fa1
150 ; LA64-NEXT: movcf2gr $a2, $fcc0
151 ; LA64-NEXT: masknez $a1, $a1, $a2
152 ; LA64-NEXT: maskeqz $a0, $a0, $a2
153 ; LA64-NEXT: or $a0, $a0, $a1
155 %cmp = fcmp one float %a, %b
156 %res = select i1 %cmp, i32 %x, i32 %y
160 define i32 @f32_fcmp_ord(float %a, float %b, i32 %x, i32 %y) {
161 ; LA32-LABEL: f32_fcmp_ord:
163 ; LA32-NEXT: fcmp.cor.s $fcc0, $fa0, $fa1
164 ; LA32-NEXT: movcf2gr $a2, $fcc0
165 ; LA32-NEXT: masknez $a1, $a1, $a2
166 ; LA32-NEXT: maskeqz $a0, $a0, $a2
167 ; LA32-NEXT: or $a0, $a0, $a1
170 ; LA64-LABEL: f32_fcmp_ord:
172 ; LA64-NEXT: fcmp.cor.s $fcc0, $fa0, $fa1
173 ; LA64-NEXT: movcf2gr $a2, $fcc0
174 ; LA64-NEXT: masknez $a1, $a1, $a2
175 ; LA64-NEXT: maskeqz $a0, $a0, $a2
176 ; LA64-NEXT: or $a0, $a0, $a1
178 %cmp = fcmp ord float %a, %b
179 %res = select i1 %cmp, i32 %x, i32 %y
183 define i32 @f32_fcmp_ueq(float %a, float %b, i32 %x, i32 %y) {
184 ; LA32-LABEL: f32_fcmp_ueq:
186 ; LA32-NEXT: fcmp.cueq.s $fcc0, $fa0, $fa1
187 ; LA32-NEXT: movcf2gr $a2, $fcc0
188 ; LA32-NEXT: masknez $a1, $a1, $a2
189 ; LA32-NEXT: maskeqz $a0, $a0, $a2
190 ; LA32-NEXT: or $a0, $a0, $a1
193 ; LA64-LABEL: f32_fcmp_ueq:
195 ; LA64-NEXT: fcmp.cueq.s $fcc0, $fa0, $fa1
196 ; LA64-NEXT: movcf2gr $a2, $fcc0
197 ; LA64-NEXT: masknez $a1, $a1, $a2
198 ; LA64-NEXT: maskeqz $a0, $a0, $a2
199 ; LA64-NEXT: or $a0, $a0, $a1
201 %cmp = fcmp ueq float %a, %b
202 %res = select i1 %cmp, i32 %x, i32 %y
206 define i32 @f32_fcmp_ugt(float %a, float %b, i32 %x, i32 %y) {
207 ; LA32-LABEL: f32_fcmp_ugt:
209 ; LA32-NEXT: fcmp.cult.s $fcc0, $fa1, $fa0
210 ; LA32-NEXT: movcf2gr $a2, $fcc0
211 ; LA32-NEXT: masknez $a1, $a1, $a2
212 ; LA32-NEXT: maskeqz $a0, $a0, $a2
213 ; LA32-NEXT: or $a0, $a0, $a1
216 ; LA64-LABEL: f32_fcmp_ugt:
218 ; LA64-NEXT: fcmp.cult.s $fcc0, $fa1, $fa0
219 ; LA64-NEXT: movcf2gr $a2, $fcc0
220 ; LA64-NEXT: masknez $a1, $a1, $a2
221 ; LA64-NEXT: maskeqz $a0, $a0, $a2
222 ; LA64-NEXT: or $a0, $a0, $a1
224 %cmp = fcmp ugt float %a, %b
225 %res = select i1 %cmp, i32 %x, i32 %y
229 define i32 @f32_fcmp_uge(float %a, float %b, i32 %x, i32 %y) {
230 ; LA32-LABEL: f32_fcmp_uge:
232 ; LA32-NEXT: fcmp.cule.s $fcc0, $fa1, $fa0
233 ; LA32-NEXT: movcf2gr $a2, $fcc0
234 ; LA32-NEXT: masknez $a1, $a1, $a2
235 ; LA32-NEXT: maskeqz $a0, $a0, $a2
236 ; LA32-NEXT: or $a0, $a0, $a1
239 ; LA64-LABEL: f32_fcmp_uge:
241 ; LA64-NEXT: fcmp.cule.s $fcc0, $fa1, $fa0
242 ; LA64-NEXT: movcf2gr $a2, $fcc0
243 ; LA64-NEXT: masknez $a1, $a1, $a2
244 ; LA64-NEXT: maskeqz $a0, $a0, $a2
245 ; LA64-NEXT: or $a0, $a0, $a1
247 %cmp = fcmp uge float %a, %b
248 %res = select i1 %cmp, i32 %x, i32 %y
252 define i32 @f32_fcmp_ult(float %a, float %b, i32 %x, i32 %y) {
253 ; LA32-LABEL: f32_fcmp_ult:
255 ; LA32-NEXT: fcmp.cult.s $fcc0, $fa0, $fa1
256 ; LA32-NEXT: movcf2gr $a2, $fcc0
257 ; LA32-NEXT: masknez $a1, $a1, $a2
258 ; LA32-NEXT: maskeqz $a0, $a0, $a2
259 ; LA32-NEXT: or $a0, $a0, $a1
262 ; LA64-LABEL: f32_fcmp_ult:
264 ; LA64-NEXT: fcmp.cult.s $fcc0, $fa0, $fa1
265 ; LA64-NEXT: movcf2gr $a2, $fcc0
266 ; LA64-NEXT: masknez $a1, $a1, $a2
267 ; LA64-NEXT: maskeqz $a0, $a0, $a2
268 ; LA64-NEXT: or $a0, $a0, $a1
270 %cmp = fcmp ult float %a, %b
271 %res = select i1 %cmp, i32 %x, i32 %y
275 define i32 @f32_fcmp_ule(float %a, float %b, i32 %x, i32 %y) {
276 ; LA32-LABEL: f32_fcmp_ule:
278 ; LA32-NEXT: fcmp.cule.s $fcc0, $fa0, $fa1
279 ; LA32-NEXT: movcf2gr $a2, $fcc0
280 ; LA32-NEXT: masknez $a1, $a1, $a2
281 ; LA32-NEXT: maskeqz $a0, $a0, $a2
282 ; LA32-NEXT: or $a0, $a0, $a1
285 ; LA64-LABEL: f32_fcmp_ule:
287 ; LA64-NEXT: fcmp.cule.s $fcc0, $fa0, $fa1
288 ; LA64-NEXT: movcf2gr $a2, $fcc0
289 ; LA64-NEXT: masknez $a1, $a1, $a2
290 ; LA64-NEXT: maskeqz $a0, $a0, $a2
291 ; LA64-NEXT: or $a0, $a0, $a1
293 %cmp = fcmp ule float %a, %b
294 %res = select i1 %cmp, i32 %x, i32 %y
298 define i32 @f32_fcmp_une(float %a, float %b, i32 %x, i32 %y) {
299 ; LA32-LABEL: f32_fcmp_une:
301 ; LA32-NEXT: fcmp.cune.s $fcc0, $fa0, $fa1
302 ; LA32-NEXT: movcf2gr $a2, $fcc0
303 ; LA32-NEXT: masknez $a1, $a1, $a2
304 ; LA32-NEXT: maskeqz $a0, $a0, $a2
305 ; LA32-NEXT: or $a0, $a0, $a1
308 ; LA64-LABEL: f32_fcmp_une:
310 ; LA64-NEXT: fcmp.cune.s $fcc0, $fa0, $fa1
311 ; LA64-NEXT: movcf2gr $a2, $fcc0
312 ; LA64-NEXT: masknez $a1, $a1, $a2
313 ; LA64-NEXT: maskeqz $a0, $a0, $a2
314 ; LA64-NEXT: or $a0, $a0, $a1
316 %cmp = fcmp une float %a, %b
317 %res = select i1 %cmp, i32 %x, i32 %y
321 define i32 @f32_fcmp_uno(float %a, float %b, i32 %x, i32 %y) {
322 ; LA32-LABEL: f32_fcmp_uno:
324 ; LA32-NEXT: fcmp.cun.s $fcc0, $fa0, $fa1
325 ; LA32-NEXT: movcf2gr $a2, $fcc0
326 ; LA32-NEXT: masknez $a1, $a1, $a2
327 ; LA32-NEXT: maskeqz $a0, $a0, $a2
328 ; LA32-NEXT: or $a0, $a0, $a1
331 ; LA64-LABEL: f32_fcmp_uno:
333 ; LA64-NEXT: fcmp.cun.s $fcc0, $fa0, $fa1
334 ; LA64-NEXT: movcf2gr $a2, $fcc0
335 ; LA64-NEXT: masknez $a1, $a1, $a2
336 ; LA64-NEXT: maskeqz $a0, $a0, $a2
337 ; LA64-NEXT: or $a0, $a0, $a1
339 %cmp = fcmp uno float %a, %b
340 %res = select i1 %cmp, i32 %x, i32 %y
344 define i32 @f32_fcmp_true(float %a, float %b, i32 %x, i32 %y) {
345 ; LA32-LABEL: f32_fcmp_true:
349 ; LA64-LABEL: f32_fcmp_true:
352 %cmp = fcmp true float %a, %b
353 %res = select i1 %cmp, i32 %x, i32 %y
357 define i32 @f64_fcmp_false(double %a, double %b, i32 %x, i32 %y) {
358 ; LA32-LABEL: f64_fcmp_false:
360 ; LA32-NEXT: move $a0, $a1
363 ; LA64-LABEL: f64_fcmp_false:
365 ; LA64-NEXT: move $a0, $a1
367 %cmp = fcmp false double %a, %b
368 %res = select i1 %cmp, i32 %x, i32 %y
372 define i32 @f64_fcmp_oeq(double %a, double %b, i32 %x, i32 %y) {
373 ; LA32-LABEL: f64_fcmp_oeq:
375 ; LA32-NEXT: fcmp.ceq.d $fcc0, $fa0, $fa1
376 ; LA32-NEXT: movcf2gr $a2, $fcc0
377 ; LA32-NEXT: masknez $a1, $a1, $a2
378 ; LA32-NEXT: maskeqz $a0, $a0, $a2
379 ; LA32-NEXT: or $a0, $a0, $a1
382 ; LA64-LABEL: f64_fcmp_oeq:
384 ; LA64-NEXT: fcmp.ceq.d $fcc0, $fa0, $fa1
385 ; LA64-NEXT: movcf2gr $a2, $fcc0
386 ; LA64-NEXT: masknez $a1, $a1, $a2
387 ; LA64-NEXT: maskeqz $a0, $a0, $a2
388 ; LA64-NEXT: or $a0, $a0, $a1
390 %cmp = fcmp oeq double %a, %b
391 %res = select i1 %cmp, i32 %x, i32 %y
395 define i32 @f64_fcmp_ogt(double %a, double %b, i32 %x, i32 %y) {
396 ; LA32-LABEL: f64_fcmp_ogt:
398 ; LA32-NEXT: fcmp.clt.d $fcc0, $fa1, $fa0
399 ; LA32-NEXT: movcf2gr $a2, $fcc0
400 ; LA32-NEXT: masknez $a1, $a1, $a2
401 ; LA32-NEXT: maskeqz $a0, $a0, $a2
402 ; LA32-NEXT: or $a0, $a0, $a1
405 ; LA64-LABEL: f64_fcmp_ogt:
407 ; LA64-NEXT: fcmp.clt.d $fcc0, $fa1, $fa0
408 ; LA64-NEXT: movcf2gr $a2, $fcc0
409 ; LA64-NEXT: masknez $a1, $a1, $a2
410 ; LA64-NEXT: maskeqz $a0, $a0, $a2
411 ; LA64-NEXT: or $a0, $a0, $a1
413 %cmp = fcmp ogt double %a, %b
414 %res = select i1 %cmp, i32 %x, i32 %y
418 define i32 @f64_fcmp_oge(double %a, double %b, i32 %x, i32 %y) {
419 ; LA32-LABEL: f64_fcmp_oge:
421 ; LA32-NEXT: fcmp.cle.d $fcc0, $fa1, $fa0
422 ; LA32-NEXT: movcf2gr $a2, $fcc0
423 ; LA32-NEXT: masknez $a1, $a1, $a2
424 ; LA32-NEXT: maskeqz $a0, $a0, $a2
425 ; LA32-NEXT: or $a0, $a0, $a1
428 ; LA64-LABEL: f64_fcmp_oge:
430 ; LA64-NEXT: fcmp.cle.d $fcc0, $fa1, $fa0
431 ; LA64-NEXT: movcf2gr $a2, $fcc0
432 ; LA64-NEXT: masknez $a1, $a1, $a2
433 ; LA64-NEXT: maskeqz $a0, $a0, $a2
434 ; LA64-NEXT: or $a0, $a0, $a1
436 %cmp = fcmp oge double %a, %b
437 %res = select i1 %cmp, i32 %x, i32 %y
441 define i32 @f64_fcmp_olt(double %a, double %b, i32 %x, i32 %y) {
442 ; LA32-LABEL: f64_fcmp_olt:
444 ; LA32-NEXT: fcmp.clt.d $fcc0, $fa0, $fa1
445 ; LA32-NEXT: movcf2gr $a2, $fcc0
446 ; LA32-NEXT: masknez $a1, $a1, $a2
447 ; LA32-NEXT: maskeqz $a0, $a0, $a2
448 ; LA32-NEXT: or $a0, $a0, $a1
451 ; LA64-LABEL: f64_fcmp_olt:
453 ; LA64-NEXT: fcmp.clt.d $fcc0, $fa0, $fa1
454 ; LA64-NEXT: movcf2gr $a2, $fcc0
455 ; LA64-NEXT: masknez $a1, $a1, $a2
456 ; LA64-NEXT: maskeqz $a0, $a0, $a2
457 ; LA64-NEXT: or $a0, $a0, $a1
459 %cmp = fcmp olt double %a, %b
460 %res = select i1 %cmp, i32 %x, i32 %y
464 define i32 @f64_fcmp_ole(double %a, double %b, i32 %x, i32 %y) {
465 ; LA32-LABEL: f64_fcmp_ole:
467 ; LA32-NEXT: fcmp.cle.d $fcc0, $fa0, $fa1
468 ; LA32-NEXT: movcf2gr $a2, $fcc0
469 ; LA32-NEXT: masknez $a1, $a1, $a2
470 ; LA32-NEXT: maskeqz $a0, $a0, $a2
471 ; LA32-NEXT: or $a0, $a0, $a1
474 ; LA64-LABEL: f64_fcmp_ole:
476 ; LA64-NEXT: fcmp.cle.d $fcc0, $fa0, $fa1
477 ; LA64-NEXT: movcf2gr $a2, $fcc0
478 ; LA64-NEXT: masknez $a1, $a1, $a2
479 ; LA64-NEXT: maskeqz $a0, $a0, $a2
480 ; LA64-NEXT: or $a0, $a0, $a1
482 %cmp = fcmp ole double %a, %b
483 %res = select i1 %cmp, i32 %x, i32 %y
487 define i32 @f64_fcmp_one(double %a, double %b, i32 %x, i32 %y) {
488 ; LA32-LABEL: f64_fcmp_one:
490 ; LA32-NEXT: fcmp.cne.d $fcc0, $fa0, $fa1
491 ; LA32-NEXT: movcf2gr $a2, $fcc0
492 ; LA32-NEXT: masknez $a1, $a1, $a2
493 ; LA32-NEXT: maskeqz $a0, $a0, $a2
494 ; LA32-NEXT: or $a0, $a0, $a1
497 ; LA64-LABEL: f64_fcmp_one:
499 ; LA64-NEXT: fcmp.cne.d $fcc0, $fa0, $fa1
500 ; LA64-NEXT: movcf2gr $a2, $fcc0
501 ; LA64-NEXT: masknez $a1, $a1, $a2
502 ; LA64-NEXT: maskeqz $a0, $a0, $a2
503 ; LA64-NEXT: or $a0, $a0, $a1
505 %cmp = fcmp one double %a, %b
506 %res = select i1 %cmp, i32 %x, i32 %y
510 define i32 @f64_fcmp_ord(double %a, double %b, i32 %x, i32 %y) {
511 ; LA32-LABEL: f64_fcmp_ord:
513 ; LA32-NEXT: fcmp.cor.d $fcc0, $fa0, $fa1
514 ; LA32-NEXT: movcf2gr $a2, $fcc0
515 ; LA32-NEXT: masknez $a1, $a1, $a2
516 ; LA32-NEXT: maskeqz $a0, $a0, $a2
517 ; LA32-NEXT: or $a0, $a0, $a1
520 ; LA64-LABEL: f64_fcmp_ord:
522 ; LA64-NEXT: fcmp.cor.d $fcc0, $fa0, $fa1
523 ; LA64-NEXT: movcf2gr $a2, $fcc0
524 ; LA64-NEXT: masknez $a1, $a1, $a2
525 ; LA64-NEXT: maskeqz $a0, $a0, $a2
526 ; LA64-NEXT: or $a0, $a0, $a1
528 %cmp = fcmp ord double %a, %b
529 %res = select i1 %cmp, i32 %x, i32 %y
533 define i32 @f64_fcmp_ueq(double %a, double %b, i32 %x, i32 %y) {
534 ; LA32-LABEL: f64_fcmp_ueq:
536 ; LA32-NEXT: fcmp.cueq.d $fcc0, $fa0, $fa1
537 ; LA32-NEXT: movcf2gr $a2, $fcc0
538 ; LA32-NEXT: masknez $a1, $a1, $a2
539 ; LA32-NEXT: maskeqz $a0, $a0, $a2
540 ; LA32-NEXT: or $a0, $a0, $a1
543 ; LA64-LABEL: f64_fcmp_ueq:
545 ; LA64-NEXT: fcmp.cueq.d $fcc0, $fa0, $fa1
546 ; LA64-NEXT: movcf2gr $a2, $fcc0
547 ; LA64-NEXT: masknez $a1, $a1, $a2
548 ; LA64-NEXT: maskeqz $a0, $a0, $a2
549 ; LA64-NEXT: or $a0, $a0, $a1
551 %cmp = fcmp ueq double %a, %b
552 %res = select i1 %cmp, i32 %x, i32 %y
556 define i32 @f64_fcmp_ugt(double %a, double %b, i32 %x, i32 %y) {
557 ; LA32-LABEL: f64_fcmp_ugt:
559 ; LA32-NEXT: fcmp.cult.d $fcc0, $fa1, $fa0
560 ; LA32-NEXT: movcf2gr $a2, $fcc0
561 ; LA32-NEXT: masknez $a1, $a1, $a2
562 ; LA32-NEXT: maskeqz $a0, $a0, $a2
563 ; LA32-NEXT: or $a0, $a0, $a1
566 ; LA64-LABEL: f64_fcmp_ugt:
568 ; LA64-NEXT: fcmp.cult.d $fcc0, $fa1, $fa0
569 ; LA64-NEXT: movcf2gr $a2, $fcc0
570 ; LA64-NEXT: masknez $a1, $a1, $a2
571 ; LA64-NEXT: maskeqz $a0, $a0, $a2
572 ; LA64-NEXT: or $a0, $a0, $a1
574 %cmp = fcmp ugt double %a, %b
575 %res = select i1 %cmp, i32 %x, i32 %y
579 define i32 @f64_fcmp_uge(double %a, double %b, i32 %x, i32 %y) {
580 ; LA32-LABEL: f64_fcmp_uge:
582 ; LA32-NEXT: fcmp.cule.d $fcc0, $fa1, $fa0
583 ; LA32-NEXT: movcf2gr $a2, $fcc0
584 ; LA32-NEXT: masknez $a1, $a1, $a2
585 ; LA32-NEXT: maskeqz $a0, $a0, $a2
586 ; LA32-NEXT: or $a0, $a0, $a1
589 ; LA64-LABEL: f64_fcmp_uge:
591 ; LA64-NEXT: fcmp.cule.d $fcc0, $fa1, $fa0
592 ; LA64-NEXT: movcf2gr $a2, $fcc0
593 ; LA64-NEXT: masknez $a1, $a1, $a2
594 ; LA64-NEXT: maskeqz $a0, $a0, $a2
595 ; LA64-NEXT: or $a0, $a0, $a1
597 %cmp = fcmp uge double %a, %b
598 %res = select i1 %cmp, i32 %x, i32 %y
602 define i32 @f64_fcmp_ult(double %a, double %b, i32 %x, i32 %y) {
603 ; LA32-LABEL: f64_fcmp_ult:
605 ; LA32-NEXT: fcmp.cult.d $fcc0, $fa0, $fa1
606 ; LA32-NEXT: movcf2gr $a2, $fcc0
607 ; LA32-NEXT: masknez $a1, $a1, $a2
608 ; LA32-NEXT: maskeqz $a0, $a0, $a2
609 ; LA32-NEXT: or $a0, $a0, $a1
612 ; LA64-LABEL: f64_fcmp_ult:
614 ; LA64-NEXT: fcmp.cult.d $fcc0, $fa0, $fa1
615 ; LA64-NEXT: movcf2gr $a2, $fcc0
616 ; LA64-NEXT: masknez $a1, $a1, $a2
617 ; LA64-NEXT: maskeqz $a0, $a0, $a2
618 ; LA64-NEXT: or $a0, $a0, $a1
620 %cmp = fcmp ult double %a, %b
621 %res = select i1 %cmp, i32 %x, i32 %y
625 define i32 @f64_fcmp_ule(double %a, double %b, i32 %x, i32 %y) {
626 ; LA32-LABEL: f64_fcmp_ule:
628 ; LA32-NEXT: fcmp.cule.d $fcc0, $fa0, $fa1
629 ; LA32-NEXT: movcf2gr $a2, $fcc0
630 ; LA32-NEXT: masknez $a1, $a1, $a2
631 ; LA32-NEXT: maskeqz $a0, $a0, $a2
632 ; LA32-NEXT: or $a0, $a0, $a1
635 ; LA64-LABEL: f64_fcmp_ule:
637 ; LA64-NEXT: fcmp.cule.d $fcc0, $fa0, $fa1
638 ; LA64-NEXT: movcf2gr $a2, $fcc0
639 ; LA64-NEXT: masknez $a1, $a1, $a2
640 ; LA64-NEXT: maskeqz $a0, $a0, $a2
641 ; LA64-NEXT: or $a0, $a0, $a1
643 %cmp = fcmp ule double %a, %b
644 %res = select i1 %cmp, i32 %x, i32 %y
648 define i32 @f64_fcmp_une(double %a, double %b, i32 %x, i32 %y) {
649 ; LA32-LABEL: f64_fcmp_une:
651 ; LA32-NEXT: fcmp.cune.d $fcc0, $fa0, $fa1
652 ; LA32-NEXT: movcf2gr $a2, $fcc0
653 ; LA32-NEXT: masknez $a1, $a1, $a2
654 ; LA32-NEXT: maskeqz $a0, $a0, $a2
655 ; LA32-NEXT: or $a0, $a0, $a1
658 ; LA64-LABEL: f64_fcmp_une:
660 ; LA64-NEXT: fcmp.cune.d $fcc0, $fa0, $fa1
661 ; LA64-NEXT: movcf2gr $a2, $fcc0
662 ; LA64-NEXT: masknez $a1, $a1, $a2
663 ; LA64-NEXT: maskeqz $a0, $a0, $a2
664 ; LA64-NEXT: or $a0, $a0, $a1
666 %cmp = fcmp une double %a, %b
667 %res = select i1 %cmp, i32 %x, i32 %y
671 define i32 @f64_fcmp_uno(double %a, double %b, i32 %x, i32 %y) {
672 ; LA32-LABEL: f64_fcmp_uno:
674 ; LA32-NEXT: fcmp.cun.d $fcc0, $fa0, $fa1
675 ; LA32-NEXT: movcf2gr $a2, $fcc0
676 ; LA32-NEXT: masknez $a1, $a1, $a2
677 ; LA32-NEXT: maskeqz $a0, $a0, $a2
678 ; LA32-NEXT: or $a0, $a0, $a1
681 ; LA64-LABEL: f64_fcmp_uno:
683 ; LA64-NEXT: fcmp.cun.d $fcc0, $fa0, $fa1
684 ; LA64-NEXT: movcf2gr $a2, $fcc0
685 ; LA64-NEXT: masknez $a1, $a1, $a2
686 ; LA64-NEXT: maskeqz $a0, $a0, $a2
687 ; LA64-NEXT: or $a0, $a0, $a1
689 %cmp = fcmp uno double %a, %b
690 %res = select i1 %cmp, i32 %x, i32 %y
694 define i32 @f64_fcmp_true(double %a, double %b, i32 %x, i32 %y) {
695 ; LA32-LABEL: f64_fcmp_true:
699 ; LA64-LABEL: f64_fcmp_true:
702 %cmp = fcmp true double %a, %b
703 %res = select i1 %cmp, i32 %x, i32 %y