1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -march=hexagon < %s | FileCheck %s
4 define <4 x i8> @f0(<4 x i8> %a0) unnamed_addr #0 {
6 ; CHECK: // %bb.0: // %b0
8 ; CHECK-NEXT: r1:0 = vsxtbh(r0)
11 ; CHECK-NEXT: r1:0 = vasrh(r1:0,#1)
14 ; CHECK-NEXT: r0 = vtrunehb(r1:0)
15 ; CHECK-NEXT: jumpr r31
18 %v0 = ashr <4 x i8> %a0, <i8 1, i8 1, i8 1, i8 1>
22 define <4 x i8> @f1(<4 x i8> %a0) unnamed_addr #0 {
24 ; CHECK: // %bb.0: // %b0
26 ; CHECK-NEXT: r1:0 = vzxtbh(r0)
29 ; CHECK-NEXT: r1:0 = vlsrh(r1:0,#1)
32 ; CHECK-NEXT: r0 = vtrunehb(r1:0)
33 ; CHECK-NEXT: jumpr r31
36 %v0 = lshr <4 x i8> %a0, <i8 1, i8 1, i8 1, i8 1>
40 define <4 x i8> @f2(<4 x i8> %a0) unnamed_addr #0 {
42 ; CHECK: // %bb.0: // %b0
44 ; CHECK-NEXT: r1:0 = vzxtbh(r0)
47 ; CHECK-NEXT: r1:0 = vaslh(r1:0,#1)
50 ; CHECK-NEXT: r0 = vtrunehb(r1:0)
51 ; CHECK-NEXT: jumpr r31
54 %v0 = shl <4 x i8> %a0, <i8 1, i8 1, i8 1, i8 1>
59 define <8 x i8> @f3(<8 x i8> %a0) unnamed_addr #0 {
61 ; CHECK: // %bb.0: // %b0
63 ; CHECK-NEXT: r3:2 = vsxtbh(r1)
64 ; CHECK-NEXT: r5:4 = vsxtbh(r0)
67 ; CHECK-NEXT: r1:0 = vasrh(r5:4,#1)
68 ; CHECK-NEXT: r3:2 = vasrh(r3:2,#1)
71 ; CHECK-NEXT: r0 = vtrunehb(r1:0)
72 ; CHECK-NEXT: r1 = vtrunehb(r3:2)
75 ; CHECK-NEXT: jumpr r31
78 %v0 = ashr <8 x i8> %a0, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
82 define <8 x i8> @f4(<8 x i8> %a0) unnamed_addr #0 {
84 ; CHECK: // %bb.0: // %b0
86 ; CHECK-NEXT: r3:2 = vzxtbh(r1)
87 ; CHECK-NEXT: r5:4 = vzxtbh(r0)
90 ; CHECK-NEXT: r1:0 = vlsrh(r5:4,#1)
91 ; CHECK-NEXT: r3:2 = vlsrh(r3:2,#1)
94 ; CHECK-NEXT: r0 = vtrunehb(r1:0)
95 ; CHECK-NEXT: r1 = vtrunehb(r3:2)
98 ; CHECK-NEXT: jumpr r31
101 %v0 = lshr <8 x i8> %a0, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
105 define <8 x i8> @f5(<8 x i8> %a0) unnamed_addr #0 {
107 ; CHECK: // %bb.0: // %b0
109 ; CHECK-NEXT: r3:2 = vzxtbh(r1)
110 ; CHECK-NEXT: r5:4 = vzxtbh(r0)
113 ; CHECK-NEXT: r1:0 = vaslh(r5:4,#1)
114 ; CHECK-NEXT: r3:2 = vaslh(r3:2,#1)
117 ; CHECK-NEXT: r0 = vtrunehb(r1:0)
118 ; CHECK-NEXT: r1 = vtrunehb(r3:2)
121 ; CHECK-NEXT: jumpr r31
124 %v0 = shl <8 x i8> %a0, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
129 define <2 x i16> @f6(<2 x i16> %a0) unnamed_addr #0 {
131 ; CHECK: // %bb.0: // %b0
133 ; CHECK-NEXT: r1:0 = vasrh(r1:0,#1)
134 ; CHECK-NEXT: jumpr r31
137 %v0 = ashr <2 x i16> %a0, <i16 1, i16 1>
141 define <2 x i16> @f7(<2 x i16> %a0) unnamed_addr #0 {
143 ; CHECK: // %bb.0: // %b0
145 ; CHECK-NEXT: r1:0 = vlsrh(r1:0,#1)
146 ; CHECK-NEXT: jumpr r31
149 %v0 = lshr <2 x i16> %a0, <i16 1, i16 1>
153 define <2 x i16> @f8(<2 x i16> %a0) unnamed_addr #0 {
155 ; CHECK: // %bb.0: // %b0
157 ; CHECK-NEXT: r1:0 = vaslh(r1:0,#1)
158 ; CHECK-NEXT: jumpr r31
161 %v0 = shl <2 x i16> %a0, <i16 1, i16 1>
166 define <4 x i16> @f9(<4 x i16> %a0) unnamed_addr #0 {
168 ; CHECK: // %bb.0: // %b0
170 ; CHECK-NEXT: r1:0 = vasrh(r1:0,#1)
171 ; CHECK-NEXT: jumpr r31
174 %v0 = ashr <4 x i16> %a0, <i16 1, i16 1, i16 1, i16 1>
178 define <4 x i16> @f10(<4 x i16> %a0) unnamed_addr #0 {
180 ; CHECK: // %bb.0: // %b0
182 ; CHECK-NEXT: r1:0 = vlsrh(r1:0,#1)
183 ; CHECK-NEXT: jumpr r31
186 %v0 = lshr <4 x i16> %a0, <i16 1, i16 1, i16 1, i16 1>
190 define <4 x i16> @f11(<4 x i16> %a0) unnamed_addr #0 {
192 ; CHECK: // %bb.0: // %b0
194 ; CHECK-NEXT: r1:0 = vaslh(r1:0,#1)
195 ; CHECK-NEXT: jumpr r31
198 %v0 = shl <4 x i16> %a0, <i16 1, i16 1, i16 1, i16 1>
203 define <2 x i32> @f12(<2 x i32> %a0) unnamed_addr #0 {
205 ; CHECK: // %bb.0: // %b0
207 ; CHECK-NEXT: r1:0 = vasrw(r1:0,#1)
208 ; CHECK-NEXT: jumpr r31
211 %v0 = ashr <2 x i32> %a0, <i32 1, i32 1>
215 define <2 x i32> @f13(<2 x i32> %a0) unnamed_addr #0 {
217 ; CHECK: // %bb.0: // %b0
219 ; CHECK-NEXT: r1:0 = vlsrw(r1:0,#1)
220 ; CHECK-NEXT: jumpr r31
223 %v0 = lshr <2 x i32> %a0, <i32 1, i32 1>
227 define <2 x i32> @f14(<2 x i32> %a0) unnamed_addr #0 {
229 ; CHECK: // %bb.0: // %b0
231 ; CHECK-NEXT: r1:0 = vaslw(r1:0,#1)
232 ; CHECK-NEXT: jumpr r31
235 %v0 = shl <2 x i32> %a0, <i32 1, i32 1>
239 define <4 x i8> @f15(<4 x i8> %a0) unnamed_addr #0 {
241 ; CHECK: // %bb.0: // %b0
243 ; CHECK-NEXT: r1 = extract(r0,#8,#16)
244 ; CHECK-NEXT: r2 = extract(r0,#8,#8)
245 ; CHECK-NEXT: r3 = sxtb(r0)
248 ; CHECK-NEXT: r4 = extract(r0,#8,#24)
249 ; CHECK-NEXT: r2 = asl(r2,#6)
252 ; CHECK-NEXT: r3 = extractu(r3,#8,#1)
253 ; CHECK-NEXT: r0 = asl(r4,#4)
256 ; CHECK-NEXT: r1 = extractu(r1,#8,#3)
257 ; CHECK-NEXT: r2 = or(r3,and(r2,##65280))
260 ; CHECK-NEXT: r0 = or(r1,and(r0,##65280))
263 ; CHECK-NEXT: r0 = combine(r0.l,r2.l)
264 ; CHECK-NEXT: jumpr r31
267 %v0 = ashr <4 x i8> %a0, <i8 1, i8 2, i8 3, i8 4>
271 define <4 x i8> @f16(<4 x i8> %a0) unnamed_addr #0 {
273 ; CHECK: // %bb.0: // %b0
275 ; CHECK-NEXT: r1 = extractu(r0,#8,#8)
276 ; CHECK-NEXT: r2 = extractu(r0,#8,#24)
279 ; CHECK-NEXT: r3 = extractu(r0,#7,#1)
280 ; CHECK-NEXT: r4 = extractu(r0,#5,#19)
281 ; CHECK-NEXT: r1 = and(r1,#252)
282 ; CHECK-NEXT: r2 = and(r2,#240)
285 ; CHECK-NEXT: r3 |= asl(r1,#6)
286 ; CHECK-NEXT: r4 |= asl(r2,#4)
289 ; CHECK-NEXT: r0 = combine(r4.l,r3.l)
290 ; CHECK-NEXT: jumpr r31
293 %v0 = lshr <4 x i8> %a0, <i8 1, i8 2, i8 3, i8 4>
297 define <4 x i8> @f17(<4 x i8> %a0) unnamed_addr #0 {
299 ; CHECK: // %bb.0: // %b0
301 ; CHECK-NEXT: r1 = extractu(r0,#8,#16)
302 ; CHECK-NEXT: r2 = extractu(r0,#8,#8)
305 ; CHECK-NEXT: r3 = extractu(r0,#8,#24)
306 ; CHECK-NEXT: r1 = and(#248,asl(r1,#3))
309 ; CHECK-NEXT: r0 = and(#254,asl(r0,#1))
310 ; CHECK-NEXT: r1 = insert(r3,#4,#12)
313 ; CHECK-NEXT: r0 = insert(r2,#6,#10)
316 ; CHECK-NEXT: r0 = combine(r1.l,r0.l)
317 ; CHECK-NEXT: jumpr r31
320 %v0 = shl <4 x i8> %a0, <i8 1, i8 2, i8 3, i8 4>
324 define <8 x i8> @f18(<8 x i8> %a0) unnamed_addr #0 {
326 ; CHECK: // %bb.0: // %b0
328 ; CHECK-NEXT: r3:2 = extractu(r1:0,#8,#48)
329 ; CHECK-NEXT: r5:4 = extractu(r1:0,#8,#24)
332 ; CHECK-NEXT: r7:6 = extractu(r1:0,#8,#16)
333 ; CHECK-NEXT: r5 = extract(r0,#8,#8)
334 ; CHECK-NEXT: r3 = sxtb(r0)
335 ; CHECK-NEXT: r2 = sxtb(r2)
338 ; CHECK-NEXT: r7 = extract(r1,#8,#8)
339 ; CHECK-NEXT: r9:8 = extractu(r1:0,#8,#32)
342 ; CHECK-NEXT: r1:0 = extractu(r1:0,#8,#56)
343 ; CHECK-NEXT: r3 = extractu(r3,#8,#1)
346 ; CHECK-NEXT: r5 = asl(r5,#6)
347 ; CHECK-NEXT: r6 = sxtb(r8)
348 ; CHECK-NEXT: r1 = sxtb(r4)
349 ; CHECK-NEXT: r4 = sxtb(r6)
352 ; CHECK-NEXT: r5 = or(r3,and(r5,##65280))
353 ; CHECK-NEXT: r3 = asl(r7,#5)
354 ; CHECK-NEXT: r0 = sxtb(r0)
357 ; CHECK-NEXT: r6 = extractu(r6,#8,#2)
358 ; CHECK-NEXT: r1 = asl(r1,#4)
361 ; CHECK-NEXT: r4 = extractu(r4,#8,#3)
362 ; CHECK-NEXT: r7 = asl(r0,#7)
365 ; CHECK-NEXT: r2 = extractu(r2,#8,#4)
366 ; CHECK-NEXT: r1 = or(r4,and(r1,##65280))
369 ; CHECK-NEXT: r3 = or(r6,and(r3,##65280))
370 ; CHECK-NEXT: r7 = or(r2,and(r7,##65280))
373 ; CHECK-NEXT: r0 = combine(r1.l,r5.l)
374 ; CHECK-NEXT: jumpr r31
375 ; CHECK-NEXT: r1 = combine(r7.l,r3.l)
378 %v0 = ashr <8 x i8> %a0, <i8 1, i8 2, i8 3, i8 4, i8 2, i8 3, i8 4, i8 1>
382 define <8 x i8> @f19(<8 x i8> %a0) unnamed_addr #0 {
384 ; CHECK: // %bb.0: // %b0
386 ; CHECK-NEXT: r3:2 = extractu(r1:0,#8,#8)
387 ; CHECK-NEXT: r5:4 = extractu(r1:0,#8,#24)
390 ; CHECK-NEXT: r3 = extractu(r1,#4,#20)
391 ; CHECK-NEXT: r5 = extractu(r0,#7,#1)
392 ; CHECK-NEXT: r2 = and(r2,#252)
393 ; CHECK-NEXT: r4 = and(r4,#240)
396 ; CHECK-NEXT: r6 = extractu(r0,#5,#19)
397 ; CHECK-NEXT: r9:8 = extractu(r1:0,#8,#40)
400 ; CHECK-NEXT: r7 = extractu(r1,#6,#2)
401 ; CHECK-NEXT: r1:0 = extractu(r1:0,#8,#56)
404 ; CHECK-NEXT: r5 |= asl(r2,#6)
405 ; CHECK-NEXT: r6 |= asl(r4,#4)
406 ; CHECK-NEXT: r1 = and(r8,#248)
407 ; CHECK-NEXT: r11 = and(r0,#254)
410 ; CHECK-NEXT: r7 |= asl(r1,#5)
411 ; CHECK-NEXT: r3 |= asl(r11,#7)
412 ; CHECK-NEXT: r0 = combine(r6.l,r5.l)
415 ; CHECK-NEXT: r1 = combine(r3.l,r7.l)
416 ; CHECK-NEXT: jumpr r31
419 %v0 = lshr <8 x i8> %a0, <i8 1, i8 2, i8 3, i8 4, i8 2, i8 3, i8 4, i8 1>
423 define <8 x i8> @f20(<8 x i8> %a0) unnamed_addr #0 {
425 ; CHECK: // %bb.0: // %b0
427 ; CHECK-NEXT: r5:4 = extractu(r1:0,#8,#16)
428 ; CHECK-NEXT: r3:2 = extractu(r1:0,#8,#48)
431 ; CHECK-NEXT: r4 = and(#248,asl(r4,#3))
432 ; CHECK-NEXT: r15:14 = extractu(r1:0,#8,#32)
433 ; CHECK-NEXT: r5 = r0
436 ; CHECK-NEXT: r13:12 = extractu(r1:0,#8,#24)
437 ; CHECK-NEXT: r7:6 = extractu(r1:0,#8,#56)
438 ; CHECK-NEXT: r3 = r4
441 ; CHECK-NEXT: r2 = and(#240,asl(r2,#4))
442 ; CHECK-NEXT: r9:8 = extractu(r1:0,#8,#8)
445 ; CHECK-NEXT: r5 = and(#254,asl(r5,#1))
446 ; CHECK-NEXT: r4 = insert(r14,#6,#2)
449 ; CHECK-NEXT: r1:0 = extractu(r1:0,#8,#40)
450 ; CHECK-NEXT: r3 = insert(r12,#4,#12)
453 ; CHECK-NEXT: r5 = insert(r8,#6,#10)
454 ; CHECK-NEXT: r4 = insert(r0,#5,#11)
457 ; CHECK-NEXT: r2 = insert(r6,#7,#9)
458 ; CHECK-NEXT: r0 = combine(r3.l,r5.l)
461 ; CHECK-NEXT: r1 = combine(r2.l,r4.l)
462 ; CHECK-NEXT: jumpr r31
465 %v0 = shl <8 x i8> %a0, <i8 1, i8 2, i8 3, i8 4, i8 2, i8 3, i8 4, i8 1>
469 define <2 x i16> @f21(<2 x i16> %a0) unnamed_addr #0 {
471 ; CHECK: // %bb.0: // %b0
473 ; CHECK-NEXT: r1 = extract(r0,#16,#16)
474 ; CHECK-NEXT: r2 = extract(r0,#15,#1)
477 ; CHECK-NEXT: r1 = asr(r1,#2)
480 ; CHECK-NEXT: r0 = combine(r1.l,r2.l)
481 ; CHECK-NEXT: jumpr r31
484 %v0 = ashr <2 x i16> %a0, <i16 1, i16 2>
488 define <2 x i16> @f22(<2 x i16> %a0) unnamed_addr #0 {
490 ; CHECK: // %bb.0: // %b0
492 ; CHECK-NEXT: r1 = extractu(r0,#16,#16)
493 ; CHECK-NEXT: r2 = extractu(r0,#15,#1)
496 ; CHECK-NEXT: r1 = extractu(r1,#14,#2)
499 ; CHECK-NEXT: r0 = combine(r1.l,r2.l)
500 ; CHECK-NEXT: jumpr r31
503 %v0 = lshr <2 x i16> %a0, <i16 1, i16 2>
507 define <2 x i16> @f23(<2 x i16> %a0) unnamed_addr #0 {
509 ; CHECK: // %bb.0: // %b0
511 ; CHECK-NEXT: r1:0 = bitsplit(r0,#16)
514 ; CHECK-NEXT: r0 = asl(r0,#1)
515 ; CHECK-NEXT: r1 = asl(r1,#2)
518 ; CHECK-NEXT: r0 = combine(r1.l,r0.l)
519 ; CHECK-NEXT: jumpr r31
522 %v0 = shl <2 x i16> %a0, <i16 1, i16 2>
526 define <4 x i16> @f24(<4 x i16> %a0) unnamed_addr #0 {
528 ; CHECK: // %bb.0: // %b0
530 ; CHECK-NEXT: r3:2 = extractu(r1:0,#16,#16)
531 ; CHECK-NEXT: r5:4 = extractu(r1:0,#16,#48)
534 ; CHECK-NEXT: r3 = extract(r0,#15,#1)
535 ; CHECK-NEXT: r1 = extract(r1,#13,#3)
536 ; CHECK-NEXT: r2 = sxth(r2)
539 ; CHECK-NEXT: r4 = extract(r4,#12,#4)
540 ; CHECK-NEXT: r0 = asr(r2,#2)
543 ; CHECK-NEXT: r0 = combine(r0.l,r3.l)
544 ; CHECK-NEXT: jumpr r31
545 ; CHECK-NEXT: r1 = combine(r4.l,r1.l)
548 %v0 = ashr <4 x i16> %a0, <i16 1, i16 2, i16 3, i16 4>
552 define <4 x i16> @f25(<4 x i16> %a0) unnamed_addr #0 {
554 ; CHECK: // %bb.0: // %b0
556 ; CHECK-NEXT: r3:2 = extractu(r1:0,#16,#48)
557 ; CHECK-NEXT: r5:4 = extractu(r1:0,#16,#16)
560 ; CHECK-NEXT: r3 = extractu(r0,#15,#1)
561 ; CHECK-NEXT: r0 = extractu(r4,#14,#2)
564 ; CHECK-NEXT: r1 = extractu(r1,#13,#3)
565 ; CHECK-NEXT: r2 = extractu(r2,#12,#4)
566 ; CHECK-NEXT: r0 = combine(r0.l,r3.l)
569 ; CHECK-NEXT: r1 = combine(r2.l,r1.l)
570 ; CHECK-NEXT: jumpr r31
573 %v0 = lshr <4 x i16> %a0, <i16 1, i16 2, i16 3, i16 4>
577 define <4 x i16> @f26(<4 x i16> %a0) unnamed_addr #0 {
579 ; CHECK: // %bb.0: // %b0
581 ; CHECK-NEXT: r3:2 = extractu(r1:0,#16,#48)
582 ; CHECK-NEXT: r5:4 = extractu(r1:0,#16,#16)
585 ; CHECK-NEXT: r1:0 = extractu(r1:0,#16,#32)
586 ; CHECK-NEXT: r4 = asl(r4,#2)
587 ; CHECK-NEXT: r3 = zxth(r0)
590 ; CHECK-NEXT: r1 = asl(r3,#1)
591 ; CHECK-NEXT: r5 = asl(r0,#3)
594 ; CHECK-NEXT: r2 = asl(r2,#4)
595 ; CHECK-NEXT: r0 = combine(r4.l,r1.l)
598 ; CHECK-NEXT: r1 = combine(r2.l,r5.l)
599 ; CHECK-NEXT: jumpr r31
602 %v0 = shl <4 x i16> %a0, <i16 1, i16 2, i16 3, i16 4>
606 define <2 x i32> @f27(<2 x i32> %a0) unnamed_addr #0 {
608 ; CHECK: // %bb.0: // %b0
610 ; CHECK-NEXT: r0 = asr(r0,#1)
611 ; CHECK-NEXT: r1 = asr(r1,#2)
614 ; CHECK-NEXT: jumpr r31
617 %v0 = ashr <2 x i32> %a0, <i32 1, i32 2>
621 define <2 x i32> @f28(<2 x i32> %a0) unnamed_addr #0 {
623 ; CHECK: // %bb.0: // %b0
625 ; CHECK-NEXT: r0 = lsr(r0,#1)
626 ; CHECK-NEXT: r1 = lsr(r1,#2)
629 ; CHECK-NEXT: jumpr r31
632 %v0 = lshr <2 x i32> %a0, <i32 1, i32 2>
636 define <2 x i32> @f29(<2 x i32> %a0) unnamed_addr #0 {
638 ; CHECK: // %bb.0: // %b0
640 ; CHECK-NEXT: r0 = asl(r0,#1)
641 ; CHECK-NEXT: r1 = asl(r1,#2)
644 ; CHECK-NEXT: jumpr r31
647 %v0 = shl <2 x i32> %a0, <i32 1, i32 2>
651 attributes #0 = { nounwind }