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 -force-streaming-compatible < %s | FileCheck %s --check-prefix=NONEON-NOSVE
7 target triple = "aarch64-unknown-linux-gnu"
13 define <4 x i8> @splat_v4i8(i8 %a) {
14 ; CHECK-LABEL: splat_v4i8:
16 ; CHECK-NEXT: mov z0.h, w0
17 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
20 ; NONEON-NOSVE-LABEL: splat_v4i8:
21 ; NONEON-NOSVE: // %bb.0:
22 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
23 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
24 ; NONEON-NOSVE-NEXT: strh w0, [sp, #14]
25 ; NONEON-NOSVE-NEXT: strh w0, [sp, #12]
26 ; NONEON-NOSVE-NEXT: strh w0, [sp, #10]
27 ; NONEON-NOSVE-NEXT: strh w0, [sp, #8]
28 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
29 ; NONEON-NOSVE-NEXT: add sp, sp, #16
30 ; NONEON-NOSVE-NEXT: ret
31 %insert = insertelement <4 x i8> undef, i8 %a, i64 0
32 %splat = shufflevector <4 x i8> %insert, <4 x i8> undef, <4 x i32> zeroinitializer
36 define <8 x i8> @splat_v8i8(i8 %a) {
37 ; CHECK-LABEL: splat_v8i8:
39 ; CHECK-NEXT: mov z0.b, w0
40 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
43 ; NONEON-NOSVE-LABEL: splat_v8i8:
44 ; NONEON-NOSVE: // %bb.0:
45 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
46 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
47 ; NONEON-NOSVE-NEXT: strb w0, [sp, #15]
48 ; NONEON-NOSVE-NEXT: strb w0, [sp, #14]
49 ; NONEON-NOSVE-NEXT: strb w0, [sp, #13]
50 ; NONEON-NOSVE-NEXT: strb w0, [sp, #12]
51 ; NONEON-NOSVE-NEXT: strb w0, [sp, #11]
52 ; NONEON-NOSVE-NEXT: strb w0, [sp, #10]
53 ; NONEON-NOSVE-NEXT: strb w0, [sp, #9]
54 ; NONEON-NOSVE-NEXT: strb w0, [sp, #8]
55 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
56 ; NONEON-NOSVE-NEXT: add sp, sp, #16
57 ; NONEON-NOSVE-NEXT: ret
58 %insert = insertelement <8 x i8> undef, i8 %a, i64 0
59 %splat = shufflevector <8 x i8> %insert, <8 x i8> undef, <8 x i32> zeroinitializer
63 define <16 x i8> @splat_v16i8(i8 %a) {
64 ; CHECK-LABEL: splat_v16i8:
66 ; CHECK-NEXT: mov z0.b, w0
67 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
70 ; NONEON-NOSVE-LABEL: splat_v16i8:
71 ; NONEON-NOSVE: // %bb.0:
72 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
73 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
74 ; NONEON-NOSVE-NEXT: strb w0, [sp, #15]
75 ; NONEON-NOSVE-NEXT: strb w0, [sp, #14]
76 ; NONEON-NOSVE-NEXT: strb w0, [sp, #13]
77 ; NONEON-NOSVE-NEXT: strb w0, [sp, #12]
78 ; NONEON-NOSVE-NEXT: strb w0, [sp, #11]
79 ; NONEON-NOSVE-NEXT: strb w0, [sp, #10]
80 ; NONEON-NOSVE-NEXT: strb w0, [sp, #9]
81 ; NONEON-NOSVE-NEXT: strb w0, [sp, #8]
82 ; NONEON-NOSVE-NEXT: strb w0, [sp, #7]
83 ; NONEON-NOSVE-NEXT: strb w0, [sp, #6]
84 ; NONEON-NOSVE-NEXT: strb w0, [sp, #5]
85 ; NONEON-NOSVE-NEXT: strb w0, [sp, #4]
86 ; NONEON-NOSVE-NEXT: strb w0, [sp, #3]
87 ; NONEON-NOSVE-NEXT: strb w0, [sp, #2]
88 ; NONEON-NOSVE-NEXT: strb w0, [sp, #1]
89 ; NONEON-NOSVE-NEXT: strb w0, [sp]
90 ; NONEON-NOSVE-NEXT: ldr q0, [sp], #16
91 ; NONEON-NOSVE-NEXT: ret
92 %insert = insertelement <16 x i8> undef, i8 %a, i64 0
93 %splat = shufflevector <16 x i8> %insert, <16 x i8> undef, <16 x i32> zeroinitializer
97 define void @splat_v32i8(i8 %a, ptr %b) {
98 ; CHECK-LABEL: splat_v32i8:
100 ; CHECK-NEXT: mov z0.b, w0
101 ; CHECK-NEXT: stp q0, q0, [x1]
104 ; NONEON-NOSVE-LABEL: splat_v32i8:
105 ; NONEON-NOSVE: // %bb.0:
106 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
107 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
108 ; NONEON-NOSVE-NEXT: strb w0, [sp, #15]
109 ; NONEON-NOSVE-NEXT: strb w0, [sp, #14]
110 ; NONEON-NOSVE-NEXT: strb w0, [sp, #13]
111 ; NONEON-NOSVE-NEXT: strb w0, [sp, #12]
112 ; NONEON-NOSVE-NEXT: strb w0, [sp, #11]
113 ; NONEON-NOSVE-NEXT: strb w0, [sp, #10]
114 ; NONEON-NOSVE-NEXT: strb w0, [sp, #9]
115 ; NONEON-NOSVE-NEXT: strb w0, [sp, #8]
116 ; NONEON-NOSVE-NEXT: strb w0, [sp, #7]
117 ; NONEON-NOSVE-NEXT: strb w0, [sp, #6]
118 ; NONEON-NOSVE-NEXT: strb w0, [sp, #5]
119 ; NONEON-NOSVE-NEXT: strb w0, [sp, #4]
120 ; NONEON-NOSVE-NEXT: strb w0, [sp, #3]
121 ; NONEON-NOSVE-NEXT: strb w0, [sp, #2]
122 ; NONEON-NOSVE-NEXT: strb w0, [sp, #1]
123 ; NONEON-NOSVE-NEXT: strb w0, [sp]
124 ; NONEON-NOSVE-NEXT: ldr q0, [sp]
125 ; NONEON-NOSVE-NEXT: stp q0, q0, [x1]
126 ; NONEON-NOSVE-NEXT: add sp, sp, #16
127 ; NONEON-NOSVE-NEXT: ret
128 %insert = insertelement <32 x i8> undef, i8 %a, i64 0
129 %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer
130 store <32 x i8> %splat, ptr %b
134 define <2 x i16> @splat_v2i16(i16 %a) {
135 ; CHECK-LABEL: splat_v2i16:
137 ; CHECK-NEXT: mov z0.s, w0
138 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
141 ; NONEON-NOSVE-LABEL: splat_v2i16:
142 ; NONEON-NOSVE: // %bb.0:
143 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
144 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
145 ; NONEON-NOSVE-NEXT: stp w0, w0, [sp, #8]
146 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
147 ; NONEON-NOSVE-NEXT: add sp, sp, #16
148 ; NONEON-NOSVE-NEXT: ret
149 %insert = insertelement <2 x i16> undef, i16 %a, i64 0
150 %splat = shufflevector <2 x i16> %insert, <2 x i16> undef, <2 x i32> zeroinitializer
154 define <4 x i16> @splat_v4i16(i16 %a) {
155 ; CHECK-LABEL: splat_v4i16:
157 ; CHECK-NEXT: mov z0.h, w0
158 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
161 ; NONEON-NOSVE-LABEL: splat_v4i16:
162 ; NONEON-NOSVE: // %bb.0:
163 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
164 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
165 ; NONEON-NOSVE-NEXT: strh w0, [sp, #14]
166 ; NONEON-NOSVE-NEXT: strh w0, [sp, #12]
167 ; NONEON-NOSVE-NEXT: strh w0, [sp, #10]
168 ; NONEON-NOSVE-NEXT: strh w0, [sp, #8]
169 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
170 ; NONEON-NOSVE-NEXT: add sp, sp, #16
171 ; NONEON-NOSVE-NEXT: ret
172 %insert = insertelement <4 x i16> undef, i16 %a, i64 0
173 %splat = shufflevector <4 x i16> %insert, <4 x i16> undef, <4 x i32> zeroinitializer
177 define <8 x i16> @splat_v8i16(i16 %a) {
178 ; CHECK-LABEL: splat_v8i16:
180 ; CHECK-NEXT: mov z0.h, w0
181 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
184 ; NONEON-NOSVE-LABEL: splat_v8i16:
185 ; NONEON-NOSVE: // %bb.0:
186 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
187 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
188 ; NONEON-NOSVE-NEXT: strh w0, [sp, #14]
189 ; NONEON-NOSVE-NEXT: strh w0, [sp, #12]
190 ; NONEON-NOSVE-NEXT: strh w0, [sp, #10]
191 ; NONEON-NOSVE-NEXT: strh w0, [sp, #8]
192 ; NONEON-NOSVE-NEXT: strh w0, [sp, #6]
193 ; NONEON-NOSVE-NEXT: strh w0, [sp, #4]
194 ; NONEON-NOSVE-NEXT: strh w0, [sp, #2]
195 ; NONEON-NOSVE-NEXT: strh w0, [sp]
196 ; NONEON-NOSVE-NEXT: ldr q0, [sp], #16
197 ; NONEON-NOSVE-NEXT: ret
198 %insert = insertelement <8 x i16> undef, i16 %a, i64 0
199 %splat = shufflevector <8 x i16> %insert, <8 x i16> undef, <8 x i32> zeroinitializer
203 define void @splat_v16i16(i16 %a, ptr %b) {
204 ; CHECK-LABEL: splat_v16i16:
206 ; CHECK-NEXT: mov z0.h, w0
207 ; CHECK-NEXT: stp q0, q0, [x1]
210 ; NONEON-NOSVE-LABEL: splat_v16i16:
211 ; NONEON-NOSVE: // %bb.0:
212 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
213 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
214 ; NONEON-NOSVE-NEXT: strh w0, [sp, #14]
215 ; NONEON-NOSVE-NEXT: strh w0, [sp, #12]
216 ; NONEON-NOSVE-NEXT: strh w0, [sp, #10]
217 ; NONEON-NOSVE-NEXT: strh w0, [sp, #8]
218 ; NONEON-NOSVE-NEXT: strh w0, [sp, #6]
219 ; NONEON-NOSVE-NEXT: strh w0, [sp, #4]
220 ; NONEON-NOSVE-NEXT: strh w0, [sp, #2]
221 ; NONEON-NOSVE-NEXT: strh w0, [sp]
222 ; NONEON-NOSVE-NEXT: ldr q0, [sp]
223 ; NONEON-NOSVE-NEXT: stp q0, q0, [x1]
224 ; NONEON-NOSVE-NEXT: add sp, sp, #16
225 ; NONEON-NOSVE-NEXT: ret
226 %insert = insertelement <16 x i16> undef, i16 %a, i64 0
227 %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer
228 store <16 x i16> %splat, ptr %b
232 define <2 x i32> @splat_v2i32(i32 %a) {
233 ; CHECK-LABEL: splat_v2i32:
235 ; CHECK-NEXT: mov z0.s, w0
236 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
239 ; NONEON-NOSVE-LABEL: splat_v2i32:
240 ; NONEON-NOSVE: // %bb.0:
241 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
242 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
243 ; NONEON-NOSVE-NEXT: stp w0, w0, [sp, #8]
244 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
245 ; NONEON-NOSVE-NEXT: add sp, sp, #16
246 ; NONEON-NOSVE-NEXT: ret
247 %insert = insertelement <2 x i32> undef, i32 %a, i64 0
248 %splat = shufflevector <2 x i32> %insert, <2 x i32> undef, <2 x i32> zeroinitializer
252 define <4 x i32> @splat_v4i32(i32 %a) {
253 ; CHECK-LABEL: splat_v4i32:
255 ; CHECK-NEXT: mov z0.s, w0
256 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
259 ; NONEON-NOSVE-LABEL: splat_v4i32:
260 ; NONEON-NOSVE: // %bb.0:
261 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
262 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
263 ; NONEON-NOSVE-NEXT: stp w0, w0, [sp, #8]
264 ; NONEON-NOSVE-NEXT: stp w0, w0, [sp]
265 ; NONEON-NOSVE-NEXT: ldr q0, [sp], #16
266 ; NONEON-NOSVE-NEXT: ret
267 %insert = insertelement <4 x i32> undef, i32 %a, i64 0
268 %splat = shufflevector <4 x i32> %insert, <4 x i32> undef, <4 x i32> zeroinitializer
272 define void @splat_v8i32(i32 %a, ptr %b) {
273 ; CHECK-LABEL: splat_v8i32:
275 ; CHECK-NEXT: mov z0.s, w0
276 ; CHECK-NEXT: stp q0, q0, [x1]
279 ; NONEON-NOSVE-LABEL: splat_v8i32:
280 ; NONEON-NOSVE: // %bb.0:
281 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
282 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
283 ; NONEON-NOSVE-NEXT: stp w0, w0, [sp, #8]
284 ; NONEON-NOSVE-NEXT: stp w0, w0, [sp]
285 ; NONEON-NOSVE-NEXT: ldr q0, [sp]
286 ; NONEON-NOSVE-NEXT: stp q0, q0, [x1]
287 ; NONEON-NOSVE-NEXT: add sp, sp, #16
288 ; NONEON-NOSVE-NEXT: ret
289 %insert = insertelement <8 x i32> undef, i32 %a, i64 0
290 %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer
291 store <8 x i32> %splat, ptr %b
295 define <1 x i64> @splat_v1i64(i64 %a) {
296 ; CHECK-LABEL: splat_v1i64:
298 ; CHECK-NEXT: mov z0.d, x0
299 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
302 ; NONEON-NOSVE-LABEL: splat_v1i64:
303 ; NONEON-NOSVE: // %bb.0:
304 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
305 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
306 ; NONEON-NOSVE-NEXT: str x0, [sp, #8]
307 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
308 ; NONEON-NOSVE-NEXT: add sp, sp, #16
309 ; NONEON-NOSVE-NEXT: ret
310 %insert = insertelement <1 x i64> undef, i64 %a, i64 0
311 %splat = shufflevector <1 x i64> %insert, <1 x i64> undef, <1 x i32> zeroinitializer
315 define <2 x i64> @splat_v2i64(i64 %a) {
316 ; CHECK-LABEL: splat_v2i64:
318 ; CHECK-NEXT: mov z0.d, x0
319 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
322 ; NONEON-NOSVE-LABEL: splat_v2i64:
323 ; NONEON-NOSVE: // %bb.0:
324 ; NONEON-NOSVE-NEXT: stp x0, x0, [sp, #-16]!
325 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
326 ; NONEON-NOSVE-NEXT: ldr q0, [sp], #16
327 ; NONEON-NOSVE-NEXT: ret
328 %insert = insertelement <2 x i64> undef, i64 %a, i64 0
329 %splat = shufflevector <2 x i64> %insert, <2 x i64> undef, <2 x i32> zeroinitializer
333 define void @splat_v4i64(i64 %a, ptr %b) {
334 ; CHECK-LABEL: splat_v4i64:
336 ; CHECK-NEXT: mov z0.d, x0
337 ; CHECK-NEXT: stp q0, q0, [x1]
340 ; NONEON-NOSVE-LABEL: splat_v4i64:
341 ; NONEON-NOSVE: // %bb.0:
342 ; NONEON-NOSVE-NEXT: stp x0, x0, [sp, #-16]!
343 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
344 ; NONEON-NOSVE-NEXT: ldr q0, [sp]
345 ; NONEON-NOSVE-NEXT: stp q0, q0, [x1]
346 ; NONEON-NOSVE-NEXT: add sp, sp, #16
347 ; NONEON-NOSVE-NEXT: ret
348 %insert = insertelement <4 x i64> undef, i64 %a, i64 0
349 %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer
350 store <4 x i64> %splat, ptr %b
355 ; DUP (floating-point)
358 define <2 x half> @splat_v2f16(half %a) {
359 ; CHECK-LABEL: splat_v2f16:
361 ; CHECK-NEXT: // kill: def $h0 killed $h0 def $z0
362 ; CHECK-NEXT: mov z0.h, h0
363 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
366 ; NONEON-NOSVE-LABEL: splat_v2f16:
367 ; NONEON-NOSVE: // %bb.0:
368 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
369 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
370 ; NONEON-NOSVE-NEXT: str h0, [sp, #10]
371 ; NONEON-NOSVE-NEXT: str h0, [sp, #8]
372 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
373 ; NONEON-NOSVE-NEXT: add sp, sp, #16
374 ; NONEON-NOSVE-NEXT: ret
375 %insert = insertelement <2 x half> undef, half %a, i64 0
376 %splat = shufflevector <2 x half> %insert, <2 x half> undef, <2 x i32> zeroinitializer
377 ret <2 x half> %splat
380 define <4 x half> @splat_v4f16(half %a) {
381 ; CHECK-LABEL: splat_v4f16:
383 ; CHECK-NEXT: // kill: def $h0 killed $h0 def $z0
384 ; CHECK-NEXT: mov z0.h, h0
385 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
388 ; NONEON-NOSVE-LABEL: splat_v4f16:
389 ; NONEON-NOSVE: // %bb.0:
390 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
391 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
392 ; NONEON-NOSVE-NEXT: str h0, [sp, #14]
393 ; NONEON-NOSVE-NEXT: str h0, [sp, #12]
394 ; NONEON-NOSVE-NEXT: str h0, [sp, #10]
395 ; NONEON-NOSVE-NEXT: str h0, [sp, #8]
396 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
397 ; NONEON-NOSVE-NEXT: add sp, sp, #16
398 ; NONEON-NOSVE-NEXT: ret
399 %insert = insertelement <4 x half> undef, half %a, i64 0
400 %splat = shufflevector <4 x half> %insert, <4 x half> undef, <4 x i32> zeroinitializer
401 ret <4 x half> %splat
404 define <8 x half> @splat_v8f16(half %a) {
405 ; CHECK-LABEL: splat_v8f16:
407 ; CHECK-NEXT: // kill: def $h0 killed $h0 def $z0
408 ; CHECK-NEXT: mov z0.h, h0
409 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
412 ; NONEON-NOSVE-LABEL: splat_v8f16:
413 ; NONEON-NOSVE: // %bb.0:
414 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
415 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
416 ; NONEON-NOSVE-NEXT: str h0, [sp, #14]
417 ; NONEON-NOSVE-NEXT: str h0, [sp, #12]
418 ; NONEON-NOSVE-NEXT: str h0, [sp, #10]
419 ; NONEON-NOSVE-NEXT: str h0, [sp, #8]
420 ; NONEON-NOSVE-NEXT: str h0, [sp, #6]
421 ; NONEON-NOSVE-NEXT: str h0, [sp, #4]
422 ; NONEON-NOSVE-NEXT: str h0, [sp, #2]
423 ; NONEON-NOSVE-NEXT: str h0, [sp]
424 ; NONEON-NOSVE-NEXT: ldr q0, [sp], #16
425 ; NONEON-NOSVE-NEXT: ret
426 %insert = insertelement <8 x half> undef, half %a, i64 0
427 %splat = shufflevector <8 x half> %insert, <8 x half> undef, <8 x i32> zeroinitializer
428 ret <8 x half> %splat
431 define void @splat_v16f16(half %a, ptr %b) {
432 ; CHECK-LABEL: splat_v16f16:
434 ; CHECK-NEXT: // kill: def $h0 killed $h0 def $z0
435 ; CHECK-NEXT: mov z0.h, h0
436 ; CHECK-NEXT: stp q0, q0, [x0]
439 ; NONEON-NOSVE-LABEL: splat_v16f16:
440 ; NONEON-NOSVE: // %bb.0:
441 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
442 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
443 ; NONEON-NOSVE-NEXT: str h0, [sp, #14]
444 ; NONEON-NOSVE-NEXT: str h0, [sp, #12]
445 ; NONEON-NOSVE-NEXT: str h0, [sp, #10]
446 ; NONEON-NOSVE-NEXT: str h0, [sp, #8]
447 ; NONEON-NOSVE-NEXT: str h0, [sp, #6]
448 ; NONEON-NOSVE-NEXT: str h0, [sp, #4]
449 ; NONEON-NOSVE-NEXT: str h0, [sp, #2]
450 ; NONEON-NOSVE-NEXT: str h0, [sp]
451 ; NONEON-NOSVE-NEXT: ldr q0, [sp]
452 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
453 ; NONEON-NOSVE-NEXT: add sp, sp, #16
454 ; NONEON-NOSVE-NEXT: ret
455 %insert = insertelement <16 x half> undef, half %a, i64 0
456 %splat = shufflevector <16 x half> %insert, <16 x half> undef, <16 x i32> zeroinitializer
457 store <16 x half> %splat, ptr %b
461 define <2 x float> @splat_v2f32(float %a, <2 x float> %op2) {
462 ; CHECK-LABEL: splat_v2f32:
464 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $z0
465 ; CHECK-NEXT: mov z0.s, s0
466 ; CHECK-NEXT: // kill: def $d0 killed $d0 killed $z0
469 ; NONEON-NOSVE-LABEL: splat_v2f32:
470 ; NONEON-NOSVE: // %bb.0:
471 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
472 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
473 ; NONEON-NOSVE-NEXT: stp s0, s0, [sp, #8]
474 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
475 ; NONEON-NOSVE-NEXT: add sp, sp, #16
476 ; NONEON-NOSVE-NEXT: ret
477 %insert = insertelement <2 x float> undef, float %a, i64 0
478 %splat = shufflevector <2 x float> %insert, <2 x float> undef, <2 x i32> zeroinitializer
479 ret <2 x float> %splat
482 define <4 x float> @splat_v4f32(float %a, <4 x float> %op2) {
483 ; CHECK-LABEL: splat_v4f32:
485 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $z0
486 ; CHECK-NEXT: mov z0.s, s0
487 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
490 ; NONEON-NOSVE-LABEL: splat_v4f32:
491 ; NONEON-NOSVE: // %bb.0:
492 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
493 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
494 ; NONEON-NOSVE-NEXT: stp s0, s0, [sp, #8]
495 ; NONEON-NOSVE-NEXT: stp s0, s0, [sp]
496 ; NONEON-NOSVE-NEXT: ldr q0, [sp], #16
497 ; NONEON-NOSVE-NEXT: ret
498 %insert = insertelement <4 x float> undef, float %a, i64 0
499 %splat = shufflevector <4 x float> %insert, <4 x float> undef, <4 x i32> zeroinitializer
500 ret <4 x float> %splat
503 define void @splat_v8f32(float %a, ptr %b) {
504 ; CHECK-LABEL: splat_v8f32:
506 ; CHECK-NEXT: // kill: def $s0 killed $s0 def $z0
507 ; CHECK-NEXT: mov z0.s, s0
508 ; CHECK-NEXT: stp q0, q0, [x0]
511 ; NONEON-NOSVE-LABEL: splat_v8f32:
512 ; NONEON-NOSVE: // %bb.0:
513 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
514 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
515 ; NONEON-NOSVE-NEXT: stp s0, s0, [sp, #8]
516 ; NONEON-NOSVE-NEXT: stp s0, s0, [sp]
517 ; NONEON-NOSVE-NEXT: ldr q0, [sp]
518 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
519 ; NONEON-NOSVE-NEXT: add sp, sp, #16
520 ; NONEON-NOSVE-NEXT: ret
521 %insert = insertelement <8 x float> undef, float %a, i64 0
522 %splat = shufflevector <8 x float> %insert, <8 x float> undef, <8 x i32> zeroinitializer
523 store <8 x float> %splat, ptr %b
527 define <1 x double> @splat_v1f64(double %a, <1 x double> %op2) {
528 ; CHECK-LABEL: splat_v1f64:
532 ; NONEON-NOSVE-LABEL: splat_v1f64:
533 ; NONEON-NOSVE: // %bb.0:
534 ; NONEON-NOSVE-NEXT: sub sp, sp, #16
535 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
536 ; NONEON-NOSVE-NEXT: str d0, [sp, #8]
537 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
538 ; NONEON-NOSVE-NEXT: add sp, sp, #16
539 ; NONEON-NOSVE-NEXT: ret
540 %insert = insertelement <1 x double> undef, double %a, i64 0
541 %splat = shufflevector <1 x double> %insert, <1 x double> undef, <1 x i32> zeroinitializer
542 ret <1 x double> %splat
545 define <2 x double> @splat_v2f64(double %a, <2 x double> %op2) {
546 ; CHECK-LABEL: splat_v2f64:
548 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
549 ; CHECK-NEXT: mov z0.d, d0
550 ; CHECK-NEXT: // kill: def $q0 killed $q0 killed $z0
553 ; NONEON-NOSVE-LABEL: splat_v2f64:
554 ; NONEON-NOSVE: // %bb.0:
555 ; NONEON-NOSVE-NEXT: stp d0, d0, [sp, #-16]!
556 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
557 ; NONEON-NOSVE-NEXT: ldr q0, [sp], #16
558 ; NONEON-NOSVE-NEXT: ret
559 %insert = insertelement <2 x double> undef, double %a, i64 0
560 %splat = shufflevector <2 x double> %insert, <2 x double> undef, <2 x i32> zeroinitializer
561 ret <2 x double> %splat
564 define void @splat_v4f64(double %a, ptr %b) {
565 ; CHECK-LABEL: splat_v4f64:
567 ; CHECK-NEXT: // kill: def $d0 killed $d0 def $z0
568 ; CHECK-NEXT: mov z0.d, d0
569 ; CHECK-NEXT: stp q0, q0, [x0]
572 ; NONEON-NOSVE-LABEL: splat_v4f64:
573 ; NONEON-NOSVE: // %bb.0:
574 ; NONEON-NOSVE-NEXT: stp d0, d0, [sp, #-16]!
575 ; NONEON-NOSVE-NEXT: .cfi_def_cfa_offset 16
576 ; NONEON-NOSVE-NEXT: ldr q0, [sp]
577 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
578 ; NONEON-NOSVE-NEXT: add sp, sp, #16
579 ; NONEON-NOSVE-NEXT: ret
580 %insert = insertelement <4 x double> undef, double %a, i64 0
581 %splat = shufflevector <4 x double> %insert, <4 x double> undef, <4 x i32> zeroinitializer
582 store <4 x double> %splat, ptr %b
587 ; DUP (integer immediate)
590 define void @splat_imm_v32i8(ptr %a) {
591 ; CHECK-LABEL: splat_imm_v32i8:
593 ; CHECK-NEXT: mov z0.b, #1 // =0x1
594 ; CHECK-NEXT: stp q0, q0, [x0]
597 ; NONEON-NOSVE-LABEL: splat_imm_v32i8:
598 ; NONEON-NOSVE: // %bb.0:
599 ; NONEON-NOSVE-NEXT: adrp x8, .LCPI24_0
600 ; NONEON-NOSVE-NEXT: ldr q0, [x8, :lo12:.LCPI24_0]
601 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
602 ; NONEON-NOSVE-NEXT: ret
603 %insert = insertelement <32 x i8> undef, i8 1, i64 0
604 %splat = shufflevector <32 x i8> %insert, <32 x i8> undef, <32 x i32> zeroinitializer
605 store <32 x i8> %splat, ptr %a
609 define void @splat_imm_v16i16(ptr %a) {
610 ; CHECK-LABEL: splat_imm_v16i16:
612 ; CHECK-NEXT: mov z0.h, #2 // =0x2
613 ; CHECK-NEXT: stp q0, q0, [x0]
616 ; NONEON-NOSVE-LABEL: splat_imm_v16i16:
617 ; NONEON-NOSVE: // %bb.0:
618 ; NONEON-NOSVE-NEXT: adrp x8, .LCPI25_0
619 ; NONEON-NOSVE-NEXT: ldr q0, [x8, :lo12:.LCPI25_0]
620 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
621 ; NONEON-NOSVE-NEXT: ret
622 %insert = insertelement <16 x i16> undef, i16 2, i64 0
623 %splat = shufflevector <16 x i16> %insert, <16 x i16> undef, <16 x i32> zeroinitializer
624 store <16 x i16> %splat, ptr %a
628 define void @splat_imm_v8i32(ptr %a) {
629 ; CHECK-LABEL: splat_imm_v8i32:
631 ; CHECK-NEXT: mov z0.s, #3 // =0x3
632 ; CHECK-NEXT: stp q0, q0, [x0]
635 ; NONEON-NOSVE-LABEL: splat_imm_v8i32:
636 ; NONEON-NOSVE: // %bb.0:
637 ; NONEON-NOSVE-NEXT: adrp x8, .LCPI26_0
638 ; NONEON-NOSVE-NEXT: ldr q0, [x8, :lo12:.LCPI26_0]
639 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
640 ; NONEON-NOSVE-NEXT: ret
641 %insert = insertelement <8 x i32> undef, i32 3, i64 0
642 %splat = shufflevector <8 x i32> %insert, <8 x i32> undef, <8 x i32> zeroinitializer
643 store <8 x i32> %splat, ptr %a
647 define void @splat_imm_v4i64(ptr %a) {
648 ; CHECK-LABEL: splat_imm_v4i64:
650 ; CHECK-NEXT: mov z0.d, #4 // =0x4
651 ; CHECK-NEXT: stp q0, q0, [x0]
654 ; NONEON-NOSVE-LABEL: splat_imm_v4i64:
655 ; NONEON-NOSVE: // %bb.0:
656 ; NONEON-NOSVE-NEXT: adrp x8, .LCPI27_0
657 ; NONEON-NOSVE-NEXT: ldr q0, [x8, :lo12:.LCPI27_0]
658 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
659 ; NONEON-NOSVE-NEXT: ret
660 %insert = insertelement <4 x i64> undef, i64 4, i64 0
661 %splat = shufflevector <4 x i64> %insert, <4 x i64> undef, <4 x i32> zeroinitializer
662 store <4 x i64> %splat, ptr %a
667 ; DUP (floating-point immediate)
670 define void @splat_imm_v16f16(ptr %a) {
671 ; CHECK-LABEL: splat_imm_v16f16:
673 ; CHECK-NEXT: fmov z0.h, #5.00000000
674 ; CHECK-NEXT: stp q0, q0, [x0]
677 ; NONEON-NOSVE-LABEL: splat_imm_v16f16:
678 ; NONEON-NOSVE: // %bb.0:
679 ; NONEON-NOSVE-NEXT: adrp x8, .LCPI28_0
680 ; NONEON-NOSVE-NEXT: ldr q0, [x8, :lo12:.LCPI28_0]
681 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
682 ; NONEON-NOSVE-NEXT: ret
683 %insert = insertelement <16 x half> undef, half 5.0, i64 0
684 %splat = shufflevector <16 x half> %insert, <16 x half> undef, <16 x i32> zeroinitializer
685 store <16 x half> %splat, ptr %a
689 define void @splat_imm_v8f32(ptr %a) {
690 ; CHECK-LABEL: splat_imm_v8f32:
692 ; CHECK-NEXT: fmov z0.s, #6.00000000
693 ; CHECK-NEXT: stp q0, q0, [x0]
696 ; NONEON-NOSVE-LABEL: splat_imm_v8f32:
697 ; NONEON-NOSVE: // %bb.0:
698 ; NONEON-NOSVE-NEXT: adrp x8, .LCPI29_0
699 ; NONEON-NOSVE-NEXT: ldr q0, [x8, :lo12:.LCPI29_0]
700 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
701 ; NONEON-NOSVE-NEXT: ret
702 %insert = insertelement <8 x float> undef, float 6.0, i64 0
703 %splat = shufflevector <8 x float> %insert, <8 x float> undef, <8 x i32> zeroinitializer
704 store <8 x float> %splat, ptr %a
708 define void @splat_imm_v4f64(ptr %a) {
709 ; CHECK-LABEL: splat_imm_v4f64:
711 ; CHECK-NEXT: fmov z0.d, #7.00000000
712 ; CHECK-NEXT: stp q0, q0, [x0]
715 ; NONEON-NOSVE-LABEL: splat_imm_v4f64:
716 ; NONEON-NOSVE: // %bb.0:
717 ; NONEON-NOSVE-NEXT: adrp x8, .LCPI30_0
718 ; NONEON-NOSVE-NEXT: ldr q0, [x8, :lo12:.LCPI30_0]
719 ; NONEON-NOSVE-NEXT: stp q0, q0, [x0]
720 ; NONEON-NOSVE-NEXT: ret
721 %insert = insertelement <4 x double> undef, double 7.0, i64 0
722 %splat = shufflevector <4 x double> %insert, <4 x double> undef, <4 x i32> zeroinitializer
723 store <4 x double> %splat, ptr %a