1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -verify-machineinstrs -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
4 define <4 x i16> @shuffle1(<4 x i16> %v) {
5 ; CHECK-LABEL: shuffle1:
6 ; CHECK: // %bb.0: // %entry
7 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
8 ; CHECK-NEXT: dup v0.2s, v0.s[0]
11 %res = shufflevector <4 x i16> %v, <4 x i16> undef, <4 x i32> <i32 0, i32 undef, i32 0, i32 1>
15 define <4 x i16> @shuffle2(<4 x i16> %v) {
16 ; CHECK-LABEL: shuffle2:
17 ; CHECK: // %bb.0: // %entry
18 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
19 ; CHECK-NEXT: dup v0.2s, v0.s[1]
22 %res = shufflevector <4 x i16> %v, <4 x i16> undef, <4 x i32> <i32 2, i32 3, i32 undef, i32 3>
26 define <8 x i16> @shuffle3(<8 x i16> %v) {
27 ; CHECK-LABEL: shuffle3:
28 ; CHECK: // %bb.0: // %entry
29 ; CHECK-NEXT: dup v0.2d, v0.d[0]
32 %res = shufflevector <8 x i16> %v, <8 x i16> undef, <8 x i32> <i32 undef, i32 undef, i32 2, i32 3,
33 i32 undef, i32 1, i32 undef, i32 3>
37 define <4 x i32> @shuffle4(<4 x i32> %v) {
38 ; CHECK-LABEL: shuffle4:
39 ; CHECK: // %bb.0: // %entry
40 ; CHECK-NEXT: dup v0.2d, v0.d[0]
43 %res = shufflevector <4 x i32> %v, <4 x i32> undef, <4 x i32> <i32 0, i32 1, i32 0, i32 1>
47 define <16 x i8> @shuffle5(<16 x i8> %v) {
48 ; CHECK-LABEL: shuffle5:
49 ; CHECK: // %bb.0: // %entry
50 ; CHECK-NEXT: dup v0.4s, v0.s[2]
53 %res = shufflevector <16 x i8> %v, <16 x i8> undef, <16 x i32> <i32 8, i32 9, i32 10, i32 11,
54 i32 8, i32 9, i32 10, i32 11,
55 i32 8, i32 9, i32 10, i32 11,
56 i32 8, i32 9, i32 10, i32 11>
60 define <16 x i8> @shuffle6(<16 x i8> %v) {
61 ; CHECK-LABEL: shuffle6:
62 ; CHECK: // %bb.0: // %entry
63 ; CHECK-NEXT: dup v0.2d, v0.d[1]
66 %res = shufflevector <16 x i8> %v, <16 x i8> undef, <16 x i32> <i32 8, i32 9, i32 10, i32 11,
67 i32 12, i32 13, i32 14, i32 15,
68 i32 8, i32 9, i32 10, i32 11,
69 i32 12, i32 13, i32 14, i32 15>
73 define <8 x i8> @shuffle7(<8 x i8> %v) {
74 ; CHECK-LABEL: shuffle7:
75 ; CHECK: // %bb.0: // %entry
76 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
77 ; CHECK-NEXT: dup v0.2s, v0.s[1]
80 %res = shufflevector <8 x i8> %v, <8 x i8> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 undef,
81 i32 undef, i32 5, i32 6, i32 undef>
85 define <8 x i8> @shuffle8(<8 x i8> %v) {
86 ; CHECK-LABEL: shuffle8:
87 ; CHECK: // %bb.0: // %entry
88 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
89 ; CHECK-NEXT: dup v0.4h, v0.h[3]
92 %res = shufflevector <8 x i8> %v, <8 x i8> undef, <8 x i32> <i32 6, i32 7, i32 6, i32 undef,
93 i32 undef, i32 7, i32 6, i32 undef>
98 define <8 x i8> @shuffle_not1(<16 x i8> %v) {
99 ; CHECK-LABEL: shuffle_not1:
101 ; CHECK-NEXT: ext v0.16b, v0.16b, v0.16b, #2
102 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $q0
104 %res = shufflevector <16 x i8> %v, <16 x i8> undef, <8 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9>
108 ; Block is not a proper lane
109 define <4 x i32> @shuffle_not2(<4 x i32> %v) {
110 ; CHECK-LABEL: shuffle_not2:
111 ; CHECK: // %bb.0: // %entry
112 ; CHECK-NEXT: mov v0.s[3], v0.s[2]
113 ; CHECK-NEXT: uzp2 v0.4s, v0.4s, v0.4s
116 %res = shufflevector <4 x i32> %v, <4 x i32> undef, <4 x i32> <i32 1, i32 2, i32 1, i32 2>
120 ; Block size is equal to vector size
121 define <4 x i16> @shuffle_not3(<4 x i16> %v) {
122 ; CHECK-LABEL: shuffle_not3:
123 ; CHECK: // %bb.0: // %entry
126 %res = shufflevector <4 x i16> %v, <4 x i16> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
131 define <8 x i8> @shuffle_not4(<8 x i8> %v) {
132 ; CHECK-LABEL: shuffle_not4:
133 ; CHECK: // %bb.0: // %entry
134 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $q0
135 ; CHECK-NEXT: adrp x8, .LCPI11_0
136 ; CHECK-NEXT: mov v0.d[1], v0.d[0]
137 ; CHECK-NEXT: ldr d1, [x8, :lo12:.LCPI11_0]
138 ; CHECK-NEXT: tbl v0.8b, { v0.16b }, v1.8b
141 %res = shufflevector <8 x i8> %v, <8 x i8> undef, <8 x i32> <i32 4, i32 5, i32 6, i32 undef,
142 i32 undef, i32 5, i32 5, i32 undef>