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-no-signed-zeros-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 %xmm2, %xmm0
111 ; RELAX-NEXT: minsd %xmm1, %xmm0
113 %c = fcmp ole double %x, %y
114 %d = select i1 %c, double %x, double %y
118 define double @oge_inverse(double %x, double %y) {
119 ; STRICT-LABEL: oge_inverse:
121 ; STRICT-NEXT: movapd %xmm1, %xmm2
122 ; STRICT-NEXT: cmplesd %xmm0, %xmm2
123 ; STRICT-NEXT: andpd %xmm2, %xmm1
124 ; STRICT-NEXT: andnpd %xmm0, %xmm2
125 ; STRICT-NEXT: orpd %xmm1, %xmm2
126 ; STRICT-NEXT: movapd %xmm2, %xmm0
129 ; UNSAFE-LABEL: oge_inverse:
131 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
134 ; FINITE-LABEL: oge_inverse:
136 ; FINITE-NEXT: minsd %xmm0, %xmm1
137 ; FINITE-NEXT: movapd %xmm1, %xmm0
139 %c = fcmp oge double %x, %y
140 %d = select i1 %c, double %y, double %x
144 define double @ole_inverse(double %x, double %y) {
145 ; STRICT-LABEL: ole_inverse:
147 ; STRICT-NEXT: movapd %xmm0, %xmm2
148 ; STRICT-NEXT: cmplesd %xmm1, %xmm2
149 ; STRICT-NEXT: andpd %xmm2, %xmm1
150 ; STRICT-NEXT: andnpd %xmm0, %xmm2
151 ; STRICT-NEXT: orpd %xmm1, %xmm2
152 ; STRICT-NEXT: movapd %xmm2, %xmm0
155 ; UNSAFE-LABEL: ole_inverse:
157 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
160 ; FINITE-LABEL: ole_inverse:
162 ; FINITE-NEXT: maxsd %xmm0, %xmm1
163 ; FINITE-NEXT: movapd %xmm1, %xmm0
165 %c = fcmp ole double %x, %y
166 %d = select i1 %c, double %y, double %x
170 define double @ogt_x(double %x) {
173 ; ALL-NEXT: xorpd %xmm1, %xmm1
174 ; ALL-NEXT: maxsd %xmm1, %xmm0
176 %c = fcmp ogt double %x, 0.000000e+00
177 %d = select i1 %c, double %x, double 0.000000e+00
181 define double @olt_x(double %x) {
184 ; ALL-NEXT: xorpd %xmm1, %xmm1
185 ; ALL-NEXT: minsd %xmm1, %xmm0
187 %c = fcmp olt double %x, 0.000000e+00
188 %d = select i1 %c, double %x, double 0.000000e+00
192 define double @ogt_inverse_x(double %x) {
193 ; STRICT-LABEL: ogt_inverse_x:
195 ; STRICT-NEXT: xorpd %xmm1, %xmm1
196 ; STRICT-NEXT: minsd %xmm0, %xmm1
197 ; STRICT-NEXT: movapd %xmm1, %xmm0
200 ; UNSAFE-LABEL: ogt_inverse_x:
202 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
203 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
206 ; FINITE-LABEL: ogt_inverse_x:
208 ; FINITE-NEXT: xorpd %xmm1, %xmm1
209 ; FINITE-NEXT: minsd %xmm0, %xmm1
210 ; FINITE-NEXT: movapd %xmm1, %xmm0
212 %c = fcmp ogt double %x, 0.000000e+00
213 %d = select i1 %c, double 0.000000e+00, double %x
217 define double @olt_inverse_x(double %x) {
218 ; STRICT-LABEL: olt_inverse_x:
220 ; STRICT-NEXT: xorpd %xmm1, %xmm1
221 ; STRICT-NEXT: maxsd %xmm0, %xmm1
222 ; STRICT-NEXT: movapd %xmm1, %xmm0
225 ; UNSAFE-LABEL: olt_inverse_x:
227 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
228 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
231 ; FINITE-LABEL: olt_inverse_x:
233 ; FINITE-NEXT: xorpd %xmm1, %xmm1
234 ; FINITE-NEXT: maxsd %xmm0, %xmm1
235 ; FINITE-NEXT: movapd %xmm1, %xmm0
237 %c = fcmp olt double %x, 0.000000e+00
238 %d = select i1 %c, double 0.000000e+00, double %x
242 define double @oge_x(double %x) {
243 ; STRICT-LABEL: oge_x:
245 ; STRICT-NEXT: xorpd %xmm1, %xmm1
246 ; STRICT-NEXT: cmplesd %xmm0, %xmm1
247 ; STRICT-NEXT: andpd %xmm1, %xmm0
250 ; RELAX-LABEL: oge_x:
252 ; RELAX-NEXT: xorpd %xmm1, %xmm1
253 ; RELAX-NEXT: maxsd %xmm1, %xmm0
255 %c = fcmp oge double %x, 0.000000e+00
256 %d = select i1 %c, double %x, double 0.000000e+00
260 define double @ole_x(double %x) {
261 ; STRICT-LABEL: ole_x:
263 ; STRICT-NEXT: xorpd %xmm1, %xmm1
264 ; STRICT-NEXT: movapd %xmm0, %xmm2
265 ; STRICT-NEXT: cmplesd %xmm1, %xmm2
266 ; STRICT-NEXT: andpd %xmm2, %xmm0
269 ; RELAX-LABEL: ole_x:
271 ; RELAX-NEXT: xorpd %xmm1, %xmm1
272 ; RELAX-NEXT: minsd %xmm1, %xmm0
274 %c = fcmp ole double %x, 0.000000e+00
275 %d = select i1 %c, double %x, double 0.000000e+00
279 define double @oge_inverse_x(double %x) {
280 ; STRICT-LABEL: oge_inverse_x:
282 ; STRICT-NEXT: xorpd %xmm1, %xmm1
283 ; STRICT-NEXT: cmplesd %xmm0, %xmm1
284 ; STRICT-NEXT: andnpd %xmm0, %xmm1
285 ; STRICT-NEXT: movapd %xmm1, %xmm0
288 ; UNSAFE-LABEL: oge_inverse_x:
290 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
291 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
294 ; FINITE-LABEL: oge_inverse_x:
296 ; FINITE-NEXT: xorpd %xmm1, %xmm1
297 ; FINITE-NEXT: minsd %xmm0, %xmm1
298 ; FINITE-NEXT: movapd %xmm1, %xmm0
300 %c = fcmp oge double %x, 0.000000e+00
301 %d = select i1 %c, double 0.000000e+00, double %x
305 define double @ole_inverse_x(double %x) {
306 ; STRICT-LABEL: ole_inverse_x:
308 ; STRICT-NEXT: xorpd %xmm2, %xmm2
309 ; STRICT-NEXT: movapd %xmm0, %xmm1
310 ; STRICT-NEXT: cmplesd %xmm2, %xmm1
311 ; STRICT-NEXT: andnpd %xmm0, %xmm1
312 ; STRICT-NEXT: movapd %xmm1, %xmm0
315 ; UNSAFE-LABEL: ole_inverse_x:
317 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
318 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
321 ; FINITE-LABEL: ole_inverse_x:
323 ; FINITE-NEXT: xorpd %xmm1, %xmm1
324 ; FINITE-NEXT: maxsd %xmm0, %xmm1
325 ; FINITE-NEXT: movapd %xmm1, %xmm0
327 %c = fcmp ole double %x, 0.000000e+00
328 %d = select i1 %c, double 0.000000e+00, double %x
332 define double @ugt(double %x, double %y) {
335 ; STRICT-NEXT: movapd %xmm0, %xmm2
336 ; STRICT-NEXT: cmpnlesd %xmm1, %xmm2
337 ; STRICT-NEXT: andpd %xmm2, %xmm0
338 ; STRICT-NEXT: andnpd %xmm1, %xmm2
339 ; STRICT-NEXT: orpd %xmm2, %xmm0
344 ; RELAX-NEXT: maxsd %xmm1, %xmm0
346 %c = fcmp ugt double %x, %y
347 %d = select i1 %c, double %x, double %y
351 define double @ult(double %x, double %y) {
354 ; STRICT-NEXT: movapd %xmm1, %xmm2
355 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm2
356 ; STRICT-NEXT: andpd %xmm2, %xmm0
357 ; STRICT-NEXT: andnpd %xmm1, %xmm2
358 ; STRICT-NEXT: orpd %xmm2, %xmm0
363 ; RELAX-NEXT: minsd %xmm1, %xmm0
365 %c = fcmp ult double %x, %y
366 %d = select i1 %c, double %x, double %y
370 define double @ugt_inverse(double %x, double %y) {
371 ; STRICT-LABEL: ugt_inverse:
373 ; STRICT-NEXT: movapd %xmm0, %xmm2
374 ; STRICT-NEXT: cmpnlesd %xmm1, %xmm2
375 ; STRICT-NEXT: andpd %xmm2, %xmm1
376 ; STRICT-NEXT: andnpd %xmm0, %xmm2
377 ; STRICT-NEXT: orpd %xmm1, %xmm2
378 ; STRICT-NEXT: movapd %xmm2, %xmm0
381 ; UNSAFE-LABEL: ugt_inverse:
383 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
386 ; FINITE-LABEL: ugt_inverse:
388 ; FINITE-NEXT: minsd %xmm0, %xmm1
389 ; FINITE-NEXT: movapd %xmm1, %xmm0
391 %c = fcmp ugt double %x, %y
392 %d = select i1 %c, double %y, double %x
396 define double @ult_inverse(double %x, double %y) {
397 ; STRICT-LABEL: ult_inverse:
399 ; STRICT-NEXT: movapd %xmm1, %xmm2
400 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm2
401 ; STRICT-NEXT: andpd %xmm2, %xmm1
402 ; STRICT-NEXT: andnpd %xmm0, %xmm2
403 ; STRICT-NEXT: orpd %xmm1, %xmm2
404 ; STRICT-NEXT: movapd %xmm2, %xmm0
407 ; UNSAFE-LABEL: ult_inverse:
409 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
412 ; FINITE-LABEL: ult_inverse:
414 ; FINITE-NEXT: maxsd %xmm0, %xmm1
415 ; FINITE-NEXT: movapd %xmm1, %xmm0
417 %c = fcmp ult double %x, %y
418 %d = select i1 %c, double %y, double %x
422 define double @uge(double %x, double %y) {
425 ; STRICT-NEXT: maxsd %xmm0, %xmm1
426 ; STRICT-NEXT: movapd %xmm1, %xmm0
431 ; RELAX-NEXT: maxsd %xmm1, %xmm0
433 %c = fcmp uge double %x, %y
434 %d = select i1 %c, double %x, double %y
438 define double @ule(double %x, double %y) {
441 ; STRICT-NEXT: minsd %xmm0, %xmm1
442 ; STRICT-NEXT: movapd %xmm1, %xmm0
447 ; RELAX-NEXT: minsd %xmm1, %xmm0
449 %c = fcmp ule double %x, %y
450 %d = select i1 %c, double %x, double %y
454 define double @uge_inverse(double %x, double %y) {
455 ; STRICT-LABEL: uge_inverse:
457 ; STRICT-NEXT: minsd %xmm1, %xmm0
460 ; UNSAFE-LABEL: uge_inverse:
462 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
465 ; FINITE-LABEL: uge_inverse:
467 ; FINITE-NEXT: minsd %xmm0, %xmm1
468 ; FINITE-NEXT: movapd %xmm1, %xmm0
470 %c = fcmp uge double %x, %y
471 %d = select i1 %c, double %y, double %x
475 define double @ule_inverse(double %x, double %y) {
476 ; STRICT-LABEL: ule_inverse:
478 ; STRICT-NEXT: maxsd %xmm1, %xmm0
481 ; UNSAFE-LABEL: ule_inverse:
483 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
486 ; FINITE-LABEL: ule_inverse:
488 ; FINITE-NEXT: maxsd %xmm0, %xmm1
489 ; FINITE-NEXT: movapd %xmm1, %xmm0
491 %c = fcmp ule double %x, %y
492 %d = select i1 %c, double %y, double %x
496 define double @ugt_x(double %x) {
497 ; STRICT-LABEL: ugt_x:
499 ; STRICT-NEXT: xorpd %xmm1, %xmm1
500 ; STRICT-NEXT: movapd %xmm0, %xmm2
501 ; STRICT-NEXT: cmpnlesd %xmm1, %xmm2
502 ; STRICT-NEXT: andpd %xmm2, %xmm0
505 ; RELAX-LABEL: ugt_x:
507 ; RELAX-NEXT: xorpd %xmm1, %xmm1
508 ; RELAX-NEXT: maxsd %xmm1, %xmm0
510 %c = fcmp ugt double %x, 0.000000e+00
511 %d = select i1 %c, double %x, double 0.000000e+00
515 define double @ult_x(double %x) {
516 ; STRICT-LABEL: ult_x:
518 ; STRICT-NEXT: xorpd %xmm1, %xmm1
519 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm1
520 ; STRICT-NEXT: andpd %xmm1, %xmm0
523 ; RELAX-LABEL: ult_x:
525 ; RELAX-NEXT: xorpd %xmm1, %xmm1
526 ; RELAX-NEXT: minsd %xmm1, %xmm0
528 %c = fcmp ult double %x, 0.000000e+00
529 %d = select i1 %c, double %x, double 0.000000e+00
533 define double @ugt_inverse_x(double %x) {
534 ; STRICT-LABEL: ugt_inverse_x:
536 ; STRICT-NEXT: xorpd %xmm2, %xmm2
537 ; STRICT-NEXT: movapd %xmm0, %xmm1
538 ; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
539 ; STRICT-NEXT: andnpd %xmm0, %xmm1
540 ; STRICT-NEXT: movapd %xmm1, %xmm0
543 ; UNSAFE-LABEL: ugt_inverse_x:
545 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
546 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
549 ; FINITE-LABEL: ugt_inverse_x:
551 ; FINITE-NEXT: xorpd %xmm1, %xmm1
552 ; FINITE-NEXT: minsd %xmm0, %xmm1
553 ; FINITE-NEXT: movapd %xmm1, %xmm0
555 %c = fcmp ugt double %x, 0.000000e+00
556 %d = select i1 %c, double 0.000000e+00, double %x
560 define double @ult_inverse_x(double %x) {
561 ; STRICT-LABEL: ult_inverse_x:
563 ; STRICT-NEXT: xorpd %xmm1, %xmm1
564 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm1
565 ; STRICT-NEXT: andnpd %xmm0, %xmm1
566 ; STRICT-NEXT: movapd %xmm1, %xmm0
569 ; UNSAFE-LABEL: ult_inverse_x:
571 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
572 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
575 ; FINITE-LABEL: ult_inverse_x:
577 ; FINITE-NEXT: xorpd %xmm1, %xmm1
578 ; FINITE-NEXT: maxsd %xmm0, %xmm1
579 ; FINITE-NEXT: movapd %xmm1, %xmm0
581 %c = fcmp ult double %x, 0.000000e+00
582 %d = select i1 %c, double 0.000000e+00, double %x
586 define double @uge_x(double %x) {
587 ; STRICT-LABEL: uge_x:
589 ; STRICT-NEXT: xorpd %xmm1, %xmm1
590 ; STRICT-NEXT: maxsd %xmm0, %xmm1
591 ; STRICT-NEXT: movapd %xmm1, %xmm0
594 ; RELAX-LABEL: uge_x:
596 ; RELAX-NEXT: xorpd %xmm1, %xmm1
597 ; RELAX-NEXT: maxsd %xmm1, %xmm0
599 %c = fcmp uge double %x, 0.000000e+00
600 %d = select i1 %c, double %x, double 0.000000e+00
604 define double @ule_x(double %x) {
605 ; STRICT-LABEL: ule_x:
607 ; STRICT-NEXT: xorpd %xmm1, %xmm1
608 ; STRICT-NEXT: minsd %xmm0, %xmm1
609 ; STRICT-NEXT: movapd %xmm1, %xmm0
612 ; RELAX-LABEL: ule_x:
614 ; RELAX-NEXT: xorpd %xmm1, %xmm1
615 ; RELAX-NEXT: minsd %xmm1, %xmm0
617 %c = fcmp ule double %x, 0.000000e+00
618 %d = select i1 %c, double %x, double 0.000000e+00
622 define double @uge_inverse_x(double %x) {
623 ; STRICT-LABEL: uge_inverse_x:
625 ; STRICT-NEXT: xorpd %xmm1, %xmm1
626 ; STRICT-NEXT: minsd %xmm1, %xmm0
629 ; UNSAFE-LABEL: uge_inverse_x:
631 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
632 ; UNSAFE-NEXT: minsd %xmm1, %xmm0
635 ; FINITE-LABEL: uge_inverse_x:
637 ; FINITE-NEXT: xorpd %xmm1, %xmm1
638 ; FINITE-NEXT: minsd %xmm0, %xmm1
639 ; FINITE-NEXT: movapd %xmm1, %xmm0
641 %c = fcmp uge double %x, 0.000000e+00
642 %d = select i1 %c, double 0.000000e+00, double %x
646 define double @ule_inverse_x(double %x) {
647 ; STRICT-LABEL: ule_inverse_x:
649 ; STRICT-NEXT: xorpd %xmm1, %xmm1
650 ; STRICT-NEXT: maxsd %xmm1, %xmm0
653 ; UNSAFE-LABEL: ule_inverse_x:
655 ; UNSAFE-NEXT: xorpd %xmm1, %xmm1
656 ; UNSAFE-NEXT: maxsd %xmm1, %xmm0
659 ; FINITE-LABEL: ule_inverse_x:
661 ; FINITE-NEXT: xorpd %xmm1, %xmm1
662 ; FINITE-NEXT: maxsd %xmm0, %xmm1
663 ; FINITE-NEXT: movapd %xmm1, %xmm0
665 %c = fcmp ule double %x, 0.000000e+00
666 %d = select i1 %c, double 0.000000e+00, double %x
670 define double @ogt_y(double %x) {
673 ; ALL-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
675 %c = fcmp ogt double %x, -0.000000e+00
676 %d = select i1 %c, double %x, double -0.000000e+00
680 define double @olt_y(double %x) {
683 ; ALL-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
685 %c = fcmp olt double %x, -0.000000e+00
686 %d = select i1 %c, double %x, double -0.000000e+00
690 define double @ogt_inverse_y(double %x) {
691 ; STRICT-LABEL: ogt_inverse_y:
693 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
694 ; STRICT-NEXT: minsd %xmm0, %xmm1
695 ; STRICT-NEXT: movapd %xmm1, %xmm0
698 ; UNSAFE-LABEL: ogt_inverse_y:
700 ; UNSAFE-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
703 ; FINITE-LABEL: ogt_inverse_y:
705 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
706 ; FINITE-NEXT: minsd %xmm0, %xmm1
707 ; FINITE-NEXT: movapd %xmm1, %xmm0
709 %c = fcmp ogt double %x, -0.000000e+00
710 %d = select i1 %c, double -0.000000e+00, double %x
714 define double @olt_inverse_y(double %x) {
715 ; STRICT-LABEL: olt_inverse_y:
717 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
718 ; STRICT-NEXT: maxsd %xmm0, %xmm1
719 ; STRICT-NEXT: movapd %xmm1, %xmm0
722 ; UNSAFE-LABEL: olt_inverse_y:
724 ; UNSAFE-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
727 ; FINITE-LABEL: olt_inverse_y:
729 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
730 ; FINITE-NEXT: maxsd %xmm0, %xmm1
731 ; FINITE-NEXT: movapd %xmm1, %xmm0
733 %c = fcmp olt double %x, -0.000000e+00
734 %d = select i1 %c, double -0.000000e+00, double %x
738 define double @oge_y(double %x) {
739 ; STRICT-LABEL: oge_y:
741 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
742 ; STRICT-NEXT: movapd %xmm1, %xmm2
743 ; STRICT-NEXT: cmplesd %xmm0, %xmm2
744 ; STRICT-NEXT: andpd %xmm2, %xmm0
745 ; STRICT-NEXT: andnpd %xmm1, %xmm2
746 ; STRICT-NEXT: orpd %xmm2, %xmm0
749 ; RELAX-LABEL: oge_y:
751 ; RELAX-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
753 %c = fcmp oge double %x, -0.000000e+00
754 %d = select i1 %c, double %x, double -0.000000e+00
758 define double @ole_y(double %x) {
759 ; STRICT-LABEL: ole_y:
761 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
762 ; STRICT-NEXT: movapd %xmm0, %xmm2
763 ; STRICT-NEXT: cmplesd %xmm1, %xmm2
764 ; STRICT-NEXT: andpd %xmm2, %xmm0
765 ; STRICT-NEXT: andnpd %xmm1, %xmm2
766 ; STRICT-NEXT: orpd %xmm2, %xmm0
769 ; RELAX-LABEL: ole_y:
771 ; RELAX-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
773 %c = fcmp ole double %x, -0.000000e+00
774 %d = select i1 %c, double %x, double -0.000000e+00
778 define double @oge_inverse_y(double %x) {
779 ; STRICT-LABEL: oge_inverse_y:
781 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = [-0.0E+0,0.0E+0]
782 ; STRICT-NEXT: movapd %xmm2, %xmm1
783 ; STRICT-NEXT: cmplesd %xmm0, %xmm1
784 ; STRICT-NEXT: andpd %xmm1, %xmm2
785 ; STRICT-NEXT: andnpd %xmm0, %xmm1
786 ; STRICT-NEXT: orpd %xmm2, %xmm1
787 ; STRICT-NEXT: movapd %xmm1, %xmm0
790 ; UNSAFE-LABEL: oge_inverse_y:
792 ; UNSAFE-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
795 ; FINITE-LABEL: oge_inverse_y:
797 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
798 ; FINITE-NEXT: minsd %xmm0, %xmm1
799 ; FINITE-NEXT: movapd %xmm1, %xmm0
801 %c = fcmp oge double %x, -0.000000e+00
802 %d = select i1 %c, double -0.000000e+00, double %x
806 define double @ole_inverse_y(double %x) {
807 ; STRICT-LABEL: ole_inverse_y:
809 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = [-0.0E+0,0.0E+0]
810 ; STRICT-NEXT: movapd %xmm0, %xmm1
811 ; STRICT-NEXT: cmplesd %xmm2, %xmm1
812 ; STRICT-NEXT: andpd %xmm1, %xmm2
813 ; STRICT-NEXT: andnpd %xmm0, %xmm1
814 ; STRICT-NEXT: orpd %xmm2, %xmm1
815 ; STRICT-NEXT: movapd %xmm1, %xmm0
818 ; UNSAFE-LABEL: ole_inverse_y:
820 ; UNSAFE-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
823 ; FINITE-LABEL: ole_inverse_y:
825 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
826 ; FINITE-NEXT: maxsd %xmm0, %xmm1
827 ; FINITE-NEXT: movapd %xmm1, %xmm0
829 %c = fcmp ole double %x, -0.000000e+00
830 %d = select i1 %c, double -0.000000e+00, double %x
834 define double @ugt_y(double %x) {
835 ; STRICT-LABEL: ugt_y:
837 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
838 ; STRICT-NEXT: movapd %xmm0, %xmm2
839 ; STRICT-NEXT: cmpnlesd %xmm1, %xmm2
840 ; STRICT-NEXT: andpd %xmm2, %xmm0
841 ; STRICT-NEXT: andnpd %xmm1, %xmm2
842 ; STRICT-NEXT: orpd %xmm2, %xmm0
845 ; RELAX-LABEL: ugt_y:
847 ; RELAX-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
849 %c = fcmp ugt double %x, -0.000000e+00
850 %d = select i1 %c, double %x, double -0.000000e+00
854 define double @ult_y(double %x) {
855 ; STRICT-LABEL: ult_y:
857 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
858 ; STRICT-NEXT: movapd %xmm1, %xmm2
859 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm2
860 ; STRICT-NEXT: andpd %xmm2, %xmm0
861 ; STRICT-NEXT: andnpd %xmm1, %xmm2
862 ; STRICT-NEXT: orpd %xmm2, %xmm0
865 ; RELAX-LABEL: ult_y:
867 ; RELAX-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
869 %c = fcmp ult double %x, -0.000000e+00
870 %d = select i1 %c, double %x, double -0.000000e+00
874 define double @ugt_inverse_y(double %x) {
875 ; STRICT-LABEL: ugt_inverse_y:
877 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = [-0.0E+0,0.0E+0]
878 ; STRICT-NEXT: movapd %xmm0, %xmm1
879 ; STRICT-NEXT: cmpnlesd %xmm2, %xmm1
880 ; STRICT-NEXT: andpd %xmm1, %xmm2
881 ; STRICT-NEXT: andnpd %xmm0, %xmm1
882 ; STRICT-NEXT: orpd %xmm2, %xmm1
883 ; STRICT-NEXT: movapd %xmm1, %xmm0
886 ; UNSAFE-LABEL: ugt_inverse_y:
888 ; UNSAFE-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
891 ; FINITE-LABEL: ugt_inverse_y:
893 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
894 ; FINITE-NEXT: minsd %xmm0, %xmm1
895 ; FINITE-NEXT: movapd %xmm1, %xmm0
897 %c = fcmp ugt double %x, -0.000000e+00
898 %d = select i1 %c, double -0.000000e+00, double %x
902 define double @ult_inverse_y(double %x) {
903 ; STRICT-LABEL: ult_inverse_y:
905 ; STRICT-NEXT: movsd {{.*#+}} xmm2 = [-0.0E+0,0.0E+0]
906 ; STRICT-NEXT: movapd %xmm2, %xmm1
907 ; STRICT-NEXT: cmpnlesd %xmm0, %xmm1
908 ; STRICT-NEXT: andpd %xmm1, %xmm2
909 ; STRICT-NEXT: andnpd %xmm0, %xmm1
910 ; STRICT-NEXT: orpd %xmm2, %xmm1
911 ; STRICT-NEXT: movapd %xmm1, %xmm0
914 ; UNSAFE-LABEL: ult_inverse_y:
916 ; UNSAFE-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
919 ; FINITE-LABEL: ult_inverse_y:
921 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
922 ; FINITE-NEXT: maxsd %xmm0, %xmm1
923 ; FINITE-NEXT: movapd %xmm1, %xmm0
925 %c = fcmp ult double %x, -0.000000e+00
926 %d = select i1 %c, double -0.000000e+00, double %x
930 define double @uge_y(double %x) {
931 ; STRICT-LABEL: uge_y:
933 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
934 ; STRICT-NEXT: maxsd %xmm0, %xmm1
935 ; STRICT-NEXT: movapd %xmm1, %xmm0
938 ; RELAX-LABEL: uge_y:
940 ; RELAX-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
942 %c = fcmp uge double %x, -0.000000e+00
943 %d = select i1 %c, double %x, double -0.000000e+00
947 define double @ule_y(double %x) {
948 ; STRICT-LABEL: ule_y:
950 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
951 ; STRICT-NEXT: minsd %xmm0, %xmm1
952 ; STRICT-NEXT: movapd %xmm1, %xmm0
955 ; RELAX-LABEL: ule_y:
957 ; RELAX-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
959 %c = fcmp ule double %x, -0.000000e+00
960 %d = select i1 %c, double %x, double -0.000000e+00
964 define double @uge_inverse_y(double %x) {
965 ; STRICT-LABEL: uge_inverse_y:
967 ; STRICT-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
970 ; UNSAFE-LABEL: uge_inverse_y:
972 ; UNSAFE-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
975 ; FINITE-LABEL: uge_inverse_y:
977 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
978 ; FINITE-NEXT: minsd %xmm0, %xmm1
979 ; FINITE-NEXT: movapd %xmm1, %xmm0
981 %c = fcmp uge double %x, -0.000000e+00
982 %d = select i1 %c, double -0.000000e+00, double %x
986 define double @ule_inverse_y(double %x) {
987 ; STRICT-LABEL: ule_inverse_y:
989 ; STRICT-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
992 ; UNSAFE-LABEL: ule_inverse_y:
994 ; UNSAFE-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
997 ; FINITE-LABEL: ule_inverse_y:
999 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [-0.0E+0,0.0E+0]
1000 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1001 ; FINITE-NEXT: movapd %xmm1, %xmm0
1003 %c = fcmp ule double %x, -0.000000e+00
1004 %d = select i1 %c, double -0.000000e+00, double %x
1008 ; Test a few more misc. cases.
1010 define double @clampTo3k_a(double %x) {
1011 ; STRICT-LABEL: clampTo3k_a:
1013 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1014 ; STRICT-NEXT: minsd %xmm0, %xmm1
1015 ; STRICT-NEXT: movapd %xmm1, %xmm0
1018 ; UNSAFE-LABEL: clampTo3k_a:
1020 ; UNSAFE-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1023 ; FINITE-LABEL: clampTo3k_a:
1025 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1026 ; FINITE-NEXT: minsd %xmm0, %xmm1
1027 ; FINITE-NEXT: movapd %xmm1, %xmm0
1029 %t0 = fcmp ogt double %x, 3.000000e+03
1030 %y = select i1 %t0, double 3.000000e+03, double %x
1034 define double @clampTo3k_b(double %x) {
1035 ; STRICT-LABEL: clampTo3k_b:
1037 ; STRICT-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1040 ; UNSAFE-LABEL: clampTo3k_b:
1042 ; UNSAFE-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1045 ; FINITE-LABEL: clampTo3k_b:
1047 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1048 ; FINITE-NEXT: minsd %xmm0, %xmm1
1049 ; FINITE-NEXT: movapd %xmm1, %xmm0
1051 %t0 = fcmp uge double %x, 3.000000e+03
1052 %y = select i1 %t0, double 3.000000e+03, double %x
1056 define double @clampTo3k_c(double %x) {
1057 ; STRICT-LABEL: clampTo3k_c:
1059 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1060 ; STRICT-NEXT: maxsd %xmm0, %xmm1
1061 ; STRICT-NEXT: movapd %xmm1, %xmm0
1064 ; UNSAFE-LABEL: clampTo3k_c:
1066 ; UNSAFE-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1069 ; FINITE-LABEL: clampTo3k_c:
1071 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1072 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1073 ; FINITE-NEXT: movapd %xmm1, %xmm0
1075 %t0 = fcmp olt double %x, 3.000000e+03
1076 %y = select i1 %t0, double 3.000000e+03, double %x
1080 define double @clampTo3k_d(double %x) {
1081 ; STRICT-LABEL: clampTo3k_d:
1083 ; STRICT-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1086 ; UNSAFE-LABEL: clampTo3k_d:
1088 ; UNSAFE-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1091 ; FINITE-LABEL: clampTo3k_d:
1093 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1094 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1095 ; FINITE-NEXT: movapd %xmm1, %xmm0
1097 %t0 = fcmp ule double %x, 3.000000e+03
1098 %y = select i1 %t0, double 3.000000e+03, double %x
1102 define double @clampTo3k_e(double %x) {
1103 ; STRICT-LABEL: clampTo3k_e:
1105 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1106 ; STRICT-NEXT: maxsd %xmm0, %xmm1
1107 ; STRICT-NEXT: movapd %xmm1, %xmm0
1110 ; UNSAFE-LABEL: clampTo3k_e:
1112 ; UNSAFE-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1115 ; FINITE-LABEL: clampTo3k_e:
1117 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1118 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1119 ; FINITE-NEXT: movapd %xmm1, %xmm0
1121 %t0 = fcmp olt double %x, 3.000000e+03
1122 %y = select i1 %t0, double 3.000000e+03, double %x
1126 define double @clampTo3k_f(double %x) {
1127 ; STRICT-LABEL: clampTo3k_f:
1129 ; STRICT-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1132 ; UNSAFE-LABEL: clampTo3k_f:
1134 ; UNSAFE-NEXT: maxsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1137 ; FINITE-LABEL: clampTo3k_f:
1139 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1140 ; FINITE-NEXT: maxsd %xmm0, %xmm1
1141 ; FINITE-NEXT: movapd %xmm1, %xmm0
1143 %t0 = fcmp ule double %x, 3.000000e+03
1144 %y = select i1 %t0, double 3.000000e+03, double %x
1148 define double @clampTo3k_g(double %x) {
1149 ; STRICT-LABEL: clampTo3k_g:
1151 ; STRICT-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1152 ; STRICT-NEXT: minsd %xmm0, %xmm1
1153 ; STRICT-NEXT: movapd %xmm1, %xmm0
1156 ; UNSAFE-LABEL: clampTo3k_g:
1158 ; UNSAFE-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1161 ; FINITE-LABEL: clampTo3k_g:
1163 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1164 ; FINITE-NEXT: minsd %xmm0, %xmm1
1165 ; FINITE-NEXT: movapd %xmm1, %xmm0
1167 %t0 = fcmp ogt double %x, 3.000000e+03
1168 %y = select i1 %t0, double 3.000000e+03, double %x
1172 define double @clampTo3k_h(double %x) {
1173 ; STRICT-LABEL: clampTo3k_h:
1175 ; STRICT-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1178 ; UNSAFE-LABEL: clampTo3k_h:
1180 ; UNSAFE-NEXT: minsd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1183 ; FINITE-LABEL: clampTo3k_h:
1185 ; FINITE-NEXT: movsd {{.*#+}} xmm1 = [3.0E+3,0.0E+0]
1186 ; FINITE-NEXT: minsd %xmm0, %xmm1
1187 ; FINITE-NEXT: movapd %xmm1, %xmm0
1189 %t0 = fcmp uge double %x, 3.000000e+03
1190 %y = select i1 %t0, double 3.000000e+03, double %x
1194 define <2 x double> @test_maxpd(<2 x double> %x, <2 x double> %y) {
1195 ; STRICT-LABEL: test_maxpd:
1197 ; STRICT-NEXT: movapd %xmm0, %xmm2
1198 ; STRICT-NEXT: movapd %xmm1, %xmm0
1199 ; STRICT-NEXT: cmplepd %xmm2, %xmm0
1200 ; STRICT-NEXT: blendvpd %xmm0, %xmm2, %xmm1
1201 ; STRICT-NEXT: movapd %xmm1, %xmm0
1204 ; RELAX-LABEL: test_maxpd:
1206 ; RELAX-NEXT: maxpd %xmm1, %xmm0
1208 %max_is_x = fcmp oge <2 x double> %x, %y
1209 %max = select <2 x i1> %max_is_x, <2 x double> %x, <2 x double> %y
1210 ret <2 x double> %max
1213 define <2 x double> @test_minpd(<2 x double> %x, <2 x double> %y) {
1214 ; STRICT-LABEL: test_minpd:
1216 ; STRICT-NEXT: movapd %xmm0, %xmm2
1217 ; STRICT-NEXT: cmplepd %xmm1, %xmm0
1218 ; STRICT-NEXT: blendvpd %xmm0, %xmm2, %xmm1
1219 ; STRICT-NEXT: movapd %xmm1, %xmm0
1222 ; RELAX-LABEL: test_minpd:
1224 ; RELAX-NEXT: minpd %xmm1, %xmm0
1226 %min_is_x = fcmp ole <2 x double> %x, %y
1227 %min = select <2 x i1> %min_is_x, <2 x double> %x, <2 x double> %y
1228 ret <2 x double> %min
1231 define <4 x float> @test_maxps(<4 x float> %x, <4 x float> %y) {
1232 ; STRICT-LABEL: test_maxps:
1234 ; STRICT-NEXT: movaps %xmm0, %xmm2
1235 ; STRICT-NEXT: movaps %xmm1, %xmm0
1236 ; STRICT-NEXT: cmpleps %xmm2, %xmm0
1237 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1238 ; STRICT-NEXT: movaps %xmm1, %xmm0
1241 ; RELAX-LABEL: test_maxps:
1243 ; RELAX-NEXT: maxps %xmm1, %xmm0
1245 %max_is_x = fcmp oge <4 x float> %x, %y
1246 %max = select <4 x i1> %max_is_x, <4 x float> %x, <4 x float> %y
1247 ret <4 x float> %max
1250 define <4 x float> @test_minps(<4 x float> %x, <4 x float> %y) {
1251 ; STRICT-LABEL: test_minps:
1253 ; STRICT-NEXT: movaps %xmm0, %xmm2
1254 ; STRICT-NEXT: cmpleps %xmm1, %xmm0
1255 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1256 ; STRICT-NEXT: movaps %xmm1, %xmm0
1259 ; RELAX-LABEL: test_minps:
1261 ; RELAX-NEXT: minps %xmm1, %xmm0
1263 %min_is_x = fcmp ole <4 x float> %x, %y
1264 %min = select <4 x i1> %min_is_x, <4 x float> %x, <4 x float> %y
1265 ret <4 x float> %min
1268 define <2 x float> @test_maxps_illegal_v2f32(<2 x float> %x, <2 x float> %y) {
1269 ; STRICT-LABEL: test_maxps_illegal_v2f32:
1271 ; STRICT-NEXT: movaps %xmm0, %xmm2
1272 ; STRICT-NEXT: movaps %xmm1, %xmm0
1273 ; STRICT-NEXT: cmpleps %xmm2, %xmm0
1274 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1275 ; STRICT-NEXT: movaps %xmm1, %xmm0
1278 ; RELAX-LABEL: test_maxps_illegal_v2f32:
1280 ; RELAX-NEXT: maxps %xmm1, %xmm0
1282 %max_is_x = fcmp oge <2 x float> %x, %y
1283 %max = select <2 x i1> %max_is_x, <2 x float> %x, <2 x float> %y
1284 ret <2 x float> %max
1287 define <2 x float> @test_minps_illegal_v2f32(<2 x float> %x, <2 x float> %y) {
1288 ; STRICT-LABEL: test_minps_illegal_v2f32:
1290 ; STRICT-NEXT: movaps %xmm0, %xmm2
1291 ; STRICT-NEXT: cmpleps %xmm1, %xmm0
1292 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1293 ; STRICT-NEXT: movaps %xmm1, %xmm0
1296 ; RELAX-LABEL: test_minps_illegal_v2f32:
1298 ; RELAX-NEXT: minps %xmm1, %xmm0
1300 %min_is_x = fcmp ole <2 x float> %x, %y
1301 %min = select <2 x i1> %min_is_x, <2 x float> %x, <2 x float> %y
1302 ret <2 x float> %min
1305 define <3 x float> @test_maxps_illegal_v3f32(<3 x float> %x, <3 x float> %y) {
1306 ; STRICT-LABEL: test_maxps_illegal_v3f32:
1308 ; STRICT-NEXT: movaps %xmm0, %xmm2
1309 ; STRICT-NEXT: movaps %xmm1, %xmm0
1310 ; STRICT-NEXT: cmpleps %xmm2, %xmm0
1311 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1312 ; STRICT-NEXT: movaps %xmm1, %xmm0
1315 ; RELAX-LABEL: test_maxps_illegal_v3f32:
1317 ; RELAX-NEXT: maxps %xmm1, %xmm0
1319 %max_is_x = fcmp oge <3 x float> %x, %y
1320 %max = select <3 x i1> %max_is_x, <3 x float> %x, <3 x float> %y
1321 ret <3 x float> %max
1324 define <3 x float> @test_minps_illegal_v3f32(<3 x float> %x, <3 x float> %y) {
1325 ; STRICT-LABEL: test_minps_illegal_v3f32:
1327 ; STRICT-NEXT: movaps %xmm0, %xmm2
1328 ; STRICT-NEXT: cmpleps %xmm1, %xmm0
1329 ; STRICT-NEXT: blendvps %xmm0, %xmm2, %xmm1
1330 ; STRICT-NEXT: movaps %xmm1, %xmm0
1333 ; RELAX-LABEL: test_minps_illegal_v3f32:
1335 ; RELAX-NEXT: minps %xmm1, %xmm0
1337 %min_is_x = fcmp ole <3 x float> %x, %y
1338 %min = select <3 x i1> %min_is_x, <3 x float> %x, <3 x float> %y
1339 ret <3 x float> %min
1343 ; https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13838
1344 define float @ossfuzz13838(float %x) {
1345 ; ALL-LABEL: ossfuzz13838:
1346 ; ALL: # %bb.0: # %bb
1347 ; ALL-NEXT: movss {{.*#+}} xmm0 = [2.55E+2,0.0E+0,0.0E+0,0.0E+0]
1350 %cmp2 = fcmp fast olt float %x, 2.550000e+02
1351 %B1 = urem i1 %cmp2, %cmp2
1352 %min = select i1 %B1, float %x, float 2.550000e+02
1353 %B = frem float %min, 0x47EFFFFFE0000000
1354 %cmp1 = fcmp fast olt float %B, 1.000000e+00
1355 %r = select i1 %cmp1, float 1.000000e+00, float %min