1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -relocation-model=static -verify-machineinstrs -mcpu=pwr7 \
3 ; RUN: -mtriple=powerpc64-unknown-linux-gnu -mattr=+vsx \
4 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck %s
5 ; RUN: llc -relocation-model=static -verify-machineinstrs -mcpu=pwr7 \
6 ; RUN: -mtriple=powerpc64-unknown-linux-gnu -mattr=+vsx \
7 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck \
8 ; RUN: -check-prefix=CHECK-REG %s
9 ; RUN: llc -relocation-model=static -verify-machineinstrs -mcpu=pwr7 \
10 ; RUN: -mtriple=powerpc64-unknown-linux-gnu -mattr=+vsx -fast-isel -O0 \
11 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck \
12 ; RUN: -check-prefix=CHECK-FISL %s
13 ; RUN: llc -relocation-model=static -verify-machineinstrs -mcpu=pwr8 \
14 ; RUN: -mtriple=powerpc64le-unknown-linux-gnu -mattr=+vsx \
15 ; RUN: -ppc-vsr-nums-as-vr -ppc-asm-full-reg-names < %s | FileCheck \
16 ; RUN: -check-prefix=CHECK-LE %s
18 define double @test1(double %a, double %b) {
20 ; CHECK: # %bb.0: # %entry
21 ; CHECK-NEXT: xsmuldp f1, f1, f2
24 ; CHECK-REG-LABEL: test1:
25 ; CHECK-REG: # %bb.0: # %entry
26 ; CHECK-REG-NEXT: xsmuldp f1, f1, f2
29 ; CHECK-FISL-LABEL: test1:
30 ; CHECK-FISL: # %bb.0: # %entry
31 ; CHECK-FISL-NEXT: xsmuldp f1, f1, f2
32 ; CHECK-FISL-NEXT: blr
34 ; CHECK-LE-LABEL: test1:
35 ; CHECK-LE: # %bb.0: # %entry
36 ; CHECK-LE-NEXT: xsmuldp f1, f1, f2
39 %v = fmul double %a, %b
45 define double @test2(double %a, double %b) {
47 ; CHECK: # %bb.0: # %entry
48 ; CHECK-NEXT: xsdivdp f1, f1, f2
51 ; CHECK-REG-LABEL: test2:
52 ; CHECK-REG: # %bb.0: # %entry
53 ; CHECK-REG-NEXT: xsdivdp f1, f1, f2
56 ; CHECK-FISL-LABEL: test2:
57 ; CHECK-FISL: # %bb.0: # %entry
58 ; CHECK-FISL-NEXT: xsdivdp f1, f1, f2
59 ; CHECK-FISL-NEXT: blr
61 ; CHECK-LE-LABEL: test2:
62 ; CHECK-LE: # %bb.0: # %entry
63 ; CHECK-LE-NEXT: xsdivdp f1, f1, f2
66 %v = fdiv double %a, %b
72 define double @test3(double %a, double %b) {
74 ; CHECK: # %bb.0: # %entry
75 ; CHECK-NEXT: xsadddp f1, f1, f2
78 ; CHECK-REG-LABEL: test3:
79 ; CHECK-REG: # %bb.0: # %entry
80 ; CHECK-REG-NEXT: xsadddp f1, f1, f2
83 ; CHECK-FISL-LABEL: test3:
84 ; CHECK-FISL: # %bb.0: # %entry
85 ; CHECK-FISL-NEXT: xsadddp f1, f1, f2
86 ; CHECK-FISL-NEXT: blr
88 ; CHECK-LE-LABEL: test3:
89 ; CHECK-LE: # %bb.0: # %entry
90 ; CHECK-LE-NEXT: xsadddp f1, f1, f2
93 %v = fadd double %a, %b
99 define <2 x double> @test4(<2 x double> %a, <2 x double> %b) {
100 ; CHECK-LABEL: test4:
101 ; CHECK: # %bb.0: # %entry
102 ; CHECK-NEXT: xvadddp v2, v2, v3
105 ; CHECK-REG-LABEL: test4:
106 ; CHECK-REG: # %bb.0: # %entry
107 ; CHECK-REG-NEXT: xvadddp v2, v2, v3
108 ; CHECK-REG-NEXT: blr
110 ; CHECK-FISL-LABEL: test4:
111 ; CHECK-FISL: # %bb.0: # %entry
112 ; CHECK-FISL-NEXT: xvadddp v2, v2, v3
113 ; CHECK-FISL-NEXT: blr
115 ; CHECK-LE-LABEL: test4:
116 ; CHECK-LE: # %bb.0: # %entry
117 ; CHECK-LE-NEXT: xvadddp v2, v2, v3
120 %v = fadd <2 x double> %a, %b
126 define <4 x i32> @test5(<4 x i32> %a, <4 x i32> %b) {
127 ; CHECK-LABEL: test5:
128 ; CHECK: # %bb.0: # %entry
129 ; CHECK-NEXT: xxlxor v2, v2, v3
132 ; CHECK-REG-LABEL: test5:
133 ; CHECK-REG: # %bb.0: # %entry
134 ; CHECK-REG-NEXT: xxlxor v2, v2, v3
135 ; CHECK-REG-NEXT: blr
137 ; CHECK-FISL-LABEL: test5:
138 ; CHECK-FISL: # %bb.0: # %entry
139 ; CHECK-FISL-NEXT: xxlxor v2, v2, v3
140 ; CHECK-FISL-NEXT: blr
142 ; CHECK-LE-LABEL: test5:
143 ; CHECK-LE: # %bb.0: # %entry
144 ; CHECK-LE-NEXT: xxlxor v2, v2, v3
147 %v = xor <4 x i32> %a, %b
154 define <8 x i16> @test6(<8 x i16> %a, <8 x i16> %b) {
155 ; CHECK-LABEL: test6:
156 ; CHECK: # %bb.0: # %entry
157 ; CHECK-NEXT: xxlxor v2, v2, v3
160 ; CHECK-REG-LABEL: test6:
161 ; CHECK-REG: # %bb.0: # %entry
162 ; CHECK-REG-NEXT: xxlxor v2, v2, v3
163 ; CHECK-REG-NEXT: blr
165 ; CHECK-FISL-LABEL: test6:
166 ; CHECK-FISL: # %bb.0: # %entry
167 ; CHECK-FISL-NEXT: xxlxor vs0, v2, v3
168 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
169 ; CHECK-FISL-NEXT: blr
171 ; CHECK-LE-LABEL: test6:
172 ; CHECK-LE: # %bb.0: # %entry
173 ; CHECK-LE-NEXT: xxlxor v2, v2, v3
176 %v = xor <8 x i16> %a, %b
183 define <16 x i8> @test7(<16 x i8> %a, <16 x i8> %b) {
184 ; CHECK-LABEL: test7:
185 ; CHECK: # %bb.0: # %entry
186 ; CHECK-NEXT: xxlxor v2, v2, v3
189 ; CHECK-REG-LABEL: test7:
190 ; CHECK-REG: # %bb.0: # %entry
191 ; CHECK-REG-NEXT: xxlxor v2, v2, v3
192 ; CHECK-REG-NEXT: blr
194 ; CHECK-FISL-LABEL: test7:
195 ; CHECK-FISL: # %bb.0: # %entry
196 ; CHECK-FISL-NEXT: xxlxor vs0, v2, v3
197 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
198 ; CHECK-FISL-NEXT: blr
200 ; CHECK-LE-LABEL: test7:
201 ; CHECK-LE: # %bb.0: # %entry
202 ; CHECK-LE-NEXT: xxlxor v2, v2, v3
205 %v = xor <16 x i8> %a, %b
212 define <4 x i32> @test8(<4 x i32> %a, <4 x i32> %b) {
213 ; CHECK-LABEL: test8:
214 ; CHECK: # %bb.0: # %entry
215 ; CHECK-NEXT: xxlor v2, v2, v3
218 ; CHECK-REG-LABEL: test8:
219 ; CHECK-REG: # %bb.0: # %entry
220 ; CHECK-REG-NEXT: xxlor v2, v2, v3
221 ; CHECK-REG-NEXT: blr
223 ; CHECK-FISL-LABEL: test8:
224 ; CHECK-FISL: # %bb.0: # %entry
225 ; CHECK-FISL-NEXT: xxlor v2, v2, v3
226 ; CHECK-FISL-NEXT: blr
228 ; CHECK-LE-LABEL: test8:
229 ; CHECK-LE: # %bb.0: # %entry
230 ; CHECK-LE-NEXT: xxlor v2, v2, v3
233 %v = or <4 x i32> %a, %b
240 define <8 x i16> @test9(<8 x i16> %a, <8 x i16> %b) {
241 ; CHECK-LABEL: test9:
242 ; CHECK: # %bb.0: # %entry
243 ; CHECK-NEXT: xxlor v2, v2, v3
246 ; CHECK-REG-LABEL: test9:
247 ; CHECK-REG: # %bb.0: # %entry
248 ; CHECK-REG-NEXT: xxlor v2, v2, v3
249 ; CHECK-REG-NEXT: blr
251 ; CHECK-FISL-LABEL: test9:
252 ; CHECK-FISL: # %bb.0: # %entry
253 ; CHECK-FISL-NEXT: xxlor vs0, v2, v3
254 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
255 ; CHECK-FISL-NEXT: blr
257 ; CHECK-LE-LABEL: test9:
258 ; CHECK-LE: # %bb.0: # %entry
259 ; CHECK-LE-NEXT: xxlor v2, v2, v3
262 %v = or <8 x i16> %a, %b
269 define <16 x i8> @test10(<16 x i8> %a, <16 x i8> %b) {
270 ; CHECK-LABEL: test10:
271 ; CHECK: # %bb.0: # %entry
272 ; CHECK-NEXT: xxlor v2, v2, v3
275 ; CHECK-REG-LABEL: test10:
276 ; CHECK-REG: # %bb.0: # %entry
277 ; CHECK-REG-NEXT: xxlor v2, v2, v3
278 ; CHECK-REG-NEXT: blr
280 ; CHECK-FISL-LABEL: test10:
281 ; CHECK-FISL: # %bb.0: # %entry
282 ; CHECK-FISL-NEXT: xxlor vs0, v2, v3
283 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
284 ; CHECK-FISL-NEXT: blr
286 ; CHECK-LE-LABEL: test10:
287 ; CHECK-LE: # %bb.0: # %entry
288 ; CHECK-LE-NEXT: xxlor v2, v2, v3
291 %v = or <16 x i8> %a, %b
298 define <4 x i32> @test11(<4 x i32> %a, <4 x i32> %b) {
299 ; CHECK-LABEL: test11:
300 ; CHECK: # %bb.0: # %entry
301 ; CHECK-NEXT: xxland v2, v2, v3
304 ; CHECK-REG-LABEL: test11:
305 ; CHECK-REG: # %bb.0: # %entry
306 ; CHECK-REG-NEXT: xxland v2, v2, v3
307 ; CHECK-REG-NEXT: blr
309 ; CHECK-FISL-LABEL: test11:
310 ; CHECK-FISL: # %bb.0: # %entry
311 ; CHECK-FISL-NEXT: xxland v2, v2, v3
312 ; CHECK-FISL-NEXT: blr
314 ; CHECK-LE-LABEL: test11:
315 ; CHECK-LE: # %bb.0: # %entry
316 ; CHECK-LE-NEXT: xxland v2, v2, v3
319 %v = and <4 x i32> %a, %b
326 define <8 x i16> @test12(<8 x i16> %a, <8 x i16> %b) {
327 ; CHECK-LABEL: test12:
328 ; CHECK: # %bb.0: # %entry
329 ; CHECK-NEXT: xxland v2, v2, v3
332 ; CHECK-REG-LABEL: test12:
333 ; CHECK-REG: # %bb.0: # %entry
334 ; CHECK-REG-NEXT: xxland v2, v2, v3
335 ; CHECK-REG-NEXT: blr
337 ; CHECK-FISL-LABEL: test12:
338 ; CHECK-FISL: # %bb.0: # %entry
339 ; CHECK-FISL-NEXT: xxland vs0, v2, v3
340 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
341 ; CHECK-FISL-NEXT: blr
343 ; CHECK-LE-LABEL: test12:
344 ; CHECK-LE: # %bb.0: # %entry
345 ; CHECK-LE-NEXT: xxland v2, v2, v3
348 %v = and <8 x i16> %a, %b
355 define <16 x i8> @test13(<16 x i8> %a, <16 x i8> %b) {
356 ; CHECK-LABEL: test13:
357 ; CHECK: # %bb.0: # %entry
358 ; CHECK-NEXT: xxland v2, v2, v3
361 ; CHECK-REG-LABEL: test13:
362 ; CHECK-REG: # %bb.0: # %entry
363 ; CHECK-REG-NEXT: xxland v2, v2, v3
364 ; CHECK-REG-NEXT: blr
366 ; CHECK-FISL-LABEL: test13:
367 ; CHECK-FISL: # %bb.0: # %entry
368 ; CHECK-FISL-NEXT: xxland vs0, v2, v3
369 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
370 ; CHECK-FISL-NEXT: blr
372 ; CHECK-LE-LABEL: test13:
373 ; CHECK-LE: # %bb.0: # %entry
374 ; CHECK-LE-NEXT: xxland v2, v2, v3
377 %v = and <16 x i8> %a, %b
384 define <4 x i32> @test14(<4 x i32> %a, <4 x i32> %b) {
385 ; CHECK-LABEL: test14:
386 ; CHECK: # %bb.0: # %entry
387 ; CHECK-NEXT: xxlnor v2, v2, v3
390 ; CHECK-REG-LABEL: test14:
391 ; CHECK-REG: # %bb.0: # %entry
392 ; CHECK-REG-NEXT: xxlnor v2, v2, v3
393 ; CHECK-REG-NEXT: blr
395 ; CHECK-FISL-LABEL: test14:
396 ; CHECK-FISL: # %bb.0: # %entry
397 ; CHECK-FISL-NEXT: xxlor vs0, v2, v3
398 ; CHECK-FISL-NEXT: xxlnor v2, v2, v3
399 ; CHECK-FISL-NEXT: blr
401 ; CHECK-LE-LABEL: test14:
402 ; CHECK-LE: # %bb.0: # %entry
403 ; CHECK-LE-NEXT: xxlnor v2, v2, v3
406 %v = or <4 x i32> %a, %b
407 %w = xor <4 x i32> %v, <i32 -1, i32 -1, i32 -1, i32 -1>
414 define <8 x i16> @test15(<8 x i16> %a, <8 x i16> %b) {
415 ; CHECK-LABEL: test15:
416 ; CHECK: # %bb.0: # %entry
417 ; CHECK-NEXT: xxlnor v2, v2, v3
420 ; CHECK-REG-LABEL: test15:
421 ; CHECK-REG: # %bb.0: # %entry
422 ; CHECK-REG-NEXT: xxlnor v2, v2, v3
423 ; CHECK-REG-NEXT: blr
425 ; CHECK-FISL-LABEL: test15:
426 ; CHECK-FISL: # %bb.0: # %entry
427 ; CHECK-FISL-NEXT: xxlor vs0, v2, v3
428 ; CHECK-FISL-NEXT: xxlor v4, vs0, vs0
429 ; CHECK-FISL-NEXT: xxlnor vs0, v2, v3
430 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
431 ; CHECK-FISL-NEXT: blr
433 ; CHECK-LE-LABEL: test15:
434 ; CHECK-LE: # %bb.0: # %entry
435 ; CHECK-LE-NEXT: xxlnor v2, v2, v3
438 %v = or <8 x i16> %a, %b
439 %w = xor <8 x i16> %v, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
446 define <16 x i8> @test16(<16 x i8> %a, <16 x i8> %b) {
447 ; CHECK-LABEL: test16:
448 ; CHECK: # %bb.0: # %entry
449 ; CHECK-NEXT: xxlnor v2, v2, v3
452 ; CHECK-REG-LABEL: test16:
453 ; CHECK-REG: # %bb.0: # %entry
454 ; CHECK-REG-NEXT: xxlnor v2, v2, v3
455 ; CHECK-REG-NEXT: blr
457 ; CHECK-FISL-LABEL: test16:
458 ; CHECK-FISL: # %bb.0: # %entry
459 ; CHECK-FISL-NEXT: xxlor vs0, v2, v3
460 ; CHECK-FISL-NEXT: xxlor v4, vs0, vs0
461 ; CHECK-FISL-NEXT: xxlnor vs0, v2, v3
462 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
463 ; CHECK-FISL-NEXT: blr
465 ; CHECK-LE-LABEL: test16:
466 ; CHECK-LE: # %bb.0: # %entry
467 ; CHECK-LE-NEXT: xxlnor v2, v2, v3
470 %v = or <16 x i8> %a, %b
471 %w = xor <16 x i8> %v, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
478 define <4 x i32> @test17(<4 x i32> %a, <4 x i32> %b) {
479 ; CHECK-LABEL: test17:
480 ; CHECK: # %bb.0: # %entry
481 ; CHECK-NEXT: xxlandc v2, v2, v3
484 ; CHECK-REG-LABEL: test17:
485 ; CHECK-REG: # %bb.0: # %entry
486 ; CHECK-REG-NEXT: xxlandc v2, v2, v3
487 ; CHECK-REG-NEXT: blr
489 ; CHECK-FISL-LABEL: test17:
490 ; CHECK-FISL: # %bb.0: # %entry
491 ; CHECK-FISL-NEXT: xxlnor vs0, v3, v3
492 ; CHECK-FISL-NEXT: xxland v2, v2, vs0
493 ; CHECK-FISL-NEXT: blr
495 ; CHECK-LE-LABEL: test17:
496 ; CHECK-LE: # %bb.0: # %entry
497 ; CHECK-LE-NEXT: xxlandc v2, v2, v3
500 %w = xor <4 x i32> %b, <i32 -1, i32 -1, i32 -1, i32 -1>
501 %v = and <4 x i32> %a, %w
508 define <8 x i16> @test18(<8 x i16> %a, <8 x i16> %b) {
509 ; CHECK-LABEL: test18:
510 ; CHECK: # %bb.0: # %entry
511 ; CHECK-NEXT: xxlandc v2, v2, v3
514 ; CHECK-REG-LABEL: test18:
515 ; CHECK-REG: # %bb.0: # %entry
516 ; CHECK-REG-NEXT: xxlandc v2, v2, v3
517 ; CHECK-REG-NEXT: blr
519 ; CHECK-FISL-LABEL: test18:
520 ; CHECK-FISL: # %bb.0: # %entry
521 ; CHECK-FISL-NEXT: xxlnor vs0, v3, v3
522 ; CHECK-FISL-NEXT: xxlor v4, vs0, vs0
523 ; CHECK-FISL-NEXT: xxlandc vs0, v2, v3
524 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
525 ; CHECK-FISL-NEXT: blr
527 ; CHECK-LE-LABEL: test18:
528 ; CHECK-LE: # %bb.0: # %entry
529 ; CHECK-LE-NEXT: xxlandc v2, v2, v3
532 %w = xor <8 x i16> %b, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
533 %v = and <8 x i16> %a, %w
540 define <16 x i8> @test19(<16 x i8> %a, <16 x i8> %b) {
541 ; CHECK-LABEL: test19:
542 ; CHECK: # %bb.0: # %entry
543 ; CHECK-NEXT: xxlandc v2, v2, v3
546 ; CHECK-REG-LABEL: test19:
547 ; CHECK-REG: # %bb.0: # %entry
548 ; CHECK-REG-NEXT: xxlandc v2, v2, v3
549 ; CHECK-REG-NEXT: blr
551 ; CHECK-FISL-LABEL: test19:
552 ; CHECK-FISL: # %bb.0: # %entry
553 ; CHECK-FISL-NEXT: xxlnor vs0, v3, v3
554 ; CHECK-FISL-NEXT: xxlor v4, vs0, vs0
555 ; CHECK-FISL-NEXT: xxlandc vs0, v2, v3
556 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
557 ; CHECK-FISL-NEXT: blr
559 ; CHECK-LE-LABEL: test19:
560 ; CHECK-LE: # %bb.0: # %entry
561 ; CHECK-LE-NEXT: xxlandc v2, v2, v3
564 %w = xor <16 x i8> %b, <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>
565 %v = and <16 x i8> %a, %w
572 define <4 x i32> @test20(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, <4 x i32> %d) {
573 ; CHECK-LABEL: test20:
574 ; CHECK: # %bb.0: # %entry
575 ; CHECK-NEXT: vcmpequw v4, v4, v5
576 ; CHECK-NEXT: xxsel v2, v3, v2, v4
579 ; CHECK-REG-LABEL: test20:
580 ; CHECK-REG: # %bb.0: # %entry
581 ; CHECK-REG-NEXT: vcmpequw v4, v4, v5
582 ; CHECK-REG-NEXT: xxsel v2, v3, v2, v4
583 ; CHECK-REG-NEXT: blr
585 ; CHECK-FISL-LABEL: test20:
586 ; CHECK-FISL: # %bb.0: # %entry
587 ; CHECK-FISL-NEXT: vcmpequw v4, v4, v5
588 ; CHECK-FISL-NEXT: xxsel v2, v3, v2, v4
589 ; CHECK-FISL-NEXT: blr
591 ; CHECK-LE-LABEL: test20:
592 ; CHECK-LE: # %bb.0: # %entry
593 ; CHECK-LE-NEXT: vcmpequw v4, v4, v5
594 ; CHECK-LE-NEXT: xxsel v2, v3, v2, v4
597 %m = icmp eq <4 x i32> %c, %d
598 %v = select <4 x i1> %m, <4 x i32> %a, <4 x i32> %b
605 define <4 x float> @test21(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d) {
606 ; CHECK-LABEL: test21:
607 ; CHECK: # %bb.0: # %entry
608 ; CHECK-NEXT: xvcmpeqsp vs0, v4, v5
609 ; CHECK-NEXT: xxsel v2, v3, v2, vs0
612 ; CHECK-REG-LABEL: test21:
613 ; CHECK-REG: # %bb.0: # %entry
614 ; CHECK-REG-NEXT: xvcmpeqsp vs0, v4, v5
615 ; CHECK-REG-NEXT: xxsel v2, v3, v2, vs0
616 ; CHECK-REG-NEXT: blr
618 ; CHECK-FISL-LABEL: test21:
619 ; CHECK-FISL: # %bb.0: # %entry
620 ; CHECK-FISL-NEXT: xvcmpeqsp vs0, v4, v5
621 ; CHECK-FISL-NEXT: xxsel v2, v3, v2, vs0
622 ; CHECK-FISL-NEXT: blr
624 ; CHECK-LE-LABEL: test21:
625 ; CHECK-LE: # %bb.0: # %entry
626 ; CHECK-LE-NEXT: xvcmpeqsp vs0, v4, v5
627 ; CHECK-LE-NEXT: xxsel v2, v3, v2, vs0
630 %m = fcmp oeq <4 x float> %c, %d
631 %v = select <4 x i1> %m, <4 x float> %a, <4 x float> %b
638 define <4 x float> @test22(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d) {
639 ; CHECK-LABEL: test22:
640 ; CHECK: # %bb.0: # %entry
641 ; CHECK-NEXT: xvcmpeqsp vs0, v5, v5
642 ; CHECK-NEXT: xvcmpeqsp vs1, v4, v4
643 ; CHECK-NEXT: xvcmpeqsp vs2, v4, v5
644 ; CHECK-NEXT: xxlnor vs0, vs0, vs0
645 ; CHECK-NEXT: xxlnor vs1, vs1, vs1
646 ; CHECK-NEXT: xxlor vs0, vs1, vs0
647 ; CHECK-NEXT: xxlor vs0, vs2, vs0
648 ; CHECK-NEXT: xxsel v2, v3, v2, vs0
651 ; CHECK-REG-LABEL: test22:
652 ; CHECK-REG: # %bb.0: # %entry
653 ; CHECK-REG-NEXT: xvcmpeqsp vs0, v5, v5
654 ; CHECK-REG-NEXT: xvcmpeqsp vs1, v4, v4
655 ; CHECK-REG-NEXT: xvcmpeqsp vs2, v4, v5
656 ; CHECK-REG-NEXT: xxlnor vs0, vs0, vs0
657 ; CHECK-REG-NEXT: xxlnor vs1, vs1, vs1
658 ; CHECK-REG-NEXT: xxlor vs0, vs1, vs0
659 ; CHECK-REG-NEXT: xxlor vs0, vs2, vs0
660 ; CHECK-REG-NEXT: xxsel v2, v3, v2, vs0
661 ; CHECK-REG-NEXT: blr
663 ; CHECK-FISL-LABEL: test22:
664 ; CHECK-FISL: # %bb.0: # %entry
665 ; CHECK-FISL-NEXT: xvcmpeqsp vs0, v4, v5
666 ; CHECK-FISL-NEXT: xvcmpeqsp vs1, v5, v5
667 ; CHECK-FISL-NEXT: xxlnor vs1, vs1, vs1
668 ; CHECK-FISL-NEXT: xvcmpeqsp vs2, v4, v4
669 ; CHECK-FISL-NEXT: xxlnor vs2, vs2, vs2
670 ; CHECK-FISL-NEXT: xxlor vs1, vs2, vs1
671 ; CHECK-FISL-NEXT: xxlor vs0, vs0, vs1
672 ; CHECK-FISL-NEXT: xxsel v2, v3, v2, vs0
673 ; CHECK-FISL-NEXT: blr
675 ; CHECK-LE-LABEL: test22:
676 ; CHECK-LE: # %bb.0: # %entry
677 ; CHECK-LE-NEXT: xvcmpeqsp vs0, v5, v5
678 ; CHECK-LE-NEXT: xvcmpeqsp vs1, v4, v4
679 ; CHECK-LE-NEXT: xvcmpeqsp vs2, v4, v5
680 ; CHECK-LE-NEXT: xxlnor vs0, vs0, vs0
681 ; CHECK-LE-NEXT: xxlnor vs1, vs1, vs1
682 ; CHECK-LE-NEXT: xxlor vs0, vs1, vs0
683 ; CHECK-LE-NEXT: xxlor vs0, vs2, vs0
684 ; CHECK-LE-NEXT: xxsel v2, v3, v2, vs0
687 %m = fcmp ueq <4 x float> %c, %d
688 %v = select <4 x i1> %m, <4 x float> %a, <4 x float> %b
695 define <8 x i16> @test23(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c, <8 x i16> %d) {
696 ; CHECK-LABEL: test23:
697 ; CHECK: # %bb.0: # %entry
698 ; CHECK-NEXT: vcmpequh v4, v4, v5
699 ; CHECK-NEXT: xxsel v2, v3, v2, v4
702 ; CHECK-REG-LABEL: test23:
703 ; CHECK-REG: # %bb.0: # %entry
704 ; CHECK-REG-NEXT: vcmpequh v4, v4, v5
705 ; CHECK-REG-NEXT: xxsel v2, v3, v2, v4
706 ; CHECK-REG-NEXT: blr
708 ; CHECK-FISL-LABEL: test23:
709 ; CHECK-FISL: # %bb.0: # %entry
710 ; CHECK-FISL-NEXT: vcmpequh v4, v4, v5
711 ; CHECK-FISL-NEXT: xxsel vs0, v3, v2, v4
712 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
713 ; CHECK-FISL-NEXT: blr
715 ; CHECK-LE-LABEL: test23:
716 ; CHECK-LE: # %bb.0: # %entry
717 ; CHECK-LE-NEXT: vcmpequh v4, v4, v5
718 ; CHECK-LE-NEXT: xxsel v2, v3, v2, v4
721 %m = icmp eq <8 x i16> %c, %d
722 %v = select <8 x i1> %m, <8 x i16> %a, <8 x i16> %b
729 define <16 x i8> @test24(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c, <16 x i8> %d) {
730 ; CHECK-LABEL: test24:
731 ; CHECK: # %bb.0: # %entry
732 ; CHECK-NEXT: vcmpequb v4, v4, v5
733 ; CHECK-NEXT: xxsel v2, v3, v2, v4
736 ; CHECK-REG-LABEL: test24:
737 ; CHECK-REG: # %bb.0: # %entry
738 ; CHECK-REG-NEXT: vcmpequb v4, v4, v5
739 ; CHECK-REG-NEXT: xxsel v2, v3, v2, v4
740 ; CHECK-REG-NEXT: blr
742 ; CHECK-FISL-LABEL: test24:
743 ; CHECK-FISL: # %bb.0: # %entry
744 ; CHECK-FISL-NEXT: vcmpequb v4, v4, v5
745 ; CHECK-FISL-NEXT: xxsel vs0, v3, v2, v4
746 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
747 ; CHECK-FISL-NEXT: blr
749 ; CHECK-LE-LABEL: test24:
750 ; CHECK-LE: # %bb.0: # %entry
751 ; CHECK-LE-NEXT: vcmpequb v4, v4, v5
752 ; CHECK-LE-NEXT: xxsel v2, v3, v2, v4
755 %m = icmp eq <16 x i8> %c, %d
756 %v = select <16 x i1> %m, <16 x i8> %a, <16 x i8> %b
763 define <2 x double> @test25(<2 x double> %a, <2 x double> %b, <2 x double> %c, <2 x double> %d) {
764 ; CHECK-LABEL: test25:
765 ; CHECK: # %bb.0: # %entry
766 ; CHECK-NEXT: xvcmpeqdp vs0, v4, v5
767 ; CHECK-NEXT: xxsel v2, v3, v2, vs0
770 ; CHECK-REG-LABEL: test25:
771 ; CHECK-REG: # %bb.0: # %entry
772 ; CHECK-REG-NEXT: xvcmpeqdp vs0, v4, v5
773 ; CHECK-REG-NEXT: xxsel v2, v3, v2, vs0
774 ; CHECK-REG-NEXT: blr
776 ; CHECK-FISL-LABEL: test25:
777 ; CHECK-FISL: # %bb.0: # %entry
778 ; CHECK-FISL-NEXT: xvcmpeqdp vs0, v4, v5
779 ; CHECK-FISL-NEXT: xxsel v2, v3, v2, vs0
780 ; CHECK-FISL-NEXT: blr
782 ; CHECK-LE-LABEL: test25:
783 ; CHECK-LE: # %bb.0: # %entry
784 ; CHECK-LE-NEXT: xvcmpeqdp v4, v4, v5
785 ; CHECK-LE-NEXT: xxsel v2, v3, v2, v4
788 %m = fcmp oeq <2 x double> %c, %d
789 %v = select <2 x i1> %m, <2 x double> %a, <2 x double> %b
795 define <2 x i64> @test26(<2 x i64> %a, <2 x i64> %b) {
796 ; CHECK-LABEL: test26:
798 ; CHECK-NEXT: addi r3, r1, -32
799 ; CHECK-NEXT: addi r4, r1, -48
800 ; CHECK-NEXT: stxvd2x v3, 0, r3
801 ; CHECK-NEXT: stxvd2x v2, 0, r4
802 ; CHECK-NEXT: ld r3, -24(r1)
803 ; CHECK-NEXT: ld r4, -40(r1)
804 ; CHECK-NEXT: add r3, r4, r3
805 ; CHECK-NEXT: ld r4, -48(r1)
806 ; CHECK-NEXT: std r3, -8(r1)
807 ; CHECK-NEXT: ld r3, -32(r1)
808 ; CHECK-NEXT: add r3, r4, r3
809 ; CHECK-NEXT: std r3, -16(r1)
810 ; CHECK-NEXT: addi r3, r1, -16
811 ; CHECK-NEXT: lxvd2x v2, 0, r3
814 ; CHECK-REG-LABEL: test26:
815 ; CHECK-REG: # %bb.0:
816 ; CHECK-REG-NEXT: addi r3, r1, -32
817 ; CHECK-REG-NEXT: addi r4, r1, -48
818 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
819 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
820 ; CHECK-REG-NEXT: ld r3, -24(r1)
821 ; CHECK-REG-NEXT: ld r4, -40(r1)
822 ; CHECK-REG-NEXT: add r3, r4, r3
823 ; CHECK-REG-NEXT: ld r4, -48(r1)
824 ; CHECK-REG-NEXT: std r3, -8(r1)
825 ; CHECK-REG-NEXT: ld r3, -32(r1)
826 ; CHECK-REG-NEXT: add r3, r4, r3
827 ; CHECK-REG-NEXT: std r3, -16(r1)
828 ; CHECK-REG-NEXT: addi r3, r1, -16
829 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
830 ; CHECK-REG-NEXT: blr
832 ; CHECK-FISL-LABEL: test26:
833 ; CHECK-FISL: # %bb.0:
834 ; CHECK-FISL-NEXT: addi r3, r1, -32
835 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
836 ; CHECK-FISL-NEXT: addi r3, r1, -48
837 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
838 ; CHECK-FISL-NEXT: ld r3, -24(r1)
839 ; CHECK-FISL-NEXT: ld r4, -40(r1)
840 ; CHECK-FISL-NEXT: add r3, r4, r3
841 ; CHECK-FISL-NEXT: std r3, -8(r1)
842 ; CHECK-FISL-NEXT: ld r3, -32(r1)
843 ; CHECK-FISL-NEXT: ld r4, -48(r1)
844 ; CHECK-FISL-NEXT: add r3, r4, r3
845 ; CHECK-FISL-NEXT: std r3, -16(r1)
846 ; CHECK-FISL-NEXT: addi r3, r1, -16
847 ; CHECK-FISL-NEXT: lxvd2x vs0, 0, r3
848 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
849 ; CHECK-FISL-NEXT: blr
851 ; CHECK-LE-LABEL: test26:
853 ; CHECK-LE-NEXT: vaddudm v2, v2, v3
855 %v = add <2 x i64> %a, %b
859 ; Make sure we use only two stores (one for each operand).
861 ; FIXME: The code quality here is not good; just make sure we do something for now.
865 define <2 x i64> @test27(<2 x i64> %a, <2 x i64> %b) {
866 ; CHECK-LABEL: test27:
868 ; CHECK-NEXT: xxland v2, v2, v3
871 ; CHECK-REG-LABEL: test27:
872 ; CHECK-REG: # %bb.0:
873 ; CHECK-REG-NEXT: xxland v2, v2, v3
874 ; CHECK-REG-NEXT: blr
876 ; CHECK-FISL-LABEL: test27:
877 ; CHECK-FISL: # %bb.0:
878 ; CHECK-FISL-NEXT: xxland vs0, v2, v3
879 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
880 ; CHECK-FISL-NEXT: blr
882 ; CHECK-LE-LABEL: test27:
884 ; CHECK-LE-NEXT: xxland v2, v2, v3
886 %v = and <2 x i64> %a, %b
892 define <2 x double> @test28(<2 x double>* %a) {
893 ; CHECK-LABEL: test28:
895 ; CHECK-NEXT: lxvd2x v2, 0, r3
898 ; CHECK-REG-LABEL: test28:
899 ; CHECK-REG: # %bb.0:
900 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
901 ; CHECK-REG-NEXT: blr
903 ; CHECK-FISL-LABEL: test28:
904 ; CHECK-FISL: # %bb.0:
905 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
906 ; CHECK-FISL-NEXT: blr
908 ; CHECK-LE-LABEL: test28:
910 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
911 ; CHECK-LE-NEXT: xxswapd v2, vs0
913 %v = load <2 x double>, <2 x double>* %a, align 16
919 define void @test29(<2 x double>* %a, <2 x double> %b) {
920 ; CHECK-LABEL: test29:
922 ; CHECK-NEXT: stxvd2x v2, 0, r3
925 ; CHECK-REG-LABEL: test29:
926 ; CHECK-REG: # %bb.0:
927 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
928 ; CHECK-REG-NEXT: blr
930 ; CHECK-FISL-LABEL: test29:
931 ; CHECK-FISL: # %bb.0:
932 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
933 ; CHECK-FISL-NEXT: blr
935 ; CHECK-LE-LABEL: test29:
937 ; CHECK-LE-NEXT: xxswapd vs0, v2
938 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
940 store <2 x double> %b, <2 x double>* %a, align 16
946 define <2 x double> @test28u(<2 x double>* %a) {
947 ; CHECK-LABEL: test28u:
949 ; CHECK-NEXT: lxvd2x v2, 0, r3
952 ; CHECK-REG-LABEL: test28u:
953 ; CHECK-REG: # %bb.0:
954 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
955 ; CHECK-REG-NEXT: blr
957 ; CHECK-FISL-LABEL: test28u:
958 ; CHECK-FISL: # %bb.0:
959 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
960 ; CHECK-FISL-NEXT: blr
962 ; CHECK-LE-LABEL: test28u:
964 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
965 ; CHECK-LE-NEXT: xxswapd v2, vs0
967 %v = load <2 x double>, <2 x double>* %a, align 8
973 define void @test29u(<2 x double>* %a, <2 x double> %b) {
974 ; CHECK-LABEL: test29u:
976 ; CHECK-NEXT: stxvd2x v2, 0, r3
979 ; CHECK-REG-LABEL: test29u:
980 ; CHECK-REG: # %bb.0:
981 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
982 ; CHECK-REG-NEXT: blr
984 ; CHECK-FISL-LABEL: test29u:
985 ; CHECK-FISL: # %bb.0:
986 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
987 ; CHECK-FISL-NEXT: blr
989 ; CHECK-LE-LABEL: test29u:
991 ; CHECK-LE-NEXT: xxswapd vs0, v2
992 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
994 store <2 x double> %b, <2 x double>* %a, align 8
1000 define <2 x i64> @test30(<2 x i64>* %a) {
1001 ; CHECK-LABEL: test30:
1003 ; CHECK-NEXT: lxvd2x v2, 0, r3
1006 ; CHECK-REG-LABEL: test30:
1007 ; CHECK-REG: # %bb.0:
1008 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1009 ; CHECK-REG-NEXT: blr
1011 ; CHECK-FISL-LABEL: test30:
1012 ; CHECK-FISL: # %bb.0:
1013 ; CHECK-FISL-NEXT: lxvd2x vs0, 0, r3
1014 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
1015 ; CHECK-FISL-NEXT: blr
1017 ; CHECK-LE-LABEL: test30:
1018 ; CHECK-LE: # %bb.0:
1019 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
1020 ; CHECK-LE-NEXT: xxswapd v2, vs0
1021 ; CHECK-LE-NEXT: blr
1022 %v = load <2 x i64>, <2 x i64>* %a, align 16
1029 define void @test31(<2 x i64>* %a, <2 x i64> %b) {
1030 ; CHECK-LABEL: test31:
1032 ; CHECK-NEXT: stxvd2x v2, 0, r3
1035 ; CHECK-REG-LABEL: test31:
1036 ; CHECK-REG: # %bb.0:
1037 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
1038 ; CHECK-REG-NEXT: blr
1040 ; CHECK-FISL-LABEL: test31:
1041 ; CHECK-FISL: # %bb.0:
1042 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1043 ; CHECK-FISL-NEXT: blr
1045 ; CHECK-LE-LABEL: test31:
1046 ; CHECK-LE: # %bb.0:
1047 ; CHECK-LE-NEXT: xxswapd vs0, v2
1048 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
1049 ; CHECK-LE-NEXT: blr
1050 store <2 x i64> %b, <2 x i64>* %a, align 16
1056 define <4 x float> @test32(<4 x float>* %a) {
1057 ; CHECK-LABEL: test32:
1059 ; CHECK-NEXT: lxvw4x v2, 0, r3
1062 ; CHECK-REG-LABEL: test32:
1063 ; CHECK-REG: # %bb.0:
1064 ; CHECK-REG-NEXT: lxvw4x v2, 0, r3
1065 ; CHECK-REG-NEXT: blr
1067 ; CHECK-FISL-LABEL: test32:
1068 ; CHECK-FISL: # %bb.0:
1069 ; CHECK-FISL-NEXT: lxvw4x v2, 0, r3
1070 ; CHECK-FISL-NEXT: blr
1072 ; CHECK-LE-LABEL: test32:
1073 ; CHECK-LE: # %bb.0:
1074 ; CHECK-LE-NEXT: lvx v2, 0, r3
1075 ; CHECK-LE-NEXT: blr
1076 %v = load <4 x float>, <4 x float>* %a, align 16
1083 define void @test33(<4 x float>* %a, <4 x float> %b) {
1084 ; CHECK-LABEL: test33:
1086 ; CHECK-NEXT: stxvw4x v2, 0, r3
1089 ; CHECK-REG-LABEL: test33:
1090 ; CHECK-REG: # %bb.0:
1091 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1092 ; CHECK-REG-NEXT: blr
1094 ; CHECK-FISL-LABEL: test33:
1095 ; CHECK-FISL: # %bb.0:
1096 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1097 ; CHECK-FISL-NEXT: blr
1099 ; CHECK-LE-LABEL: test33:
1100 ; CHECK-LE: # %bb.0:
1101 ; CHECK-LE-NEXT: stvx v2, 0, r3
1102 ; CHECK-LE-NEXT: blr
1103 store <4 x float> %b, <4 x float>* %a, align 16
1110 define <4 x float> @test32u(<4 x float>* %a) {
1111 ; CHECK-LABEL: test32u:
1113 ; CHECK-NEXT: li r4, 15
1114 ; CHECK-NEXT: lvsl v3, 0, r3
1115 ; CHECK-NEXT: lvx v2, r3, r4
1116 ; CHECK-NEXT: lvx v4, 0, r3
1117 ; CHECK-NEXT: vperm v2, v4, v2, v3
1120 ; CHECK-REG-LABEL: test32u:
1121 ; CHECK-REG: # %bb.0:
1122 ; CHECK-REG-NEXT: li r4, 15
1123 ; CHECK-REG-NEXT: lvsl v3, 0, r3
1124 ; CHECK-REG-NEXT: lvx v2, r3, r4
1125 ; CHECK-REG-NEXT: lvx v4, 0, r3
1126 ; CHECK-REG-NEXT: vperm v2, v4, v2, v3
1127 ; CHECK-REG-NEXT: blr
1129 ; CHECK-FISL-LABEL: test32u:
1130 ; CHECK-FISL: # %bb.0:
1131 ; CHECK-FISL-NEXT: li r4, 15
1132 ; CHECK-FISL-NEXT: lvx v2, r3, r4
1133 ; CHECK-FISL-NEXT: lvsl v3, 0, r3
1134 ; CHECK-FISL-NEXT: lvx v4, 0, r3
1135 ; CHECK-FISL-NEXT: vperm v2, v4, v2, v3
1136 ; CHECK-FISL-NEXT: blr
1138 ; CHECK-LE-LABEL: test32u:
1139 ; CHECK-LE: # %bb.0:
1140 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
1141 ; CHECK-LE-NEXT: xxswapd v2, vs0
1142 ; CHECK-LE-NEXT: blr
1143 %v = load <4 x float>, <4 x float>* %a, align 8
1149 define void @test33u(<4 x float>* %a, <4 x float> %b) {
1150 ; CHECK-LABEL: test33u:
1152 ; CHECK-NEXT: stxvw4x v2, 0, r3
1155 ; CHECK-REG-LABEL: test33u:
1156 ; CHECK-REG: # %bb.0:
1157 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1158 ; CHECK-REG-NEXT: blr
1160 ; CHECK-FISL-LABEL: test33u:
1161 ; CHECK-FISL: # %bb.0:
1162 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1163 ; CHECK-FISL-NEXT: blr
1165 ; CHECK-LE-LABEL: test33u:
1166 ; CHECK-LE: # %bb.0:
1167 ; CHECK-LE-NEXT: xxswapd vs0, v2
1168 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
1169 ; CHECK-LE-NEXT: blr
1170 store <4 x float> %b, <4 x float>* %a, align 8
1177 define <4 x i32> @test34(<4 x i32>* %a) {
1178 ; CHECK-LABEL: test34:
1180 ; CHECK-NEXT: lxvw4x v2, 0, r3
1183 ; CHECK-REG-LABEL: test34:
1184 ; CHECK-REG: # %bb.0:
1185 ; CHECK-REG-NEXT: lxvw4x v2, 0, r3
1186 ; CHECK-REG-NEXT: blr
1188 ; CHECK-FISL-LABEL: test34:
1189 ; CHECK-FISL: # %bb.0:
1190 ; CHECK-FISL-NEXT: lxvw4x v2, 0, r3
1191 ; CHECK-FISL-NEXT: blr
1193 ; CHECK-LE-LABEL: test34:
1194 ; CHECK-LE: # %bb.0:
1195 ; CHECK-LE-NEXT: lvx v2, 0, r3
1196 ; CHECK-LE-NEXT: blr
1197 %v = load <4 x i32>, <4 x i32>* %a, align 16
1204 define void @test35(<4 x i32>* %a, <4 x i32> %b) {
1205 ; CHECK-LABEL: test35:
1207 ; CHECK-NEXT: stxvw4x v2, 0, r3
1210 ; CHECK-REG-LABEL: test35:
1211 ; CHECK-REG: # %bb.0:
1212 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1213 ; CHECK-REG-NEXT: blr
1215 ; CHECK-FISL-LABEL: test35:
1216 ; CHECK-FISL: # %bb.0:
1217 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1218 ; CHECK-FISL-NEXT: blr
1220 ; CHECK-LE-LABEL: test35:
1221 ; CHECK-LE: # %bb.0:
1222 ; CHECK-LE-NEXT: stvx v2, 0, r3
1223 ; CHECK-LE-NEXT: blr
1224 store <4 x i32> %b, <4 x i32>* %a, align 16
1231 define <2 x double> @test40(<2 x i64> %a) {
1232 ; CHECK-LABEL: test40:
1234 ; CHECK-NEXT: xvcvuxddp v2, v2
1237 ; CHECK-REG-LABEL: test40:
1238 ; CHECK-REG: # %bb.0:
1239 ; CHECK-REG-NEXT: xvcvuxddp v2, v2
1240 ; CHECK-REG-NEXT: blr
1242 ; CHECK-FISL-LABEL: test40:
1243 ; CHECK-FISL: # %bb.0:
1244 ; CHECK-FISL-NEXT: xvcvuxddp v2, v2
1245 ; CHECK-FISL-NEXT: blr
1247 ; CHECK-LE-LABEL: test40:
1248 ; CHECK-LE: # %bb.0:
1249 ; CHECK-LE-NEXT: xvcvuxddp v2, v2
1250 ; CHECK-LE-NEXT: blr
1251 %v = uitofp <2 x i64> %a to <2 x double>
1257 define <2 x double> @test41(<2 x i64> %a) {
1258 ; CHECK-LABEL: test41:
1260 ; CHECK-NEXT: xvcvsxddp v2, v2
1263 ; CHECK-REG-LABEL: test41:
1264 ; CHECK-REG: # %bb.0:
1265 ; CHECK-REG-NEXT: xvcvsxddp v2, v2
1266 ; CHECK-REG-NEXT: blr
1268 ; CHECK-FISL-LABEL: test41:
1269 ; CHECK-FISL: # %bb.0:
1270 ; CHECK-FISL-NEXT: xvcvsxddp v2, v2
1271 ; CHECK-FISL-NEXT: blr
1273 ; CHECK-LE-LABEL: test41:
1274 ; CHECK-LE: # %bb.0:
1275 ; CHECK-LE-NEXT: xvcvsxddp v2, v2
1276 ; CHECK-LE-NEXT: blr
1277 %v = sitofp <2 x i64> %a to <2 x double>
1283 define <2 x i64> @test42(<2 x double> %a) {
1284 ; CHECK-LABEL: test42:
1286 ; CHECK-NEXT: xvcvdpuxds v2, v2
1289 ; CHECK-REG-LABEL: test42:
1290 ; CHECK-REG: # %bb.0:
1291 ; CHECK-REG-NEXT: xvcvdpuxds v2, v2
1292 ; CHECK-REG-NEXT: blr
1294 ; CHECK-FISL-LABEL: test42:
1295 ; CHECK-FISL: # %bb.0:
1296 ; CHECK-FISL-NEXT: xvcvdpuxds v2, v2
1297 ; CHECK-FISL-NEXT: blr
1299 ; CHECK-LE-LABEL: test42:
1300 ; CHECK-LE: # %bb.0:
1301 ; CHECK-LE-NEXT: xvcvdpuxds v2, v2
1302 ; CHECK-LE-NEXT: blr
1303 %v = fptoui <2 x double> %a to <2 x i64>
1309 define <2 x i64> @test43(<2 x double> %a) {
1310 ; CHECK-LABEL: test43:
1312 ; CHECK-NEXT: xvcvdpsxds v2, v2
1315 ; CHECK-REG-LABEL: test43:
1316 ; CHECK-REG: # %bb.0:
1317 ; CHECK-REG-NEXT: xvcvdpsxds v2, v2
1318 ; CHECK-REG-NEXT: blr
1320 ; CHECK-FISL-LABEL: test43:
1321 ; CHECK-FISL: # %bb.0:
1322 ; CHECK-FISL-NEXT: xvcvdpsxds v2, v2
1323 ; CHECK-FISL-NEXT: blr
1325 ; CHECK-LE-LABEL: test43:
1326 ; CHECK-LE: # %bb.0:
1327 ; CHECK-LE-NEXT: xvcvdpsxds v2, v2
1328 ; CHECK-LE-NEXT: blr
1329 %v = fptosi <2 x double> %a to <2 x i64>
1335 define <2 x float> @test44(<2 x i64> %a) {
1336 ; CHECK-LABEL: test44:
1338 ; CHECK-NEXT: addi r3, r1, -16
1339 ; CHECK-NEXT: addi r4, r1, -64
1340 ; CHECK-NEXT: stxvd2x v2, 0, r3
1341 ; CHECK-NEXT: ld r3, -8(r1)
1342 ; CHECK-NEXT: std r3, -24(r1)
1343 ; CHECK-NEXT: ld r3, -16(r1)
1344 ; CHECK-NEXT: std r3, -32(r1)
1345 ; CHECK-NEXT: lfd f0, -24(r1)
1346 ; CHECK-NEXT: fcfidus f0, f0
1347 ; CHECK-NEXT: stfs f0, -48(r1)
1348 ; CHECK-NEXT: lfd f0, -32(r1)
1349 ; CHECK-NEXT: addi r3, r1, -48
1350 ; CHECK-NEXT: fcfidus f0, f0
1351 ; CHECK-NEXT: stfs f0, -64(r1)
1352 ; CHECK-NEXT: lxvw4x v2, 0, r3
1353 ; CHECK-NEXT: lxvw4x v3, 0, r4
1354 ; CHECK-NEXT: vmrghw v2, v3, v2
1357 ; CHECK-REG-LABEL: test44:
1358 ; CHECK-REG: # %bb.0:
1359 ; CHECK-REG-NEXT: addi r3, r1, -16
1360 ; CHECK-REG-NEXT: addi r4, r1, -64
1361 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
1362 ; CHECK-REG-NEXT: ld r3, -8(r1)
1363 ; CHECK-REG-NEXT: std r3, -24(r1)
1364 ; CHECK-REG-NEXT: ld r3, -16(r1)
1365 ; CHECK-REG-NEXT: std r3, -32(r1)
1366 ; CHECK-REG-NEXT: lfd f0, -24(r1)
1367 ; CHECK-REG-NEXT: fcfidus f0, f0
1368 ; CHECK-REG-NEXT: stfs f0, -48(r1)
1369 ; CHECK-REG-NEXT: lfd f0, -32(r1)
1370 ; CHECK-REG-NEXT: addi r3, r1, -48
1371 ; CHECK-REG-NEXT: fcfidus f0, f0
1372 ; CHECK-REG-NEXT: stfs f0, -64(r1)
1373 ; CHECK-REG-NEXT: lxvw4x v2, 0, r3
1374 ; CHECK-REG-NEXT: lxvw4x v3, 0, r4
1375 ; CHECK-REG-NEXT: vmrghw v2, v3, v2
1376 ; CHECK-REG-NEXT: blr
1378 ; CHECK-FISL-LABEL: test44:
1379 ; CHECK-FISL: # %bb.0:
1380 ; CHECK-FISL-NEXT: addi r3, r1, -16
1381 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1382 ; CHECK-FISL-NEXT: ld r3, -8(r1)
1383 ; CHECK-FISL-NEXT: std r3, -24(r1)
1384 ; CHECK-FISL-NEXT: ld r3, -16(r1)
1385 ; CHECK-FISL-NEXT: std r3, -32(r1)
1386 ; CHECK-FISL-NEXT: lfd f0, -24(r1)
1387 ; CHECK-FISL-NEXT: fcfidus f0, f0
1388 ; CHECK-FISL-NEXT: stfs f0, -48(r1)
1389 ; CHECK-FISL-NEXT: lfd f0, -32(r1)
1390 ; CHECK-FISL-NEXT: fcfidus f0, f0
1391 ; CHECK-FISL-NEXT: stfs f0, -64(r1)
1392 ; CHECK-FISL-NEXT: addi r3, r1, -48
1393 ; CHECK-FISL-NEXT: lxvw4x v2, 0, r3
1394 ; CHECK-FISL-NEXT: addi r3, r1, -64
1395 ; CHECK-FISL-NEXT: lxvw4x v3, 0, r3
1396 ; CHECK-FISL-NEXT: vmrghw v2, v3, v2
1397 ; CHECK-FISL-NEXT: blr
1399 ; CHECK-LE-LABEL: test44:
1400 ; CHECK-LE: # %bb.0:
1401 ; CHECK-LE-NEXT: xxswapd vs0, v2
1402 ; CHECK-LE-NEXT: xxlor vs1, v2, v2
1403 ; CHECK-LE-NEXT: xscvuxdsp f1, f1
1404 ; CHECK-LE-NEXT: xscvuxdsp f0, f0
1405 ; CHECK-LE-NEXT: xscvdpspn vs1, f1
1406 ; CHECK-LE-NEXT: xscvdpspn vs0, f0
1407 ; CHECK-LE-NEXT: xxsldwi v3, vs1, vs1, 1
1408 ; CHECK-LE-NEXT: xxsldwi v2, vs0, vs0, 1
1409 ; CHECK-LE-NEXT: vmrglw v2, v3, v2
1410 ; CHECK-LE-NEXT: blr
1411 %v = uitofp <2 x i64> %a to <2 x float>
1414 ; FIXME: The code quality here looks pretty bad.
1417 define <2 x float> @test45(<2 x i64> %a) {
1418 ; CHECK-LABEL: test45:
1420 ; CHECK-NEXT: addi r3, r1, -16
1421 ; CHECK-NEXT: addi r4, r1, -64
1422 ; CHECK-NEXT: stxvd2x v2, 0, r3
1423 ; CHECK-NEXT: ld r3, -8(r1)
1424 ; CHECK-NEXT: std r3, -24(r1)
1425 ; CHECK-NEXT: ld r3, -16(r1)
1426 ; CHECK-NEXT: std r3, -32(r1)
1427 ; CHECK-NEXT: lfd f0, -24(r1)
1428 ; CHECK-NEXT: fcfids f0, f0
1429 ; CHECK-NEXT: stfs f0, -48(r1)
1430 ; CHECK-NEXT: lfd f0, -32(r1)
1431 ; CHECK-NEXT: addi r3, r1, -48
1432 ; CHECK-NEXT: fcfids f0, f0
1433 ; CHECK-NEXT: stfs f0, -64(r1)
1434 ; CHECK-NEXT: lxvw4x v2, 0, r3
1435 ; CHECK-NEXT: lxvw4x v3, 0, r4
1436 ; CHECK-NEXT: vmrghw v2, v3, v2
1439 ; CHECK-REG-LABEL: test45:
1440 ; CHECK-REG: # %bb.0:
1441 ; CHECK-REG-NEXT: addi r3, r1, -16
1442 ; CHECK-REG-NEXT: addi r4, r1, -64
1443 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
1444 ; CHECK-REG-NEXT: ld r3, -8(r1)
1445 ; CHECK-REG-NEXT: std r3, -24(r1)
1446 ; CHECK-REG-NEXT: ld r3, -16(r1)
1447 ; CHECK-REG-NEXT: std r3, -32(r1)
1448 ; CHECK-REG-NEXT: lfd f0, -24(r1)
1449 ; CHECK-REG-NEXT: fcfids f0, f0
1450 ; CHECK-REG-NEXT: stfs f0, -48(r1)
1451 ; CHECK-REG-NEXT: lfd f0, -32(r1)
1452 ; CHECK-REG-NEXT: addi r3, r1, -48
1453 ; CHECK-REG-NEXT: fcfids f0, f0
1454 ; CHECK-REG-NEXT: stfs f0, -64(r1)
1455 ; CHECK-REG-NEXT: lxvw4x v2, 0, r3
1456 ; CHECK-REG-NEXT: lxvw4x v3, 0, r4
1457 ; CHECK-REG-NEXT: vmrghw v2, v3, v2
1458 ; CHECK-REG-NEXT: blr
1460 ; CHECK-FISL-LABEL: test45:
1461 ; CHECK-FISL: # %bb.0:
1462 ; CHECK-FISL-NEXT: addi r3, r1, -16
1463 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1464 ; CHECK-FISL-NEXT: ld r3, -8(r1)
1465 ; CHECK-FISL-NEXT: std r3, -24(r1)
1466 ; CHECK-FISL-NEXT: ld r3, -16(r1)
1467 ; CHECK-FISL-NEXT: std r3, -32(r1)
1468 ; CHECK-FISL-NEXT: lfd f0, -24(r1)
1469 ; CHECK-FISL-NEXT: fcfids f0, f0
1470 ; CHECK-FISL-NEXT: stfs f0, -48(r1)
1471 ; CHECK-FISL-NEXT: lfd f0, -32(r1)
1472 ; CHECK-FISL-NEXT: fcfids f0, f0
1473 ; CHECK-FISL-NEXT: stfs f0, -64(r1)
1474 ; CHECK-FISL-NEXT: addi r3, r1, -48
1475 ; CHECK-FISL-NEXT: lxvw4x v2, 0, r3
1476 ; CHECK-FISL-NEXT: addi r3, r1, -64
1477 ; CHECK-FISL-NEXT: lxvw4x v3, 0, r3
1478 ; CHECK-FISL-NEXT: vmrghw v2, v3, v2
1479 ; CHECK-FISL-NEXT: blr
1481 ; CHECK-LE-LABEL: test45:
1482 ; CHECK-LE: # %bb.0:
1483 ; CHECK-LE-NEXT: xxswapd vs0, v2
1484 ; CHECK-LE-NEXT: xxlor vs1, v2, v2
1485 ; CHECK-LE-NEXT: xscvsxdsp f1, f1
1486 ; CHECK-LE-NEXT: xscvsxdsp f0, f0
1487 ; CHECK-LE-NEXT: xscvdpspn vs1, f1
1488 ; CHECK-LE-NEXT: xscvdpspn vs0, f0
1489 ; CHECK-LE-NEXT: xxsldwi v3, vs1, vs1, 1
1490 ; CHECK-LE-NEXT: xxsldwi v2, vs0, vs0, 1
1491 ; CHECK-LE-NEXT: vmrglw v2, v3, v2
1492 ; CHECK-LE-NEXT: blr
1493 %v = sitofp <2 x i64> %a to <2 x float>
1496 ; FIXME: The code quality here looks pretty bad.
1499 define <2 x i64> @test46(<2 x float> %a) {
1500 ; CHECK-LABEL: test46:
1502 ; CHECK-NEXT: addi r3, r1, -48
1503 ; CHECK-NEXT: stxvw4x v2, 0, r3
1504 ; CHECK-NEXT: lfs f0, -44(r1)
1505 ; CHECK-NEXT: xscvdpuxds f0, f0
1506 ; CHECK-NEXT: stfd f0, -32(r1)
1507 ; CHECK-NEXT: lfs f0, -48(r1)
1508 ; CHECK-NEXT: xscvdpuxds f0, f0
1509 ; CHECK-NEXT: stfd f0, -24(r1)
1510 ; CHECK-NEXT: ld r3, -32(r1)
1511 ; CHECK-NEXT: std r3, -8(r1)
1512 ; CHECK-NEXT: ld r3, -24(r1)
1513 ; CHECK-NEXT: std r3, -16(r1)
1514 ; CHECK-NEXT: addi r3, r1, -16
1515 ; CHECK-NEXT: lxvd2x v2, 0, r3
1518 ; CHECK-REG-LABEL: test46:
1519 ; CHECK-REG: # %bb.0:
1520 ; CHECK-REG-NEXT: addi r3, r1, -48
1521 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1522 ; CHECK-REG-NEXT: lfs f0, -44(r1)
1523 ; CHECK-REG-NEXT: xscvdpuxds f0, f0
1524 ; CHECK-REG-NEXT: stfd f0, -32(r1)
1525 ; CHECK-REG-NEXT: lfs f0, -48(r1)
1526 ; CHECK-REG-NEXT: xscvdpuxds f0, f0
1527 ; CHECK-REG-NEXT: stfd f0, -24(r1)
1528 ; CHECK-REG-NEXT: ld r3, -32(r1)
1529 ; CHECK-REG-NEXT: std r3, -8(r1)
1530 ; CHECK-REG-NEXT: ld r3, -24(r1)
1531 ; CHECK-REG-NEXT: std r3, -16(r1)
1532 ; CHECK-REG-NEXT: addi r3, r1, -16
1533 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1534 ; CHECK-REG-NEXT: blr
1536 ; CHECK-FISL-LABEL: test46:
1537 ; CHECK-FISL: # %bb.0:
1538 ; CHECK-FISL-NEXT: addi r3, r1, -48
1539 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1540 ; CHECK-FISL-NEXT: lfs f0, -44(r1)
1541 ; CHECK-FISL-NEXT: xscvdpuxds f0, f0
1542 ; CHECK-FISL-NEXT: stfd f0, -32(r1)
1543 ; CHECK-FISL-NEXT: lfs f0, -48(r1)
1544 ; CHECK-FISL-NEXT: xscvdpuxds f0, f0
1545 ; CHECK-FISL-NEXT: stfd f0, -24(r1)
1546 ; CHECK-FISL-NEXT: ld r3, -32(r1)
1547 ; CHECK-FISL-NEXT: std r3, -8(r1)
1548 ; CHECK-FISL-NEXT: ld r3, -24(r1)
1549 ; CHECK-FISL-NEXT: std r3, -16(r1)
1550 ; CHECK-FISL-NEXT: addi r3, r1, -16
1551 ; CHECK-FISL-NEXT: lxvd2x vs1, 0, r3
1552 ; CHECK-FISL-NEXT: xxlor v2, vs1, vs1
1553 ; CHECK-FISL-NEXT: blr
1555 ; CHECK-LE-LABEL: test46:
1556 ; CHECK-LE: # %bb.0:
1557 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 3
1558 ; CHECK-LE-NEXT: xxswapd vs1, v2
1559 ; CHECK-LE-NEXT: xscvspdpn f0, vs0
1560 ; CHECK-LE-NEXT: xscvspdpn f1, vs1
1561 ; CHECK-LE-NEXT: xxmrghd vs0, vs1, vs0
1562 ; CHECK-LE-NEXT: xvcvdpuxds v2, vs0
1563 ; CHECK-LE-NEXT: blr
1564 %v = fptoui <2 x float> %a to <2 x i64>
1567 ; FIXME: The code quality here looks pretty bad.
1570 define <2 x i64> @test47(<2 x float> %a) {
1571 ; CHECK-LABEL: test47:
1573 ; CHECK-NEXT: addi r3, r1, -48
1574 ; CHECK-NEXT: stxvw4x v2, 0, r3
1575 ; CHECK-NEXT: lfs f0, -44(r1)
1576 ; CHECK-NEXT: xscvdpsxds f0, f0
1577 ; CHECK-NEXT: stfd f0, -32(r1)
1578 ; CHECK-NEXT: lfs f0, -48(r1)
1579 ; CHECK-NEXT: xscvdpsxds f0, f0
1580 ; CHECK-NEXT: stfd f0, -24(r1)
1581 ; CHECK-NEXT: ld r3, -32(r1)
1582 ; CHECK-NEXT: std r3, -8(r1)
1583 ; CHECK-NEXT: ld r3, -24(r1)
1584 ; CHECK-NEXT: std r3, -16(r1)
1585 ; CHECK-NEXT: addi r3, r1, -16
1586 ; CHECK-NEXT: lxvd2x v2, 0, r3
1589 ; CHECK-REG-LABEL: test47:
1590 ; CHECK-REG: # %bb.0:
1591 ; CHECK-REG-NEXT: addi r3, r1, -48
1592 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1593 ; CHECK-REG-NEXT: lfs f0, -44(r1)
1594 ; CHECK-REG-NEXT: xscvdpsxds f0, f0
1595 ; CHECK-REG-NEXT: stfd f0, -32(r1)
1596 ; CHECK-REG-NEXT: lfs f0, -48(r1)
1597 ; CHECK-REG-NEXT: xscvdpsxds f0, f0
1598 ; CHECK-REG-NEXT: stfd f0, -24(r1)
1599 ; CHECK-REG-NEXT: ld r3, -32(r1)
1600 ; CHECK-REG-NEXT: std r3, -8(r1)
1601 ; CHECK-REG-NEXT: ld r3, -24(r1)
1602 ; CHECK-REG-NEXT: std r3, -16(r1)
1603 ; CHECK-REG-NEXT: addi r3, r1, -16
1604 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1605 ; CHECK-REG-NEXT: blr
1607 ; CHECK-FISL-LABEL: test47:
1608 ; CHECK-FISL: # %bb.0:
1609 ; CHECK-FISL-NEXT: addi r3, r1, -48
1610 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1611 ; CHECK-FISL-NEXT: lfs f0, -44(r1)
1612 ; CHECK-FISL-NEXT: xscvdpsxds f0, f0
1613 ; CHECK-FISL-NEXT: stfd f0, -32(r1)
1614 ; CHECK-FISL-NEXT: lfs f0, -48(r1)
1615 ; CHECK-FISL-NEXT: xscvdpsxds f0, f0
1616 ; CHECK-FISL-NEXT: stfd f0, -24(r1)
1617 ; CHECK-FISL-NEXT: ld r3, -32(r1)
1618 ; CHECK-FISL-NEXT: std r3, -8(r1)
1619 ; CHECK-FISL-NEXT: ld r3, -24(r1)
1620 ; CHECK-FISL-NEXT: std r3, -16(r1)
1621 ; CHECK-FISL-NEXT: addi r3, r1, -16
1622 ; CHECK-FISL-NEXT: lxvd2x vs1, 0, r3
1623 ; CHECK-FISL-NEXT: xxlor v2, vs1, vs1
1624 ; CHECK-FISL-NEXT: blr
1626 ; CHECK-LE-LABEL: test47:
1627 ; CHECK-LE: # %bb.0:
1628 ; CHECK-LE-NEXT: xxsldwi vs0, v2, v2, 3
1629 ; CHECK-LE-NEXT: xxswapd vs1, v2
1630 ; CHECK-LE-NEXT: xscvspdpn f0, vs0
1631 ; CHECK-LE-NEXT: xscvspdpn f1, vs1
1632 ; CHECK-LE-NEXT: xxmrghd vs0, vs1, vs0
1633 ; CHECK-LE-NEXT: xvcvdpsxds v2, vs0
1634 ; CHECK-LE-NEXT: blr
1635 %v = fptosi <2 x float> %a to <2 x i64>
1638 ; FIXME: The code quality here looks pretty bad.
1641 define <2 x double> @test50(double* %a) {
1642 ; CHECK-LABEL: test50:
1644 ; CHECK-NEXT: lxvdsx v2, 0, r3
1647 ; CHECK-REG-LABEL: test50:
1648 ; CHECK-REG: # %bb.0:
1649 ; CHECK-REG-NEXT: lxvdsx v2, 0, r3
1650 ; CHECK-REG-NEXT: blr
1652 ; CHECK-FISL-LABEL: test50:
1653 ; CHECK-FISL: # %bb.0:
1654 ; CHECK-FISL-NEXT: lxvdsx v2, 0, r3
1655 ; CHECK-FISL-NEXT: blr
1657 ; CHECK-LE-LABEL: test50:
1658 ; CHECK-LE: # %bb.0:
1659 ; CHECK-LE-NEXT: lxvdsx v2, 0, r3
1660 ; CHECK-LE-NEXT: blr
1661 %v = load double, double* %a, align 8
1662 %w = insertelement <2 x double> undef, double %v, i32 0
1663 %x = insertelement <2 x double> %w, double %v, i32 1
1669 define <2 x double> @test51(<2 x double> %a, <2 x double> %b) {
1670 ; CHECK-LABEL: test51:
1672 ; CHECK-NEXT: xxspltd v2, v2, 0
1675 ; CHECK-REG-LABEL: test51:
1676 ; CHECK-REG: # %bb.0:
1677 ; CHECK-REG-NEXT: xxspltd v2, v2, 0
1678 ; CHECK-REG-NEXT: blr
1680 ; CHECK-FISL-LABEL: test51:
1681 ; CHECK-FISL: # %bb.0:
1682 ; CHECK-FISL-NEXT: xxspltd v2, v2, 0
1683 ; CHECK-FISL-NEXT: blr
1685 ; CHECK-LE-LABEL: test51:
1686 ; CHECK-LE: # %bb.0:
1687 ; CHECK-LE-NEXT: xxspltd v2, v2, 1
1688 ; CHECK-LE-NEXT: blr
1689 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 0, i32 0>
1695 define <2 x double> @test52(<2 x double> %a, <2 x double> %b) {
1696 ; CHECK-LABEL: test52:
1698 ; CHECK-NEXT: xxmrghd v2, v2, v3
1701 ; CHECK-REG-LABEL: test52:
1702 ; CHECK-REG: # %bb.0:
1703 ; CHECK-REG-NEXT: xxmrghd v2, v2, v3
1704 ; CHECK-REG-NEXT: blr
1706 ; CHECK-FISL-LABEL: test52:
1707 ; CHECK-FISL: # %bb.0:
1708 ; CHECK-FISL-NEXT: xxmrghd v2, v2, v3
1709 ; CHECK-FISL-NEXT: blr
1711 ; CHECK-LE-LABEL: test52:
1712 ; CHECK-LE: # %bb.0:
1713 ; CHECK-LE-NEXT: xxmrgld v2, v3, v2
1714 ; CHECK-LE-NEXT: blr
1715 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 0, i32 2>
1721 define <2 x double> @test53(<2 x double> %a, <2 x double> %b) {
1722 ; CHECK-LABEL: test53:
1724 ; CHECK-NEXT: xxmrghd v2, v3, v2
1727 ; CHECK-REG-LABEL: test53:
1728 ; CHECK-REG: # %bb.0:
1729 ; CHECK-REG-NEXT: xxmrghd v2, v3, v2
1730 ; CHECK-REG-NEXT: blr
1732 ; CHECK-FISL-LABEL: test53:
1733 ; CHECK-FISL: # %bb.0:
1734 ; CHECK-FISL-NEXT: xxmrghd v2, v3, v2
1735 ; CHECK-FISL-NEXT: blr
1737 ; CHECK-LE-LABEL: test53:
1738 ; CHECK-LE: # %bb.0:
1739 ; CHECK-LE-NEXT: xxmrgld v2, v2, v3
1740 ; CHECK-LE-NEXT: blr
1741 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 2, i32 0>
1747 define <2 x double> @test54(<2 x double> %a, <2 x double> %b) {
1748 ; CHECK-LABEL: test54:
1750 ; CHECK-NEXT: xxpermdi v2, v2, v3, 2
1753 ; CHECK-REG-LABEL: test54:
1754 ; CHECK-REG: # %bb.0:
1755 ; CHECK-REG-NEXT: xxpermdi v2, v2, v3, 2
1756 ; CHECK-REG-NEXT: blr
1758 ; CHECK-FISL-LABEL: test54:
1759 ; CHECK-FISL: # %bb.0:
1760 ; CHECK-FISL-NEXT: xxpermdi v2, v2, v3, 2
1761 ; CHECK-FISL-NEXT: blr
1763 ; CHECK-LE-LABEL: test54:
1764 ; CHECK-LE: # %bb.0:
1765 ; CHECK-LE-NEXT: xxpermdi v2, v3, v2, 2
1766 ; CHECK-LE-NEXT: blr
1767 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 1, i32 2>
1773 define <2 x double> @test55(<2 x double> %a, <2 x double> %b) {
1774 ; CHECK-LABEL: test55:
1776 ; CHECK-NEXT: xxmrgld v2, v2, v3
1779 ; CHECK-REG-LABEL: test55:
1780 ; CHECK-REG: # %bb.0:
1781 ; CHECK-REG-NEXT: xxmrgld v2, v2, v3
1782 ; CHECK-REG-NEXT: blr
1784 ; CHECK-FISL-LABEL: test55:
1785 ; CHECK-FISL: # %bb.0:
1786 ; CHECK-FISL-NEXT: xxmrgld v2, v2, v3
1787 ; CHECK-FISL-NEXT: blr
1789 ; CHECK-LE-LABEL: test55:
1790 ; CHECK-LE: # %bb.0:
1791 ; CHECK-LE-NEXT: xxmrghd v2, v3, v2
1792 ; CHECK-LE-NEXT: blr
1793 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 1, i32 3>
1799 define <2 x i64> @test56(<2 x i64> %a, <2 x i64> %b) {
1800 ; CHECK-LABEL: test56:
1802 ; CHECK-NEXT: xxmrgld v2, v2, v3
1805 ; CHECK-REG-LABEL: test56:
1806 ; CHECK-REG: # %bb.0:
1807 ; CHECK-REG-NEXT: xxmrgld v2, v2, v3
1808 ; CHECK-REG-NEXT: blr
1810 ; CHECK-FISL-LABEL: test56:
1811 ; CHECK-FISL: # %bb.0:
1812 ; CHECK-FISL-NEXT: xxmrgld v2, v2, v3
1813 ; CHECK-FISL-NEXT: blr
1815 ; CHECK-LE-LABEL: test56:
1816 ; CHECK-LE: # %bb.0:
1817 ; CHECK-LE-NEXT: xxmrghd v2, v3, v2
1818 ; CHECK-LE-NEXT: blr
1819 %v = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 1, i32 3>
1825 define <2 x i64> @test60(<2 x i64> %a, <2 x i64> %b) {
1826 ; CHECK-LABEL: test60:
1828 ; CHECK-NEXT: addi r3, r1, -32
1829 ; CHECK-NEXT: addi r4, r1, -48
1830 ; CHECK-NEXT: stxvd2x v3, 0, r3
1831 ; CHECK-NEXT: stxvd2x v2, 0, r4
1832 ; CHECK-NEXT: lwz r3, -20(r1)
1833 ; CHECK-NEXT: ld r4, -40(r1)
1834 ; CHECK-NEXT: sld r3, r4, r3
1835 ; CHECK-NEXT: ld r4, -48(r1)
1836 ; CHECK-NEXT: std r3, -8(r1)
1837 ; CHECK-NEXT: lwz r3, -28(r1)
1838 ; CHECK-NEXT: sld r3, r4, r3
1839 ; CHECK-NEXT: std r3, -16(r1)
1840 ; CHECK-NEXT: addi r3, r1, -16
1841 ; CHECK-NEXT: lxvd2x v2, 0, r3
1844 ; CHECK-REG-LABEL: test60:
1845 ; CHECK-REG: # %bb.0:
1846 ; CHECK-REG-NEXT: addi r3, r1, -32
1847 ; CHECK-REG-NEXT: addi r4, r1, -48
1848 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
1849 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
1850 ; CHECK-REG-NEXT: lwz r3, -20(r1)
1851 ; CHECK-REG-NEXT: ld r4, -40(r1)
1852 ; CHECK-REG-NEXT: sld r3, r4, r3
1853 ; CHECK-REG-NEXT: ld r4, -48(r1)
1854 ; CHECK-REG-NEXT: std r3, -8(r1)
1855 ; CHECK-REG-NEXT: lwz r3, -28(r1)
1856 ; CHECK-REG-NEXT: sld r3, r4, r3
1857 ; CHECK-REG-NEXT: std r3, -16(r1)
1858 ; CHECK-REG-NEXT: addi r3, r1, -16
1859 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1860 ; CHECK-REG-NEXT: blr
1862 ; CHECK-FISL-LABEL: test60:
1863 ; CHECK-FISL: # %bb.0:
1864 ; CHECK-FISL-NEXT: addi r3, r1, -32
1865 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
1866 ; CHECK-FISL-NEXT: addi r3, r1, -48
1867 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1868 ; CHECK-FISL-NEXT: lwz r4, -20(r1)
1869 ; CHECK-FISL-NEXT: ld r3, -40(r1)
1870 ; CHECK-FISL-NEXT: sld r3, r3, r4
1871 ; CHECK-FISL-NEXT: std r3, -8(r1)
1872 ; CHECK-FISL-NEXT: lwz r4, -28(r1)
1873 ; CHECK-FISL-NEXT: ld r3, -48(r1)
1874 ; CHECK-FISL-NEXT: sld r3, r3, r4
1875 ; CHECK-FISL-NEXT: std r3, -16(r1)
1876 ; CHECK-FISL-NEXT: addi r3, r1, -16
1877 ; CHECK-FISL-NEXT: lxvd2x vs0, 0, r3
1878 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
1879 ; CHECK-FISL-NEXT: blr
1881 ; CHECK-LE-LABEL: test60:
1882 ; CHECK-LE: # %bb.0:
1883 ; CHECK-LE-NEXT: vsld v2, v2, v3
1884 ; CHECK-LE-NEXT: blr
1885 %v = shl <2 x i64> %a, %b
1888 ; This should scalarize, and the current code quality is not good.
1891 define <2 x i64> @test61(<2 x i64> %a, <2 x i64> %b) {
1892 ; CHECK-LABEL: test61:
1894 ; CHECK-NEXT: addi r3, r1, -32
1895 ; CHECK-NEXT: addi r4, r1, -48
1896 ; CHECK-NEXT: stxvd2x v3, 0, r3
1897 ; CHECK-NEXT: stxvd2x v2, 0, r4
1898 ; CHECK-NEXT: lwz r3, -20(r1)
1899 ; CHECK-NEXT: ld r4, -40(r1)
1900 ; CHECK-NEXT: srd r3, r4, r3
1901 ; CHECK-NEXT: ld r4, -48(r1)
1902 ; CHECK-NEXT: std r3, -8(r1)
1903 ; CHECK-NEXT: lwz r3, -28(r1)
1904 ; CHECK-NEXT: srd r3, r4, r3
1905 ; CHECK-NEXT: std r3, -16(r1)
1906 ; CHECK-NEXT: addi r3, r1, -16
1907 ; CHECK-NEXT: lxvd2x v2, 0, r3
1910 ; CHECK-REG-LABEL: test61:
1911 ; CHECK-REG: # %bb.0:
1912 ; CHECK-REG-NEXT: addi r3, r1, -32
1913 ; CHECK-REG-NEXT: addi r4, r1, -48
1914 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
1915 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
1916 ; CHECK-REG-NEXT: lwz r3, -20(r1)
1917 ; CHECK-REG-NEXT: ld r4, -40(r1)
1918 ; CHECK-REG-NEXT: srd r3, r4, r3
1919 ; CHECK-REG-NEXT: ld r4, -48(r1)
1920 ; CHECK-REG-NEXT: std r3, -8(r1)
1921 ; CHECK-REG-NEXT: lwz r3, -28(r1)
1922 ; CHECK-REG-NEXT: srd r3, r4, r3
1923 ; CHECK-REG-NEXT: std r3, -16(r1)
1924 ; CHECK-REG-NEXT: addi r3, r1, -16
1925 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1926 ; CHECK-REG-NEXT: blr
1928 ; CHECK-FISL-LABEL: test61:
1929 ; CHECK-FISL: # %bb.0:
1930 ; CHECK-FISL-NEXT: addi r3, r1, -32
1931 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
1932 ; CHECK-FISL-NEXT: addi r3, r1, -48
1933 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1934 ; CHECK-FISL-NEXT: lwz r4, -20(r1)
1935 ; CHECK-FISL-NEXT: ld r3, -40(r1)
1936 ; CHECK-FISL-NEXT: srd r3, r3, r4
1937 ; CHECK-FISL-NEXT: std r3, -8(r1)
1938 ; CHECK-FISL-NEXT: lwz r4, -28(r1)
1939 ; CHECK-FISL-NEXT: ld r3, -48(r1)
1940 ; CHECK-FISL-NEXT: srd r3, r3, r4
1941 ; CHECK-FISL-NEXT: std r3, -16(r1)
1942 ; CHECK-FISL-NEXT: addi r3, r1, -16
1943 ; CHECK-FISL-NEXT: lxvd2x vs0, 0, r3
1944 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
1945 ; CHECK-FISL-NEXT: blr
1947 ; CHECK-LE-LABEL: test61:
1948 ; CHECK-LE: # %bb.0:
1949 ; CHECK-LE-NEXT: vsrd v2, v2, v3
1950 ; CHECK-LE-NEXT: blr
1951 %v = lshr <2 x i64> %a, %b
1954 ; This should scalarize, and the current code quality is not good.
1957 define <2 x i64> @test62(<2 x i64> %a, <2 x i64> %b) {
1958 ; CHECK-LABEL: test62:
1960 ; CHECK-NEXT: addi r3, r1, -32
1961 ; CHECK-NEXT: addi r4, r1, -48
1962 ; CHECK-NEXT: stxvd2x v3, 0, r3
1963 ; CHECK-NEXT: stxvd2x v2, 0, r4
1964 ; CHECK-NEXT: lwz r3, -20(r1)
1965 ; CHECK-NEXT: ld r4, -40(r1)
1966 ; CHECK-NEXT: srad r3, r4, r3
1967 ; CHECK-NEXT: ld r4, -48(r1)
1968 ; CHECK-NEXT: std r3, -8(r1)
1969 ; CHECK-NEXT: lwz r3, -28(r1)
1970 ; CHECK-NEXT: srad r3, r4, r3
1971 ; CHECK-NEXT: std r3, -16(r1)
1972 ; CHECK-NEXT: addi r3, r1, -16
1973 ; CHECK-NEXT: lxvd2x v2, 0, r3
1976 ; CHECK-REG-LABEL: test62:
1977 ; CHECK-REG: # %bb.0:
1978 ; CHECK-REG-NEXT: addi r3, r1, -32
1979 ; CHECK-REG-NEXT: addi r4, r1, -48
1980 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
1981 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
1982 ; CHECK-REG-NEXT: lwz r3, -20(r1)
1983 ; CHECK-REG-NEXT: ld r4, -40(r1)
1984 ; CHECK-REG-NEXT: srad r3, r4, r3
1985 ; CHECK-REG-NEXT: ld r4, -48(r1)
1986 ; CHECK-REG-NEXT: std r3, -8(r1)
1987 ; CHECK-REG-NEXT: lwz r3, -28(r1)
1988 ; CHECK-REG-NEXT: srad r3, r4, r3
1989 ; CHECK-REG-NEXT: std r3, -16(r1)
1990 ; CHECK-REG-NEXT: addi r3, r1, -16
1991 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1992 ; CHECK-REG-NEXT: blr
1994 ; CHECK-FISL-LABEL: test62:
1995 ; CHECK-FISL: # %bb.0:
1996 ; CHECK-FISL-NEXT: addi r3, r1, -32
1997 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
1998 ; CHECK-FISL-NEXT: addi r3, r1, -48
1999 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
2000 ; CHECK-FISL-NEXT: lwz r4, -20(r1)
2001 ; CHECK-FISL-NEXT: ld r3, -40(r1)
2002 ; CHECK-FISL-NEXT: srad r3, r3, r4
2003 ; CHECK-FISL-NEXT: std r3, -8(r1)
2004 ; CHECK-FISL-NEXT: lwz r4, -28(r1)
2005 ; CHECK-FISL-NEXT: ld r3, -48(r1)
2006 ; CHECK-FISL-NEXT: srad r3, r3, r4
2007 ; CHECK-FISL-NEXT: std r3, -16(r1)
2008 ; CHECK-FISL-NEXT: addi r3, r1, -16
2009 ; CHECK-FISL-NEXT: lxvd2x vs0, 0, r3
2010 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
2011 ; CHECK-FISL-NEXT: blr
2013 ; CHECK-LE-LABEL: test62:
2014 ; CHECK-LE: # %bb.0:
2015 ; CHECK-LE-NEXT: vsrad v2, v2, v3
2016 ; CHECK-LE-NEXT: blr
2017 %v = ashr <2 x i64> %a, %b
2020 ; This should scalarize, and the current code quality is not good.
2023 define double @test63(<2 x double> %a) {
2024 ; CHECK-LABEL: test63:
2026 ; CHECK-NEXT: xxlor f1, v2, v2
2029 ; CHECK-REG-LABEL: test63:
2030 ; CHECK-REG: # %bb.0:
2031 ; CHECK-REG-NEXT: xxlor f1, v2, v2
2032 ; CHECK-REG-NEXT: blr
2034 ; CHECK-FISL-LABEL: test63:
2035 ; CHECK-FISL: # %bb.0:
2036 ; CHECK-FISL-NEXT: # kill: def $vf2 killed $vf2 killed $v2
2037 ; CHECK-FISL-NEXT: xxlor f1, v2, v2
2038 ; CHECK-FISL-NEXT: blr
2040 ; CHECK-LE-LABEL: test63:
2041 ; CHECK-LE: # %bb.0:
2042 ; CHECK-LE-NEXT: xxswapd vs1, v2
2043 ; CHECK-LE-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2044 ; CHECK-LE-NEXT: blr
2045 %v = extractelement <2 x double> %a, i32 0
2052 define double @test64(<2 x double> %a) {
2053 ; CHECK-LABEL: test64:
2055 ; CHECK-NEXT: xxswapd vs1, v2
2056 ; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2059 ; CHECK-REG-LABEL: test64:
2060 ; CHECK-REG: # %bb.0:
2061 ; CHECK-REG-NEXT: xxswapd vs1, v2
2062 ; CHECK-REG-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2063 ; CHECK-REG-NEXT: blr
2065 ; CHECK-FISL-LABEL: test64:
2066 ; CHECK-FISL: # %bb.0:
2067 ; CHECK-FISL-NEXT: xxswapd vs0, v2
2068 ; CHECK-FISL-NEXT: # kill: def $f0 killed $f0 killed $vsl0
2069 ; CHECK-FISL-NEXT: fmr f1, f0
2070 ; CHECK-FISL-NEXT: blr
2072 ; CHECK-LE-LABEL: test64:
2073 ; CHECK-LE: # %bb.0:
2074 ; CHECK-LE-NEXT: xxlor f1, v2, v2
2075 ; CHECK-LE-NEXT: blr
2076 %v = extractelement <2 x double> %a, i32 1
2083 define <2 x i1> @test65(<2 x i64> %a, <2 x i64> %b) {
2084 ; CHECK-LABEL: test65:
2086 ; CHECK-NEXT: vcmpequw v2, v2, v3
2089 ; CHECK-REG-LABEL: test65:
2090 ; CHECK-REG: # %bb.0:
2091 ; CHECK-REG-NEXT: vcmpequw v2, v2, v3
2092 ; CHECK-REG-NEXT: blr
2094 ; CHECK-FISL-LABEL: test65:
2095 ; CHECK-FISL: # %bb.0:
2096 ; CHECK-FISL-NEXT: vcmpequw v2, v2, v3
2097 ; CHECK-FISL-NEXT: blr
2099 ; CHECK-LE-LABEL: test65:
2100 ; CHECK-LE: # %bb.0:
2101 ; CHECK-LE-NEXT: vcmpequd v2, v2, v3
2102 ; CHECK-LE-NEXT: blr
2103 %w = icmp eq <2 x i64> %a, %b
2110 define <2 x i1> @test66(<2 x i64> %a, <2 x i64> %b) {
2111 ; CHECK-LABEL: test66:
2113 ; CHECK-NEXT: vcmpequw v2, v2, v3
2114 ; CHECK-NEXT: xxlnor v2, v2, v2
2117 ; CHECK-REG-LABEL: test66:
2118 ; CHECK-REG: # %bb.0:
2119 ; CHECK-REG-NEXT: vcmpequw v2, v2, v3
2120 ; CHECK-REG-NEXT: xxlnor v2, v2, v2
2121 ; CHECK-REG-NEXT: blr
2123 ; CHECK-FISL-LABEL: test66:
2124 ; CHECK-FISL: # %bb.0:
2125 ; CHECK-FISL-NEXT: vcmpequw v2, v2, v3
2126 ; CHECK-FISL-NEXT: xxlnor vs0, v2, v2
2127 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
2128 ; CHECK-FISL-NEXT: blr
2130 ; CHECK-LE-LABEL: test66:
2131 ; CHECK-LE: # %bb.0:
2132 ; CHECK-LE-NEXT: vcmpequd v2, v2, v3
2133 ; CHECK-LE-NEXT: xxlnor v2, v2, v2
2134 ; CHECK-LE-NEXT: blr
2135 %w = icmp ne <2 x i64> %a, %b
2142 define <2 x i1> @test67(<2 x i64> %a, <2 x i64> %b) {
2143 ; CHECK-LABEL: test67:
2145 ; CHECK-NEXT: addi r3, r1, -32
2146 ; CHECK-NEXT: addi r4, r1, -48
2147 ; CHECK-NEXT: stxvd2x v3, 0, r3
2148 ; CHECK-NEXT: stxvd2x v2, 0, r4
2149 ; CHECK-NEXT: ld r3, -24(r1)
2150 ; CHECK-NEXT: ld r4, -40(r1)
2151 ; CHECK-NEXT: ld r6, -48(r1)
2152 ; CHECK-NEXT: cmpld r4, r3
2153 ; CHECK-NEXT: li r3, 0
2154 ; CHECK-NEXT: li r4, -1
2155 ; CHECK-NEXT: isel r5, r4, r3, lt
2156 ; CHECK-NEXT: std r5, -8(r1)
2157 ; CHECK-NEXT: ld r5, -32(r1)
2158 ; CHECK-NEXT: cmpld r6, r5
2159 ; CHECK-NEXT: isel r3, r4, r3, lt
2160 ; CHECK-NEXT: std r3, -16(r1)
2161 ; CHECK-NEXT: addi r3, r1, -16
2162 ; CHECK-NEXT: lxvd2x v2, 0, r3
2165 ; CHECK-REG-LABEL: test67:
2166 ; CHECK-REG: # %bb.0:
2167 ; CHECK-REG-NEXT: addi r3, r1, -32
2168 ; CHECK-REG-NEXT: addi r4, r1, -48
2169 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
2170 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
2171 ; CHECK-REG-NEXT: ld r3, -24(r1)
2172 ; CHECK-REG-NEXT: ld r4, -40(r1)
2173 ; CHECK-REG-NEXT: ld r6, -48(r1)
2174 ; CHECK-REG-NEXT: cmpld r4, r3
2175 ; CHECK-REG-NEXT: li r3, 0
2176 ; CHECK-REG-NEXT: li r4, -1
2177 ; CHECK-REG-NEXT: isel r5, r4, r3, lt
2178 ; CHECK-REG-NEXT: std r5, -8(r1)
2179 ; CHECK-REG-NEXT: ld r5, -32(r1)
2180 ; CHECK-REG-NEXT: cmpld r6, r5
2181 ; CHECK-REG-NEXT: isel r3, r4, r3, lt
2182 ; CHECK-REG-NEXT: std r3, -16(r1)
2183 ; CHECK-REG-NEXT: addi r3, r1, -16
2184 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
2185 ; CHECK-REG-NEXT: blr
2187 ; CHECK-FISL-LABEL: test67:
2188 ; CHECK-FISL: # %bb.0:
2189 ; CHECK-FISL-NEXT: addi r3, r1, -32
2190 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
2191 ; CHECK-FISL-NEXT: addi r3, r1, -48
2192 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
2193 ; CHECK-FISL-NEXT: ld r3, -24(r1)
2194 ; CHECK-FISL-NEXT: ld r4, -40(r1)
2195 ; CHECK-FISL-NEXT: cmpld r4, r3
2196 ; CHECK-FISL-NEXT: li r3, 0
2197 ; CHECK-FISL-NEXT: li r4, -1
2198 ; CHECK-FISL-NEXT: isel r5, r4, r3, lt
2199 ; CHECK-FISL-NEXT: std r5, -8(r1)
2200 ; CHECK-FISL-NEXT: ld r5, -32(r1)
2201 ; CHECK-FISL-NEXT: ld r6, -48(r1)
2202 ; CHECK-FISL-NEXT: cmpld r6, r5
2203 ; CHECK-FISL-NEXT: isel r3, r4, r3, lt
2204 ; CHECK-FISL-NEXT: std r3, -16(r1)
2205 ; CHECK-FISL-NEXT: addi r3, r1, -16
2206 ; CHECK-FISL-NEXT: lxvd2x vs0, 0, r3
2207 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
2208 ; CHECK-FISL-NEXT: blr
2210 ; CHECK-LE-LABEL: test67:
2211 ; CHECK-LE: # %bb.0:
2212 ; CHECK-LE-NEXT: vcmpgtud v2, v3, v2
2213 ; CHECK-LE-NEXT: blr
2214 %w = icmp ult <2 x i64> %a, %b
2217 ; This should scalarize, and the current code quality is not good.
2221 define <2 x double> @test68(<2 x i32> %a) {
2222 ; CHECK-LABEL: test68:
2224 ; CHECK-NEXT: xxmrghw vs0, v2, v2
2225 ; CHECK-NEXT: xvcvsxwdp v2, vs0
2228 ; CHECK-REG-LABEL: test68:
2229 ; CHECK-REG: # %bb.0:
2230 ; CHECK-REG-NEXT: xxmrghw vs0, v2, v2
2231 ; CHECK-REG-NEXT: xvcvsxwdp v2, vs0
2232 ; CHECK-REG-NEXT: blr
2234 ; CHECK-FISL-LABEL: test68:
2235 ; CHECK-FISL: # %bb.0:
2236 ; CHECK-FISL-NEXT: xxmrghw vs0, v2, v2
2237 ; CHECK-FISL-NEXT: xvcvsxwdp v2, vs0
2238 ; CHECK-FISL-NEXT: blr
2240 ; CHECK-LE-LABEL: test68:
2241 ; CHECK-LE: # %bb.0:
2242 ; CHECK-LE-NEXT: xxmrglw v2, v2, v2
2243 ; CHECK-LE-NEXT: xvcvsxwdp v2, v2
2244 ; CHECK-LE-NEXT: blr
2245 %w = sitofp <2 x i32> %a to <2 x double>
2251 ; This gets scalarized so the code isn't great
2252 define <2 x double> @test69(<2 x i16> %a) {
2253 ; CHECK-LABEL: test69:
2255 ; CHECK-NEXT: addis r3, r2, .LCPI63_0@toc@ha
2256 ; CHECK-NEXT: addi r3, r3, .LCPI63_0@toc@l
2257 ; CHECK-NEXT: lxvw4x v3, 0, r3
2258 ; CHECK-NEXT: addi r3, r1, -32
2259 ; CHECK-NEXT: vperm v2, v2, v2, v3
2260 ; CHECK-NEXT: stxvd2x v2, 0, r3
2261 ; CHECK-NEXT: lha r3, -18(r1)
2262 ; CHECK-NEXT: std r3, -8(r1)
2263 ; CHECK-NEXT: lha r3, -26(r1)
2264 ; CHECK-NEXT: std r3, -16(r1)
2265 ; CHECK-NEXT: addi r3, r1, -16
2266 ; CHECK-NEXT: lxvd2x v2, 0, r3
2267 ; CHECK-NEXT: xvcvsxddp v2, v2
2270 ; CHECK-REG-LABEL: test69:
2271 ; CHECK-REG: # %bb.0:
2272 ; CHECK-REG-NEXT: addis r3, r2, .LCPI63_0@toc@ha
2273 ; CHECK-REG-NEXT: addi r3, r3, .LCPI63_0@toc@l
2274 ; CHECK-REG-NEXT: lxvw4x v3, 0, r3
2275 ; CHECK-REG-NEXT: addi r3, r1, -32
2276 ; CHECK-REG-NEXT: vperm v2, v2, v2, v3
2277 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
2278 ; CHECK-REG-NEXT: lha r3, -18(r1)
2279 ; CHECK-REG-NEXT: std r3, -8(r1)
2280 ; CHECK-REG-NEXT: lha r3, -26(r1)
2281 ; CHECK-REG-NEXT: std r3, -16(r1)
2282 ; CHECK-REG-NEXT: addi r3, r1, -16
2283 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
2284 ; CHECK-REG-NEXT: xvcvsxddp v2, v2
2285 ; CHECK-REG-NEXT: blr
2287 ; CHECK-FISL-LABEL: test69:
2288 ; CHECK-FISL: # %bb.0:
2289 ; CHECK-FISL-NEXT: addis r3, r2, .LCPI63_0@toc@ha
2290 ; CHECK-FISL-NEXT: addi r3, r3, .LCPI63_0@toc@l
2291 ; CHECK-FISL-NEXT: lxvw4x v3, 0, r3
2292 ; CHECK-FISL-NEXT: vperm v2, v2, v2, v3
2293 ; CHECK-FISL-NEXT: addi r3, r1, -32
2294 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
2295 ; CHECK-FISL-NEXT: lha r3, -18(r1)
2296 ; CHECK-FISL-NEXT: std r3, -8(r1)
2297 ; CHECK-FISL-NEXT: lha r3, -26(r1)
2298 ; CHECK-FISL-NEXT: std r3, -16(r1)
2299 ; CHECK-FISL-NEXT: addi r3, r1, -16
2300 ; CHECK-FISL-NEXT: lxvd2x vs0, 0, r3
2301 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
2302 ; CHECK-FISL-NEXT: xvcvsxddp v2, v2
2303 ; CHECK-FISL-NEXT: blr
2305 ; CHECK-LE-LABEL: test69:
2306 ; CHECK-LE: # %bb.0:
2307 ; CHECK-LE-NEXT: addis r3, r2, .LCPI63_0@toc@ha
2308 ; CHECK-LE-NEXT: addi r3, r3, .LCPI63_0@toc@l
2309 ; CHECK-LE-NEXT: lvx v3, 0, r3
2310 ; CHECK-LE-NEXT: addis r3, r2, .LCPI63_1@toc@ha
2311 ; CHECK-LE-NEXT: addi r3, r3, .LCPI63_1@toc@l
2312 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
2313 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2314 ; CHECK-LE-NEXT: xxswapd v3, vs0
2315 ; CHECK-LE-NEXT: vsld v2, v2, v3
2316 ; CHECK-LE-NEXT: vsrad v2, v2, v3
2317 ; CHECK-LE-NEXT: xvcvsxddp v2, v2
2318 ; CHECK-LE-NEXT: blr
2319 %w = sitofp <2 x i16> %a to <2 x double>
2325 ; This gets scalarized so the code isn't great
2326 define <2 x double> @test70(<2 x i8> %a) {
2327 ; CHECK-LABEL: test70:
2329 ; CHECK-NEXT: addis r3, r2, .LCPI64_0@toc@ha
2330 ; CHECK-NEXT: addi r3, r3, .LCPI64_0@toc@l
2331 ; CHECK-NEXT: lxvw4x v3, 0, r3
2332 ; CHECK-NEXT: addi r3, r1, -32
2333 ; CHECK-NEXT: vperm v2, v2, v2, v3
2334 ; CHECK-NEXT: stxvd2x v2, 0, r3
2335 ; CHECK-NEXT: ld r3, -24(r1)
2336 ; CHECK-NEXT: extsb r3, r3
2337 ; CHECK-NEXT: std r3, -8(r1)
2338 ; CHECK-NEXT: ld r3, -32(r1)
2339 ; CHECK-NEXT: extsb r3, r3
2340 ; CHECK-NEXT: std r3, -16(r1)
2341 ; CHECK-NEXT: addi r3, r1, -16
2342 ; CHECK-NEXT: lxvd2x v2, 0, r3
2343 ; CHECK-NEXT: xvcvsxddp v2, v2
2346 ; CHECK-REG-LABEL: test70:
2347 ; CHECK-REG: # %bb.0:
2348 ; CHECK-REG-NEXT: addis r3, r2, .LCPI64_0@toc@ha
2349 ; CHECK-REG-NEXT: addi r3, r3, .LCPI64_0@toc@l
2350 ; CHECK-REG-NEXT: lxvw4x v3, 0, r3
2351 ; CHECK-REG-NEXT: addi r3, r1, -32
2352 ; CHECK-REG-NEXT: vperm v2, v2, v2, v3
2353 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
2354 ; CHECK-REG-NEXT: ld r3, -24(r1)
2355 ; CHECK-REG-NEXT: extsb r3, r3
2356 ; CHECK-REG-NEXT: std r3, -8(r1)
2357 ; CHECK-REG-NEXT: ld r3, -32(r1)
2358 ; CHECK-REG-NEXT: extsb r3, r3
2359 ; CHECK-REG-NEXT: std r3, -16(r1)
2360 ; CHECK-REG-NEXT: addi r3, r1, -16
2361 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
2362 ; CHECK-REG-NEXT: xvcvsxddp v2, v2
2363 ; CHECK-REG-NEXT: blr
2365 ; CHECK-FISL-LABEL: test70:
2366 ; CHECK-FISL: # %bb.0:
2367 ; CHECK-FISL-NEXT: addis r3, r2, .LCPI64_0@toc@ha
2368 ; CHECK-FISL-NEXT: addi r3, r3, .LCPI64_0@toc@l
2369 ; CHECK-FISL-NEXT: lxvw4x v3, 0, r3
2370 ; CHECK-FISL-NEXT: vperm v2, v2, v2, v3
2371 ; CHECK-FISL-NEXT: addi r3, r1, -32
2372 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
2373 ; CHECK-FISL-NEXT: ld r3, -24(r1)
2374 ; CHECK-FISL-NEXT: extsb r3, r3
2375 ; CHECK-FISL-NEXT: std r3, -8(r1)
2376 ; CHECK-FISL-NEXT: ld r3, -32(r1)
2377 ; CHECK-FISL-NEXT: extsb r3, r3
2378 ; CHECK-FISL-NEXT: std r3, -16(r1)
2379 ; CHECK-FISL-NEXT: addi r3, r1, -16
2380 ; CHECK-FISL-NEXT: lxvd2x vs0, 0, r3
2381 ; CHECK-FISL-NEXT: xxlor v2, vs0, vs0
2382 ; CHECK-FISL-NEXT: xvcvsxddp v2, v2
2383 ; CHECK-FISL-NEXT: blr
2385 ; CHECK-LE-LABEL: test70:
2386 ; CHECK-LE: # %bb.0:
2387 ; CHECK-LE-NEXT: addis r3, r2, .LCPI64_0@toc@ha
2388 ; CHECK-LE-NEXT: addi r3, r3, .LCPI64_0@toc@l
2389 ; CHECK-LE-NEXT: lvx v3, 0, r3
2390 ; CHECK-LE-NEXT: addis r3, r2, .LCPI64_1@toc@ha
2391 ; CHECK-LE-NEXT: addi r3, r3, .LCPI64_1@toc@l
2392 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
2393 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2394 ; CHECK-LE-NEXT: xxswapd v3, vs0
2395 ; CHECK-LE-NEXT: vsld v2, v2, v3
2396 ; CHECK-LE-NEXT: vsrad v2, v2, v3
2397 ; CHECK-LE-NEXT: xvcvsxddp v2, v2
2398 ; CHECK-LE-NEXT: blr
2399 %w = sitofp <2 x i8> %a to <2 x double>
2405 ; This gets scalarized so the code isn't great
2406 define <2 x i32> @test80(i32 %v) {
2407 ; CHECK-LABEL: test80:
2409 ; CHECK-NEXT: addi r4, r1, -16
2410 ; CHECK-NEXT: stw r3, -16(r1)
2411 ; CHECK-NEXT: addis r3, r2, .LCPI65_0@toc@ha
2412 ; CHECK-NEXT: lxvw4x vs0, 0, r4
2413 ; CHECK-NEXT: addi r3, r3, .LCPI65_0@toc@l
2414 ; CHECK-NEXT: lxvw4x v3, 0, r3
2415 ; CHECK-NEXT: xxspltw v2, vs0, 0
2416 ; CHECK-NEXT: vadduwm v2, v2, v3
2419 ; CHECK-REG-LABEL: test80:
2420 ; CHECK-REG: # %bb.0:
2421 ; CHECK-REG-NEXT: addi r4, r1, -16
2422 ; CHECK-REG-NEXT: stw r3, -16(r1)
2423 ; CHECK-REG-NEXT: addis r3, r2, .LCPI65_0@toc@ha
2424 ; CHECK-REG-NEXT: lxvw4x vs0, 0, r4
2425 ; CHECK-REG-NEXT: addi r3, r3, .LCPI65_0@toc@l
2426 ; CHECK-REG-NEXT: lxvw4x v3, 0, r3
2427 ; CHECK-REG-NEXT: xxspltw v2, vs0, 0
2428 ; CHECK-REG-NEXT: vadduwm v2, v2, v3
2429 ; CHECK-REG-NEXT: blr
2431 ; CHECK-FISL-LABEL: test80:
2432 ; CHECK-FISL: # %bb.0:
2433 ; CHECK-FISL-NEXT: # kill: def $r3 killed $r3 killed $x3
2434 ; CHECK-FISL-NEXT: stw r3, -16(r1)
2435 ; CHECK-FISL-NEXT: addi r4, r1, -16
2436 ; CHECK-FISL-NEXT: lxvw4x vs0, 0, r4
2437 ; CHECK-FISL-NEXT: xxspltw v2, vs0, 0
2438 ; CHECK-FISL-NEXT: addis r4, r2, .LCPI65_0@toc@ha
2439 ; CHECK-FISL-NEXT: addi r4, r4, .LCPI65_0@toc@l
2440 ; CHECK-FISL-NEXT: lxvw4x v3, 0, r4
2441 ; CHECK-FISL-NEXT: vadduwm v2, v2, v3
2442 ; CHECK-FISL-NEXT: blr
2444 ; CHECK-LE-LABEL: test80:
2445 ; CHECK-LE: # %bb.0:
2446 ; CHECK-LE-NEXT: mtvsrd f0, r3
2447 ; CHECK-LE-NEXT: addis r4, r2, .LCPI65_0@toc@ha
2448 ; CHECK-LE-NEXT: addi r3, r4, .LCPI65_0@toc@l
2449 ; CHECK-LE-NEXT: xxswapd vs0, vs0
2450 ; CHECK-LE-NEXT: lvx v3, 0, r3
2451 ; CHECK-LE-NEXT: xxspltw v2, vs0, 3
2452 ; CHECK-LE-NEXT: vadduwm v2, v2, v3
2453 ; CHECK-LE-NEXT: blr
2454 %b1 = insertelement <2 x i32> undef, i32 %v, i32 0
2455 %b2 = shufflevector <2 x i32> %b1, <2 x i32> undef, <2 x i32> zeroinitializer
2456 %i = add <2 x i32> %b2, <i32 2, i32 3>
2463 define <2 x double> @test81(<4 x float> %b) {
2464 ; CHECK-LABEL: test81:
2468 ; CHECK-REG-LABEL: test81:
2469 ; CHECK-REG: # %bb.0:
2470 ; CHECK-REG-NEXT: blr
2472 ; CHECK-FISL-LABEL: test81:
2473 ; CHECK-FISL: # %bb.0:
2474 ; CHECK-FISL-NEXT: blr
2476 ; CHECK-LE-LABEL: test81:
2477 ; CHECK-LE: # %bb.0:
2478 ; CHECK-LE-NEXT: blr
2479 %w = bitcast <4 x float> %b to <2 x double>
2485 define double @test82(double %a, double %b, double %c, double %d) {
2486 ; CHECK-LABEL: test82:
2487 ; CHECK: # %bb.0: # %entry
2488 ; CHECK-NEXT: xscmpudp cr0, f3, f4
2489 ; CHECK-NEXT: beqlr cr0
2490 ; CHECK-NEXT: # %bb.1: # %entry
2491 ; CHECK-NEXT: fmr f1, f2
2494 ; CHECK-REG-LABEL: test82:
2495 ; CHECK-REG: # %bb.0: # %entry
2496 ; CHECK-REG-NEXT: xscmpudp cr0, f3, f4
2497 ; CHECK-REG-NEXT: beqlr cr0
2498 ; CHECK-REG-NEXT: # %bb.1: # %entry
2499 ; CHECK-REG-NEXT: fmr f1, f2
2500 ; CHECK-REG-NEXT: blr
2502 ; CHECK-FISL-LABEL: test82:
2503 ; CHECK-FISL: # %bb.0: # %entry
2504 ; CHECK-FISL-NEXT: xscmpudp cr0, f3, f4
2505 ; CHECK-FISL-NEXT: stfd f2, -8(r1) # 8-byte Folded Spill
2506 ; CHECK-FISL-NEXT: stfd f1, -16(r1) # 8-byte Folded Spill
2507 ; CHECK-FISL-NEXT: beq cr0, .LBB67_2
2508 ; CHECK-FISL-NEXT: # %bb.1: # %entry
2509 ; CHECK-FISL-NEXT: lfd f0, -8(r1) # 8-byte Folded Reload
2510 ; CHECK-FISL-NEXT: stfd f0, -16(r1) # 8-byte Folded Spill
2511 ; CHECK-FISL-NEXT: .LBB67_2: # %entry
2512 ; CHECK-FISL-NEXT: lfd f0, -16(r1) # 8-byte Folded Reload
2513 ; CHECK-FISL-NEXT: fmr f1, f0
2514 ; CHECK-FISL-NEXT: blr
2516 ; CHECK-LE-LABEL: test82:
2517 ; CHECK-LE: # %bb.0: # %entry
2518 ; CHECK-LE-NEXT: xscmpudp cr0, f3, f4
2519 ; CHECK-LE-NEXT: beqlr cr0
2520 ; CHECK-LE-NEXT: # %bb.1: # %entry
2521 ; CHECK-LE-NEXT: fmr f1, f2
2522 ; CHECK-LE-NEXT: blr
2524 %m = fcmp oeq double %c, %d
2525 %v = select i1 %m, double %a, double %b