1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -verify-machineinstrs | FileCheck %s --check-prefix=SSE
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -verify-machineinstrs -fast-isel -fast-isel-abort=1 | FileCheck %s --check-prefix=SSE
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -verify-machineinstrs -mattr=avx | FileCheck %s --check-prefix=AVX
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -verify-machineinstrs -fast-isel -fast-isel-abort=1 -mattr=avx | FileCheck %s --check-prefix=AVX
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -verify-machineinstrs -mattr=avx512f | FileCheck %s --check-prefix=AVX512
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -verify-machineinstrs -fast-isel -fast-isel-abort=1 -mattr=avx512f | FileCheck %s --check-prefix=AVX512
9 ; Test all cmp predicates that can be used with SSE.
11 define float @select_fcmp_oeq_f32(float %a, float %b, float %c, float %d) {
12 ; SSE-LABEL: select_fcmp_oeq_f32:
14 ; SSE-NEXT: cmpeqss %xmm1, %xmm0
15 ; SSE-NEXT: andps %xmm0, %xmm2
16 ; SSE-NEXT: andnps %xmm3, %xmm0
17 ; SSE-NEXT: orps %xmm2, %xmm0
20 ; AVX-LABEL: select_fcmp_oeq_f32:
22 ; AVX-NEXT: vcmpeqss %xmm1, %xmm0, %xmm0
23 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
26 ; AVX512-LABEL: select_fcmp_oeq_f32:
28 ; AVX512-NEXT: vcmpeqss %xmm1, %xmm0, %k1
29 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
30 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
32 %1 = fcmp oeq float %a, %b
33 %2 = select i1 %1, float %c, float %d
37 define double @select_fcmp_oeq_f64(double %a, double %b, double %c, double %d) {
38 ; SSE-LABEL: select_fcmp_oeq_f64:
40 ; SSE-NEXT: cmpeqsd %xmm1, %xmm0
41 ; SSE-NEXT: andpd %xmm0, %xmm2
42 ; SSE-NEXT: andnpd %xmm3, %xmm0
43 ; SSE-NEXT: orpd %xmm2, %xmm0
46 ; AVX-LABEL: select_fcmp_oeq_f64:
48 ; AVX-NEXT: vcmpeqsd %xmm1, %xmm0, %xmm0
49 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
52 ; AVX512-LABEL: select_fcmp_oeq_f64:
54 ; AVX512-NEXT: vcmpeqsd %xmm1, %xmm0, %k1
55 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
56 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
58 %1 = fcmp oeq double %a, %b
59 %2 = select i1 %1, double %c, double %d
63 define float @select_fcmp_ogt_f32(float %a, float %b, float %c, float %d) {
64 ; SSE-LABEL: select_fcmp_ogt_f32:
66 ; SSE-NEXT: cmpltss %xmm0, %xmm1
67 ; SSE-NEXT: andps %xmm1, %xmm2
68 ; SSE-NEXT: andnps %xmm3, %xmm1
69 ; SSE-NEXT: orps %xmm2, %xmm1
70 ; SSE-NEXT: movaps %xmm1, %xmm0
73 ; AVX-LABEL: select_fcmp_ogt_f32:
75 ; AVX-NEXT: vcmpltss %xmm0, %xmm1, %xmm0
76 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
79 ; AVX512-LABEL: select_fcmp_ogt_f32:
81 ; AVX512-NEXT: vcmpltss %xmm0, %xmm1, %k1
82 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
83 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
85 %1 = fcmp ogt float %a, %b
86 %2 = select i1 %1, float %c, float %d
90 define double @select_fcmp_ogt_f64(double %a, double %b, double %c, double %d) {
91 ; SSE-LABEL: select_fcmp_ogt_f64:
93 ; SSE-NEXT: cmpltsd %xmm0, %xmm1
94 ; SSE-NEXT: andpd %xmm1, %xmm2
95 ; SSE-NEXT: andnpd %xmm3, %xmm1
96 ; SSE-NEXT: orpd %xmm2, %xmm1
97 ; SSE-NEXT: movapd %xmm1, %xmm0
100 ; AVX-LABEL: select_fcmp_ogt_f64:
102 ; AVX-NEXT: vcmpltsd %xmm0, %xmm1, %xmm0
103 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
106 ; AVX512-LABEL: select_fcmp_ogt_f64:
108 ; AVX512-NEXT: vcmpltsd %xmm0, %xmm1, %k1
109 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
110 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
112 %1 = fcmp ogt double %a, %b
113 %2 = select i1 %1, double %c, double %d
117 define float @select_fcmp_oge_f32(float %a, float %b, float %c, float %d) {
118 ; SSE-LABEL: select_fcmp_oge_f32:
120 ; SSE-NEXT: cmpless %xmm0, %xmm1
121 ; SSE-NEXT: andps %xmm1, %xmm2
122 ; SSE-NEXT: andnps %xmm3, %xmm1
123 ; SSE-NEXT: orps %xmm2, %xmm1
124 ; SSE-NEXT: movaps %xmm1, %xmm0
127 ; AVX-LABEL: select_fcmp_oge_f32:
129 ; AVX-NEXT: vcmpless %xmm0, %xmm1, %xmm0
130 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
133 ; AVX512-LABEL: select_fcmp_oge_f32:
135 ; AVX512-NEXT: vcmpless %xmm0, %xmm1, %k1
136 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
137 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
139 %1 = fcmp oge float %a, %b
140 %2 = select i1 %1, float %c, float %d
144 define double @select_fcmp_oge_f64(double %a, double %b, double %c, double %d) {
145 ; SSE-LABEL: select_fcmp_oge_f64:
147 ; SSE-NEXT: cmplesd %xmm0, %xmm1
148 ; SSE-NEXT: andpd %xmm1, %xmm2
149 ; SSE-NEXT: andnpd %xmm3, %xmm1
150 ; SSE-NEXT: orpd %xmm2, %xmm1
151 ; SSE-NEXT: movapd %xmm1, %xmm0
154 ; AVX-LABEL: select_fcmp_oge_f64:
156 ; AVX-NEXT: vcmplesd %xmm0, %xmm1, %xmm0
157 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
160 ; AVX512-LABEL: select_fcmp_oge_f64:
162 ; AVX512-NEXT: vcmplesd %xmm0, %xmm1, %k1
163 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
164 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
166 %1 = fcmp oge double %a, %b
167 %2 = select i1 %1, double %c, double %d
171 define float @select_fcmp_olt_f32(float %a, float %b, float %c, float %d) {
172 ; SSE-LABEL: select_fcmp_olt_f32:
174 ; SSE-NEXT: cmpltss %xmm1, %xmm0
175 ; SSE-NEXT: andps %xmm0, %xmm2
176 ; SSE-NEXT: andnps %xmm3, %xmm0
177 ; SSE-NEXT: orps %xmm2, %xmm0
180 ; AVX-LABEL: select_fcmp_olt_f32:
182 ; AVX-NEXT: vcmpltss %xmm1, %xmm0, %xmm0
183 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
186 ; AVX512-LABEL: select_fcmp_olt_f32:
188 ; AVX512-NEXT: vcmpltss %xmm1, %xmm0, %k1
189 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
190 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
192 %1 = fcmp olt float %a, %b
193 %2 = select i1 %1, float %c, float %d
197 define double @select_fcmp_olt_f64(double %a, double %b, double %c, double %d) {
198 ; SSE-LABEL: select_fcmp_olt_f64:
200 ; SSE-NEXT: cmpltsd %xmm1, %xmm0
201 ; SSE-NEXT: andpd %xmm0, %xmm2
202 ; SSE-NEXT: andnpd %xmm3, %xmm0
203 ; SSE-NEXT: orpd %xmm2, %xmm0
206 ; AVX-LABEL: select_fcmp_olt_f64:
208 ; AVX-NEXT: vcmpltsd %xmm1, %xmm0, %xmm0
209 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
212 ; AVX512-LABEL: select_fcmp_olt_f64:
214 ; AVX512-NEXT: vcmpltsd %xmm1, %xmm0, %k1
215 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
216 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
218 %1 = fcmp olt double %a, %b
219 %2 = select i1 %1, double %c, double %d
223 define float @select_fcmp_ole_f32(float %a, float %b, float %c, float %d) {
224 ; SSE-LABEL: select_fcmp_ole_f32:
226 ; SSE-NEXT: cmpless %xmm1, %xmm0
227 ; SSE-NEXT: andps %xmm0, %xmm2
228 ; SSE-NEXT: andnps %xmm3, %xmm0
229 ; SSE-NEXT: orps %xmm2, %xmm0
232 ; AVX-LABEL: select_fcmp_ole_f32:
234 ; AVX-NEXT: vcmpless %xmm1, %xmm0, %xmm0
235 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
238 ; AVX512-LABEL: select_fcmp_ole_f32:
240 ; AVX512-NEXT: vcmpless %xmm1, %xmm0, %k1
241 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
242 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
244 %1 = fcmp ole float %a, %b
245 %2 = select i1 %1, float %c, float %d
249 define double @select_fcmp_ole_f64(double %a, double %b, double %c, double %d) {
250 ; SSE-LABEL: select_fcmp_ole_f64:
252 ; SSE-NEXT: cmplesd %xmm1, %xmm0
253 ; SSE-NEXT: andpd %xmm0, %xmm2
254 ; SSE-NEXT: andnpd %xmm3, %xmm0
255 ; SSE-NEXT: orpd %xmm2, %xmm0
258 ; AVX-LABEL: select_fcmp_ole_f64:
260 ; AVX-NEXT: vcmplesd %xmm1, %xmm0, %xmm0
261 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
264 ; AVX512-LABEL: select_fcmp_ole_f64:
266 ; AVX512-NEXT: vcmplesd %xmm1, %xmm0, %k1
267 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
268 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
270 %1 = fcmp ole double %a, %b
271 %2 = select i1 %1, double %c, double %d
275 define float @select_fcmp_ord_f32(float %a, float %b, float %c, float %d) {
276 ; SSE-LABEL: select_fcmp_ord_f32:
278 ; SSE-NEXT: cmpordss %xmm1, %xmm0
279 ; SSE-NEXT: andps %xmm0, %xmm2
280 ; SSE-NEXT: andnps %xmm3, %xmm0
281 ; SSE-NEXT: orps %xmm2, %xmm0
284 ; AVX-LABEL: select_fcmp_ord_f32:
286 ; AVX-NEXT: vcmpordss %xmm1, %xmm0, %xmm0
287 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
290 ; AVX512-LABEL: select_fcmp_ord_f32:
292 ; AVX512-NEXT: vcmpordss %xmm1, %xmm0, %k1
293 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
294 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
296 %1 = fcmp ord float %a, %b
297 %2 = select i1 %1, float %c, float %d
301 define double @select_fcmp_ord_f64(double %a, double %b, double %c, double %d) {
302 ; SSE-LABEL: select_fcmp_ord_f64:
304 ; SSE-NEXT: cmpordsd %xmm1, %xmm0
305 ; SSE-NEXT: andpd %xmm0, %xmm2
306 ; SSE-NEXT: andnpd %xmm3, %xmm0
307 ; SSE-NEXT: orpd %xmm2, %xmm0
310 ; AVX-LABEL: select_fcmp_ord_f64:
312 ; AVX-NEXT: vcmpordsd %xmm1, %xmm0, %xmm0
313 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
316 ; AVX512-LABEL: select_fcmp_ord_f64:
318 ; AVX512-NEXT: vcmpordsd %xmm1, %xmm0, %k1
319 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
320 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
322 %1 = fcmp ord double %a, %b
323 %2 = select i1 %1, double %c, double %d
327 define float @select_fcmp_uno_f32(float %a, float %b, float %c, float %d) {
328 ; SSE-LABEL: select_fcmp_uno_f32:
330 ; SSE-NEXT: cmpunordss %xmm1, %xmm0
331 ; SSE-NEXT: andps %xmm0, %xmm2
332 ; SSE-NEXT: andnps %xmm3, %xmm0
333 ; SSE-NEXT: orps %xmm2, %xmm0
336 ; AVX-LABEL: select_fcmp_uno_f32:
338 ; AVX-NEXT: vcmpunordss %xmm1, %xmm0, %xmm0
339 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
342 ; AVX512-LABEL: select_fcmp_uno_f32:
344 ; AVX512-NEXT: vcmpunordss %xmm1, %xmm0, %k1
345 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
346 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
348 %1 = fcmp uno float %a, %b
349 %2 = select i1 %1, float %c, float %d
353 define double @select_fcmp_uno_f64(double %a, double %b, double %c, double %d) {
354 ; SSE-LABEL: select_fcmp_uno_f64:
356 ; SSE-NEXT: cmpunordsd %xmm1, %xmm0
357 ; SSE-NEXT: andpd %xmm0, %xmm2
358 ; SSE-NEXT: andnpd %xmm3, %xmm0
359 ; SSE-NEXT: orpd %xmm2, %xmm0
362 ; AVX-LABEL: select_fcmp_uno_f64:
364 ; AVX-NEXT: vcmpunordsd %xmm1, %xmm0, %xmm0
365 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
368 ; AVX512-LABEL: select_fcmp_uno_f64:
370 ; AVX512-NEXT: vcmpunordsd %xmm1, %xmm0, %k1
371 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
372 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
374 %1 = fcmp uno double %a, %b
375 %2 = select i1 %1, double %c, double %d
379 define float @select_fcmp_ugt_f32(float %a, float %b, float %c, float %d) {
380 ; SSE-LABEL: select_fcmp_ugt_f32:
382 ; SSE-NEXT: cmpnless %xmm1, %xmm0
383 ; SSE-NEXT: andps %xmm0, %xmm2
384 ; SSE-NEXT: andnps %xmm3, %xmm0
385 ; SSE-NEXT: orps %xmm2, %xmm0
388 ; AVX-LABEL: select_fcmp_ugt_f32:
390 ; AVX-NEXT: vcmpnless %xmm1, %xmm0, %xmm0
391 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
394 ; AVX512-LABEL: select_fcmp_ugt_f32:
396 ; AVX512-NEXT: vcmpnless %xmm1, %xmm0, %k1
397 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
398 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
400 %1 = fcmp ugt float %a, %b
401 %2 = select i1 %1, float %c, float %d
405 define double @select_fcmp_ugt_f64(double %a, double %b, double %c, double %d) {
406 ; SSE-LABEL: select_fcmp_ugt_f64:
408 ; SSE-NEXT: cmpnlesd %xmm1, %xmm0
409 ; SSE-NEXT: andpd %xmm0, %xmm2
410 ; SSE-NEXT: andnpd %xmm3, %xmm0
411 ; SSE-NEXT: orpd %xmm2, %xmm0
414 ; AVX-LABEL: select_fcmp_ugt_f64:
416 ; AVX-NEXT: vcmpnlesd %xmm1, %xmm0, %xmm0
417 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
420 ; AVX512-LABEL: select_fcmp_ugt_f64:
422 ; AVX512-NEXT: vcmpnlesd %xmm1, %xmm0, %k1
423 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
424 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
426 %1 = fcmp ugt double %a, %b
427 %2 = select i1 %1, double %c, double %d
431 define float @select_fcmp_uge_f32(float %a, float %b, float %c, float %d) {
432 ; SSE-LABEL: select_fcmp_uge_f32:
434 ; SSE-NEXT: cmpnltss %xmm1, %xmm0
435 ; SSE-NEXT: andps %xmm0, %xmm2
436 ; SSE-NEXT: andnps %xmm3, %xmm0
437 ; SSE-NEXT: orps %xmm2, %xmm0
440 ; AVX-LABEL: select_fcmp_uge_f32:
442 ; AVX-NEXT: vcmpnltss %xmm1, %xmm0, %xmm0
443 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
446 ; AVX512-LABEL: select_fcmp_uge_f32:
448 ; AVX512-NEXT: vcmpnltss %xmm1, %xmm0, %k1
449 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
450 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
452 %1 = fcmp uge float %a, %b
453 %2 = select i1 %1, float %c, float %d
457 define double @select_fcmp_uge_f64(double %a, double %b, double %c, double %d) {
458 ; SSE-LABEL: select_fcmp_uge_f64:
460 ; SSE-NEXT: cmpnltsd %xmm1, %xmm0
461 ; SSE-NEXT: andpd %xmm0, %xmm2
462 ; SSE-NEXT: andnpd %xmm3, %xmm0
463 ; SSE-NEXT: orpd %xmm2, %xmm0
466 ; AVX-LABEL: select_fcmp_uge_f64:
468 ; AVX-NEXT: vcmpnltsd %xmm1, %xmm0, %xmm0
469 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
472 ; AVX512-LABEL: select_fcmp_uge_f64:
474 ; AVX512-NEXT: vcmpnltsd %xmm1, %xmm0, %k1
475 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
476 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
478 %1 = fcmp uge double %a, %b
479 %2 = select i1 %1, double %c, double %d
483 define float @select_fcmp_ult_f32(float %a, float %b, float %c, float %d) {
484 ; SSE-LABEL: select_fcmp_ult_f32:
486 ; SSE-NEXT: cmpnless %xmm0, %xmm1
487 ; SSE-NEXT: andps %xmm1, %xmm2
488 ; SSE-NEXT: andnps %xmm3, %xmm1
489 ; SSE-NEXT: orps %xmm2, %xmm1
490 ; SSE-NEXT: movaps %xmm1, %xmm0
493 ; AVX-LABEL: select_fcmp_ult_f32:
495 ; AVX-NEXT: vcmpnless %xmm0, %xmm1, %xmm0
496 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
499 ; AVX512-LABEL: select_fcmp_ult_f32:
501 ; AVX512-NEXT: vcmpnless %xmm0, %xmm1, %k1
502 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
503 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
505 %1 = fcmp ult float %a, %b
506 %2 = select i1 %1, float %c, float %d
510 define double @select_fcmp_ult_f64(double %a, double %b, double %c, double %d) {
511 ; SSE-LABEL: select_fcmp_ult_f64:
513 ; SSE-NEXT: cmpnlesd %xmm0, %xmm1
514 ; SSE-NEXT: andpd %xmm1, %xmm2
515 ; SSE-NEXT: andnpd %xmm3, %xmm1
516 ; SSE-NEXT: orpd %xmm2, %xmm1
517 ; SSE-NEXT: movapd %xmm1, %xmm0
520 ; AVX-LABEL: select_fcmp_ult_f64:
522 ; AVX-NEXT: vcmpnlesd %xmm0, %xmm1, %xmm0
523 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
526 ; AVX512-LABEL: select_fcmp_ult_f64:
528 ; AVX512-NEXT: vcmpnlesd %xmm0, %xmm1, %k1
529 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
530 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
532 %1 = fcmp ult double %a, %b
533 %2 = select i1 %1, double %c, double %d
537 define float @select_fcmp_ule_f32(float %a, float %b, float %c, float %d) {
538 ; SSE-LABEL: select_fcmp_ule_f32:
540 ; SSE-NEXT: cmpnltss %xmm0, %xmm1
541 ; SSE-NEXT: andps %xmm1, %xmm2
542 ; SSE-NEXT: andnps %xmm3, %xmm1
543 ; SSE-NEXT: orps %xmm2, %xmm1
544 ; SSE-NEXT: movaps %xmm1, %xmm0
547 ; AVX-LABEL: select_fcmp_ule_f32:
549 ; AVX-NEXT: vcmpnltss %xmm0, %xmm1, %xmm0
550 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
553 ; AVX512-LABEL: select_fcmp_ule_f32:
555 ; AVX512-NEXT: vcmpnltss %xmm0, %xmm1, %k1
556 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
557 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
559 %1 = fcmp ule float %a, %b
560 %2 = select i1 %1, float %c, float %d
564 define double @select_fcmp_ule_f64(double %a, double %b, double %c, double %d) {
565 ; SSE-LABEL: select_fcmp_ule_f64:
567 ; SSE-NEXT: cmpnltsd %xmm0, %xmm1
568 ; SSE-NEXT: andpd %xmm1, %xmm2
569 ; SSE-NEXT: andnpd %xmm3, %xmm1
570 ; SSE-NEXT: orpd %xmm2, %xmm1
571 ; SSE-NEXT: movapd %xmm1, %xmm0
574 ; AVX-LABEL: select_fcmp_ule_f64:
576 ; AVX-NEXT: vcmpnltsd %xmm0, %xmm1, %xmm0
577 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
580 ; AVX512-LABEL: select_fcmp_ule_f64:
582 ; AVX512-NEXT: vcmpnltsd %xmm0, %xmm1, %k1
583 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
584 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
586 %1 = fcmp ule double %a, %b
587 %2 = select i1 %1, double %c, double %d
591 define float @select_fcmp_une_f32(float %a, float %b, float %c, float %d) {
592 ; SSE-LABEL: select_fcmp_une_f32:
594 ; SSE-NEXT: cmpneqss %xmm1, %xmm0
595 ; SSE-NEXT: andps %xmm0, %xmm2
596 ; SSE-NEXT: andnps %xmm3, %xmm0
597 ; SSE-NEXT: orps %xmm2, %xmm0
600 ; AVX-LABEL: select_fcmp_une_f32:
602 ; AVX-NEXT: vcmpneqss %xmm1, %xmm0, %xmm0
603 ; AVX-NEXT: vblendvps %xmm0, %xmm2, %xmm3, %xmm0
606 ; AVX512-LABEL: select_fcmp_une_f32:
608 ; AVX512-NEXT: vcmpneqss %xmm1, %xmm0, %k1
609 ; AVX512-NEXT: vmovss %xmm2, %xmm0, %xmm3 {%k1}
610 ; AVX512-NEXT: vmovaps %xmm3, %xmm0
612 %1 = fcmp une float %a, %b
613 %2 = select i1 %1, float %c, float %d
617 define double @select_fcmp_une_f64(double %a, double %b, double %c, double %d) {
618 ; SSE-LABEL: select_fcmp_une_f64:
620 ; SSE-NEXT: cmpneqsd %xmm1, %xmm0
621 ; SSE-NEXT: andpd %xmm0, %xmm2
622 ; SSE-NEXT: andnpd %xmm3, %xmm0
623 ; SSE-NEXT: orpd %xmm2, %xmm0
626 ; AVX-LABEL: select_fcmp_une_f64:
628 ; AVX-NEXT: vcmpneqsd %xmm1, %xmm0, %xmm0
629 ; AVX-NEXT: vblendvpd %xmm0, %xmm2, %xmm3, %xmm0
632 ; AVX512-LABEL: select_fcmp_une_f64:
634 ; AVX512-NEXT: vcmpneqsd %xmm1, %xmm0, %k1
635 ; AVX512-NEXT: vmovsd %xmm2, %xmm0, %xmm3 {%k1}
636 ; AVX512-NEXT: vmovapd %xmm3, %xmm0
638 %1 = fcmp une double %a, %b
639 %2 = select i1 %1, double %c, double %d