1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse4.2 | FileCheck %s --check-prefix=ALL --check-prefix=STRICT
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse4.2 -enable-unsafe-fp-math -enable-no-nans-fp-math | FileCheck %s --check-prefix=ALL --check-prefix=RELAX --check-prefix=UNSAFE
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=sse4.2 -enable-no-nans-fp-math | FileCheck %s --check-prefix=ALL --check-prefix=RELAX --check-prefix=FINITE
6 ; Some of these patterns can be matched as SSE min or max. Some of
7 ; them can be matched provided that the operands are swapped.
8 ; Some of them can't be matched at all and require a comparison
9 ; and a conditional branch.
11 ; The naming convention is {,x_,y_}{o,u}{gt,lt,ge,le}{,_inverse}
12 ; _x: use 0.0 instead of %y
13 ; _y: use -0.0 instead of %y
14 ; _inverse : swap the arms of the select.
16 define double @ogt(double %x, double %y) {
19 ; ALL-NEXT: maxsd %xmm1, %xmm0
21 %c = fcmp ogt double %x, %y
22 %d = select i1 %c, double %x, double %y
26 define double @olt(double %x, double %y) {
29 ; ALL-NEXT: minsd %xmm1, %xmm0
31 %c = fcmp olt double %x, %y
32 %d = select i1 %c, double %x, double %y
36 define double @ogt_inverse(double %x, double %y) {
37 ; STRICT-LABEL: ogt_inverse:
39 ; STRICT-NEXT: minsd %xmm0, %xmm1
40 ; STRICT-NEXT: movapd %xmm1, %xmm0
43 ; UNSAFE-LABEL: ogt_inverse:
45 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
48 ; FINITE-LABEL: ogt_inverse:
50 ; FINITE-NEXT: minsd %xmm0, %xmm1
51 ; FINITE-NEXT: movapd %xmm1, %xmm0
53 %c = fcmp ogt double %x, %y
54 %d = select i1 %c, double %y, double %x
58 define double @olt_inverse(double %x, double %y) {
59 ; STRICT-LABEL: olt_inverse:
61 ; STRICT-NEXT: maxsd %xmm0, %xmm1
62 ; STRICT-NEXT: movapd %xmm1, %xmm0
65 ; UNSAFE-LABEL: olt_inverse:
67 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
70 ; FINITE-LABEL: olt_inverse:
72 ; FINITE-NEXT: maxsd %xmm0, %xmm1
73 ; FINITE-NEXT: movapd %xmm1, %xmm0
75 %c = fcmp olt double %x, %y
76 %d = select i1 %c, double %y, double %x
80 define double @oge(double %x, double %y) {
83 ; STRICT-NEXT: movapd %xmm1, %xmm2
84 ; STRICT-NEXT: cmplesd %xmm0, %xmm2
85 ; STRICT-NEXT: andpd %xmm2, %xmm0
86 ; STRICT-NEXT: andnpd %xmm1, %xmm2
87 ; STRICT-NEXT: orpd %xmm2, %xmm0
92 ; RELAX-NEXT: maxsd %xmm1, %xmm0
94 %c = fcmp oge double %x, %y
95 %d = select i1 %c, double %x, double %y
99 define double @ole(double %x, double %y) {
102 ; STRICT-NEXT: movapd %xmm0, %xmm2
103 ; STRICT-NEXT: cmplesd %xmm1, %xmm2
104 ; STRICT-NEXT: andpd %xmm2, %xmm0
105 ; STRICT-NEXT: andnpd %xmm1, %xmm2
106 ; STRICT-NEXT: orpd %xmm0, %xmm2
107 ; STRICT-NEXT: movapd %xmm2, %xmm0
112 ; RELAX-NEXT: minsd %xmm1, %xmm0
114 %c = fcmp ole double %x, %y
115 %d = select i1 %c, double %x, double %y
119 define double @oge_inverse(double %x, double %y) {
120 ; STRICT-LABEL: oge_inverse:
122 ; STRICT-NEXT: movapd %xmm1, %xmm2
123 ; STRICT-NEXT: cmplesd %xmm0, %xmm2
124 ; STRICT-NEXT: andpd %xmm2, %xmm1
125 ; STRICT-NEXT: andnpd %xmm0, %xmm2
126 ; STRICT-NEXT: orpd %xmm1, %xmm2
127 ; STRICT-NEXT: movapd %xmm2, %xmm0
130 ; UNSAFE-LABEL: oge_inverse:
132 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
135 ; FINITE-LABEL: oge_inverse:
137 ; FINITE-NEXT: minsd %xmm0, %xmm1
138 ; FINITE-NEXT: movapd %xmm1, %xmm0
140 %c = fcmp oge double %x, %y
141 %d = select i1 %c, double %y, double %x
145 define double @ole_inverse(double %x, double %y) {
146 ; STRICT-LABEL: ole_inverse:
148 ; STRICT-NEXT: movapd %xmm0, %xmm2
149 ; STRICT-NEXT: cmplesd %xmm1, %xmm2
150 ; STRICT-NEXT: andpd %xmm2, %xmm1
151 ; STRICT-NEXT: andnpd %xmm0, %xmm2
152 ; STRICT-NEXT: orpd %xmm1, %xmm2
153 ; STRICT-NEXT: movapd %xmm2, %xmm0
156 ; UNSAFE-LABEL: ole_inverse:
158 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
161 ; FINITE-LABEL: ole_inverse:
163 ; FINITE-NEXT: maxsd %xmm0, %xmm1
164 ; FINITE-NEXT: movapd %xmm1, %xmm0
166 %c = fcmp ole double %x, %y
167 %d = select i1 %c, double %y, double %x
171 define double @ogt_x(double %x) {
174 ; ALL-NEXT: xorpd %xmm1, %xmm1
175 ; ALL-NEXT: maxsd %xmm1, %xmm0
177 %c = fcmp ogt double %x, 0.000000e+00
178 %d = select i1 %c, double %x, double 0.000000e+00
182 define double @olt_x(double %x) {
185 ; ALL-NEXT: xorpd %xmm1, %xmm1
186 ; ALL-NEXT: minsd %xmm1, %xmm0
188 %c = fcmp olt double %x, 0.000000e+00
189 %d = select i1 %c, double %x, double 0.000000e+00
193 define double @ogt_inverse_x(double %x) {
194 ; STRICT-LABEL: ogt_inverse_x:
196 ; STRICT-NEXT: xorpd %xmm1, %xmm1
197 ; STRICT-NEXT: minsd %xmm0, %xmm1
198 ; STRICT-NEXT: movapd %xmm1, %xmm0
201 ; UNSAFE-LABEL: ogt_inverse_x:
203 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
204 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
207 ; FINITE-LABEL: ogt_inverse_x:
209 ; FINITE-NEXT: xorpd %xmm1, %xmm1
210 ; FINITE-NEXT: minsd %xmm0, %xmm1
211 ; FINITE-NEXT: movapd %xmm1, %xmm0
213 %c = fcmp ogt double %x, 0.000000e+00
214 %d = select i1 %c, double 0.000000e+00, double %x
218 define double @olt_inverse_x(double %x) {
219 ; STRICT-LABEL: olt_inverse_x:
221 ; STRICT-NEXT: xorpd %xmm1, %xmm1
222 ; STRICT-NEXT: maxsd %xmm0, %xmm1
223 ; STRICT-NEXT: movapd %xmm1, %xmm0
226 ; UNSAFE-LABEL: olt_inverse_x:
228 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
229 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
232 ; FINITE-LABEL: olt_inverse_x:
234 ; FINITE-NEXT: xorpd %xmm1, %xmm1
235 ; FINITE-NEXT: maxsd %xmm0, %xmm1
236 ; FINITE-NEXT: movapd %xmm1, %xmm0
238 %c = fcmp olt double %x, 0.000000e+00
239 %d = select i1 %c, double 0.000000e+00, double %x
243 define double @oge_x(double %x) {
244 ; STRICT-LABEL: oge_x:
246 ; STRICT-NEXT: xorpd %xmm1, %xmm1
247 ; STRICT-NEXT: cmplesd %xmm0, %xmm1
248 ; STRICT-NEXT: andpd %xmm1, %xmm0
251 ; RELAX-LABEL: oge_x:
253 ; RELAX-NEXT: xorpd %xmm1, %xmm1
254 ; RELAX-NEXT: maxsd %xmm1, %xmm0
256 %c = fcmp oge double %x, 0.000000e+00
257 %d = select i1 %c, double %x, double 0.000000e+00
261 define double @ole_x(double %x) {
262 ; STRICT-LABEL: ole_x:
264 ; STRICT-NEXT: xorpd %xmm2, %xmm2
265 ; STRICT-NEXT: movapd %xmm0, %xmm1
266 ; STRICT-NEXT: cmplesd %xmm2, %xmm1
267 ; STRICT-NEXT: andpd %xmm0, %xmm1
268 ; STRICT-NEXT: movapd %xmm1, %xmm0
271 ; RELAX-LABEL: ole_x:
273 ; RELAX-NEXT: xorpd %xmm1, %xmm1
274 ; RELAX-NEXT: minsd %xmm1, %xmm0
276 %c = fcmp ole double %x, 0.000000e+00
277 %d = select i1 %c, double %x, double 0.000000e+00
281 define double @oge_inverse_x(double %x) {
282 ; STRICT-LABEL: oge_inverse_x:
284 ; STRICT-NEXT: xorpd %xmm1, %xmm1
285 ; STRICT-NEXT: cmplesd %xmm0, %xmm1
286 ; STRICT-NEXT: andnpd %xmm0, %xmm1
287 ; STRICT-NEXT: movapd %xmm1, %xmm0
290 ; UNSAFE-LABEL: oge_inverse_x:
292 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
293 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
296 ; FINITE-LABEL: oge_inverse_x:
298 ; FINITE-NEXT: xorpd %xmm1, %xmm1
299 ; FINITE-NEXT: minsd %xmm0, %xmm1
300 ; FINITE-NEXT: movapd %xmm1, %xmm0
302 %c = fcmp oge double %x, 0.000000e+00
303 %d = select i1 %c, double 0.000000e+00, double %x
307 define double @ole_inverse_x(double %x) {
308 ; STRICT-LABEL: ole_inverse_x:
310 ; STRICT-NEXT: xorpd %xmm2, %xmm2
311 ; STRICT-NEXT: movapd %xmm0, %xmm1
312 ; STRICT-NEXT: cmplesd %xmm2, %xmm1
313 ; STRICT-NEXT: andnpd %xmm0, %xmm1
314 ; STRICT-NEXT: movapd %xmm1, %xmm0
317 ; UNSAFE-LABEL: ole_inverse_x:
319 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
320 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
323 ; FINITE-LABEL: ole_inverse_x:
325 ; FINITE-NEXT: xorpd %xmm1, %xmm1
326 ; FINITE-NEXT: maxsd %xmm0, %xmm1
327 ; FINITE-NEXT: movapd %xmm1, %xmm0
329 %c = fcmp ole double %x, 0.000000e+00
330 %d = select i1 %c, double 0.000000e+00, double %x
334 define double @ugt(double %x, double %y) {
337 ; STRICT-NEXT: movapd %xmm0, %xmm2
338 ; STRICT-NEXT: cmpnlesd %xmm1, %xmm2
339 ; STRICT-NEXT: andpd %xmm2, %xmm0
340 ; STRICT-NEXT: andnpd %xmm1, %xmm2
341 ; STRICT-NEXT: orpd %xmm0, %xmm2
342 ; STRICT-NEXT: movapd %xmm2, %xmm0
347 ; RELAX-NEXT: maxsd %xmm1, %xmm0
349 %c = fcmp ugt double %x, %y
350 %d = select i1 %c, double %x, double %y
354 define double @ult(double %x, double %y) {
357 ; STRICT-NEXT: movapd %xmm1, %xmm2
358 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm2
359 ; STRICT-NEXT: andpd %xmm2, %xmm0
360 ; STRICT-NEXT: andnpd %xmm1, %xmm2
361 ; STRICT-NEXT: orpd %xmm2, %xmm0
366 ; RELAX-NEXT: minsd %xmm1, %xmm0
368 %c = fcmp ult double %x, %y
369 %d = select i1 %c, double %x, double %y
373 define double @ugt_inverse(double %x, double %y) {
374 ; STRICT-LABEL: ugt_inverse:
376 ; STRICT-NEXT: movapd %xmm0, %xmm2
377 ; STRICT-NEXT: cmpnlesd %xmm1, %xmm2
378 ; STRICT-NEXT: andpd %xmm2, %xmm1
379 ; STRICT-NEXT: andnpd %xmm0, %xmm2
380 ; STRICT-NEXT: orpd %xmm1, %xmm2
381 ; STRICT-NEXT: movapd %xmm2, %xmm0
384 ; UNSAFE-LABEL: ugt_inverse:
386 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
389 ; FINITE-LABEL: ugt_inverse:
391 ; FINITE-NEXT: minsd %xmm0, %xmm1
392 ; FINITE-NEXT: movapd %xmm1, %xmm0
394 %c = fcmp ugt double %x, %y
395 %d = select i1 %c, double %y, double %x
399 define double @ult_inverse(double %x, double %y) {
400 ; STRICT-LABEL: ult_inverse:
402 ; STRICT-NEXT: movapd %xmm1, %xmm2
403 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm2
404 ; STRICT-NEXT: andpd %xmm2, %xmm1
405 ; STRICT-NEXT: andnpd %xmm0, %xmm2
406 ; STRICT-NEXT: orpd %xmm1, %xmm2
407 ; STRICT-NEXT: movapd %xmm2, %xmm0
410 ; UNSAFE-LABEL: ult_inverse:
412 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
415 ; FINITE-LABEL: ult_inverse:
417 ; FINITE-NEXT: maxsd %xmm0, %xmm1
418 ; FINITE-NEXT: movapd %xmm1, %xmm0
420 %c = fcmp ult double %x, %y
421 %d = select i1 %c, double %y, double %x
425 define double @uge(double %x, double %y) {
428 ; STRICT-NEXT: maxsd %xmm0, %xmm1
429 ; STRICT-NEXT: movapd %xmm1, %xmm0
434 ; RELAX-NEXT: maxsd %xmm1, %xmm0
436 %c = fcmp uge double %x, %y
437 %d = select i1 %c, double %x, double %y
441 define double @ule(double %x, double %y) {
444 ; STRICT-NEXT: minsd %xmm0, %xmm1
445 ; STRICT-NEXT: movapd %xmm1, %xmm0
450 ; RELAX-NEXT: minsd %xmm1, %xmm0
452 %c = fcmp ule double %x, %y
453 %d = select i1 %c, double %x, double %y
457 define double @uge_inverse(double %x, double %y) {
458 ; STRICT-LABEL: uge_inverse:
460 ; STRICT-NEXT: minsd %xmm1, %xmm0
463 ; UNSAFE-LABEL: uge_inverse:
465 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
468 ; FINITE-LABEL: uge_inverse:
470 ; FINITE-NEXT: minsd %xmm0, %xmm1
471 ; FINITE-NEXT: movapd %xmm1, %xmm0
473 %c = fcmp uge double %x, %y
474 %d = select i1 %c, double %y, double %x
478 define double @ule_inverse(double %x, double %y) {
479 ; STRICT-LABEL: ule_inverse:
481 ; STRICT-NEXT: maxsd %xmm1, %xmm0
484 ; UNSAFE-LABEL: ule_inverse:
486 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
489 ; FINITE-LABEL: ule_inverse:
491 ; FINITE-NEXT: maxsd %xmm0, %xmm1
492 ; FINITE-NEXT: movapd %xmm1, %xmm0
494 %c = fcmp ule double %x, %y
495 %d = select i1 %c, double %y, double %x
499 define double @ugt_x(double %x) {
500 ; STRICT-LABEL: ugt_x:
502 ; STRICT-NEXT: xorpd %xmm2, %xmm2
503 ; STRICT-NEXT: movapd %xmm0, %xmm1
504 ; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
505 ; STRICT-NEXT: andpd %xmm0, %xmm1
506 ; STRICT-NEXT: movapd %xmm1, %xmm0
509 ; RELAX-LABEL: ugt_x:
511 ; RELAX-NEXT: xorpd %xmm1, %xmm1
512 ; RELAX-NEXT: maxsd %xmm1, %xmm0
514 %c = fcmp ugt double %x, 0.000000e+00
515 %d = select i1 %c, double %x, double 0.000000e+00
519 define double @ult_x(double %x) {
520 ; STRICT-LABEL: ult_x:
522 ; STRICT-NEXT: xorpd %xmm1, %xmm1
523 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm1
524 ; STRICT-NEXT: andpd %xmm1, %xmm0
527 ; RELAX-LABEL: ult_x:
529 ; RELAX-NEXT: xorpd %xmm1, %xmm1
530 ; RELAX-NEXT: minsd %xmm1, %xmm0
532 %c = fcmp ult double %x, 0.000000e+00
533 %d = select i1 %c, double %x, double 0.000000e+00
537 define double @ugt_inverse_x(double %x) {
538 ; STRICT-LABEL: ugt_inverse_x:
540 ; STRICT-NEXT: xorpd %xmm2, %xmm2
541 ; STRICT-NEXT: movapd %xmm0, %xmm1
542 ; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
543 ; STRICT-NEXT: andnpd %xmm0, %xmm1
544 ; STRICT-NEXT: movapd %xmm1, %xmm0
547 ; UNSAFE-LABEL: ugt_inverse_x:
549 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
550 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
553 ; FINITE-LABEL: ugt_inverse_x:
555 ; FINITE-NEXT: xorpd %xmm1, %xmm1
556 ; FINITE-NEXT: minsd %xmm0, %xmm1
557 ; FINITE-NEXT: movapd %xmm1, %xmm0
559 %c = fcmp ugt double %x, 0.000000e+00
560 %d = select i1 %c, double 0.000000e+00, double %x
564 define double @ult_inverse_x(double %x) {
565 ; STRICT-LABEL: ult_inverse_x:
567 ; STRICT-NEXT: xorpd %xmm1, %xmm1
568 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm1
569 ; STRICT-NEXT: andnpd %xmm0, %xmm1
570 ; STRICT-NEXT: movapd %xmm1, %xmm0
573 ; UNSAFE-LABEL: ult_inverse_x:
575 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
576 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
579 ; FINITE-LABEL: ult_inverse_x:
581 ; FINITE-NEXT: xorpd %xmm1, %xmm1
582 ; FINITE-NEXT: maxsd %xmm0, %xmm1
583 ; FINITE-NEXT: movapd %xmm1, %xmm0
585 %c = fcmp ult double %x, 0.000000e+00
586 %d = select i1 %c, double 0.000000e+00, double %x
590 define double @uge_x(double %x) {
591 ; STRICT-LABEL: uge_x:
593 ; STRICT-NEXT: xorpd %xmm1, %xmm1
594 ; STRICT-NEXT: maxsd %xmm0, %xmm1
595 ; STRICT-NEXT: movapd %xmm1, %xmm0
598 ; RELAX-LABEL: uge_x:
600 ; RELAX-NEXT: xorpd %xmm1, %xmm1
601 ; RELAX-NEXT: maxsd %xmm1, %xmm0
603 %c = fcmp uge double %x, 0.000000e+00
604 %d = select i1 %c, double %x, double 0.000000e+00
608 define double @ule_x(double %x) {
609 ; STRICT-LABEL: ule_x:
611 ; STRICT-NEXT: xorpd %xmm1, %xmm1
612 ; STRICT-NEXT: minsd %xmm0, %xmm1
613 ; STRICT-NEXT: movapd %xmm1, %xmm0
616 ; RELAX-LABEL: ule_x:
618 ; RELAX-NEXT: xorpd %xmm1, %xmm1
619 ; RELAX-NEXT: minsd %xmm1, %xmm0
621 %c = fcmp ule double %x, 0.000000e+00
622 %d = select i1 %c, double %x, double 0.000000e+00
626 define double @uge_inverse_x(double %x) {
627 ; STRICT-LABEL: uge_inverse_x:
629 ; STRICT-NEXT: xorpd %xmm1, %xmm1
630 ; STRICT-NEXT: minsd %xmm1, %xmm0
633 ; UNSAFE-LABEL: uge_inverse_x:
635 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
636 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
639 ; FINITE-LABEL: uge_inverse_x:
641 ; FINITE-NEXT: xorpd %xmm1, %xmm1
642 ; FINITE-NEXT: minsd %xmm0, %xmm1
643 ; FINITE-NEXT: movapd %xmm1, %xmm0
645 %c = fcmp uge double %x, 0.000000e+00
646 %d = select i1 %c, double 0.000000e+00, double %x
650 define double @ule_inverse_x(double %x) {
651 ; STRICT-LABEL: ule_inverse_x:
653 ; STRICT-NEXT: xorpd %xmm1, %xmm1
654 ; STRICT-NEXT: maxsd %xmm1, %xmm0
657 ; UNSAFE-LABEL: ule_inverse_x:
659 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
660 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
663 ; FINITE-LABEL: ule_inverse_x:
665 ; FINITE-NEXT: xorpd %xmm1, %xmm1
666 ; FINITE-NEXT: maxsd %xmm0, %xmm1
667 ; FINITE-NEXT: movapd %xmm1, %xmm0
669 %c = fcmp ule double %x, 0.000000e+00
670 %d = select i1 %c, double 0.000000e+00, double %x
674 define double @ogt_y(double %x) {
677 ; ALL-NEXT: maxsd {{.*}}(%rip), %xmm0
679 %c = fcmp ogt double %x, -0.000000e+00
680 %d = select i1 %c, double %x, double -0.000000e+00
684 define double @olt_y(double %x) {
687 ; ALL-NEXT: minsd {{.*}}(%rip), %xmm0
689 %c = fcmp olt double %x, -0.000000e+00
690 %d = select i1 %c, double %x, double -0.000000e+00
694 define double @ogt_inverse_y(double %x) {
695 ; STRICT-LABEL: ogt_inverse_y:
697 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
698 ; STRICT-NEXT: minsd %xmm0, %xmm1
699 ; STRICT-NEXT: movapd %xmm1, %xmm0
702 ; UNSAFE-LABEL: ogt_inverse_y:
704 ; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
707 ; FINITE-LABEL: ogt_inverse_y:
709 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
710 ; FINITE-NEXT: minsd %xmm0, %xmm1
711 ; FINITE-NEXT: movapd %xmm1, %xmm0
713 %c = fcmp ogt double %x, -0.000000e+00
714 %d = select i1 %c, double -0.000000e+00, double %x
718 define double @olt_inverse_y(double %x) {
719 ; STRICT-LABEL: olt_inverse_y:
721 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
722 ; STRICT-NEXT: maxsd %xmm0, %xmm1
723 ; STRICT-NEXT: movapd %xmm1, %xmm0
726 ; UNSAFE-LABEL: olt_inverse_y:
728 ; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
731 ; FINITE-LABEL: olt_inverse_y:
733 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
734 ; FINITE-NEXT: maxsd %xmm0, %xmm1
735 ; FINITE-NEXT: movapd %xmm1, %xmm0
737 %c = fcmp olt double %x, -0.000000e+00
738 %d = select i1 %c, double -0.000000e+00, double %x
742 define double @oge_y(double %x) {
743 ; STRICT-LABEL: oge_y:
745 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
746 ; STRICT-NEXT: movapd %xmm1, %xmm2
747 ; STRICT-NEXT: cmplesd %xmm0, %xmm2
748 ; STRICT-NEXT: andpd %xmm2, %xmm0
749 ; STRICT-NEXT: andnpd %xmm1, %xmm2
750 ; STRICT-NEXT: orpd %xmm2, %xmm0
753 ; RELAX-LABEL: oge_y:
755 ; RELAX-NEXT: maxsd {{.*}}(%rip), %xmm0
757 %c = fcmp oge double %x, -0.000000e+00
758 %d = select i1 %c, double %x, double -0.000000e+00
762 define double @ole_y(double %x) {
763 ; STRICT-LABEL: ole_y:
765 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
766 ; STRICT-NEXT: movapd %xmm0, %xmm1
767 ; STRICT-NEXT: cmplesd %xmm2, %xmm1
768 ; STRICT-NEXT: andpd %xmm1, %xmm0
769 ; STRICT-NEXT: andnpd %xmm2, %xmm1
770 ; STRICT-NEXT: orpd %xmm0, %xmm1
771 ; STRICT-NEXT: movapd %xmm1, %xmm0
774 ; RELAX-LABEL: ole_y:
776 ; RELAX-NEXT: minsd {{.*}}(%rip), %xmm0
778 %c = fcmp ole double %x, -0.000000e+00
779 %d = select i1 %c, double %x, double -0.000000e+00
783 define double @oge_inverse_y(double %x) {
784 ; STRICT-LABEL: oge_inverse_y:
786 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
787 ; STRICT-NEXT: movapd %xmm2, %xmm1
788 ; STRICT-NEXT: cmplesd %xmm0, %xmm1
789 ; STRICT-NEXT: andpd %xmm1, %xmm2
790 ; STRICT-NEXT: andnpd %xmm0, %xmm1
791 ; STRICT-NEXT: orpd %xmm2, %xmm1
792 ; STRICT-NEXT: movapd %xmm1, %xmm0
795 ; UNSAFE-LABEL: oge_inverse_y:
797 ; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
800 ; FINITE-LABEL: oge_inverse_y:
802 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
803 ; FINITE-NEXT: minsd %xmm0, %xmm1
804 ; FINITE-NEXT: movapd %xmm1, %xmm0
806 %c = fcmp oge double %x, -0.000000e+00
807 %d = select i1 %c, double -0.000000e+00, double %x
811 define double @ole_inverse_y(double %x) {
812 ; STRICT-LABEL: ole_inverse_y:
814 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
815 ; STRICT-NEXT: movapd %xmm0, %xmm1
816 ; STRICT-NEXT: cmplesd %xmm2, %xmm1
817 ; STRICT-NEXT: andpd %xmm1, %xmm2
818 ; STRICT-NEXT: andnpd %xmm0, %xmm1
819 ; STRICT-NEXT: orpd %xmm2, %xmm1
820 ; STRICT-NEXT: movapd %xmm1, %xmm0
823 ; UNSAFE-LABEL: ole_inverse_y:
825 ; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
828 ; FINITE-LABEL: ole_inverse_y:
830 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
831 ; FINITE-NEXT: maxsd %xmm0, %xmm1
832 ; FINITE-NEXT: movapd %xmm1, %xmm0
834 %c = fcmp ole double %x, -0.000000e+00
835 %d = select i1 %c, double -0.000000e+00, double %x
839 define double @ugt_y(double %x) {
840 ; STRICT-LABEL: ugt_y:
842 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
843 ; STRICT-NEXT: movapd %xmm0, %xmm1
844 ; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
845 ; STRICT-NEXT: andpd %xmm1, %xmm0
846 ; STRICT-NEXT: andnpd %xmm2, %xmm1
847 ; STRICT-NEXT: orpd %xmm0, %xmm1
848 ; STRICT-NEXT: movapd %xmm1, %xmm0
851 ; RELAX-LABEL: ugt_y:
853 ; RELAX-NEXT: maxsd {{.*}}(%rip), %xmm0
855 %c = fcmp ugt double %x, -0.000000e+00
856 %d = select i1 %c, double %x, double -0.000000e+00
860 define double @ult_y(double %x) {
861 ; STRICT-LABEL: ult_y:
863 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
864 ; STRICT-NEXT: movapd %xmm1, %xmm2
865 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm2
866 ; STRICT-NEXT: andpd %xmm2, %xmm0
867 ; STRICT-NEXT: andnpd %xmm1, %xmm2
868 ; STRICT-NEXT: orpd %xmm2, %xmm0
871 ; RELAX-LABEL: ult_y:
873 ; RELAX-NEXT: minsd {{.*}}(%rip), %xmm0
875 %c = fcmp ult double %x, -0.000000e+00
876 %d = select i1 %c, double %x, double -0.000000e+00
880 define double @ugt_inverse_y(double %x) {
881 ; STRICT-LABEL: ugt_inverse_y:
883 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
884 ; STRICT-NEXT: movapd %xmm0, %xmm1
885 ; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
886 ; STRICT-NEXT: andpd %xmm1, %xmm2
887 ; STRICT-NEXT: andnpd %xmm0, %xmm1
888 ; STRICT-NEXT: orpd %xmm2, %xmm1
889 ; STRICT-NEXT: movapd %xmm1, %xmm0
892 ; UNSAFE-LABEL: ugt_inverse_y:
894 ; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
897 ; FINITE-LABEL: ugt_inverse_y:
899 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
900 ; FINITE-NEXT: minsd %xmm0, %xmm1
901 ; FINITE-NEXT: movapd %xmm1, %xmm0
903 %c = fcmp ugt double %x, -0.000000e+00
904 %d = select i1 %c, double -0.000000e+00, double %x
908 define double @ult_inverse_y(double %x) {
909 ; STRICT-LABEL: ult_inverse_y:
911 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
912 ; STRICT-NEXT: movapd %xmm2, %xmm1
913 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm1
914 ; STRICT-NEXT: andpd %xmm1, %xmm2
915 ; STRICT-NEXT: andnpd %xmm0, %xmm1
916 ; STRICT-NEXT: orpd %xmm2, %xmm1
917 ; STRICT-NEXT: movapd %xmm1, %xmm0
920 ; UNSAFE-LABEL: ult_inverse_y:
922 ; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
925 ; FINITE-LABEL: ult_inverse_y:
927 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
928 ; FINITE-NEXT: maxsd %xmm0, %xmm1
929 ; FINITE-NEXT: movapd %xmm1, %xmm0
931 %c = fcmp ult double %x, -0.000000e+00
932 %d = select i1 %c, double -0.000000e+00, double %x
936 define double @uge_y(double %x) {
937 ; STRICT-LABEL: uge_y:
939 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
940 ; STRICT-NEXT: maxsd %xmm0, %xmm1
941 ; STRICT-NEXT: movapd %xmm1, %xmm0
944 ; RELAX-LABEL: uge_y:
946 ; RELAX-NEXT: maxsd {{.*}}(%rip), %xmm0
948 %c = fcmp uge double %x, -0.000000e+00
949 %d = select i1 %c, double %x, double -0.000000e+00
953 define double @ule_y(double %x) {
954 ; STRICT-LABEL: ule_y:
956 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
957 ; STRICT-NEXT: minsd %xmm0, %xmm1
958 ; STRICT-NEXT: movapd %xmm1, %xmm0
961 ; RELAX-LABEL: ule_y:
963 ; RELAX-NEXT: minsd {{.*}}(%rip), %xmm0
965 %c = fcmp ule double %x, -0.000000e+00
966 %d = select i1 %c, double %x, double -0.000000e+00
970 define double @uge_inverse_y(double %x) {
971 ; STRICT-LABEL: uge_inverse_y:
973 ; STRICT-NEXT: minsd {{.*}}(%rip), %xmm0
976 ; UNSAFE-LABEL: uge_inverse_y:
978 ; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
981 ; FINITE-LABEL: uge_inverse_y:
983 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
984 ; FINITE-NEXT: minsd %xmm0, %xmm1
985 ; FINITE-NEXT: movapd %xmm1, %xmm0
987 %c = fcmp uge double %x, -0.000000e+00
988 %d = select i1 %c, double -0.000000e+00, double %x
992 define double @ule_inverse_y(double %x) {
993 ; STRICT-LABEL: ule_inverse_y:
995 ; STRICT-NEXT: maxsd {{.*}}(%rip), %xmm0
998 ; UNSAFE-LABEL: ule_inverse_y:
1000 ; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
1003 ; FINITE-LABEL: ule_inverse_y:
1005 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1006 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1007 ; FINITE-NEXT: movapd %xmm1, %xmm0
1009 %c = fcmp ule double %x, -0.000000e+00
1010 %d = select i1 %c, double -0.000000e+00, double %x
1014 ; Test a few more misc. cases.
1016 define double @clampTo3k_a(double %x) {
1017 ; STRICT-LABEL: clampTo3k_a:
1019 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1020 ; STRICT-NEXT: minsd %xmm0, %xmm1
1021 ; STRICT-NEXT: movapd %xmm1, %xmm0
1024 ; UNSAFE-LABEL: clampTo3k_a:
1026 ; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
1029 ; FINITE-LABEL: clampTo3k_a:
1031 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1032 ; FINITE-NEXT: minsd %xmm0, %xmm1
1033 ; FINITE-NEXT: movapd %xmm1, %xmm0
1035 %t0 = fcmp ogt double %x, 3.000000e+03
1036 %y = select i1 %t0, double 3.000000e+03, double %x
1040 define double @clampTo3k_b(double %x) {
1041 ; STRICT-LABEL: clampTo3k_b:
1043 ; STRICT-NEXT: minsd {{.*}}(%rip), %xmm0
1046 ; UNSAFE-LABEL: clampTo3k_b:
1048 ; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
1051 ; FINITE-LABEL: clampTo3k_b:
1053 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1054 ; FINITE-NEXT: minsd %xmm0, %xmm1
1055 ; FINITE-NEXT: movapd %xmm1, %xmm0
1057 %t0 = fcmp uge double %x, 3.000000e+03
1058 %y = select i1 %t0, double 3.000000e+03, double %x
1062 define double @clampTo3k_c(double %x) {
1063 ; STRICT-LABEL: clampTo3k_c:
1065 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1066 ; STRICT-NEXT: maxsd %xmm0, %xmm1
1067 ; STRICT-NEXT: movapd %xmm1, %xmm0
1070 ; UNSAFE-LABEL: clampTo3k_c:
1072 ; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
1075 ; FINITE-LABEL: clampTo3k_c:
1077 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1078 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1079 ; FINITE-NEXT: movapd %xmm1, %xmm0
1081 %t0 = fcmp olt double %x, 3.000000e+03
1082 %y = select i1 %t0, double 3.000000e+03, double %x
1086 define double @clampTo3k_d(double %x) {
1087 ; STRICT-LABEL: clampTo3k_d:
1089 ; STRICT-NEXT: maxsd {{.*}}(%rip), %xmm0
1092 ; UNSAFE-LABEL: clampTo3k_d:
1094 ; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
1097 ; FINITE-LABEL: clampTo3k_d:
1099 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1100 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1101 ; FINITE-NEXT: movapd %xmm1, %xmm0
1103 %t0 = fcmp ule double %x, 3.000000e+03
1104 %y = select i1 %t0, double 3.000000e+03, double %x
1108 define double @clampTo3k_e(double %x) {
1109 ; STRICT-LABEL: clampTo3k_e:
1111 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1112 ; STRICT-NEXT: maxsd %xmm0, %xmm1
1113 ; STRICT-NEXT: movapd %xmm1, %xmm0
1116 ; UNSAFE-LABEL: clampTo3k_e:
1118 ; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
1121 ; FINITE-LABEL: clampTo3k_e:
1123 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1124 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1125 ; FINITE-NEXT: movapd %xmm1, %xmm0
1127 %t0 = fcmp olt double %x, 3.000000e+03
1128 %y = select i1 %t0, double 3.000000e+03, double %x
1132 define double @clampTo3k_f(double %x) {
1133 ; STRICT-LABEL: clampTo3k_f:
1135 ; STRICT-NEXT: maxsd {{.*}}(%rip), %xmm0
1138 ; UNSAFE-LABEL: clampTo3k_f:
1140 ; UNSAFE-NEXT: maxsd {{.*}}(%rip), %xmm0
1143 ; FINITE-LABEL: clampTo3k_f:
1145 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1146 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1147 ; FINITE-NEXT: movapd %xmm1, %xmm0
1149 %t0 = fcmp ule double %x, 3.000000e+03
1150 %y = select i1 %t0, double 3.000000e+03, double %x
1154 define double @clampTo3k_g(double %x) {
1155 ; STRICT-LABEL: clampTo3k_g:
1157 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1158 ; STRICT-NEXT: minsd %xmm0, %xmm1
1159 ; STRICT-NEXT: movapd %xmm1, %xmm0
1162 ; UNSAFE-LABEL: clampTo3k_g:
1164 ; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
1167 ; FINITE-LABEL: clampTo3k_g:
1169 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1170 ; FINITE-NEXT: minsd %xmm0, %xmm1
1171 ; FINITE-NEXT: movapd %xmm1, %xmm0
1173 %t0 = fcmp ogt double %x, 3.000000e+03
1174 %y = select i1 %t0, double 3.000000e+03, double %x
1178 define double @clampTo3k_h(double %x) {
1179 ; STRICT-LABEL: clampTo3k_h:
1181 ; STRICT-NEXT: minsd {{.*}}(%rip), %xmm0
1184 ; UNSAFE-LABEL: clampTo3k_h:
1186 ; UNSAFE-NEXT: minsd {{.*}}(%rip), %xmm0
1189 ; FINITE-LABEL: clampTo3k_h:
1191 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1192 ; FINITE-NEXT: minsd %xmm0, %xmm1
1193 ; FINITE-NEXT: movapd %xmm1, %xmm0
1195 %t0 = fcmp uge double %x, 3.000000e+03
1196 %y = select i1 %t0, double 3.000000e+03, double %x
1200 define <2 x double> @test_maxpd(<2 x double> %x, <2 x double> %y) {
1201 ; STRICT-LABEL: test_maxpd:
1203 ; STRICT-NEXT: movapd %xmm0, %xmm2
1204 ; STRICT-NEXT: movapd %xmm1, %xmm0
1205 ; STRICT-NEXT: cmplepd %xmm2, %xmm0
1206 ; STRICT-NEXT: blendvpd %xmm0, %xmm2, %xmm1
1207 ; STRICT-NEXT: movapd %xmm1, %xmm0
1210 ; RELAX-LABEL: test_maxpd:
1212 ; RELAX-NEXT: maxpd %xmm1, %xmm0
1214 %max_is_x = fcmp oge <2 x double> %x, %y
1215 %max = select <2 x i1> %max_is_x, <2 x double> %x, <2 x double> %y
1216 ret <2 x double> %max
1219 define <2 x double> @test_minpd(<2 x double> %x, <2 x double> %y) {
1220 ; STRICT-LABEL: test_minpd:
1222 ; STRICT-NEXT: movapd %xmm0, %xmm2
1223 ; STRICT-NEXT: cmplepd %xmm1, %xmm0
1224 ; STRICT-NEXT: blendvpd %xmm0, %xmm2, %xmm1
1225 ; STRICT-NEXT: movapd %xmm1, %xmm0
1228 ; RELAX-LABEL: test_minpd:
1230 ; RELAX-NEXT: minpd %xmm1, %xmm0
1232 %min_is_x = fcmp ole <2 x double> %x, %y
1233 %min = select <2 x i1> %min_is_x, <2 x double> %x, <2 x double> %y
1234 ret <2 x double> %min
1237 define <4 x float> @test_maxps(<4 x float> %x, <4 x float> %y) {
1238 ; STRICT-LABEL: test_maxps:
1240 ; STRICT-NEXT: movaps %xmm0, %xmm2
1241 ; STRICT-NEXT: movaps %xmm1, %xmm0
1242 ; STRICT-NEXT: cmpleps %xmm2, %xmm0
1243 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1244 ; STRICT-NEXT: movaps %xmm1, %xmm0
1247 ; RELAX-LABEL: test_maxps:
1249 ; RELAX-NEXT: maxps %xmm1, %xmm0
1251 %max_is_x = fcmp oge <4 x float> %x, %y
1252 %max = select <4 x i1> %max_is_x, <4 x float> %x, <4 x float> %y
1253 ret <4 x float> %max
1256 define <4 x float> @test_minps(<4 x float> %x, <4 x float> %y) {
1257 ; STRICT-LABEL: test_minps:
1259 ; STRICT-NEXT: movaps %xmm0, %xmm2
1260 ; STRICT-NEXT: cmpleps %xmm1, %xmm0
1261 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1262 ; STRICT-NEXT: movaps %xmm1, %xmm0
1265 ; RELAX-LABEL: test_minps:
1267 ; RELAX-NEXT: minps %xmm1, %xmm0
1269 %min_is_x = fcmp ole <4 x float> %x, %y
1270 %min = select <4 x i1> %min_is_x, <4 x float> %x, <4 x float> %y
1271 ret <4 x float> %min
1274 define <2 x float> @test_maxps_illegal_v2f32(<2 x float> %x, <2 x float> %y) {
1275 ; STRICT-LABEL: test_maxps_illegal_v2f32:
1277 ; STRICT-NEXT: movaps %xmm0, %xmm2
1278 ; STRICT-NEXT: movaps %xmm1, %xmm0
1279 ; STRICT-NEXT: cmpleps %xmm2, %xmm0
1280 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1281 ; STRICT-NEXT: movaps %xmm1, %xmm0
1284 ; RELAX-LABEL: test_maxps_illegal_v2f32:
1286 ; RELAX-NEXT: maxps %xmm1, %xmm0
1288 %max_is_x = fcmp oge <2 x float> %x, %y
1289 %max = select <2 x i1> %max_is_x, <2 x float> %x, <2 x float> %y
1290 ret <2 x float> %max
1293 define <2 x float> @test_minps_illegal_v2f32(<2 x float> %x, <2 x float> %y) {
1294 ; STRICT-LABEL: test_minps_illegal_v2f32:
1296 ; STRICT-NEXT: movaps %xmm0, %xmm2
1297 ; STRICT-NEXT: cmpleps %xmm1, %xmm0
1298 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1299 ; STRICT-NEXT: movaps %xmm1, %xmm0
1302 ; RELAX-LABEL: test_minps_illegal_v2f32:
1304 ; RELAX-NEXT: minps %xmm1, %xmm0
1306 %min_is_x = fcmp ole <2 x float> %x, %y
1307 %min = select <2 x i1> %min_is_x, <2 x float> %x, <2 x float> %y
1308 ret <2 x float> %min
1311 define <3 x float> @test_maxps_illegal_v3f32(<3 x float> %x, <3 x float> %y) {
1312 ; STRICT-LABEL: test_maxps_illegal_v3f32:
1314 ; STRICT-NEXT: movaps %xmm0, %xmm2
1315 ; STRICT-NEXT: movaps %xmm1, %xmm0
1316 ; STRICT-NEXT: cmpleps %xmm2, %xmm0
1317 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1318 ; STRICT-NEXT: movaps %xmm1, %xmm0
1321 ; RELAX-LABEL: test_maxps_illegal_v3f32:
1323 ; RELAX-NEXT: maxps %xmm1, %xmm0
1325 %max_is_x = fcmp oge <3 x float> %x, %y
1326 %max = select <3 x i1> %max_is_x, <3 x float> %x, <3 x float> %y
1327 ret <3 x float> %max
1330 define <3 x float> @test_minps_illegal_v3f32(<3 x float> %x, <3 x float> %y) {
1331 ; STRICT-LABEL: test_minps_illegal_v3f32:
1333 ; STRICT-NEXT: movaps %xmm0, %xmm2
1334 ; STRICT-NEXT: cmpleps %xmm1, %xmm0
1335 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1336 ; STRICT-NEXT: movaps %xmm1, %xmm0
1339 ; RELAX-LABEL: test_minps_illegal_v3f32:
1341 ; RELAX-NEXT: minps %xmm1, %xmm0
1343 %min_is_x = fcmp ole <3 x float> %x, %y
1344 %min = select <3 x i1> %min_is_x, <3 x float> %x, <3 x float> %y
1345 ret <3 x float> %min
1349 ; https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13838
1350 define float @ossfuzz13838(float %x) {
1351 ; ALL-LABEL: ossfuzz13838:
1352 ; ALL: # %bb.0: # %bb
1353 ; ALL-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
1356 %cmp2 = fcmp fast olt float %x, 2.550000e+02
1357 %B1 = urem i1 %cmp2, %cmp2
1358 %min = select i1 %B1, float %x, float 2.550000e+02
1359 %B = frem float %min, 0x47EFFFFFE0000000
1360 %cmp1 = fcmp fast olt float %B, 1.000000e+00
1361 %r = select i1 %cmp1, float 1.000000e+00, float %min