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 v2, v2, v3
168 ; CHECK-FISL-NEXT: blr
170 ; CHECK-LE-LABEL: test6:
171 ; CHECK-LE: # %bb.0: # %entry
172 ; CHECK-LE-NEXT: xxlxor v2, v2, v3
175 %v = xor <8 x i16> %a, %b
182 define <16 x i8> @test7(<16 x i8> %a, <16 x i8> %b) {
183 ; CHECK-LABEL: test7:
184 ; CHECK: # %bb.0: # %entry
185 ; CHECK-NEXT: xxlxor v2, v2, v3
188 ; CHECK-REG-LABEL: test7:
189 ; CHECK-REG: # %bb.0: # %entry
190 ; CHECK-REG-NEXT: xxlxor v2, v2, v3
191 ; CHECK-REG-NEXT: blr
193 ; CHECK-FISL-LABEL: test7:
194 ; CHECK-FISL: # %bb.0: # %entry
195 ; CHECK-FISL-NEXT: xxlxor v2, v2, v3
196 ; CHECK-FISL-NEXT: blr
198 ; CHECK-LE-LABEL: test7:
199 ; CHECK-LE: # %bb.0: # %entry
200 ; CHECK-LE-NEXT: xxlxor v2, v2, v3
203 %v = xor <16 x i8> %a, %b
210 define <4 x i32> @test8(<4 x i32> %a, <4 x i32> %b) {
211 ; CHECK-LABEL: test8:
212 ; CHECK: # %bb.0: # %entry
213 ; CHECK-NEXT: xxlor v2, v2, v3
216 ; CHECK-REG-LABEL: test8:
217 ; CHECK-REG: # %bb.0: # %entry
218 ; CHECK-REG-NEXT: xxlor v2, v2, v3
219 ; CHECK-REG-NEXT: blr
221 ; CHECK-FISL-LABEL: test8:
222 ; CHECK-FISL: # %bb.0: # %entry
223 ; CHECK-FISL-NEXT: xxlor v2, v2, v3
224 ; CHECK-FISL-NEXT: blr
226 ; CHECK-LE-LABEL: test8:
227 ; CHECK-LE: # %bb.0: # %entry
228 ; CHECK-LE-NEXT: xxlor v2, v2, v3
231 %v = or <4 x i32> %a, %b
238 define <8 x i16> @test9(<8 x i16> %a, <8 x i16> %b) {
239 ; CHECK-LABEL: test9:
240 ; CHECK: # %bb.0: # %entry
241 ; CHECK-NEXT: xxlor v2, v2, v3
244 ; CHECK-REG-LABEL: test9:
245 ; CHECK-REG: # %bb.0: # %entry
246 ; CHECK-REG-NEXT: xxlor v2, v2, v3
247 ; CHECK-REG-NEXT: blr
249 ; CHECK-FISL-LABEL: test9:
250 ; CHECK-FISL: # %bb.0: # %entry
251 ; CHECK-FISL-NEXT: xxlor v2, v2, v3
252 ; CHECK-FISL-NEXT: blr
254 ; CHECK-LE-LABEL: test9:
255 ; CHECK-LE: # %bb.0: # %entry
256 ; CHECK-LE-NEXT: xxlor v2, v2, v3
259 %v = or <8 x i16> %a, %b
266 define <16 x i8> @test10(<16 x i8> %a, <16 x i8> %b) {
267 ; CHECK-LABEL: test10:
268 ; CHECK: # %bb.0: # %entry
269 ; CHECK-NEXT: xxlor v2, v2, v3
272 ; CHECK-REG-LABEL: test10:
273 ; CHECK-REG: # %bb.0: # %entry
274 ; CHECK-REG-NEXT: xxlor v2, v2, v3
275 ; CHECK-REG-NEXT: blr
277 ; CHECK-FISL-LABEL: test10:
278 ; CHECK-FISL: # %bb.0: # %entry
279 ; CHECK-FISL-NEXT: xxlor v2, v2, v3
280 ; CHECK-FISL-NEXT: blr
282 ; CHECK-LE-LABEL: test10:
283 ; CHECK-LE: # %bb.0: # %entry
284 ; CHECK-LE-NEXT: xxlor v2, v2, v3
287 %v = or <16 x i8> %a, %b
294 define <4 x i32> @test11(<4 x i32> %a, <4 x i32> %b) {
295 ; CHECK-LABEL: test11:
296 ; CHECK: # %bb.0: # %entry
297 ; CHECK-NEXT: xxland v2, v2, v3
300 ; CHECK-REG-LABEL: test11:
301 ; CHECK-REG: # %bb.0: # %entry
302 ; CHECK-REG-NEXT: xxland v2, v2, v3
303 ; CHECK-REG-NEXT: blr
305 ; CHECK-FISL-LABEL: test11:
306 ; CHECK-FISL: # %bb.0: # %entry
307 ; CHECK-FISL-NEXT: xxland v2, v2, v3
308 ; CHECK-FISL-NEXT: blr
310 ; CHECK-LE-LABEL: test11:
311 ; CHECK-LE: # %bb.0: # %entry
312 ; CHECK-LE-NEXT: xxland v2, v2, v3
315 %v = and <4 x i32> %a, %b
322 define <8 x i16> @test12(<8 x i16> %a, <8 x i16> %b) {
323 ; CHECK-LABEL: test12:
324 ; CHECK: # %bb.0: # %entry
325 ; CHECK-NEXT: xxland v2, v2, v3
328 ; CHECK-REG-LABEL: test12:
329 ; CHECK-REG: # %bb.0: # %entry
330 ; CHECK-REG-NEXT: xxland v2, v2, v3
331 ; CHECK-REG-NEXT: blr
333 ; CHECK-FISL-LABEL: test12:
334 ; CHECK-FISL: # %bb.0: # %entry
335 ; CHECK-FISL-NEXT: xxland v2, v2, v3
336 ; CHECK-FISL-NEXT: blr
338 ; CHECK-LE-LABEL: test12:
339 ; CHECK-LE: # %bb.0: # %entry
340 ; CHECK-LE-NEXT: xxland v2, v2, v3
343 %v = and <8 x i16> %a, %b
350 define <16 x i8> @test13(<16 x i8> %a, <16 x i8> %b) {
351 ; CHECK-LABEL: test13:
352 ; CHECK: # %bb.0: # %entry
353 ; CHECK-NEXT: xxland v2, v2, v3
356 ; CHECK-REG-LABEL: test13:
357 ; CHECK-REG: # %bb.0: # %entry
358 ; CHECK-REG-NEXT: xxland v2, v2, v3
359 ; CHECK-REG-NEXT: blr
361 ; CHECK-FISL-LABEL: test13:
362 ; CHECK-FISL: # %bb.0: # %entry
363 ; CHECK-FISL-NEXT: xxland v2, v2, v3
364 ; CHECK-FISL-NEXT: blr
366 ; CHECK-LE-LABEL: test13:
367 ; CHECK-LE: # %bb.0: # %entry
368 ; CHECK-LE-NEXT: xxland v2, v2, v3
371 %v = and <16 x i8> %a, %b
378 define <4 x i32> @test14(<4 x i32> %a, <4 x i32> %b) {
379 ; CHECK-LABEL: test14:
380 ; CHECK: # %bb.0: # %entry
381 ; CHECK-NEXT: xxlnor v2, v2, v3
384 ; CHECK-REG-LABEL: test14:
385 ; CHECK-REG: # %bb.0: # %entry
386 ; CHECK-REG-NEXT: xxlnor v2, v2, v3
387 ; CHECK-REG-NEXT: blr
389 ; CHECK-FISL-LABEL: test14:
390 ; CHECK-FISL: # %bb.0: # %entry
391 ; CHECK-FISL-NEXT: xxlor vs0, v2, v3
392 ; CHECK-FISL-NEXT: xxlnor v2, v2, v3
393 ; CHECK-FISL-NEXT: blr
395 ; CHECK-LE-LABEL: test14:
396 ; CHECK-LE: # %bb.0: # %entry
397 ; CHECK-LE-NEXT: xxlnor v2, v2, v3
400 %v = or <4 x i32> %a, %b
401 %w = xor <4 x i32> %v, <i32 -1, i32 -1, i32 -1, i32 -1>
408 define <8 x i16> @test15(<8 x i16> %a, <8 x i16> %b) {
409 ; CHECK-LABEL: test15:
410 ; CHECK: # %bb.0: # %entry
411 ; CHECK-NEXT: xxlnor v2, v2, v3
414 ; CHECK-REG-LABEL: test15:
415 ; CHECK-REG: # %bb.0: # %entry
416 ; CHECK-REG-NEXT: xxlnor v2, v2, v3
417 ; CHECK-REG-NEXT: blr
419 ; CHECK-FISL-LABEL: test15:
420 ; CHECK-FISL: # %bb.0: # %entry
421 ; CHECK-FISL-NEXT: xxlor v4, v2, v3
422 ; CHECK-FISL-NEXT: xxlnor v2, v2, v3
423 ; CHECK-FISL-NEXT: blr
425 ; CHECK-LE-LABEL: test15:
426 ; CHECK-LE: # %bb.0: # %entry
427 ; CHECK-LE-NEXT: xxlnor v2, v2, v3
430 %v = or <8 x i16> %a, %b
431 %w = xor <8 x i16> %v, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
438 define <16 x i8> @test16(<16 x i8> %a, <16 x i8> %b) {
439 ; CHECK-LABEL: test16:
440 ; CHECK: # %bb.0: # %entry
441 ; CHECK-NEXT: xxlnor v2, v2, v3
444 ; CHECK-REG-LABEL: test16:
445 ; CHECK-REG: # %bb.0: # %entry
446 ; CHECK-REG-NEXT: xxlnor v2, v2, v3
447 ; CHECK-REG-NEXT: blr
449 ; CHECK-FISL-LABEL: test16:
450 ; CHECK-FISL: # %bb.0: # %entry
451 ; CHECK-FISL-NEXT: xxlor v4, v2, v3
452 ; CHECK-FISL-NEXT: xxlnor v2, v2, v3
453 ; CHECK-FISL-NEXT: blr
455 ; CHECK-LE-LABEL: test16:
456 ; CHECK-LE: # %bb.0: # %entry
457 ; CHECK-LE-NEXT: xxlnor v2, v2, v3
460 %v = or <16 x i8> %a, %b
461 %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>
468 define <4 x i32> @test17(<4 x i32> %a, <4 x i32> %b) {
469 ; CHECK-LABEL: test17:
470 ; CHECK: # %bb.0: # %entry
471 ; CHECK-NEXT: xxlandc v2, v2, v3
474 ; CHECK-REG-LABEL: test17:
475 ; CHECK-REG: # %bb.0: # %entry
476 ; CHECK-REG-NEXT: xxlandc v2, v2, v3
477 ; CHECK-REG-NEXT: blr
479 ; CHECK-FISL-LABEL: test17:
480 ; CHECK-FISL: # %bb.0: # %entry
481 ; CHECK-FISL-NEXT: xxlnor vs0, v3, v3
482 ; CHECK-FISL-NEXT: xxland v2, v2, vs0
483 ; CHECK-FISL-NEXT: blr
485 ; CHECK-LE-LABEL: test17:
486 ; CHECK-LE: # %bb.0: # %entry
487 ; CHECK-LE-NEXT: xxlandc v2, v2, v3
490 %w = xor <4 x i32> %b, <i32 -1, i32 -1, i32 -1, i32 -1>
491 %v = and <4 x i32> %a, %w
498 define <8 x i16> @test18(<8 x i16> %a, <8 x i16> %b) {
499 ; CHECK-LABEL: test18:
500 ; CHECK: # %bb.0: # %entry
501 ; CHECK-NEXT: xxlandc v2, v2, v3
504 ; CHECK-REG-LABEL: test18:
505 ; CHECK-REG: # %bb.0: # %entry
506 ; CHECK-REG-NEXT: xxlandc v2, v2, v3
507 ; CHECK-REG-NEXT: blr
509 ; CHECK-FISL-LABEL: test18:
510 ; CHECK-FISL: # %bb.0: # %entry
511 ; CHECK-FISL-NEXT: xxlnor v4, v3, v3
512 ; CHECK-FISL-NEXT: xxlandc v2, v2, v3
513 ; CHECK-FISL-NEXT: blr
515 ; CHECK-LE-LABEL: test18:
516 ; CHECK-LE: # %bb.0: # %entry
517 ; CHECK-LE-NEXT: xxlandc v2, v2, v3
520 %w = xor <8 x i16> %b, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
521 %v = and <8 x i16> %a, %w
528 define <16 x i8> @test19(<16 x i8> %a, <16 x i8> %b) {
529 ; CHECK-LABEL: test19:
530 ; CHECK: # %bb.0: # %entry
531 ; CHECK-NEXT: xxlandc v2, v2, v3
534 ; CHECK-REG-LABEL: test19:
535 ; CHECK-REG: # %bb.0: # %entry
536 ; CHECK-REG-NEXT: xxlandc v2, v2, v3
537 ; CHECK-REG-NEXT: blr
539 ; CHECK-FISL-LABEL: test19:
540 ; CHECK-FISL: # %bb.0: # %entry
541 ; CHECK-FISL-NEXT: xxlnor v4, v3, v3
542 ; CHECK-FISL-NEXT: xxlandc v2, v2, v3
543 ; CHECK-FISL-NEXT: blr
545 ; CHECK-LE-LABEL: test19:
546 ; CHECK-LE: # %bb.0: # %entry
547 ; CHECK-LE-NEXT: xxlandc v2, v2, v3
550 %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>
551 %v = and <16 x i8> %a, %w
558 define <4 x i32> @test20(<4 x i32> %a, <4 x i32> %b, <4 x i32> %c, <4 x i32> %d) {
559 ; CHECK-LABEL: test20:
560 ; CHECK: # %bb.0: # %entry
561 ; CHECK-NEXT: vcmpequw v4, v4, v5
562 ; CHECK-NEXT: xxsel v2, v3, v2, v4
565 ; CHECK-REG-LABEL: test20:
566 ; CHECK-REG: # %bb.0: # %entry
567 ; CHECK-REG-NEXT: vcmpequw v4, v4, v5
568 ; CHECK-REG-NEXT: xxsel v2, v3, v2, v4
569 ; CHECK-REG-NEXT: blr
571 ; CHECK-FISL-LABEL: test20:
572 ; CHECK-FISL: # %bb.0: # %entry
573 ; CHECK-FISL-NEXT: vcmpequw v4, v4, v5
574 ; CHECK-FISL-NEXT: xxsel v2, v3, v2, v4
575 ; CHECK-FISL-NEXT: blr
577 ; CHECK-LE-LABEL: test20:
578 ; CHECK-LE: # %bb.0: # %entry
579 ; CHECK-LE-NEXT: vcmpequw v4, v4, v5
580 ; CHECK-LE-NEXT: xxsel v2, v3, v2, v4
583 %m = icmp eq <4 x i32> %c, %d
584 %v = select <4 x i1> %m, <4 x i32> %a, <4 x i32> %b
591 define <4 x float> @test21(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d) {
592 ; CHECK-LABEL: test21:
593 ; CHECK: # %bb.0: # %entry
594 ; CHECK-NEXT: xvcmpeqsp vs0, v4, v5
595 ; CHECK-NEXT: xxsel v2, v3, v2, vs0
598 ; CHECK-REG-LABEL: test21:
599 ; CHECK-REG: # %bb.0: # %entry
600 ; CHECK-REG-NEXT: xvcmpeqsp vs0, v4, v5
601 ; CHECK-REG-NEXT: xxsel v2, v3, v2, vs0
602 ; CHECK-REG-NEXT: blr
604 ; CHECK-FISL-LABEL: test21:
605 ; CHECK-FISL: # %bb.0: # %entry
606 ; CHECK-FISL-NEXT: xvcmpeqsp vs0, v4, v5
607 ; CHECK-FISL-NEXT: xxsel v2, v3, v2, vs0
608 ; CHECK-FISL-NEXT: blr
610 ; CHECK-LE-LABEL: test21:
611 ; CHECK-LE: # %bb.0: # %entry
612 ; CHECK-LE-NEXT: xvcmpeqsp vs0, v4, v5
613 ; CHECK-LE-NEXT: xxsel v2, v3, v2, vs0
616 %m = fcmp oeq <4 x float> %c, %d
617 %v = select <4 x i1> %m, <4 x float> %a, <4 x float> %b
624 define <4 x float> @test22(<4 x float> %a, <4 x float> %b, <4 x float> %c, <4 x float> %d) {
625 ; CHECK-LABEL: test22:
626 ; CHECK: # %bb.0: # %entry
627 ; CHECK-NEXT: xvcmpgtsp vs0, v5, v4
628 ; CHECK-NEXT: xvcmpgtsp vs1, v4, v5
629 ; CHECK-NEXT: xxlor vs0, vs1, vs0
630 ; CHECK-NEXT: xxsel v2, v2, v3, vs0
633 ; CHECK-REG-LABEL: test22:
634 ; CHECK-REG: # %bb.0: # %entry
635 ; CHECK-REG-NEXT: xvcmpgtsp vs0, v5, v4
636 ; CHECK-REG-NEXT: xvcmpgtsp vs1, v4, v5
637 ; CHECK-REG-NEXT: xxlor vs0, vs1, vs0
638 ; CHECK-REG-NEXT: xxsel v2, v2, v3, vs0
639 ; CHECK-REG-NEXT: blr
641 ; CHECK-FISL-LABEL: test22:
642 ; CHECK-FISL: # %bb.0: # %entry
643 ; CHECK-FISL-NEXT: xvcmpgtsp vs1, v5, v4
644 ; CHECK-FISL-NEXT: xvcmpgtsp vs0, v4, v5
645 ; CHECK-FISL-NEXT: xxlor vs0, vs0, vs1
646 ; CHECK-FISL-NEXT: xxsel v2, v2, v3, vs0
647 ; CHECK-FISL-NEXT: blr
649 ; CHECK-LE-LABEL: test22:
650 ; CHECK-LE: # %bb.0: # %entry
651 ; CHECK-LE-NEXT: xvcmpgtsp vs0, v5, v4
652 ; CHECK-LE-NEXT: xvcmpgtsp vs1, v4, v5
653 ; CHECK-LE-NEXT: xxlor vs0, vs1, vs0
654 ; CHECK-LE-NEXT: xxsel v2, v2, v3, vs0
657 %m = fcmp ueq <4 x float> %c, %d
658 %v = select <4 x i1> %m, <4 x float> %a, <4 x float> %b
665 define <8 x i16> @test23(<8 x i16> %a, <8 x i16> %b, <8 x i16> %c, <8 x i16> %d) {
666 ; CHECK-LABEL: test23:
667 ; CHECK: # %bb.0: # %entry
668 ; CHECK-NEXT: vcmpequh v4, v4, v5
669 ; CHECK-NEXT: xxsel v2, v3, v2, v4
672 ; CHECK-REG-LABEL: test23:
673 ; CHECK-REG: # %bb.0: # %entry
674 ; CHECK-REG-NEXT: vcmpequh v4, v4, v5
675 ; CHECK-REG-NEXT: xxsel v2, v3, v2, v4
676 ; CHECK-REG-NEXT: blr
678 ; CHECK-FISL-LABEL: test23:
679 ; CHECK-FISL: # %bb.0: # %entry
680 ; CHECK-FISL-NEXT: vcmpequh v4, v4, v5
681 ; CHECK-FISL-NEXT: xxlor vs0, v4, v4
682 ; CHECK-FISL-NEXT: xxsel v2, v3, v2, vs0
683 ; CHECK-FISL-NEXT: blr
685 ; CHECK-LE-LABEL: test23:
686 ; CHECK-LE: # %bb.0: # %entry
687 ; CHECK-LE-NEXT: vcmpequh v4, v4, v5
688 ; CHECK-LE-NEXT: xxsel v2, v3, v2, v4
691 %m = icmp eq <8 x i16> %c, %d
692 %v = select <8 x i1> %m, <8 x i16> %a, <8 x i16> %b
699 define <16 x i8> @test24(<16 x i8> %a, <16 x i8> %b, <16 x i8> %c, <16 x i8> %d) {
700 ; CHECK-LABEL: test24:
701 ; CHECK: # %bb.0: # %entry
702 ; CHECK-NEXT: vcmpequb v4, v4, v5
703 ; CHECK-NEXT: xxsel v2, v3, v2, v4
706 ; CHECK-REG-LABEL: test24:
707 ; CHECK-REG: # %bb.0: # %entry
708 ; CHECK-REG-NEXT: vcmpequb v4, v4, v5
709 ; CHECK-REG-NEXT: xxsel v2, v3, v2, v4
710 ; CHECK-REG-NEXT: blr
712 ; CHECK-FISL-LABEL: test24:
713 ; CHECK-FISL: # %bb.0: # %entry
714 ; CHECK-FISL-NEXT: vcmpequb v4, v4, v5
715 ; CHECK-FISL-NEXT: xxlor vs0, v4, v4
716 ; CHECK-FISL-NEXT: xxsel v2, v3, v2, vs0
717 ; CHECK-FISL-NEXT: blr
719 ; CHECK-LE-LABEL: test24:
720 ; CHECK-LE: # %bb.0: # %entry
721 ; CHECK-LE-NEXT: vcmpequb v4, v4, v5
722 ; CHECK-LE-NEXT: xxsel v2, v3, v2, v4
725 %m = icmp eq <16 x i8> %c, %d
726 %v = select <16 x i1> %m, <16 x i8> %a, <16 x i8> %b
733 define <2 x double> @test25(<2 x double> %a, <2 x double> %b, <2 x double> %c, <2 x double> %d) {
734 ; CHECK-LABEL: test25:
735 ; CHECK: # %bb.0: # %entry
736 ; CHECK-NEXT: xvcmpeqdp vs0, v4, v5
737 ; CHECK-NEXT: xxsel v2, v3, v2, vs0
740 ; CHECK-REG-LABEL: test25:
741 ; CHECK-REG: # %bb.0: # %entry
742 ; CHECK-REG-NEXT: xvcmpeqdp vs0, v4, v5
743 ; CHECK-REG-NEXT: xxsel v2, v3, v2, vs0
744 ; CHECK-REG-NEXT: blr
746 ; CHECK-FISL-LABEL: test25:
747 ; CHECK-FISL: # %bb.0: # %entry
748 ; CHECK-FISL-NEXT: xvcmpeqdp vs0, v4, v5
749 ; CHECK-FISL-NEXT: xxsel v2, v3, v2, vs0
750 ; CHECK-FISL-NEXT: blr
752 ; CHECK-LE-LABEL: test25:
753 ; CHECK-LE: # %bb.0: # %entry
754 ; CHECK-LE-NEXT: xvcmpeqdp v4, v4, v5
755 ; CHECK-LE-NEXT: xxsel v2, v3, v2, v4
758 %m = fcmp oeq <2 x double> %c, %d
759 %v = select <2 x i1> %m, <2 x double> %a, <2 x double> %b
765 define <2 x i64> @test26(<2 x i64> %a, <2 x i64> %b) {
766 ; CHECK-LABEL: test26:
768 ; CHECK-NEXT: addi r3, r1, -32
769 ; CHECK-NEXT: addi r4, r1, -48
770 ; CHECK-NEXT: stxvd2x v3, 0, r3
771 ; CHECK-NEXT: stxvd2x v2, 0, r4
772 ; CHECK-NEXT: ld r3, -24(r1)
773 ; CHECK-NEXT: ld r4, -40(r1)
774 ; CHECK-NEXT: add r3, r4, r3
775 ; CHECK-NEXT: ld r4, -48(r1)
776 ; CHECK-NEXT: std r3, -8(r1)
777 ; CHECK-NEXT: ld r3, -32(r1)
778 ; CHECK-NEXT: add r3, r4, r3
779 ; CHECK-NEXT: std r3, -16(r1)
780 ; CHECK-NEXT: addi r3, r1, -16
781 ; CHECK-NEXT: lxvd2x v2, 0, r3
784 ; CHECK-REG-LABEL: test26:
785 ; CHECK-REG: # %bb.0:
786 ; CHECK-REG-NEXT: addi r3, r1, -32
787 ; CHECK-REG-NEXT: addi r4, r1, -48
788 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
789 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
790 ; CHECK-REG-NEXT: ld r3, -24(r1)
791 ; CHECK-REG-NEXT: ld r4, -40(r1)
792 ; CHECK-REG-NEXT: add r3, r4, r3
793 ; CHECK-REG-NEXT: ld r4, -48(r1)
794 ; CHECK-REG-NEXT: std r3, -8(r1)
795 ; CHECK-REG-NEXT: ld r3, -32(r1)
796 ; CHECK-REG-NEXT: add r3, r4, r3
797 ; CHECK-REG-NEXT: std r3, -16(r1)
798 ; CHECK-REG-NEXT: addi r3, r1, -16
799 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
800 ; CHECK-REG-NEXT: blr
802 ; CHECK-FISL-LABEL: test26:
803 ; CHECK-FISL: # %bb.0:
804 ; CHECK-FISL-NEXT: addi r3, r1, -32
805 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
806 ; CHECK-FISL-NEXT: addi r3, r1, -48
807 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
808 ; CHECK-FISL-NEXT: ld r4, -24(r1)
809 ; CHECK-FISL-NEXT: ld r3, -40(r1)
810 ; CHECK-FISL-NEXT: add r3, r3, r4
811 ; CHECK-FISL-NEXT: std r3, -8(r1)
812 ; CHECK-FISL-NEXT: ld r4, -32(r1)
813 ; CHECK-FISL-NEXT: ld r3, -48(r1)
814 ; CHECK-FISL-NEXT: add r3, r3, r4
815 ; CHECK-FISL-NEXT: std r3, -16(r1)
816 ; CHECK-FISL-NEXT: addi r3, r1, -16
817 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
818 ; CHECK-FISL-NEXT: blr
820 ; CHECK-LE-LABEL: test26:
822 ; CHECK-LE-NEXT: vaddudm v2, v2, v3
824 %v = add <2 x i64> %a, %b
828 ; Make sure we use only two stores (one for each operand).
830 ; FIXME: The code quality here is not good; just make sure we do something for now.
834 define <2 x i64> @test27(<2 x i64> %a, <2 x i64> %b) {
835 ; CHECK-LABEL: test27:
837 ; CHECK-NEXT: xxland v2, v2, v3
840 ; CHECK-REG-LABEL: test27:
841 ; CHECK-REG: # %bb.0:
842 ; CHECK-REG-NEXT: xxland v2, v2, v3
843 ; CHECK-REG-NEXT: blr
845 ; CHECK-FISL-LABEL: test27:
846 ; CHECK-FISL: # %bb.0:
847 ; CHECK-FISL-NEXT: xxland v2, v2, v3
848 ; CHECK-FISL-NEXT: blr
850 ; CHECK-LE-LABEL: test27:
852 ; CHECK-LE-NEXT: xxland v2, v2, v3
854 %v = and <2 x i64> %a, %b
860 define <2 x double> @test28(ptr %a) {
861 ; CHECK-LABEL: test28:
863 ; CHECK-NEXT: lxvd2x v2, 0, r3
866 ; CHECK-REG-LABEL: test28:
867 ; CHECK-REG: # %bb.0:
868 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
869 ; CHECK-REG-NEXT: blr
871 ; CHECK-FISL-LABEL: test28:
872 ; CHECK-FISL: # %bb.0:
873 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
874 ; CHECK-FISL-NEXT: blr
876 ; CHECK-LE-LABEL: test28:
878 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
879 ; CHECK-LE-NEXT: xxswapd v2, vs0
881 %v = load <2 x double>, ptr %a, align 16
887 define void @test29(ptr %a, <2 x double> %b) {
888 ; CHECK-LABEL: test29:
890 ; CHECK-NEXT: stxvd2x v2, 0, r3
893 ; CHECK-REG-LABEL: test29:
894 ; CHECK-REG: # %bb.0:
895 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
896 ; CHECK-REG-NEXT: blr
898 ; CHECK-FISL-LABEL: test29:
899 ; CHECK-FISL: # %bb.0:
900 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
901 ; CHECK-FISL-NEXT: blr
903 ; CHECK-LE-LABEL: test29:
905 ; CHECK-LE-NEXT: xxswapd vs0, v2
906 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
908 store <2 x double> %b, ptr %a, align 16
914 define <2 x double> @test28u(ptr %a) {
915 ; CHECK-LABEL: test28u:
917 ; CHECK-NEXT: lxvd2x v2, 0, r3
920 ; CHECK-REG-LABEL: test28u:
921 ; CHECK-REG: # %bb.0:
922 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
923 ; CHECK-REG-NEXT: blr
925 ; CHECK-FISL-LABEL: test28u:
926 ; CHECK-FISL: # %bb.0:
927 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
928 ; CHECK-FISL-NEXT: blr
930 ; CHECK-LE-LABEL: test28u:
932 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
933 ; CHECK-LE-NEXT: xxswapd v2, vs0
935 %v = load <2 x double>, ptr %a, align 8
941 define void @test29u(ptr %a, <2 x double> %b) {
942 ; CHECK-LABEL: test29u:
944 ; CHECK-NEXT: stxvd2x v2, 0, r3
947 ; CHECK-REG-LABEL: test29u:
948 ; CHECK-REG: # %bb.0:
949 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
950 ; CHECK-REG-NEXT: blr
952 ; CHECK-FISL-LABEL: test29u:
953 ; CHECK-FISL: # %bb.0:
954 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
955 ; CHECK-FISL-NEXT: blr
957 ; CHECK-LE-LABEL: test29u:
959 ; CHECK-LE-NEXT: xxswapd vs0, v2
960 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
962 store <2 x double> %b, ptr %a, align 8
968 define <2 x i64> @test30(ptr %a) {
969 ; CHECK-LABEL: test30:
971 ; CHECK-NEXT: lxvd2x v2, 0, r3
974 ; CHECK-REG-LABEL: test30:
975 ; CHECK-REG: # %bb.0:
976 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
977 ; CHECK-REG-NEXT: blr
979 ; CHECK-FISL-LABEL: test30:
980 ; CHECK-FISL: # %bb.0:
981 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
982 ; CHECK-FISL-NEXT: blr
984 ; CHECK-LE-LABEL: test30:
986 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
987 ; CHECK-LE-NEXT: xxswapd v2, vs0
989 %v = load <2 x i64>, ptr %a, align 16
996 define void @test31(ptr %a, <2 x i64> %b) {
997 ; CHECK-LABEL: test31:
999 ; CHECK-NEXT: stxvd2x v2, 0, r3
1002 ; CHECK-REG-LABEL: test31:
1003 ; CHECK-REG: # %bb.0:
1004 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
1005 ; CHECK-REG-NEXT: blr
1007 ; CHECK-FISL-LABEL: test31:
1008 ; CHECK-FISL: # %bb.0:
1009 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1010 ; CHECK-FISL-NEXT: blr
1012 ; CHECK-LE-LABEL: test31:
1013 ; CHECK-LE: # %bb.0:
1014 ; CHECK-LE-NEXT: xxswapd vs0, v2
1015 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
1016 ; CHECK-LE-NEXT: blr
1017 store <2 x i64> %b, ptr %a, align 16
1023 define <4 x float> @test32(ptr %a) {
1024 ; CHECK-LABEL: test32:
1026 ; CHECK-NEXT: lxvw4x v2, 0, r3
1029 ; CHECK-REG-LABEL: test32:
1030 ; CHECK-REG: # %bb.0:
1031 ; CHECK-REG-NEXT: lxvw4x v2, 0, r3
1032 ; CHECK-REG-NEXT: blr
1034 ; CHECK-FISL-LABEL: test32:
1035 ; CHECK-FISL: # %bb.0:
1036 ; CHECK-FISL-NEXT: lxvw4x v2, 0, r3
1037 ; CHECK-FISL-NEXT: blr
1039 ; CHECK-LE-LABEL: test32:
1040 ; CHECK-LE: # %bb.0:
1041 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
1042 ; CHECK-LE-NEXT: xxswapd v2, vs0
1043 ; CHECK-LE-NEXT: blr
1044 %v = load <4 x float>, ptr %a, align 16
1051 define void @test33(ptr %a, <4 x float> %b) {
1052 ; CHECK-LABEL: test33:
1054 ; CHECK-NEXT: stxvw4x v2, 0, r3
1057 ; CHECK-REG-LABEL: test33:
1058 ; CHECK-REG: # %bb.0:
1059 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1060 ; CHECK-REG-NEXT: blr
1062 ; CHECK-FISL-LABEL: test33:
1063 ; CHECK-FISL: # %bb.0:
1064 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1065 ; CHECK-FISL-NEXT: blr
1067 ; CHECK-LE-LABEL: test33:
1068 ; CHECK-LE: # %bb.0:
1069 ; CHECK-LE-NEXT: xxswapd vs0, v2
1070 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
1071 ; CHECK-LE-NEXT: blr
1072 store <4 x float> %b, ptr %a, align 16
1079 define <4 x float> @test32u(ptr %a) {
1080 ; CHECK-LABEL: test32u:
1082 ; CHECK-NEXT: li r4, 15
1083 ; CHECK-NEXT: lvsl v3, 0, r3
1084 ; CHECK-NEXT: lvx v2, r3, r4
1085 ; CHECK-NEXT: lvx v4, 0, r3
1086 ; CHECK-NEXT: vperm v2, v4, v2, v3
1089 ; CHECK-REG-LABEL: test32u:
1090 ; CHECK-REG: # %bb.0:
1091 ; CHECK-REG-NEXT: li r4, 15
1092 ; CHECK-REG-NEXT: lvsl v3, 0, r3
1093 ; CHECK-REG-NEXT: lvx v2, r3, r4
1094 ; CHECK-REG-NEXT: lvx v4, 0, r3
1095 ; CHECK-REG-NEXT: vperm v2, v4, v2, v3
1096 ; CHECK-REG-NEXT: blr
1098 ; CHECK-FISL-LABEL: test32u:
1099 ; CHECK-FISL: # %bb.0:
1100 ; CHECK-FISL-NEXT: li r4, 15
1101 ; CHECK-FISL-NEXT: lvx v3, r3, r4
1102 ; CHECK-FISL-NEXT: lvsl v4, 0, r3
1103 ; CHECK-FISL-NEXT: lvx v2, 0, r3
1104 ; CHECK-FISL-NEXT: vperm v2, v2, v3, v4
1105 ; CHECK-FISL-NEXT: blr
1107 ; CHECK-LE-LABEL: test32u:
1108 ; CHECK-LE: # %bb.0:
1109 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
1110 ; CHECK-LE-NEXT: xxswapd v2, vs0
1111 ; CHECK-LE-NEXT: blr
1112 %v = load <4 x float>, ptr %a, align 8
1118 define void @test33u(ptr %a, <4 x float> %b) {
1119 ; CHECK-LABEL: test33u:
1121 ; CHECK-NEXT: stxvw4x v2, 0, r3
1124 ; CHECK-REG-LABEL: test33u:
1125 ; CHECK-REG: # %bb.0:
1126 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1127 ; CHECK-REG-NEXT: blr
1129 ; CHECK-FISL-LABEL: test33u:
1130 ; CHECK-FISL: # %bb.0:
1131 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1132 ; CHECK-FISL-NEXT: blr
1134 ; CHECK-LE-LABEL: test33u:
1135 ; CHECK-LE: # %bb.0:
1136 ; CHECK-LE-NEXT: xxswapd vs0, v2
1137 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
1138 ; CHECK-LE-NEXT: blr
1139 store <4 x float> %b, ptr %a, align 8
1146 define <4 x i32> @test34(ptr %a) {
1147 ; CHECK-LABEL: test34:
1149 ; CHECK-NEXT: lxvw4x v2, 0, r3
1152 ; CHECK-REG-LABEL: test34:
1153 ; CHECK-REG: # %bb.0:
1154 ; CHECK-REG-NEXT: lxvw4x v2, 0, r3
1155 ; CHECK-REG-NEXT: blr
1157 ; CHECK-FISL-LABEL: test34:
1158 ; CHECK-FISL: # %bb.0:
1159 ; CHECK-FISL-NEXT: lxvw4x v2, 0, r3
1160 ; CHECK-FISL-NEXT: blr
1162 ; CHECK-LE-LABEL: test34:
1163 ; CHECK-LE: # %bb.0:
1164 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
1165 ; CHECK-LE-NEXT: xxswapd v2, vs0
1166 ; CHECK-LE-NEXT: blr
1167 %v = load <4 x i32>, ptr %a, align 16
1174 define void @test35(ptr %a, <4 x i32> %b) {
1175 ; CHECK-LABEL: test35:
1177 ; CHECK-NEXT: stxvw4x v2, 0, r3
1180 ; CHECK-REG-LABEL: test35:
1181 ; CHECK-REG: # %bb.0:
1182 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1183 ; CHECK-REG-NEXT: blr
1185 ; CHECK-FISL-LABEL: test35:
1186 ; CHECK-FISL: # %bb.0:
1187 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1188 ; CHECK-FISL-NEXT: blr
1190 ; CHECK-LE-LABEL: test35:
1191 ; CHECK-LE: # %bb.0:
1192 ; CHECK-LE-NEXT: xxswapd vs0, v2
1193 ; CHECK-LE-NEXT: stxvd2x vs0, 0, r3
1194 ; CHECK-LE-NEXT: blr
1195 store <4 x i32> %b, ptr %a, align 16
1202 define <2 x double> @test40(<2 x i64> %a) {
1203 ; CHECK-LABEL: test40:
1205 ; CHECK-NEXT: xvcvuxddp v2, v2
1208 ; CHECK-REG-LABEL: test40:
1209 ; CHECK-REG: # %bb.0:
1210 ; CHECK-REG-NEXT: xvcvuxddp v2, v2
1211 ; CHECK-REG-NEXT: blr
1213 ; CHECK-FISL-LABEL: test40:
1214 ; CHECK-FISL: # %bb.0:
1215 ; CHECK-FISL-NEXT: xvcvuxddp v2, v2
1216 ; CHECK-FISL-NEXT: blr
1218 ; CHECK-LE-LABEL: test40:
1219 ; CHECK-LE: # %bb.0:
1220 ; CHECK-LE-NEXT: xvcvuxddp v2, v2
1221 ; CHECK-LE-NEXT: blr
1222 %v = uitofp <2 x i64> %a to <2 x double>
1228 define <2 x double> @test41(<2 x i64> %a) {
1229 ; CHECK-LABEL: test41:
1231 ; CHECK-NEXT: xvcvsxddp v2, v2
1234 ; CHECK-REG-LABEL: test41:
1235 ; CHECK-REG: # %bb.0:
1236 ; CHECK-REG-NEXT: xvcvsxddp v2, v2
1237 ; CHECK-REG-NEXT: blr
1239 ; CHECK-FISL-LABEL: test41:
1240 ; CHECK-FISL: # %bb.0:
1241 ; CHECK-FISL-NEXT: xvcvsxddp v2, v2
1242 ; CHECK-FISL-NEXT: blr
1244 ; CHECK-LE-LABEL: test41:
1245 ; CHECK-LE: # %bb.0:
1246 ; CHECK-LE-NEXT: xvcvsxddp v2, v2
1247 ; CHECK-LE-NEXT: blr
1248 %v = sitofp <2 x i64> %a to <2 x double>
1254 define <2 x i64> @test42(<2 x double> %a) {
1255 ; CHECK-LABEL: test42:
1257 ; CHECK-NEXT: xvcvdpuxds v2, v2
1260 ; CHECK-REG-LABEL: test42:
1261 ; CHECK-REG: # %bb.0:
1262 ; CHECK-REG-NEXT: xvcvdpuxds v2, v2
1263 ; CHECK-REG-NEXT: blr
1265 ; CHECK-FISL-LABEL: test42:
1266 ; CHECK-FISL: # %bb.0:
1267 ; CHECK-FISL-NEXT: xvcvdpuxds v2, v2
1268 ; CHECK-FISL-NEXT: blr
1270 ; CHECK-LE-LABEL: test42:
1271 ; CHECK-LE: # %bb.0:
1272 ; CHECK-LE-NEXT: xvcvdpuxds v2, v2
1273 ; CHECK-LE-NEXT: blr
1274 %v = fptoui <2 x double> %a to <2 x i64>
1280 define <2 x i64> @test43(<2 x double> %a) {
1281 ; CHECK-LABEL: test43:
1283 ; CHECK-NEXT: xvcvdpsxds v2, v2
1286 ; CHECK-REG-LABEL: test43:
1287 ; CHECK-REG: # %bb.0:
1288 ; CHECK-REG-NEXT: xvcvdpsxds v2, v2
1289 ; CHECK-REG-NEXT: blr
1291 ; CHECK-FISL-LABEL: test43:
1292 ; CHECK-FISL: # %bb.0:
1293 ; CHECK-FISL-NEXT: xvcvdpsxds v2, v2
1294 ; CHECK-FISL-NEXT: blr
1296 ; CHECK-LE-LABEL: test43:
1297 ; CHECK-LE: # %bb.0:
1298 ; CHECK-LE-NEXT: xvcvdpsxds v2, v2
1299 ; CHECK-LE-NEXT: blr
1300 %v = fptosi <2 x double> %a to <2 x i64>
1306 define <2 x float> @test44(<2 x i64> %a) {
1307 ; CHECK-LABEL: test44:
1309 ; CHECK-NEXT: addi r3, r1, -16
1310 ; CHECK-NEXT: addi r4, r1, -64
1311 ; CHECK-NEXT: stxvd2x v2, 0, r3
1312 ; CHECK-NEXT: ld r3, -8(r1)
1313 ; CHECK-NEXT: std r3, -24(r1)
1314 ; CHECK-NEXT: ld r3, -16(r1)
1315 ; CHECK-NEXT: lfd f0, -24(r1)
1316 ; CHECK-NEXT: std r3, -32(r1)
1317 ; CHECK-NEXT: addi r3, r1, -48
1318 ; CHECK-NEXT: fcfidus f0, f0
1319 ; CHECK-NEXT: stfs f0, -48(r1)
1320 ; CHECK-NEXT: lfd f0, -32(r1)
1321 ; CHECK-NEXT: fcfidus f0, f0
1322 ; CHECK-NEXT: stfs f0, -64(r1)
1323 ; CHECK-NEXT: lxvw4x vs0, 0, r3
1324 ; CHECK-NEXT: lxvw4x vs1, 0, r4
1325 ; CHECK-NEXT: xxmrghw v2, vs1, vs0
1328 ; CHECK-REG-LABEL: test44:
1329 ; CHECK-REG: # %bb.0:
1330 ; CHECK-REG-NEXT: addi r3, r1, -16
1331 ; CHECK-REG-NEXT: addi r4, r1, -64
1332 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
1333 ; CHECK-REG-NEXT: ld r3, -8(r1)
1334 ; CHECK-REG-NEXT: std r3, -24(r1)
1335 ; CHECK-REG-NEXT: ld r3, -16(r1)
1336 ; CHECK-REG-NEXT: lfd f0, -24(r1)
1337 ; CHECK-REG-NEXT: std r3, -32(r1)
1338 ; CHECK-REG-NEXT: addi r3, r1, -48
1339 ; CHECK-REG-NEXT: fcfidus f0, f0
1340 ; CHECK-REG-NEXT: stfs f0, -48(r1)
1341 ; CHECK-REG-NEXT: lfd f0, -32(r1)
1342 ; CHECK-REG-NEXT: fcfidus f0, f0
1343 ; CHECK-REG-NEXT: stfs f0, -64(r1)
1344 ; CHECK-REG-NEXT: lxvw4x vs0, 0, r3
1345 ; CHECK-REG-NEXT: lxvw4x vs1, 0, r4
1346 ; CHECK-REG-NEXT: xxmrghw v2, vs1, vs0
1347 ; CHECK-REG-NEXT: blr
1349 ; CHECK-FISL-LABEL: test44:
1350 ; CHECK-FISL: # %bb.0:
1351 ; CHECK-FISL-NEXT: addi r3, r1, -16
1352 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1353 ; CHECK-FISL-NEXT: ld r3, -8(r1)
1354 ; CHECK-FISL-NEXT: std r3, -24(r1)
1355 ; CHECK-FISL-NEXT: ld r3, -16(r1)
1356 ; CHECK-FISL-NEXT: std r3, -32(r1)
1357 ; CHECK-FISL-NEXT: lfd f0, -24(r1)
1358 ; CHECK-FISL-NEXT: fcfidus f0, f0
1359 ; CHECK-FISL-NEXT: stfs f0, -48(r1)
1360 ; CHECK-FISL-NEXT: lfd f0, -32(r1)
1361 ; CHECK-FISL-NEXT: fcfidus f0, f0
1362 ; CHECK-FISL-NEXT: stfs f0, -64(r1)
1363 ; CHECK-FISL-NEXT: addi r3, r1, -48
1364 ; CHECK-FISL-NEXT: lxvw4x vs1, 0, r3
1365 ; CHECK-FISL-NEXT: addi r3, r1, -64
1366 ; CHECK-FISL-NEXT: lxvw4x vs0, 0, r3
1367 ; CHECK-FISL-NEXT: xxmrghw v2, vs0, vs1
1368 ; CHECK-FISL-NEXT: blr
1370 ; CHECK-LE-LABEL: test44:
1371 ; CHECK-LE: # %bb.0:
1372 ; CHECK-LE-NEXT: xxswapd vs0, v2
1373 ; CHECK-LE-NEXT: xscvuxdsp f1, v2
1374 ; CHECK-LE-NEXT: xscvuxdsp f0, f0
1375 ; CHECK-LE-NEXT: xscvdpspn vs1, f1
1376 ; CHECK-LE-NEXT: xscvdpspn vs0, f0
1377 ; CHECK-LE-NEXT: xxmrghw v2, vs1, vs0
1378 ; CHECK-LE-NEXT: blr
1379 %v = uitofp <2 x i64> %a to <2 x float>
1382 ; FIXME: The code quality here looks pretty bad.
1385 define <2 x float> @test45(<2 x i64> %a) {
1386 ; CHECK-LABEL: test45:
1388 ; CHECK-NEXT: addi r3, r1, -16
1389 ; CHECK-NEXT: addi r4, r1, -64
1390 ; CHECK-NEXT: stxvd2x v2, 0, r3
1391 ; CHECK-NEXT: ld r3, -8(r1)
1392 ; CHECK-NEXT: std r3, -24(r1)
1393 ; CHECK-NEXT: ld r3, -16(r1)
1394 ; CHECK-NEXT: lfd f0, -24(r1)
1395 ; CHECK-NEXT: std r3, -32(r1)
1396 ; CHECK-NEXT: addi r3, r1, -48
1397 ; CHECK-NEXT: fcfids f0, f0
1398 ; CHECK-NEXT: stfs f0, -48(r1)
1399 ; CHECK-NEXT: lfd f0, -32(r1)
1400 ; CHECK-NEXT: fcfids f0, f0
1401 ; CHECK-NEXT: stfs f0, -64(r1)
1402 ; CHECK-NEXT: lxvw4x vs0, 0, r3
1403 ; CHECK-NEXT: lxvw4x vs1, 0, r4
1404 ; CHECK-NEXT: xxmrghw v2, vs1, vs0
1407 ; CHECK-REG-LABEL: test45:
1408 ; CHECK-REG: # %bb.0:
1409 ; CHECK-REG-NEXT: addi r3, r1, -16
1410 ; CHECK-REG-NEXT: addi r4, r1, -64
1411 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
1412 ; CHECK-REG-NEXT: ld r3, -8(r1)
1413 ; CHECK-REG-NEXT: std r3, -24(r1)
1414 ; CHECK-REG-NEXT: ld r3, -16(r1)
1415 ; CHECK-REG-NEXT: lfd f0, -24(r1)
1416 ; CHECK-REG-NEXT: std r3, -32(r1)
1417 ; CHECK-REG-NEXT: addi r3, r1, -48
1418 ; CHECK-REG-NEXT: fcfids f0, f0
1419 ; CHECK-REG-NEXT: stfs f0, -48(r1)
1420 ; CHECK-REG-NEXT: lfd f0, -32(r1)
1421 ; CHECK-REG-NEXT: fcfids f0, f0
1422 ; CHECK-REG-NEXT: stfs f0, -64(r1)
1423 ; CHECK-REG-NEXT: lxvw4x vs0, 0, r3
1424 ; CHECK-REG-NEXT: lxvw4x vs1, 0, r4
1425 ; CHECK-REG-NEXT: xxmrghw v2, vs1, vs0
1426 ; CHECK-REG-NEXT: blr
1428 ; CHECK-FISL-LABEL: test45:
1429 ; CHECK-FISL: # %bb.0:
1430 ; CHECK-FISL-NEXT: addi r3, r1, -16
1431 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1432 ; CHECK-FISL-NEXT: ld r3, -8(r1)
1433 ; CHECK-FISL-NEXT: std r3, -24(r1)
1434 ; CHECK-FISL-NEXT: ld r3, -16(r1)
1435 ; CHECK-FISL-NEXT: std r3, -32(r1)
1436 ; CHECK-FISL-NEXT: lfd f0, -24(r1)
1437 ; CHECK-FISL-NEXT: fcfids f0, f0
1438 ; CHECK-FISL-NEXT: stfs f0, -48(r1)
1439 ; CHECK-FISL-NEXT: lfd f0, -32(r1)
1440 ; CHECK-FISL-NEXT: fcfids f0, f0
1441 ; CHECK-FISL-NEXT: stfs f0, -64(r1)
1442 ; CHECK-FISL-NEXT: addi r3, r1, -48
1443 ; CHECK-FISL-NEXT: lxvw4x vs1, 0, r3
1444 ; CHECK-FISL-NEXT: addi r3, r1, -64
1445 ; CHECK-FISL-NEXT: lxvw4x vs0, 0, r3
1446 ; CHECK-FISL-NEXT: xxmrghw v2, vs0, vs1
1447 ; CHECK-FISL-NEXT: blr
1449 ; CHECK-LE-LABEL: test45:
1450 ; CHECK-LE: # %bb.0:
1451 ; CHECK-LE-NEXT: xxswapd vs0, v2
1452 ; CHECK-LE-NEXT: xscvsxdsp f1, v2
1453 ; CHECK-LE-NEXT: xscvsxdsp f0, f0
1454 ; CHECK-LE-NEXT: xscvdpspn vs1, f1
1455 ; CHECK-LE-NEXT: xscvdpspn vs0, f0
1456 ; CHECK-LE-NEXT: xxmrghw v2, vs1, vs0
1457 ; CHECK-LE-NEXT: blr
1458 %v = sitofp <2 x i64> %a to <2 x float>
1461 ; FIXME: The code quality here looks pretty bad.
1464 define <2 x i64> @test46(<2 x float> %a) {
1465 ; CHECK-LABEL: test46:
1467 ; CHECK-NEXT: addi r3, r1, -48
1468 ; CHECK-NEXT: stxvw4x v2, 0, r3
1469 ; CHECK-NEXT: lfs f0, -44(r1)
1470 ; CHECK-NEXT: xscvdpuxds f0, f0
1471 ; CHECK-NEXT: stfd f0, -32(r1)
1472 ; CHECK-NEXT: lfs f0, -48(r1)
1473 ; CHECK-NEXT: ld r3, -32(r1)
1474 ; CHECK-NEXT: xscvdpuxds f0, f0
1475 ; CHECK-NEXT: std r3, -8(r1)
1476 ; CHECK-NEXT: stfd f0, -24(r1)
1477 ; CHECK-NEXT: ld r3, -24(r1)
1478 ; CHECK-NEXT: std r3, -16(r1)
1479 ; CHECK-NEXT: addi r3, r1, -16
1480 ; CHECK-NEXT: lxvd2x v2, 0, r3
1483 ; CHECK-REG-LABEL: test46:
1484 ; CHECK-REG: # %bb.0:
1485 ; CHECK-REG-NEXT: addi r3, r1, -48
1486 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1487 ; CHECK-REG-NEXT: lfs f0, -44(r1)
1488 ; CHECK-REG-NEXT: xscvdpuxds f0, f0
1489 ; CHECK-REG-NEXT: stfd f0, -32(r1)
1490 ; CHECK-REG-NEXT: lfs f0, -48(r1)
1491 ; CHECK-REG-NEXT: ld r3, -32(r1)
1492 ; CHECK-REG-NEXT: xscvdpuxds f0, f0
1493 ; CHECK-REG-NEXT: std r3, -8(r1)
1494 ; CHECK-REG-NEXT: stfd f0, -24(r1)
1495 ; CHECK-REG-NEXT: ld r3, -24(r1)
1496 ; CHECK-REG-NEXT: std r3, -16(r1)
1497 ; CHECK-REG-NEXT: addi r3, r1, -16
1498 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1499 ; CHECK-REG-NEXT: blr
1501 ; CHECK-FISL-LABEL: test46:
1502 ; CHECK-FISL: # %bb.0:
1503 ; CHECK-FISL-NEXT: addi r3, r1, -48
1504 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1505 ; CHECK-FISL-NEXT: lfs f0, -44(r1)
1506 ; CHECK-FISL-NEXT: xscvdpuxds f0, f0
1507 ; CHECK-FISL-NEXT: stfd f0, -32(r1)
1508 ; CHECK-FISL-NEXT: lfs f0, -48(r1)
1509 ; CHECK-FISL-NEXT: xscvdpuxds f0, f0
1510 ; CHECK-FISL-NEXT: stfd f0, -24(r1)
1511 ; CHECK-FISL-NEXT: ld r3, -32(r1)
1512 ; CHECK-FISL-NEXT: std r3, -8(r1)
1513 ; CHECK-FISL-NEXT: ld r3, -24(r1)
1514 ; CHECK-FISL-NEXT: std r3, -16(r1)
1515 ; CHECK-FISL-NEXT: addi r3, r1, -16
1516 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
1517 ; CHECK-FISL-NEXT: blr
1519 ; CHECK-LE-LABEL: test46:
1520 ; CHECK-LE: # %bb.0:
1521 ; CHECK-LE-NEXT: xxmrglw vs0, v2, v2
1522 ; CHECK-LE-NEXT: xvcvspdp vs0, vs0
1523 ; CHECK-LE-NEXT: xvcvdpuxds v2, vs0
1524 ; CHECK-LE-NEXT: blr
1525 %v = fptoui <2 x float> %a to <2 x i64>
1528 ; FIXME: The code quality here looks pretty bad.
1531 define <2 x i64> @test47(<2 x float> %a) {
1532 ; CHECK-LABEL: test47:
1534 ; CHECK-NEXT: addi r3, r1, -48
1535 ; CHECK-NEXT: stxvw4x v2, 0, r3
1536 ; CHECK-NEXT: lfs f0, -44(r1)
1537 ; CHECK-NEXT: xscvdpsxds f0, f0
1538 ; CHECK-NEXT: stfd f0, -32(r1)
1539 ; CHECK-NEXT: lfs f0, -48(r1)
1540 ; CHECK-NEXT: ld r3, -32(r1)
1541 ; CHECK-NEXT: xscvdpsxds f0, f0
1542 ; CHECK-NEXT: std r3, -8(r1)
1543 ; CHECK-NEXT: stfd f0, -24(r1)
1544 ; CHECK-NEXT: ld r3, -24(r1)
1545 ; CHECK-NEXT: std r3, -16(r1)
1546 ; CHECK-NEXT: addi r3, r1, -16
1547 ; CHECK-NEXT: lxvd2x v2, 0, r3
1550 ; CHECK-REG-LABEL: test47:
1551 ; CHECK-REG: # %bb.0:
1552 ; CHECK-REG-NEXT: addi r3, r1, -48
1553 ; CHECK-REG-NEXT: stxvw4x v2, 0, r3
1554 ; CHECK-REG-NEXT: lfs f0, -44(r1)
1555 ; CHECK-REG-NEXT: xscvdpsxds f0, f0
1556 ; CHECK-REG-NEXT: stfd f0, -32(r1)
1557 ; CHECK-REG-NEXT: lfs f0, -48(r1)
1558 ; CHECK-REG-NEXT: ld r3, -32(r1)
1559 ; CHECK-REG-NEXT: xscvdpsxds f0, f0
1560 ; CHECK-REG-NEXT: std r3, -8(r1)
1561 ; CHECK-REG-NEXT: stfd f0, -24(r1)
1562 ; CHECK-REG-NEXT: ld r3, -24(r1)
1563 ; CHECK-REG-NEXT: std r3, -16(r1)
1564 ; CHECK-REG-NEXT: addi r3, r1, -16
1565 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1566 ; CHECK-REG-NEXT: blr
1568 ; CHECK-FISL-LABEL: test47:
1569 ; CHECK-FISL: # %bb.0:
1570 ; CHECK-FISL-NEXT: addi r3, r1, -48
1571 ; CHECK-FISL-NEXT: stxvw4x v2, 0, r3
1572 ; CHECK-FISL-NEXT: lfs f0, -44(r1)
1573 ; CHECK-FISL-NEXT: xscvdpsxds f0, f0
1574 ; CHECK-FISL-NEXT: stfd f0, -32(r1)
1575 ; CHECK-FISL-NEXT: lfs f0, -48(r1)
1576 ; CHECK-FISL-NEXT: xscvdpsxds f0, f0
1577 ; CHECK-FISL-NEXT: stfd f0, -24(r1)
1578 ; CHECK-FISL-NEXT: ld r3, -32(r1)
1579 ; CHECK-FISL-NEXT: std r3, -8(r1)
1580 ; CHECK-FISL-NEXT: ld r3, -24(r1)
1581 ; CHECK-FISL-NEXT: std r3, -16(r1)
1582 ; CHECK-FISL-NEXT: addi r3, r1, -16
1583 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
1584 ; CHECK-FISL-NEXT: blr
1586 ; CHECK-LE-LABEL: test47:
1587 ; CHECK-LE: # %bb.0:
1588 ; CHECK-LE-NEXT: xxmrglw vs0, v2, v2
1589 ; CHECK-LE-NEXT: xvcvspdp vs0, vs0
1590 ; CHECK-LE-NEXT: xvcvdpsxds v2, vs0
1591 ; CHECK-LE-NEXT: blr
1592 %v = fptosi <2 x float> %a to <2 x i64>
1595 ; FIXME: The code quality here looks pretty bad.
1598 define <2 x double> @test50(ptr %a) {
1599 ; CHECK-LABEL: test50:
1601 ; CHECK-NEXT: lxvdsx v2, 0, r3
1604 ; CHECK-REG-LABEL: test50:
1605 ; CHECK-REG: # %bb.0:
1606 ; CHECK-REG-NEXT: lxvdsx v2, 0, r3
1607 ; CHECK-REG-NEXT: blr
1609 ; CHECK-FISL-LABEL: test50:
1610 ; CHECK-FISL: # %bb.0:
1611 ; CHECK-FISL-NEXT: lxvdsx v2, 0, r3
1612 ; CHECK-FISL-NEXT: blr
1614 ; CHECK-LE-LABEL: test50:
1615 ; CHECK-LE: # %bb.0:
1616 ; CHECK-LE-NEXT: lxvdsx v2, 0, r3
1617 ; CHECK-LE-NEXT: blr
1618 %v = load double, ptr %a, align 8
1619 %w = insertelement <2 x double> undef, double %v, i32 0
1620 %x = insertelement <2 x double> %w, double %v, i32 1
1626 define <2 x double> @test51(<2 x double> %a, <2 x double> %b) {
1627 ; CHECK-LABEL: test51:
1629 ; CHECK-NEXT: xxspltd v2, v2, 0
1632 ; CHECK-REG-LABEL: test51:
1633 ; CHECK-REG: # %bb.0:
1634 ; CHECK-REG-NEXT: xxspltd v2, v2, 0
1635 ; CHECK-REG-NEXT: blr
1637 ; CHECK-FISL-LABEL: test51:
1638 ; CHECK-FISL: # %bb.0:
1639 ; CHECK-FISL-NEXT: xxspltd v2, v2, 0
1640 ; CHECK-FISL-NEXT: blr
1642 ; CHECK-LE-LABEL: test51:
1643 ; CHECK-LE: # %bb.0:
1644 ; CHECK-LE-NEXT: xxspltd v2, v2, 1
1645 ; CHECK-LE-NEXT: blr
1646 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 0, i32 0>
1652 define <2 x double> @test52(<2 x double> %a, <2 x double> %b) {
1653 ; CHECK-LABEL: test52:
1655 ; CHECK-NEXT: xxmrghd v2, v2, v3
1658 ; CHECK-REG-LABEL: test52:
1659 ; CHECK-REG: # %bb.0:
1660 ; CHECK-REG-NEXT: xxmrghd v2, v2, v3
1661 ; CHECK-REG-NEXT: blr
1663 ; CHECK-FISL-LABEL: test52:
1664 ; CHECK-FISL: # %bb.0:
1665 ; CHECK-FISL-NEXT: xxmrghd v2, v2, v3
1666 ; CHECK-FISL-NEXT: blr
1668 ; CHECK-LE-LABEL: test52:
1669 ; CHECK-LE: # %bb.0:
1670 ; CHECK-LE-NEXT: xxmrgld v2, v3, v2
1671 ; CHECK-LE-NEXT: blr
1672 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 0, i32 2>
1678 define <2 x double> @test53(<2 x double> %a, <2 x double> %b) {
1679 ; CHECK-LABEL: test53:
1681 ; CHECK-NEXT: xxmrghd v2, v3, v2
1684 ; CHECK-REG-LABEL: test53:
1685 ; CHECK-REG: # %bb.0:
1686 ; CHECK-REG-NEXT: xxmrghd v2, v3, v2
1687 ; CHECK-REG-NEXT: blr
1689 ; CHECK-FISL-LABEL: test53:
1690 ; CHECK-FISL: # %bb.0:
1691 ; CHECK-FISL-NEXT: xxmrghd v2, v3, v2
1692 ; CHECK-FISL-NEXT: blr
1694 ; CHECK-LE-LABEL: test53:
1695 ; CHECK-LE: # %bb.0:
1696 ; CHECK-LE-NEXT: xxmrgld v2, v2, v3
1697 ; CHECK-LE-NEXT: blr
1698 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 2, i32 0>
1704 define <2 x double> @test54(<2 x double> %a, <2 x double> %b) {
1705 ; CHECK-LABEL: test54:
1707 ; CHECK-NEXT: xxpermdi v2, v2, v3, 2
1710 ; CHECK-REG-LABEL: test54:
1711 ; CHECK-REG: # %bb.0:
1712 ; CHECK-REG-NEXT: xxpermdi v2, v2, v3, 2
1713 ; CHECK-REG-NEXT: blr
1715 ; CHECK-FISL-LABEL: test54:
1716 ; CHECK-FISL: # %bb.0:
1717 ; CHECK-FISL-NEXT: xxpermdi v2, v2, v3, 2
1718 ; CHECK-FISL-NEXT: blr
1720 ; CHECK-LE-LABEL: test54:
1721 ; CHECK-LE: # %bb.0:
1722 ; CHECK-LE-NEXT: xxpermdi v2, v3, v2, 2
1723 ; CHECK-LE-NEXT: blr
1724 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 1, i32 2>
1730 define <2 x double> @test55(<2 x double> %a, <2 x double> %b) {
1731 ; CHECK-LABEL: test55:
1733 ; CHECK-NEXT: xxmrgld v2, v2, v3
1736 ; CHECK-REG-LABEL: test55:
1737 ; CHECK-REG: # %bb.0:
1738 ; CHECK-REG-NEXT: xxmrgld v2, v2, v3
1739 ; CHECK-REG-NEXT: blr
1741 ; CHECK-FISL-LABEL: test55:
1742 ; CHECK-FISL: # %bb.0:
1743 ; CHECK-FISL-NEXT: xxmrgld v2, v2, v3
1744 ; CHECK-FISL-NEXT: blr
1746 ; CHECK-LE-LABEL: test55:
1747 ; CHECK-LE: # %bb.0:
1748 ; CHECK-LE-NEXT: xxmrghd v2, v3, v2
1749 ; CHECK-LE-NEXT: blr
1750 %v = shufflevector <2 x double> %a, <2 x double> %b, <2 x i32> <i32 1, i32 3>
1756 define <2 x i64> @test56(<2 x i64> %a, <2 x i64> %b) {
1757 ; CHECK-LABEL: test56:
1759 ; CHECK-NEXT: xxmrgld v2, v2, v3
1762 ; CHECK-REG-LABEL: test56:
1763 ; CHECK-REG: # %bb.0:
1764 ; CHECK-REG-NEXT: xxmrgld v2, v2, v3
1765 ; CHECK-REG-NEXT: blr
1767 ; CHECK-FISL-LABEL: test56:
1768 ; CHECK-FISL: # %bb.0:
1769 ; CHECK-FISL-NEXT: xxmrgld v2, v2, v3
1770 ; CHECK-FISL-NEXT: blr
1772 ; CHECK-LE-LABEL: test56:
1773 ; CHECK-LE: # %bb.0:
1774 ; CHECK-LE-NEXT: xxmrghd v2, v3, v2
1775 ; CHECK-LE-NEXT: blr
1776 %v = shufflevector <2 x i64> %a, <2 x i64> %b, <2 x i32> <i32 1, i32 3>
1782 define <2 x i64> @test60(<2 x i64> %a, <2 x i64> %b) {
1783 ; CHECK-LABEL: test60:
1785 ; CHECK-NEXT: addi r3, r1, -32
1786 ; CHECK-NEXT: addi r4, r1, -48
1787 ; CHECK-NEXT: stxvd2x v3, 0, r3
1788 ; CHECK-NEXT: stxvd2x v2, 0, r4
1789 ; CHECK-NEXT: lwz r3, -20(r1)
1790 ; CHECK-NEXT: ld r4, -40(r1)
1791 ; CHECK-NEXT: sld r3, r4, r3
1792 ; CHECK-NEXT: ld r4, -48(r1)
1793 ; CHECK-NEXT: std r3, -8(r1)
1794 ; CHECK-NEXT: lwz r3, -28(r1)
1795 ; CHECK-NEXT: sld r3, r4, r3
1796 ; CHECK-NEXT: std r3, -16(r1)
1797 ; CHECK-NEXT: addi r3, r1, -16
1798 ; CHECK-NEXT: lxvd2x v2, 0, r3
1801 ; CHECK-REG-LABEL: test60:
1802 ; CHECK-REG: # %bb.0:
1803 ; CHECK-REG-NEXT: addi r3, r1, -32
1804 ; CHECK-REG-NEXT: addi r4, r1, -48
1805 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
1806 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
1807 ; CHECK-REG-NEXT: lwz r3, -20(r1)
1808 ; CHECK-REG-NEXT: ld r4, -40(r1)
1809 ; CHECK-REG-NEXT: sld r3, r4, r3
1810 ; CHECK-REG-NEXT: ld r4, -48(r1)
1811 ; CHECK-REG-NEXT: std r3, -8(r1)
1812 ; CHECK-REG-NEXT: lwz r3, -28(r1)
1813 ; CHECK-REG-NEXT: sld r3, r4, r3
1814 ; CHECK-REG-NEXT: std r3, -16(r1)
1815 ; CHECK-REG-NEXT: addi r3, r1, -16
1816 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1817 ; CHECK-REG-NEXT: blr
1819 ; CHECK-FISL-LABEL: test60:
1820 ; CHECK-FISL: # %bb.0:
1821 ; CHECK-FISL-NEXT: addi r3, r1, -32
1822 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
1823 ; CHECK-FISL-NEXT: addi r3, r1, -48
1824 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1825 ; CHECK-FISL-NEXT: lwz r4, -20(r1)
1826 ; CHECK-FISL-NEXT: ld r3, -40(r1)
1827 ; CHECK-FISL-NEXT: sld r3, r3, r4
1828 ; CHECK-FISL-NEXT: std r3, -8(r1)
1829 ; CHECK-FISL-NEXT: lwz r4, -28(r1)
1830 ; CHECK-FISL-NEXT: ld r3, -48(r1)
1831 ; CHECK-FISL-NEXT: sld r3, r3, r4
1832 ; CHECK-FISL-NEXT: std r3, -16(r1)
1833 ; CHECK-FISL-NEXT: addi r3, r1, -16
1834 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
1835 ; CHECK-FISL-NEXT: blr
1837 ; CHECK-LE-LABEL: test60:
1838 ; CHECK-LE: # %bb.0:
1839 ; CHECK-LE-NEXT: vsld v2, v2, v3
1840 ; CHECK-LE-NEXT: blr
1841 %v = shl <2 x i64> %a, %b
1844 ; This should scalarize, and the current code quality is not good.
1847 define <2 x i64> @test61(<2 x i64> %a, <2 x i64> %b) {
1848 ; CHECK-LABEL: test61:
1850 ; CHECK-NEXT: addi r3, r1, -32
1851 ; CHECK-NEXT: addi r4, r1, -48
1852 ; CHECK-NEXT: stxvd2x v3, 0, r3
1853 ; CHECK-NEXT: stxvd2x v2, 0, r4
1854 ; CHECK-NEXT: lwz r3, -20(r1)
1855 ; CHECK-NEXT: ld r4, -40(r1)
1856 ; CHECK-NEXT: srd r3, r4, r3
1857 ; CHECK-NEXT: ld r4, -48(r1)
1858 ; CHECK-NEXT: std r3, -8(r1)
1859 ; CHECK-NEXT: lwz r3, -28(r1)
1860 ; CHECK-NEXT: srd r3, r4, r3
1861 ; CHECK-NEXT: std r3, -16(r1)
1862 ; CHECK-NEXT: addi r3, r1, -16
1863 ; CHECK-NEXT: lxvd2x v2, 0, r3
1866 ; CHECK-REG-LABEL: test61:
1867 ; CHECK-REG: # %bb.0:
1868 ; CHECK-REG-NEXT: addi r3, r1, -32
1869 ; CHECK-REG-NEXT: addi r4, r1, -48
1870 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
1871 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
1872 ; CHECK-REG-NEXT: lwz r3, -20(r1)
1873 ; CHECK-REG-NEXT: ld r4, -40(r1)
1874 ; CHECK-REG-NEXT: srd r3, r4, r3
1875 ; CHECK-REG-NEXT: ld r4, -48(r1)
1876 ; CHECK-REG-NEXT: std r3, -8(r1)
1877 ; CHECK-REG-NEXT: lwz r3, -28(r1)
1878 ; CHECK-REG-NEXT: srd r3, r4, r3
1879 ; CHECK-REG-NEXT: std r3, -16(r1)
1880 ; CHECK-REG-NEXT: addi r3, r1, -16
1881 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1882 ; CHECK-REG-NEXT: blr
1884 ; CHECK-FISL-LABEL: test61:
1885 ; CHECK-FISL: # %bb.0:
1886 ; CHECK-FISL-NEXT: addi r3, r1, -32
1887 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
1888 ; CHECK-FISL-NEXT: addi r3, r1, -48
1889 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1890 ; CHECK-FISL-NEXT: lwz r4, -20(r1)
1891 ; CHECK-FISL-NEXT: ld r3, -40(r1)
1892 ; CHECK-FISL-NEXT: srd r3, r3, r4
1893 ; CHECK-FISL-NEXT: std r3, -8(r1)
1894 ; CHECK-FISL-NEXT: lwz r4, -28(r1)
1895 ; CHECK-FISL-NEXT: ld r3, -48(r1)
1896 ; CHECK-FISL-NEXT: srd r3, r3, r4
1897 ; CHECK-FISL-NEXT: std r3, -16(r1)
1898 ; CHECK-FISL-NEXT: addi r3, r1, -16
1899 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
1900 ; CHECK-FISL-NEXT: blr
1902 ; CHECK-LE-LABEL: test61:
1903 ; CHECK-LE: # %bb.0:
1904 ; CHECK-LE-NEXT: vsrd v2, v2, v3
1905 ; CHECK-LE-NEXT: blr
1906 %v = lshr <2 x i64> %a, %b
1909 ; This should scalarize, and the current code quality is not good.
1912 define <2 x i64> @test62(<2 x i64> %a, <2 x i64> %b) {
1913 ; CHECK-LABEL: test62:
1915 ; CHECK-NEXT: addi r3, r1, -32
1916 ; CHECK-NEXT: addi r4, r1, -48
1917 ; CHECK-NEXT: stxvd2x v3, 0, r3
1918 ; CHECK-NEXT: stxvd2x v2, 0, r4
1919 ; CHECK-NEXT: lwz r3, -20(r1)
1920 ; CHECK-NEXT: ld r4, -40(r1)
1921 ; CHECK-NEXT: srad r3, r4, r3
1922 ; CHECK-NEXT: ld r4, -48(r1)
1923 ; CHECK-NEXT: std r3, -8(r1)
1924 ; CHECK-NEXT: lwz r3, -28(r1)
1925 ; CHECK-NEXT: srad r3, r4, r3
1926 ; CHECK-NEXT: std r3, -16(r1)
1927 ; CHECK-NEXT: addi r3, r1, -16
1928 ; CHECK-NEXT: lxvd2x v2, 0, r3
1931 ; CHECK-REG-LABEL: test62:
1932 ; CHECK-REG: # %bb.0:
1933 ; CHECK-REG-NEXT: addi r3, r1, -32
1934 ; CHECK-REG-NEXT: addi r4, r1, -48
1935 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
1936 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
1937 ; CHECK-REG-NEXT: lwz r3, -20(r1)
1938 ; CHECK-REG-NEXT: ld r4, -40(r1)
1939 ; CHECK-REG-NEXT: srad r3, r4, r3
1940 ; CHECK-REG-NEXT: ld r4, -48(r1)
1941 ; CHECK-REG-NEXT: std r3, -8(r1)
1942 ; CHECK-REG-NEXT: lwz r3, -28(r1)
1943 ; CHECK-REG-NEXT: srad r3, r4, r3
1944 ; CHECK-REG-NEXT: std r3, -16(r1)
1945 ; CHECK-REG-NEXT: addi r3, r1, -16
1946 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
1947 ; CHECK-REG-NEXT: blr
1949 ; CHECK-FISL-LABEL: test62:
1950 ; CHECK-FISL: # %bb.0:
1951 ; CHECK-FISL-NEXT: addi r3, r1, -32
1952 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
1953 ; CHECK-FISL-NEXT: addi r3, r1, -48
1954 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
1955 ; CHECK-FISL-NEXT: lwz r4, -20(r1)
1956 ; CHECK-FISL-NEXT: ld r3, -40(r1)
1957 ; CHECK-FISL-NEXT: srad r3, r3, r4
1958 ; CHECK-FISL-NEXT: std r3, -8(r1)
1959 ; CHECK-FISL-NEXT: lwz r4, -28(r1)
1960 ; CHECK-FISL-NEXT: ld r3, -48(r1)
1961 ; CHECK-FISL-NEXT: srad r3, r3, r4
1962 ; CHECK-FISL-NEXT: std r3, -16(r1)
1963 ; CHECK-FISL-NEXT: addi r3, r1, -16
1964 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
1965 ; CHECK-FISL-NEXT: blr
1967 ; CHECK-LE-LABEL: test62:
1968 ; CHECK-LE: # %bb.0:
1969 ; CHECK-LE-NEXT: vsrad v2, v2, v3
1970 ; CHECK-LE-NEXT: blr
1971 %v = ashr <2 x i64> %a, %b
1974 ; This should scalarize, and the current code quality is not good.
1977 define double @test63(<2 x double> %a) {
1978 ; CHECK-LABEL: test63:
1980 ; CHECK-NEXT: xxlor f1, v2, v2
1983 ; CHECK-REG-LABEL: test63:
1984 ; CHECK-REG: # %bb.0:
1985 ; CHECK-REG-NEXT: xxlor f1, v2, v2
1986 ; CHECK-REG-NEXT: blr
1988 ; CHECK-FISL-LABEL: test63:
1989 ; CHECK-FISL: # %bb.0:
1990 ; CHECK-FISL-NEXT: xxlor f1, v2, v2
1991 ; CHECK-FISL-NEXT: blr
1993 ; CHECK-LE-LABEL: test63:
1994 ; CHECK-LE: # %bb.0:
1995 ; CHECK-LE-NEXT: xxswapd vs1, v2
1996 ; CHECK-LE-NEXT: # kill: def $f1 killed $f1 killed $vsl1
1997 ; CHECK-LE-NEXT: blr
1998 %v = extractelement <2 x double> %a, i32 0
2005 define double @test64(<2 x double> %a) {
2006 ; CHECK-LABEL: test64:
2008 ; CHECK-NEXT: xxswapd vs1, v2
2009 ; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2012 ; CHECK-REG-LABEL: test64:
2013 ; CHECK-REG: # %bb.0:
2014 ; CHECK-REG-NEXT: xxswapd vs1, v2
2015 ; CHECK-REG-NEXT: # kill: def $f1 killed $f1 killed $vsl1
2016 ; CHECK-REG-NEXT: blr
2018 ; CHECK-FISL-LABEL: test64:
2019 ; CHECK-FISL: # %bb.0:
2020 ; CHECK-FISL-NEXT: xxswapd vs0, v2
2021 ; CHECK-FISL-NEXT: fmr f1, f0
2022 ; CHECK-FISL-NEXT: blr
2024 ; CHECK-LE-LABEL: test64:
2025 ; CHECK-LE: # %bb.0:
2026 ; CHECK-LE-NEXT: xxlor f1, v2, v2
2027 ; CHECK-LE-NEXT: blr
2028 %v = extractelement <2 x double> %a, i32 1
2035 define <2 x i1> @test65(<2 x i64> %a, <2 x i64> %b) {
2036 ; CHECK-LABEL: test65:
2038 ; CHECK-NEXT: vcmpequw v2, v2, v3
2039 ; CHECK-NEXT: addis r3, r2, .LCPI59_0@toc@ha
2040 ; CHECK-NEXT: addi r3, r3, .LCPI59_0@toc@l
2041 ; CHECK-NEXT: lxvw4x v3, 0, r3
2042 ; CHECK-NEXT: vperm v3, v2, v2, v3
2043 ; CHECK-NEXT: xxland v2, v3, v2
2046 ; CHECK-REG-LABEL: test65:
2047 ; CHECK-REG: # %bb.0:
2048 ; CHECK-REG-NEXT: vcmpequw v2, v2, v3
2049 ; CHECK-REG-NEXT: addis r3, r2, .LCPI59_0@toc@ha
2050 ; CHECK-REG-NEXT: addi r3, r3, .LCPI59_0@toc@l
2051 ; CHECK-REG-NEXT: lxvw4x v3, 0, r3
2052 ; CHECK-REG-NEXT: vperm v3, v2, v2, v3
2053 ; CHECK-REG-NEXT: xxland v2, v3, v2
2054 ; CHECK-REG-NEXT: blr
2056 ; CHECK-FISL-LABEL: test65:
2057 ; CHECK-FISL: # %bb.0:
2058 ; CHECK-FISL-NEXT: vcmpequw v3, v2, v3
2059 ; CHECK-FISL-NEXT: addis r3, r2, .LCPI59_0@toc@ha
2060 ; CHECK-FISL-NEXT: addi r3, r3, .LCPI59_0@toc@l
2061 ; CHECK-FISL-NEXT: lxvw4x v2, 0, r3
2062 ; CHECK-FISL-NEXT: vperm v2, v3, v3, v2
2063 ; CHECK-FISL-NEXT: xxland v2, v2, v3
2064 ; CHECK-FISL-NEXT: blr
2066 ; CHECK-LE-LABEL: test65:
2067 ; CHECK-LE: # %bb.0:
2068 ; CHECK-LE-NEXT: vcmpequd v2, v2, v3
2069 ; CHECK-LE-NEXT: blr
2070 %w = icmp eq <2 x i64> %a, %b
2077 define <2 x i1> @test66(<2 x i64> %a, <2 x i64> %b) {
2078 ; CHECK-LABEL: test66:
2080 ; CHECK-NEXT: vcmpequw v2, v2, v3
2081 ; CHECK-NEXT: addis r3, r2, .LCPI60_0@toc@ha
2082 ; CHECK-NEXT: addi r3, r3, .LCPI60_0@toc@l
2083 ; CHECK-NEXT: lxvw4x v3, 0, r3
2084 ; CHECK-NEXT: xxlnor v2, v2, v2
2085 ; CHECK-NEXT: vperm v3, v2, v2, v3
2086 ; CHECK-NEXT: xxlor v2, v3, v2
2089 ; CHECK-REG-LABEL: test66:
2090 ; CHECK-REG: # %bb.0:
2091 ; CHECK-REG-NEXT: vcmpequw v2, v2, v3
2092 ; CHECK-REG-NEXT: addis r3, r2, .LCPI60_0@toc@ha
2093 ; CHECK-REG-NEXT: addi r3, r3, .LCPI60_0@toc@l
2094 ; CHECK-REG-NEXT: lxvw4x v3, 0, r3
2095 ; CHECK-REG-NEXT: xxlnor v2, v2, v2
2096 ; CHECK-REG-NEXT: vperm v3, v2, v2, v3
2097 ; CHECK-REG-NEXT: xxlor v2, v3, v2
2098 ; CHECK-REG-NEXT: blr
2100 ; CHECK-FISL-LABEL: test66:
2101 ; CHECK-FISL: # %bb.0:
2102 ; CHECK-FISL-NEXT: vcmpequw v2, v2, v3
2103 ; CHECK-FISL-NEXT: xxlnor v3, v2, v2
2104 ; CHECK-FISL-NEXT: addis r3, r2, .LCPI60_0@toc@ha
2105 ; CHECK-FISL-NEXT: addi r3, r3, .LCPI60_0@toc@l
2106 ; CHECK-FISL-NEXT: lxvw4x v2, 0, r3
2107 ; CHECK-FISL-NEXT: vperm v2, v3, v3, v2
2108 ; CHECK-FISL-NEXT: xxlor v2, v2, v3
2109 ; CHECK-FISL-NEXT: blr
2111 ; CHECK-LE-LABEL: test66:
2112 ; CHECK-LE: # %bb.0:
2113 ; CHECK-LE-NEXT: vcmpequd v2, v2, v3
2114 ; CHECK-LE-NEXT: xxlnor v2, v2, v2
2115 ; CHECK-LE-NEXT: blr
2116 %w = icmp ne <2 x i64> %a, %b
2123 define <2 x i1> @test67(<2 x i64> %a, <2 x i64> %b) {
2124 ; CHECK-LABEL: test67:
2126 ; CHECK-NEXT: addi r3, r1, -32
2127 ; CHECK-NEXT: addi r4, r1, -48
2128 ; CHECK-NEXT: stxvd2x v3, 0, r3
2129 ; CHECK-NEXT: stxvd2x v2, 0, r4
2130 ; CHECK-NEXT: ld r3, -24(r1)
2131 ; CHECK-NEXT: ld r4, -40(r1)
2132 ; CHECK-NEXT: ld r6, -48(r1)
2133 ; CHECK-NEXT: cmpld r4, r3
2134 ; CHECK-NEXT: li r3, 0
2135 ; CHECK-NEXT: li r4, -1
2136 ; CHECK-NEXT: isellt r5, r4, r3
2137 ; CHECK-NEXT: std r5, -8(r1)
2138 ; CHECK-NEXT: ld r5, -32(r1)
2139 ; CHECK-NEXT: cmpld r6, r5
2140 ; CHECK-NEXT: isellt r3, r4, r3
2141 ; CHECK-NEXT: std r3, -16(r1)
2142 ; CHECK-NEXT: addi r3, r1, -16
2143 ; CHECK-NEXT: lxvd2x v2, 0, r3
2146 ; CHECK-REG-LABEL: test67:
2147 ; CHECK-REG: # %bb.0:
2148 ; CHECK-REG-NEXT: addi r3, r1, -32
2149 ; CHECK-REG-NEXT: addi r4, r1, -48
2150 ; CHECK-REG-NEXT: stxvd2x v3, 0, r3
2151 ; CHECK-REG-NEXT: stxvd2x v2, 0, r4
2152 ; CHECK-REG-NEXT: ld r3, -24(r1)
2153 ; CHECK-REG-NEXT: ld r4, -40(r1)
2154 ; CHECK-REG-NEXT: ld r6, -48(r1)
2155 ; CHECK-REG-NEXT: cmpld r4, r3
2156 ; CHECK-REG-NEXT: li r3, 0
2157 ; CHECK-REG-NEXT: li r4, -1
2158 ; CHECK-REG-NEXT: isellt r5, r4, r3
2159 ; CHECK-REG-NEXT: std r5, -8(r1)
2160 ; CHECK-REG-NEXT: ld r5, -32(r1)
2161 ; CHECK-REG-NEXT: cmpld r6, r5
2162 ; CHECK-REG-NEXT: isellt r3, r4, r3
2163 ; CHECK-REG-NEXT: std r3, -16(r1)
2164 ; CHECK-REG-NEXT: addi r3, r1, -16
2165 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
2166 ; CHECK-REG-NEXT: blr
2168 ; CHECK-FISL-LABEL: test67:
2169 ; CHECK-FISL: # %bb.0:
2170 ; CHECK-FISL-NEXT: addi r3, r1, -32
2171 ; CHECK-FISL-NEXT: stxvd2x v3, 0, r3
2172 ; CHECK-FISL-NEXT: addi r3, r1, -48
2173 ; CHECK-FISL-NEXT: stxvd2x v2, 0, r3
2174 ; CHECK-FISL-NEXT: ld r4, -24(r1)
2175 ; CHECK-FISL-NEXT: ld r3, -40(r1)
2176 ; CHECK-FISL-NEXT: cmpld r3, r4
2177 ; CHECK-FISL-NEXT: li r4, 0
2178 ; CHECK-FISL-NEXT: li r3, -1
2179 ; CHECK-FISL-NEXT: isellt r5, r3, r4
2180 ; CHECK-FISL-NEXT: std r5, -8(r1)
2181 ; CHECK-FISL-NEXT: ld r6, -32(r1)
2182 ; CHECK-FISL-NEXT: ld r5, -48(r1)
2183 ; CHECK-FISL-NEXT: cmpld r5, r6
2184 ; CHECK-FISL-NEXT: isellt r3, r3, r4
2185 ; CHECK-FISL-NEXT: std r3, -16(r1)
2186 ; CHECK-FISL-NEXT: addi r3, r1, -16
2187 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
2188 ; CHECK-FISL-NEXT: blr
2190 ; CHECK-LE-LABEL: test67:
2191 ; CHECK-LE: # %bb.0:
2192 ; CHECK-LE-NEXT: vcmpgtud v2, v3, v2
2193 ; CHECK-LE-NEXT: blr
2194 %w = icmp ult <2 x i64> %a, %b
2197 ; This should scalarize, and the current code quality is not good.
2201 define <2 x double> @test68(<2 x i32> %a) {
2202 ; CHECK-LABEL: test68:
2204 ; CHECK-NEXT: xxmrghw vs0, v2, v2
2205 ; CHECK-NEXT: xvcvsxwdp v2, vs0
2208 ; CHECK-REG-LABEL: test68:
2209 ; CHECK-REG: # %bb.0:
2210 ; CHECK-REG-NEXT: xxmrghw vs0, v2, v2
2211 ; CHECK-REG-NEXT: xvcvsxwdp v2, vs0
2212 ; CHECK-REG-NEXT: blr
2214 ; CHECK-FISL-LABEL: test68:
2215 ; CHECK-FISL: # %bb.0:
2216 ; CHECK-FISL-NEXT: xxmrghw vs0, v2, v2
2217 ; CHECK-FISL-NEXT: xvcvsxwdp v2, vs0
2218 ; CHECK-FISL-NEXT: blr
2220 ; CHECK-LE-LABEL: test68:
2221 ; CHECK-LE: # %bb.0:
2222 ; CHECK-LE-NEXT: xxmrglw v2, v2, v2
2223 ; CHECK-LE-NEXT: xvcvsxwdp v2, v2
2224 ; CHECK-LE-NEXT: blr
2225 %w = sitofp <2 x i32> %a to <2 x double>
2231 ; This gets scalarized so the code isn't great
2232 define <2 x double> @test69(<2 x i16> %a) {
2233 ; CHECK-LABEL: test69:
2235 ; CHECK-NEXT: addis r3, r2, .LCPI63_0@toc@ha
2236 ; CHECK-NEXT: addi r3, r3, .LCPI63_0@toc@l
2237 ; CHECK-NEXT: lxvw4x v3, 0, r3
2238 ; CHECK-NEXT: addi r3, r1, -32
2239 ; CHECK-NEXT: vperm v2, v2, v2, v3
2240 ; CHECK-NEXT: stxvd2x v2, 0, r3
2241 ; CHECK-NEXT: lha r3, -18(r1)
2242 ; CHECK-NEXT: std r3, -8(r1)
2243 ; CHECK-NEXT: lha r3, -26(r1)
2244 ; CHECK-NEXT: std r3, -16(r1)
2245 ; CHECK-NEXT: addi r3, r1, -16
2246 ; CHECK-NEXT: lxvd2x v2, 0, r3
2247 ; CHECK-NEXT: xvcvsxddp v2, v2
2250 ; CHECK-REG-LABEL: test69:
2251 ; CHECK-REG: # %bb.0:
2252 ; CHECK-REG-NEXT: addis r3, r2, .LCPI63_0@toc@ha
2253 ; CHECK-REG-NEXT: addi r3, r3, .LCPI63_0@toc@l
2254 ; CHECK-REG-NEXT: lxvw4x v3, 0, r3
2255 ; CHECK-REG-NEXT: addi r3, r1, -32
2256 ; CHECK-REG-NEXT: vperm v2, v2, v2, v3
2257 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
2258 ; CHECK-REG-NEXT: lha r3, -18(r1)
2259 ; CHECK-REG-NEXT: std r3, -8(r1)
2260 ; CHECK-REG-NEXT: lha r3, -26(r1)
2261 ; CHECK-REG-NEXT: std r3, -16(r1)
2262 ; CHECK-REG-NEXT: addi r3, r1, -16
2263 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
2264 ; CHECK-REG-NEXT: xvcvsxddp v2, v2
2265 ; CHECK-REG-NEXT: blr
2267 ; CHECK-FISL-LABEL: test69:
2268 ; CHECK-FISL: # %bb.0:
2269 ; CHECK-FISL-NEXT: addis r3, r2, .LCPI63_0@toc@ha
2270 ; CHECK-FISL-NEXT: addi r3, r3, .LCPI63_0@toc@l
2271 ; CHECK-FISL-NEXT: lxvw4x v3, 0, r3
2272 ; CHECK-FISL-NEXT: vperm v2, v2, v2, v3
2273 ; CHECK-FISL-NEXT: xxlor vs0, v2, v2
2274 ; CHECK-FISL-NEXT: addi r3, r1, -32
2275 ; CHECK-FISL-NEXT: stxvd2x vs0, 0, r3
2276 ; CHECK-FISL-NEXT: lha r3, -18(r1)
2277 ; CHECK-FISL-NEXT: std r3, -8(r1)
2278 ; CHECK-FISL-NEXT: lha r3, -26(r1)
2279 ; CHECK-FISL-NEXT: std r3, -16(r1)
2280 ; CHECK-FISL-NEXT: addi r3, r1, -16
2281 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
2282 ; CHECK-FISL-NEXT: xvcvsxddp v2, v2
2283 ; CHECK-FISL-NEXT: blr
2285 ; CHECK-LE-LABEL: test69:
2286 ; CHECK-LE: # %bb.0:
2287 ; CHECK-LE-NEXT: addis r3, r2, .LCPI63_0@toc@ha
2288 ; CHECK-LE-NEXT: addi r3, r3, .LCPI63_0@toc@l
2289 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
2290 ; CHECK-LE-NEXT: addis r3, r2, .LCPI63_1@toc@ha
2291 ; CHECK-LE-NEXT: addi r3, r3, .LCPI63_1@toc@l
2292 ; CHECK-LE-NEXT: xxswapd v3, vs0
2293 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2294 ; CHECK-LE-NEXT: lxvd2x v3, 0, r3
2295 ; CHECK-LE-NEXT: vsld v2, v2, v3
2296 ; CHECK-LE-NEXT: vsrad v2, v2, v3
2297 ; CHECK-LE-NEXT: xvcvsxddp v2, v2
2298 ; CHECK-LE-NEXT: blr
2299 %w = sitofp <2 x i16> %a to <2 x double>
2305 ; This gets scalarized so the code isn't great
2306 define <2 x double> @test70(<2 x i8> %a) {
2307 ; CHECK-LABEL: test70:
2309 ; CHECK-NEXT: addis r3, r2, .LCPI64_0@toc@ha
2310 ; CHECK-NEXT: addi r3, r3, .LCPI64_0@toc@l
2311 ; CHECK-NEXT: lxvw4x v3, 0, r3
2312 ; CHECK-NEXT: addi r3, r1, -32
2313 ; CHECK-NEXT: vperm v2, v2, v2, v3
2314 ; CHECK-NEXT: stxvd2x v2, 0, r3
2315 ; CHECK-NEXT: ld r3, -24(r1)
2316 ; CHECK-NEXT: extsb r3, r3
2317 ; CHECK-NEXT: std r3, -8(r1)
2318 ; CHECK-NEXT: ld r3, -32(r1)
2319 ; CHECK-NEXT: extsb r3, r3
2320 ; CHECK-NEXT: std r3, -16(r1)
2321 ; CHECK-NEXT: addi r3, r1, -16
2322 ; CHECK-NEXT: lxvd2x v2, 0, r3
2323 ; CHECK-NEXT: xvcvsxddp v2, v2
2326 ; CHECK-REG-LABEL: test70:
2327 ; CHECK-REG: # %bb.0:
2328 ; CHECK-REG-NEXT: addis r3, r2, .LCPI64_0@toc@ha
2329 ; CHECK-REG-NEXT: addi r3, r3, .LCPI64_0@toc@l
2330 ; CHECK-REG-NEXT: lxvw4x v3, 0, r3
2331 ; CHECK-REG-NEXT: addi r3, r1, -32
2332 ; CHECK-REG-NEXT: vperm v2, v2, v2, v3
2333 ; CHECK-REG-NEXT: stxvd2x v2, 0, r3
2334 ; CHECK-REG-NEXT: ld r3, -24(r1)
2335 ; CHECK-REG-NEXT: extsb r3, r3
2336 ; CHECK-REG-NEXT: std r3, -8(r1)
2337 ; CHECK-REG-NEXT: ld r3, -32(r1)
2338 ; CHECK-REG-NEXT: extsb r3, r3
2339 ; CHECK-REG-NEXT: std r3, -16(r1)
2340 ; CHECK-REG-NEXT: addi r3, r1, -16
2341 ; CHECK-REG-NEXT: lxvd2x v2, 0, r3
2342 ; CHECK-REG-NEXT: xvcvsxddp v2, v2
2343 ; CHECK-REG-NEXT: blr
2345 ; CHECK-FISL-LABEL: test70:
2346 ; CHECK-FISL: # %bb.0:
2347 ; CHECK-FISL-NEXT: addis r3, r2, .LCPI64_0@toc@ha
2348 ; CHECK-FISL-NEXT: addi r3, r3, .LCPI64_0@toc@l
2349 ; CHECK-FISL-NEXT: lxvw4x v3, 0, r3
2350 ; CHECK-FISL-NEXT: vperm v2, v2, v2, v3
2351 ; CHECK-FISL-NEXT: xxlor vs0, v2, v2
2352 ; CHECK-FISL-NEXT: addi r3, r1, -32
2353 ; CHECK-FISL-NEXT: stxvd2x vs0, 0, r3
2354 ; CHECK-FISL-NEXT: ld r3, -24(r1)
2355 ; CHECK-FISL-NEXT: extsb r3, r3
2356 ; CHECK-FISL-NEXT: std r3, -8(r1)
2357 ; CHECK-FISL-NEXT: ld r3, -32(r1)
2358 ; CHECK-FISL-NEXT: extsb r3, r3
2359 ; CHECK-FISL-NEXT: std r3, -16(r1)
2360 ; CHECK-FISL-NEXT: addi r3, r1, -16
2361 ; CHECK-FISL-NEXT: lxvd2x v2, 0, r3
2362 ; CHECK-FISL-NEXT: xvcvsxddp v2, v2
2363 ; CHECK-FISL-NEXT: blr
2365 ; CHECK-LE-LABEL: test70:
2366 ; CHECK-LE: # %bb.0:
2367 ; CHECK-LE-NEXT: addis r3, r2, .LCPI64_0@toc@ha
2368 ; CHECK-LE-NEXT: addi r3, r3, .LCPI64_0@toc@l
2369 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
2370 ; CHECK-LE-NEXT: addis r3, r2, .LCPI64_1@toc@ha
2371 ; CHECK-LE-NEXT: addi r3, r3, .LCPI64_1@toc@l
2372 ; CHECK-LE-NEXT: xxswapd v3, vs0
2373 ; CHECK-LE-NEXT: vperm v2, v2, v2, v3
2374 ; CHECK-LE-NEXT: lxvd2x v3, 0, r3
2375 ; CHECK-LE-NEXT: vsld v2, v2, v3
2376 ; CHECK-LE-NEXT: vsrad v2, v2, v3
2377 ; CHECK-LE-NEXT: xvcvsxddp v2, v2
2378 ; CHECK-LE-NEXT: blr
2379 %w = sitofp <2 x i8> %a to <2 x double>
2385 ; This gets scalarized so the code isn't great
2386 define <2 x i32> @test80(i32 %v) {
2387 ; CHECK-LABEL: test80:
2389 ; CHECK-NEXT: addi r4, r1, -16
2390 ; CHECK-NEXT: stw r3, -16(r1)
2391 ; CHECK-NEXT: addis r3, r2, .LCPI65_0@toc@ha
2392 ; CHECK-NEXT: lxvw4x vs0, 0, r4
2393 ; CHECK-NEXT: addi r3, r3, .LCPI65_0@toc@l
2394 ; CHECK-NEXT: lxvw4x v3, 0, r3
2395 ; CHECK-NEXT: xxspltw v2, vs0, 0
2396 ; CHECK-NEXT: vadduwm v2, v2, v3
2399 ; CHECK-REG-LABEL: test80:
2400 ; CHECK-REG: # %bb.0:
2401 ; CHECK-REG-NEXT: addi r4, r1, -16
2402 ; CHECK-REG-NEXT: stw r3, -16(r1)
2403 ; CHECK-REG-NEXT: addis r3, r2, .LCPI65_0@toc@ha
2404 ; CHECK-REG-NEXT: lxvw4x vs0, 0, r4
2405 ; CHECK-REG-NEXT: addi r3, r3, .LCPI65_0@toc@l
2406 ; CHECK-REG-NEXT: lxvw4x v3, 0, r3
2407 ; CHECK-REG-NEXT: xxspltw v2, vs0, 0
2408 ; CHECK-REG-NEXT: vadduwm v2, v2, v3
2409 ; CHECK-REG-NEXT: blr
2411 ; CHECK-FISL-LABEL: test80:
2412 ; CHECK-FISL: # %bb.0:
2413 ; CHECK-FISL-NEXT: # kill: def $r3 killed $r3 killed $x3
2414 ; CHECK-FISL-NEXT: stw r3, -16(r1)
2415 ; CHECK-FISL-NEXT: addi r3, r1, -16
2416 ; CHECK-FISL-NEXT: lxvw4x vs0, 0, r3
2417 ; CHECK-FISL-NEXT: xxspltw v2, vs0, 0
2418 ; CHECK-FISL-NEXT: addis r3, r2, .LCPI65_0@toc@ha
2419 ; CHECK-FISL-NEXT: addi r3, r3, .LCPI65_0@toc@l
2420 ; CHECK-FISL-NEXT: lxvw4x v3, 0, r3
2421 ; CHECK-FISL-NEXT: vadduwm v2, v2, v3
2422 ; CHECK-FISL-NEXT: blr
2424 ; CHECK-LE-LABEL: test80:
2425 ; CHECK-LE: # %bb.0:
2426 ; CHECK-LE-NEXT: mtfprwz f0, r3
2427 ; CHECK-LE-NEXT: addis r3, r2, .LCPI65_0@toc@ha
2428 ; CHECK-LE-NEXT: addi r3, r3, .LCPI65_0@toc@l
2429 ; CHECK-LE-NEXT: xxspltw v2, vs0, 1
2430 ; CHECK-LE-NEXT: lxvd2x vs0, 0, r3
2431 ; CHECK-LE-NEXT: xxswapd v3, vs0
2432 ; CHECK-LE-NEXT: vadduwm v2, v2, v3
2433 ; CHECK-LE-NEXT: blr
2434 %b1 = insertelement <2 x i32> undef, i32 %v, i32 0
2435 %b2 = shufflevector <2 x i32> %b1, <2 x i32> undef, <2 x i32> zeroinitializer
2436 %i = add <2 x i32> %b2, <i32 2, i32 3>
2443 define <2 x double> @test81(<4 x float> %b) {
2444 ; CHECK-LABEL: test81:
2448 ; CHECK-REG-LABEL: test81:
2449 ; CHECK-REG: # %bb.0:
2450 ; CHECK-REG-NEXT: blr
2452 ; CHECK-FISL-LABEL: test81:
2453 ; CHECK-FISL: # %bb.0:
2454 ; CHECK-FISL-NEXT: blr
2456 ; CHECK-LE-LABEL: test81:
2457 ; CHECK-LE: # %bb.0:
2458 ; CHECK-LE-NEXT: blr
2459 %w = bitcast <4 x float> %b to <2 x double>
2465 define double @test82(double %a, double %b, double %c, double %d) {
2466 ; CHECK-LABEL: test82:
2467 ; CHECK: # %bb.0: # %entry
2468 ; CHECK-NEXT: xscmpudp cr0, f3, f4
2469 ; CHECK-NEXT: beqlr cr0
2470 ; CHECK-NEXT: # %bb.1: # %entry
2471 ; CHECK-NEXT: fmr f1, f2
2474 ; CHECK-REG-LABEL: test82:
2475 ; CHECK-REG: # %bb.0: # %entry
2476 ; CHECK-REG-NEXT: xscmpudp cr0, f3, f4
2477 ; CHECK-REG-NEXT: beqlr cr0
2478 ; CHECK-REG-NEXT: # %bb.1: # %entry
2479 ; CHECK-REG-NEXT: fmr f1, f2
2480 ; CHECK-REG-NEXT: blr
2482 ; CHECK-FISL-LABEL: test82:
2483 ; CHECK-FISL: # %bb.0: # %entry
2484 ; CHECK-FISL-NEXT: stfd f2, -16(r1) # 8-byte Folded Spill
2485 ; CHECK-FISL-NEXT: fmr f2, f1
2486 ; CHECK-FISL-NEXT: xscmpudp cr0, f3, f4
2487 ; CHECK-FISL-NEXT: stfd f2, -8(r1) # 8-byte Folded Spill
2488 ; CHECK-FISL-NEXT: beq cr0, .LBB67_2
2489 ; CHECK-FISL-NEXT: # %bb.1: # %entry
2490 ; CHECK-FISL-NEXT: lfd f0, -16(r1) # 8-byte Folded Reload
2491 ; CHECK-FISL-NEXT: stfd f0, -8(r1) # 8-byte Folded Spill
2492 ; CHECK-FISL-NEXT: .LBB67_2: # %entry
2493 ; CHECK-FISL-NEXT: lfd f1, -8(r1) # 8-byte Folded Reload
2494 ; CHECK-FISL-NEXT: blr
2496 ; CHECK-LE-LABEL: test82:
2497 ; CHECK-LE: # %bb.0: # %entry
2498 ; CHECK-LE-NEXT: xscmpudp cr0, f3, f4
2499 ; CHECK-LE-NEXT: beqlr cr0
2500 ; CHECK-LE-NEXT: # %bb.1: # %entry
2501 ; CHECK-LE-NEXT: fmr f1, f2
2502 ; CHECK-LE-NEXT: blr
2504 %m = fcmp oeq double %c, %d
2505 %v = select i1 %m, double %a, double %b