1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mattr=+sve -force-streaming-compatible < %s | FileCheck %s
3 ; RUN: llc -mattr=+sme -force-streaming < %s | FileCheck %s
4 ; RUN: llc -force-streaming-compatible < %s | FileCheck %s --check-prefix=NONEON-NOSVE
7 target triple = "aarch64-unknown-linux-gnu"
9 define <4 x i8> @shuffle_ext_byone_v4i8(<4 x i8> %op1, <4 x i8> %op2) {
10 ; CHECK-LABEL: shuffle_ext_byone_v4i8:
12 ; CHECK-NEXT: adrp x8, .LCPI0_0
13 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
14 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI0_0]
15 ; CHECK-NEXT: tbl z0.h, { z0.h }, z1.h
16 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
19 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v4i8:
20 ; NONEON-NOSVE: // %bb.0:
21 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
22 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
23 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #6]
24 ; NONEON-NOSVE-NEXT: strh w8, [sp, #10]
25 ; NONEON-NOSVE-NEXT: ldrh w8, [sp]
26 ; NONEON-NOSVE-NEXT: strh w8, [sp, #8]
27 ; NONEON-NOSVE-NEXT: ldur w8, [sp, #2]
28 ; NONEON-NOSVE-NEXT: ror w8, w8, #16
29 ; NONEON-NOSVE-NEXT: str w8, [sp, #12]
30 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
31 ; NONEON-NOSVE-NEXT: add sp, sp, #16
32 ; NONEON-NOSVE-NEXT: ret
33 %ret = shufflevector <4 x i8> %op1, <4 x i8> %op2, <4 x i32> <i32 0, i32 3, i32 2, i32 1>
37 define <8 x i8> @shuffle_ext_byone_v8i8(<8 x i8> %op1, <8 x i8> %op2) {
38 ; CHECK-LABEL: shuffle_ext_byone_v8i8:
40 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
41 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
42 ; CHECK-NEXT: mov z0.b, z0.b[7]
43 ; CHECK-NEXT: fmov w8, s0
44 ; CHECK-NEXT: insr z1.b, w8
45 ; CHECK-NEXT: fmov d0, d1
48 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v8i8:
49 ; NONEON-NOSVE: // %bb.0:
50 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
51 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
52 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
53 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #22]
54 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
55 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #20]
56 ; NONEON-NOSVE-NEXT: sturh w8, [sp, #29]
57 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #16]
58 ; NONEON-NOSVE-NEXT: stur w8, [sp, #25]
59 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
60 ; NONEON-NOSVE-NEXT: strb w8, [sp, #24]
61 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
62 ; NONEON-NOSVE-NEXT: add sp, sp, #32
63 ; NONEON-NOSVE-NEXT: ret
64 %ret = shufflevector <8 x i8> %op1, <8 x i8> %op2, <8 x i32> <i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14>
68 define <16 x i8> @shuffle_ext_byone_v16i8(<16 x i8> %op1, <16 x i8> %op2) {
69 ; CHECK-LABEL: shuffle_ext_byone_v16i8:
71 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
72 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
73 ; CHECK-NEXT: mov z0.b, z0.b[15]
74 ; CHECK-NEXT: fmov w8, s0
75 ; CHECK-NEXT: insr z1.b, w8
76 ; CHECK-NEXT: mov z0.d, z1.d
79 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v16i8:
80 ; NONEON-NOSVE: // %bb.0:
81 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
82 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
83 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #30]
84 ; NONEON-NOSVE-NEXT: strb w8, [sp, #47]
85 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #28]
86 ; NONEON-NOSVE-NEXT: sturh w8, [sp, #45]
87 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #24]
88 ; NONEON-NOSVE-NEXT: stur w8, [sp, #41]
89 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #16]
90 ; NONEON-NOSVE-NEXT: stur x8, [sp, #33]
91 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #15]
92 ; NONEON-NOSVE-NEXT: strb w8, [sp, #32]
93 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
94 ; NONEON-NOSVE-NEXT: add sp, sp, #48
95 ; NONEON-NOSVE-NEXT: ret
96 %ret = shufflevector <16 x i8> %op1, <16 x i8> %op2, <16 x i32> <i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22,
97 i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30>
101 define void @shuffle_ext_byone_v32i8(ptr %a, ptr %b) {
102 ; CHECK-LABEL: shuffle_ext_byone_v32i8:
104 ; CHECK-NEXT: ldr q0, [x0, #16]
105 ; CHECK-NEXT: ldp q1, q3, [x1]
106 ; CHECK-NEXT: mov z0.b, z0.b[15]
107 ; CHECK-NEXT: mov z2.b, z1.b[15]
108 ; CHECK-NEXT: fmov w8, s0
109 ; CHECK-NEXT: insr z1.b, w8
110 ; CHECK-NEXT: fmov w8, s2
111 ; CHECK-NEXT: insr z3.b, w8
112 ; CHECK-NEXT: stp q1, q3, [x0]
115 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v32i8:
116 ; NONEON-NOSVE: // %bb.0:
117 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x1]
118 ; NONEON-NOSVE-NEXT: ldr q2, [x0, #16]
119 ; NONEON-NOSVE-NEXT: str q0, [sp, #-80]!
120 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 80
121 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
122 ; NONEON-NOSVE-NEXT: stp q2, q1, [sp, #32]
123 ; NONEON-NOSVE-NEXT: strb w8, [sp, #31]
124 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #12]
125 ; NONEON-NOSVE-NEXT: sturh w8, [sp, #29]
126 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #8]
127 ; NONEON-NOSVE-NEXT: stur w8, [sp, #25]
128 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
129 ; NONEON-NOSVE-NEXT: stur x8, [sp, #17]
130 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #63]
131 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
132 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #62]
133 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
134 ; NONEON-NOSVE-NEXT: strb w8, [sp, #79]
135 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #60]
136 ; NONEON-NOSVE-NEXT: sturh w8, [sp, #77]
137 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #56]
138 ; NONEON-NOSVE-NEXT: stur w8, [sp, #73]
139 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #48]
140 ; NONEON-NOSVE-NEXT: stur x8, [sp, #65]
141 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #47]
142 ; NONEON-NOSVE-NEXT: strb w8, [sp, #64]
143 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #64]
144 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
145 ; NONEON-NOSVE-NEXT: add sp, sp, #80
146 ; NONEON-NOSVE-NEXT: ret
147 %op1 = load <32 x i8>, ptr %a
148 %op2 = load <32 x i8>, ptr %b
149 %ret = shufflevector <32 x i8> %op1, <32 x i8> %op2, <32 x i32> <i32 31, i32 32, i32 33, i32 34, i32 35, i32 36, i32 37, i32 38,
150 i32 39, i32 40, i32 41, i32 42, i32 43, i32 44, i32 45, i32 46,
151 i32 47, i32 48, i32 49, i32 50, i32 51, i32 52, i32 53, i32 54,
152 i32 55, i32 56, i32 57, i32 58, i32 59, i32 60, i32 61, i32 62>
153 store <32 x i8> %ret, ptr %a
157 define <2 x i16> @shuffle_ext_byone_v2i16(<2 x i16> %op1, <2 x i16> %op2) {
158 ; CHECK-LABEL: shuffle_ext_byone_v2i16:
160 ; CHECK-NEXT: ptrue p0.d
161 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
162 ; CHECK-NEXT: revw z0.d, p0/m, z0.d
163 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
166 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v2i16:
167 ; NONEON-NOSVE: // %bb.0:
168 ; NONEON-NOSVE-NEXT: str d0, [sp, #-16]!
169 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
170 ; NONEON-NOSVE-NEXT: ldp w9, w8, [sp]
171 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #8]
172 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
173 ; NONEON-NOSVE-NEXT: add sp, sp, #16
174 ; NONEON-NOSVE-NEXT: ret
175 %ret = shufflevector <2 x i16> %op1, <2 x i16> %op2, <2 x i32> <i32 1, i32 0>
179 define <4 x i16> @shuffle_ext_byone_v4i16(<4 x i16> %op1, <4 x i16> %op2) {
180 ; CHECK-LABEL: shuffle_ext_byone_v4i16:
182 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
183 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
184 ; CHECK-NEXT: mov z0.h, z0.h[3]
185 ; CHECK-NEXT: fmov w8, s0
186 ; CHECK-NEXT: insr z1.h, w8
187 ; CHECK-NEXT: fmov d0, d1
190 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v4i16:
191 ; NONEON-NOSVE: // %bb.0:
192 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
193 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
194 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
195 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #20]
196 ; NONEON-NOSVE-NEXT: strh w8, [sp, #30]
197 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #16]
198 ; NONEON-NOSVE-NEXT: stur w8, [sp, #26]
199 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #14]
200 ; NONEON-NOSVE-NEXT: strh w8, [sp, #24]
201 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
202 ; NONEON-NOSVE-NEXT: add sp, sp, #32
203 ; NONEON-NOSVE-NEXT: ret
204 %ret = shufflevector <4 x i16> %op1, <4 x i16> %op2, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
208 define <8 x i16> @shuffle_ext_byone_v8i16(<8 x i16> %op1, <8 x i16> %op2) {
209 ; CHECK-LABEL: shuffle_ext_byone_v8i16:
211 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
212 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
213 ; CHECK-NEXT: mov z0.h, z0.h[7]
214 ; CHECK-NEXT: fmov w8, s0
215 ; CHECK-NEXT: insr z1.h, w8
216 ; CHECK-NEXT: mov z0.d, z1.d
219 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v8i16:
220 ; NONEON-NOSVE: // %bb.0:
221 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
222 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
223 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #28]
224 ; NONEON-NOSVE-NEXT: strh w8, [sp, #46]
225 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #24]
226 ; NONEON-NOSVE-NEXT: stur w8, [sp, #42]
227 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #16]
228 ; NONEON-NOSVE-NEXT: stur x8, [sp, #34]
229 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #14]
230 ; NONEON-NOSVE-NEXT: strh w8, [sp, #32]
231 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
232 ; NONEON-NOSVE-NEXT: add sp, sp, #48
233 ; NONEON-NOSVE-NEXT: ret
234 %ret = shufflevector <8 x i16> %op1, <8 x i16> %op2, <8 x i32> <i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14>
238 define void @shuffle_ext_byone_v16i16(ptr %a, ptr %b) {
239 ; CHECK-LABEL: shuffle_ext_byone_v16i16:
241 ; CHECK-NEXT: ldr q0, [x0, #16]
242 ; CHECK-NEXT: ldp q1, q3, [x1]
243 ; CHECK-NEXT: mov z0.h, z0.h[7]
244 ; CHECK-NEXT: mov z2.h, z1.h[7]
245 ; CHECK-NEXT: fmov w8, s0
246 ; CHECK-NEXT: insr z1.h, w8
247 ; CHECK-NEXT: fmov w8, s2
248 ; CHECK-NEXT: insr z3.h, w8
249 ; CHECK-NEXT: stp q1, q3, [x0]
252 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v16i16:
253 ; NONEON-NOSVE: // %bb.0:
254 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x1]
255 ; NONEON-NOSVE-NEXT: ldr q2, [x0, #16]
256 ; NONEON-NOSVE-NEXT: str q0, [sp, #-80]!
257 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 80
258 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #12]
259 ; NONEON-NOSVE-NEXT: stp q2, q1, [sp, #32]
260 ; NONEON-NOSVE-NEXT: strh w8, [sp, #30]
261 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #8]
262 ; NONEON-NOSVE-NEXT: stur w8, [sp, #26]
263 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
264 ; NONEON-NOSVE-NEXT: stur x8, [sp, #18]
265 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #62]
266 ; NONEON-NOSVE-NEXT: strh w8, [sp, #16]
267 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #60]
268 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
269 ; NONEON-NOSVE-NEXT: strh w8, [sp, #78]
270 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #56]
271 ; NONEON-NOSVE-NEXT: stur w8, [sp, #74]
272 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #48]
273 ; NONEON-NOSVE-NEXT: stur x8, [sp, #66]
274 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #46]
275 ; NONEON-NOSVE-NEXT: strh w8, [sp, #64]
276 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #64]
277 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
278 ; NONEON-NOSVE-NEXT: add sp, sp, #80
279 ; NONEON-NOSVE-NEXT: ret
280 %op1 = load <16 x i16>, ptr %a
281 %op2 = load <16 x i16>, ptr %b
282 %ret = shufflevector <16 x i16> %op1, <16 x i16> %op2, <16 x i32> <i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22,
283 i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30>
284 store <16 x i16> %ret, ptr %a
288 define <2 x i32> @shuffle_ext_byone_v2i32(<2 x i32> %op1, <2 x i32> %op2) {
289 ; CHECK-LABEL: shuffle_ext_byone_v2i32:
291 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
292 ; CHECK-NEXT: // kill: def $d1 killed $d1 def $z1
293 ; CHECK-NEXT: mov z0.s, z0.s[1]
294 ; CHECK-NEXT: fmov w8, s0
295 ; CHECK-NEXT: insr z1.s, w8
296 ; CHECK-NEXT: fmov d0, d1
299 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v2i32:
300 ; NONEON-NOSVE: // %bb.0:
301 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
302 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
303 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
304 ; NONEON-NOSVE-NEXT: ldp w8, w9, [sp, #12]
305 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #24]
306 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
307 ; NONEON-NOSVE-NEXT: add sp, sp, #32
308 ; NONEON-NOSVE-NEXT: ret
309 %ret = shufflevector <2 x i32> %op1, <2 x i32> %op2, <2 x i32> <i32 1, i32 2>
313 define <4 x i32> @shuffle_ext_byone_v4i32(<4 x i32> %op1, <4 x i32> %op2) {
314 ; CHECK-LABEL: shuffle_ext_byone_v4i32:
316 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
317 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
318 ; CHECK-NEXT: mov z0.s, z0.s[3]
319 ; CHECK-NEXT: fmov w8, s0
320 ; CHECK-NEXT: insr z1.s, w8
321 ; CHECK-NEXT: mov z0.d, z1.d
324 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v4i32:
325 ; NONEON-NOSVE: // %bb.0:
326 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
327 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
328 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #24]
329 ; NONEON-NOSVE-NEXT: str w8, [sp, #44]
330 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #16]
331 ; NONEON-NOSVE-NEXT: stur x8, [sp, #36]
332 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #12]
333 ; NONEON-NOSVE-NEXT: str w8, [sp, #32]
334 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
335 ; NONEON-NOSVE-NEXT: add sp, sp, #48
336 ; NONEON-NOSVE-NEXT: ret
337 %ret = shufflevector <4 x i32> %op1, <4 x i32> %op2, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
341 define void @shuffle_ext_byone_v8i32(ptr %a, ptr %b) {
342 ; CHECK-LABEL: shuffle_ext_byone_v8i32:
344 ; CHECK-NEXT: ldr q0, [x0, #16]
345 ; CHECK-NEXT: ldp q1, q3, [x1]
346 ; CHECK-NEXT: mov z0.s, z0.s[3]
347 ; CHECK-NEXT: mov z2.s, z1.s[3]
348 ; CHECK-NEXT: fmov w8, s0
349 ; CHECK-NEXT: insr z1.s, w8
350 ; CHECK-NEXT: fmov w8, s2
351 ; CHECK-NEXT: insr z3.s, w8
352 ; CHECK-NEXT: stp q1, q3, [x0]
355 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v8i32:
356 ; NONEON-NOSVE: // %bb.0:
357 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x1]
358 ; NONEON-NOSVE-NEXT: ldr q2, [x0, #16]
359 ; NONEON-NOSVE-NEXT: str q0, [sp, #-80]!
360 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 80
361 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #8]
362 ; NONEON-NOSVE-NEXT: stp q2, q1, [sp, #32]
363 ; NONEON-NOSVE-NEXT: str w8, [sp, #28]
364 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
365 ; NONEON-NOSVE-NEXT: stur x8, [sp, #20]
366 ; NONEON-NOSVE-NEXT: ldp w8, w9, [sp, #56]
367 ; NONEON-NOSVE-NEXT: str w8, [sp, #76]
368 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #48]
369 ; NONEON-NOSVE-NEXT: str w9, [sp, #16]
370 ; NONEON-NOSVE-NEXT: stur x8, [sp, #68]
371 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #44]
372 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
373 ; NONEON-NOSVE-NEXT: str w8, [sp, #64]
374 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #64]
375 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
376 ; NONEON-NOSVE-NEXT: add sp, sp, #80
377 ; NONEON-NOSVE-NEXT: ret
378 %op1 = load <8 x i32>, ptr %a
379 %op2 = load <8 x i32>, ptr %b
380 %ret = shufflevector <8 x i32> %op1, <8 x i32> %op2, <8 x i32> <i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14>
381 store <8 x i32> %ret, ptr %a
385 define <2 x i64> @shuffle_ext_byone_v2i64(<2 x i64> %op1, <2 x i64> %op2) {
386 ; CHECK-LABEL: shuffle_ext_byone_v2i64:
388 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
389 ; CHECK-NEXT: // kill: def $q1 killed $q1 def $z1
390 ; CHECK-NEXT: mov z0.d, z0.d[1]
391 ; CHECK-NEXT: fmov x8, d0
392 ; CHECK-NEXT: insr z1.d, x8
393 ; CHECK-NEXT: mov z0.d, z1.d
396 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v2i64:
397 ; NONEON-NOSVE: // %bb.0:
398 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
399 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
400 ; NONEON-NOSVE-NEXT: ldp x8, x9, [sp, #8]
401 ; NONEON-NOSVE-NEXT: stp x8, x9, [sp, #32]
402 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
403 ; NONEON-NOSVE-NEXT: add sp, sp, #48
404 ; NONEON-NOSVE-NEXT: ret
405 %ret = shufflevector <2 x i64> %op1, <2 x i64> %op2, <2 x i32> <i32 1, i32 2>
409 define void @shuffle_ext_byone_v4i64(ptr %a, ptr %b) {
410 ; CHECK-LABEL: shuffle_ext_byone_v4i64:
412 ; CHECK-NEXT: ldr q0, [x0, #16]
413 ; CHECK-NEXT: ldp q1, q3, [x1]
414 ; CHECK-NEXT: mov z0.d, z0.d[1]
415 ; CHECK-NEXT: mov z2.d, z1.d[1]
416 ; CHECK-NEXT: fmov x8, d0
417 ; CHECK-NEXT: insr z1.d, x8
418 ; CHECK-NEXT: fmov x8, d2
419 ; CHECK-NEXT: insr z3.d, x8
420 ; CHECK-NEXT: stp q1, q3, [x0]
423 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v4i64:
424 ; NONEON-NOSVE: // %bb.0:
425 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x1]
426 ; NONEON-NOSVE-NEXT: ldr q2, [x0, #16]
427 ; NONEON-NOSVE-NEXT: str q0, [sp, #-80]!
428 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 80
429 ; NONEON-NOSVE-NEXT: stp q2, q1, [sp, #32]
430 ; NONEON-NOSVE-NEXT: ldr x9, [sp]
431 ; NONEON-NOSVE-NEXT: ldp x11, x10, [sp, #48]
432 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #40]
433 ; NONEON-NOSVE-NEXT: stp x10, x9, [sp, #16]
434 ; NONEON-NOSVE-NEXT: stp x8, x11, [sp, #64]
435 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
436 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #64]
437 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
438 ; NONEON-NOSVE-NEXT: add sp, sp, #80
439 ; NONEON-NOSVE-NEXT: ret
440 %op1 = load <4 x i64>, ptr %a
441 %op2 = load <4 x i64>, ptr %b
442 %ret = shufflevector <4 x i64> %op1, <4 x i64> %op2, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
443 store <4 x i64> %ret, ptr %a
448 define <4 x half> @shuffle_ext_byone_v4f16(<4 x half> %op1, <4 x half> %op2) {
449 ; CHECK-LABEL: shuffle_ext_byone_v4f16:
451 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
452 ; CHECK-NEXT: mov z2.h, z0.h[3]
453 ; CHECK-NEXT: fmov d0, d1
454 ; CHECK-NEXT: insr z0.h, h2
455 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
458 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v4f16:
459 ; NONEON-NOSVE: // %bb.0:
460 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
461 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
462 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
463 ; NONEON-NOSVE-NEXT: ldr h0, [sp, #20]
464 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #16]
465 ; NONEON-NOSVE-NEXT: str h0, [sp, #30]
466 ; NONEON-NOSVE-NEXT: ldr h0, [sp, #14]
467 ; NONEON-NOSVE-NEXT: stur w8, [sp, #26]
468 ; NONEON-NOSVE-NEXT: str h0, [sp, #24]
469 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
470 ; NONEON-NOSVE-NEXT: add sp, sp, #32
471 ; NONEON-NOSVE-NEXT: ret
472 %ret = shufflevector <4 x half> %op1, <4 x half> %op2, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
476 define <8 x half> @shuffle_ext_byone_v8f16(<8 x half> %op1, <8 x half> %op2) {
477 ; CHECK-LABEL: shuffle_ext_byone_v8f16:
479 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
480 ; CHECK-NEXT: mov z2.h, z0.h[7]
481 ; CHECK-NEXT: mov z0.d, z1.d
482 ; CHECK-NEXT: insr z0.h, h2
483 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
486 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v8f16:
487 ; NONEON-NOSVE: // %bb.0:
488 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
489 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
490 ; NONEON-NOSVE-NEXT: ldr h0, [sp, #28]
491 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #24]
492 ; NONEON-NOSVE-NEXT: str h0, [sp, #46]
493 ; NONEON-NOSVE-NEXT: ldr h0, [sp, #14]
494 ; NONEON-NOSVE-NEXT: stur w8, [sp, #42]
495 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #16]
496 ; NONEON-NOSVE-NEXT: str h0, [sp, #32]
497 ; NONEON-NOSVE-NEXT: stur x8, [sp, #34]
498 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
499 ; NONEON-NOSVE-NEXT: add sp, sp, #48
500 ; NONEON-NOSVE-NEXT: ret
501 %ret = shufflevector <8 x half> %op1, <8 x half> %op2, <8 x i32> <i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14>
505 define void @shuffle_ext_byone_v16f16(ptr %a, ptr %b) {
506 ; CHECK-LABEL: shuffle_ext_byone_v16f16:
508 ; CHECK-NEXT: ldp q1, q3, [x1]
509 ; CHECK-NEXT: ldr q0, [x0, #16]
510 ; CHECK-NEXT: mov z0.h, z0.h[7]
511 ; CHECK-NEXT: mov z2.h, z1.h[7]
512 ; CHECK-NEXT: insr z1.h, h0
513 ; CHECK-NEXT: insr z3.h, h2
514 ; CHECK-NEXT: stp q1, q3, [x0]
517 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v16f16:
518 ; NONEON-NOSVE: // %bb.0:
519 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x1]
520 ; NONEON-NOSVE-NEXT: ldr q2, [x0, #16]
521 ; NONEON-NOSVE-NEXT: str q0, [sp, #-80]!
522 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 80
523 ; NONEON-NOSVE-NEXT: ldr h0, [sp, #12]
524 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #8]
525 ; NONEON-NOSVE-NEXT: stp q2, q1, [sp, #32]
526 ; NONEON-NOSVE-NEXT: str h0, [sp, #30]
527 ; NONEON-NOSVE-NEXT: ldr h0, [sp, #62]
528 ; NONEON-NOSVE-NEXT: stur w8, [sp, #26]
529 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
530 ; NONEON-NOSVE-NEXT: str h0, [sp, #16]
531 ; NONEON-NOSVE-NEXT: ldr h0, [sp, #60]
532 ; NONEON-NOSVE-NEXT: stur x8, [sp, #18]
533 ; NONEON-NOSVE-NEXT: ldr w8, [sp, #56]
534 ; NONEON-NOSVE-NEXT: str h0, [sp, #78]
535 ; NONEON-NOSVE-NEXT: ldr h0, [sp, #46]
536 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
537 ; NONEON-NOSVE-NEXT: stur w8, [sp, #74]
538 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #48]
539 ; NONEON-NOSVE-NEXT: str h0, [sp, #64]
540 ; NONEON-NOSVE-NEXT: stur x8, [sp, #66]
541 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #64]
542 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
543 ; NONEON-NOSVE-NEXT: add sp, sp, #80
544 ; NONEON-NOSVE-NEXT: ret
545 %op1 = load <16 x half>, ptr %a
546 %op2 = load <16 x half>, ptr %b
547 %ret = shufflevector <16 x half> %op1, <16 x half> %op2, <16 x i32> <i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22,
548 i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30>
549 store <16 x half> %ret, ptr %a
553 define <2 x float> @shuffle_ext_byone_v2f32(<2 x float> %op1, <2 x float> %op2) {
554 ; CHECK-LABEL: shuffle_ext_byone_v2f32:
556 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
557 ; CHECK-NEXT: mov z2.s, z0.s[1]
558 ; CHECK-NEXT: fmov d0, d1
559 ; CHECK-NEXT: insr z0.s, s2
560 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
563 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v2f32:
564 ; NONEON-NOSVE: // %bb.0:
565 ; NONEON-NOSVE-NEXT: sub sp, sp, #32
566 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 32
567 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #8]
568 ; NONEON-NOSVE-NEXT: ldp w8, w9, [sp, #12]
569 ; NONEON-NOSVE-NEXT: stp w8, w9, [sp, #24]
570 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #24]
571 ; NONEON-NOSVE-NEXT: add sp, sp, #32
572 ; NONEON-NOSVE-NEXT: ret
573 %ret = shufflevector <2 x float> %op1, <2 x float> %op2, <2 x i32> <i32 1, i32 2>
577 define <4 x float> @shuffle_ext_byone_v4f32(<4 x float> %op1, <4 x float> %op2) {
578 ; CHECK-LABEL: shuffle_ext_byone_v4f32:
580 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
581 ; CHECK-NEXT: mov z2.s, z0.s[3]
582 ; CHECK-NEXT: mov z0.d, z1.d
583 ; CHECK-NEXT: insr z0.s, s2
584 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
587 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v4f32:
588 ; NONEON-NOSVE: // %bb.0:
589 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
590 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
591 ; NONEON-NOSVE-NEXT: ldr s0, [sp, #24]
592 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #16]
593 ; NONEON-NOSVE-NEXT: str s0, [sp, #44]
594 ; NONEON-NOSVE-NEXT: ldr s0, [sp, #12]
595 ; NONEON-NOSVE-NEXT: stur x8, [sp, #36]
596 ; NONEON-NOSVE-NEXT: str s0, [sp, #32]
597 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
598 ; NONEON-NOSVE-NEXT: add sp, sp, #48
599 ; NONEON-NOSVE-NEXT: ret
600 %ret = shufflevector <4 x float> %op1, <4 x float> %op2, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
604 define void @shuffle_ext_byone_v8f32(ptr %a, ptr %b) {
605 ; CHECK-LABEL: shuffle_ext_byone_v8f32:
607 ; CHECK-NEXT: ldp q1, q3, [x1]
608 ; CHECK-NEXT: ldr q0, [x0, #16]
609 ; CHECK-NEXT: mov z0.s, z0.s[3]
610 ; CHECK-NEXT: mov z2.s, z1.s[3]
611 ; CHECK-NEXT: insr z1.s, s0
612 ; CHECK-NEXT: insr z3.s, s2
613 ; CHECK-NEXT: stp q1, q3, [x0]
616 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v8f32:
617 ; NONEON-NOSVE: // %bb.0:
618 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x1]
619 ; NONEON-NOSVE-NEXT: ldr q2, [x0, #16]
620 ; NONEON-NOSVE-NEXT: str q0, [sp, #-80]!
621 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 80
622 ; NONEON-NOSVE-NEXT: ldr s0, [sp, #8]
623 ; NONEON-NOSVE-NEXT: stp q2, q1, [sp, #32]
624 ; NONEON-NOSVE-NEXT: ldr x8, [sp]
625 ; NONEON-NOSVE-NEXT: str s0, [sp, #28]
626 ; NONEON-NOSVE-NEXT: ldp s0, s1, [sp, #56]
627 ; NONEON-NOSVE-NEXT: stur x8, [sp, #20]
628 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #48]
629 ; NONEON-NOSVE-NEXT: str s0, [sp, #76]
630 ; NONEON-NOSVE-NEXT: ldr s0, [sp, #44]
631 ; NONEON-NOSVE-NEXT: str s1, [sp, #16]
632 ; NONEON-NOSVE-NEXT: stur x8, [sp, #68]
633 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
634 ; NONEON-NOSVE-NEXT: str s0, [sp, #64]
635 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #64]
636 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
637 ; NONEON-NOSVE-NEXT: add sp, sp, #80
638 ; NONEON-NOSVE-NEXT: ret
639 %op1 = load <8 x float>, ptr %a
640 %op2 = load <8 x float>, ptr %b
641 %ret = shufflevector <8 x float> %op1, <8 x float> %op2, <8 x i32> <i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14>
642 store <8 x float> %ret, ptr %a
646 define <2 x double> @shuffle_ext_byone_v2f64(<2 x double> %op1, <2 x double> %op2) {
647 ; CHECK-LABEL: shuffle_ext_byone_v2f64:
649 ; CHECK-NEXT: // kill: def $q0 killed $q0 def $z0
650 ; CHECK-NEXT: mov z2.d, z0.d[1]
651 ; CHECK-NEXT: mov z0.d, z1.d
652 ; CHECK-NEXT: insr z0.d, d2
653 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
656 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v2f64:
657 ; NONEON-NOSVE: // %bb.0:
658 ; NONEON-NOSVE-NEXT: stp q0, q1, [sp, #-48]!
659 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 48
660 ; NONEON-NOSVE-NEXT: ldp x8, x9, [sp, #8]
661 ; NONEON-NOSVE-NEXT: stp x8, x9, [sp, #32]
662 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
663 ; NONEON-NOSVE-NEXT: add sp, sp, #48
664 ; NONEON-NOSVE-NEXT: ret
665 %ret = shufflevector <2 x double> %op1, <2 x double> %op2, <2 x i32> <i32 1, i32 2>
666 ret <2 x double> %ret
669 define void @shuffle_ext_byone_v4f64(ptr %a, ptr %b) {
670 ; CHECK-LABEL: shuffle_ext_byone_v4f64:
672 ; CHECK-NEXT: ldp q1, q3, [x1]
673 ; CHECK-NEXT: ldr q0, [x0, #16]
674 ; CHECK-NEXT: mov z0.d, z0.d[1]
675 ; CHECK-NEXT: mov z2.d, z1.d[1]
676 ; CHECK-NEXT: insr z1.d, d0
677 ; CHECK-NEXT: insr z3.d, d2
678 ; CHECK-NEXT: stp q1, q3, [x0]
681 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_v4f64:
682 ; NONEON-NOSVE: // %bb.0:
683 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x1]
684 ; NONEON-NOSVE-NEXT: ldr q2, [x0, #16]
685 ; NONEON-NOSVE-NEXT: str q0, [sp, #-80]!
686 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 80
687 ; NONEON-NOSVE-NEXT: stp q2, q1, [sp, #32]
688 ; NONEON-NOSVE-NEXT: ldr d1, [sp]
689 ; NONEON-NOSVE-NEXT: ldp d3, d2, [sp, #48]
690 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #40]
691 ; NONEON-NOSVE-NEXT: stp d2, d1, [sp, #16]
692 ; NONEON-NOSVE-NEXT: stp d0, d3, [sp, #64]
693 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #16]
694 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #64]
695 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
696 ; NONEON-NOSVE-NEXT: add sp, sp, #80
697 ; NONEON-NOSVE-NEXT: ret
698 %op1 = load <4 x double>, ptr %a
699 %op2 = load <4 x double>, ptr %b
700 %ret = shufflevector <4 x double> %op1, <4 x double> %op2, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
701 store <4 x double> %ret, ptr %a
705 define void @shuffle_ext_byone_reverse(ptr %a, ptr %b) {
706 ; CHECK-LABEL: shuffle_ext_byone_reverse:
708 ; CHECK-NEXT: ldp q1, q3, [x0]
709 ; CHECK-NEXT: ldr q0, [x1, #16]
710 ; CHECK-NEXT: mov z0.d, z0.d[1]
711 ; CHECK-NEXT: mov z2.d, z1.d[1]
712 ; CHECK-NEXT: insr z1.d, d0
713 ; CHECK-NEXT: insr z3.d, d2
714 ; CHECK-NEXT: stp q1, q3, [x0]
717 ; NONEON-NOSVE-LABEL: shuffle_ext_byone_reverse:
718 ; NONEON-NOSVE: // %bb.0:
719 ; NONEON-NOSVE-NEXT: sub sp, sp, #80
720 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 80
721 ; NONEON-NOSVE-NEXT: ldp q1, q0, [x0]
722 ; NONEON-NOSVE-NEXT: ldr q2, [x1, #16]
723 ; NONEON-NOSVE-NEXT: str q2, [sp]
724 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #32]
725 ; NONEON-NOSVE-NEXT: ldp d0, d1, [sp, #40]
726 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #64]
727 ; NONEON-NOSVE-NEXT: ldr d1, [sp, #32]
728 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
729 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #16]
730 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #64]
731 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
732 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
733 ; NONEON-NOSVE-NEXT: add sp, sp, #80
734 ; NONEON-NOSVE-NEXT: ret
735 %op1 = load <4 x double>, ptr %a
736 %op2 = load <4 x double>, ptr %b
737 %ret = shufflevector <4 x double> %op1, <4 x double> %op2, <4 x i32> <i32 7, i32 0, i32 1, i32 2>
738 store <4 x double> %ret, ptr %a
742 define void @shuffle_ext_invalid(ptr %a, ptr %b) {
743 ; CHECK-LABEL: shuffle_ext_invalid:
745 ; CHECK-NEXT: ldr q0, [x0, #16]
746 ; CHECK-NEXT: ldr q1, [x1]
747 ; CHECK-NEXT: stp q0, q1, [x0]
750 ; NONEON-NOSVE-LABEL: shuffle_ext_invalid:
751 ; NONEON-NOSVE: // %bb.0:
752 ; NONEON-NOSVE-NEXT: ldr q0, [x0, #16]
753 ; NONEON-NOSVE-NEXT: ldr q1, [x1]
754 ; NONEON-NOSVE-NEXT: stp q0, q1, [x0]
755 ; NONEON-NOSVE-NEXT: ret
756 %op1 = load <4 x double>, ptr %a
757 %op2 = load <4 x double>, ptr %b
758 %ret = shufflevector <4 x double> %op1, <4 x double> %op2, <4 x i32> <i32 2, i32 3, i32 4, i32 5>
759 store <4 x double> %ret, ptr %a