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
6 target triple = "aarch64-unknown-linux-gnu"
10 define void @alloc_v4i8(ptr %st_ptr) nounwind {
11 ; CHECK-LABEL: alloc_v4i8:
13 ; CHECK-NEXT: sub sp, sp, #48
14 ; CHECK-NEXT: stp x20, x19, [sp, #32] // 16-byte Folded Spill
15 ; CHECK-NEXT: mov x19, x0
16 ; CHECK-NEXT: add x0, sp, #28
17 ; CHECK-NEXT: str x30, [sp, #16] // 8-byte Folded Spill
18 ; CHECK-NEXT: add x20, sp, #28
20 ; CHECK-NEXT: ptrue p0.b, vl2
21 ; CHECK-NEXT: ld2b { z0.b, z1.b }, p0/z, [x20]
22 ; CHECK-NEXT: ptrue p0.s, vl2
23 ; CHECK-NEXT: ldr x30, [sp, #16] // 8-byte Folded Reload
24 ; CHECK-NEXT: mov z2.b, z0.b[1]
25 ; CHECK-NEXT: fmov w8, s0
26 ; CHECK-NEXT: fmov w9, s2
27 ; CHECK-NEXT: stp w8, w9, [sp, #8]
28 ; CHECK-NEXT: ldr d0, [sp, #8]
29 ; CHECK-NEXT: st1b { z0.s }, p0, [x19]
30 ; CHECK-NEXT: ldp x20, x19, [sp, #32] // 16-byte Folded Reload
31 ; CHECK-NEXT: add sp, sp, #48
34 ; NONEON-NOSVE-LABEL: alloc_v4i8:
35 ; NONEON-NOSVE: // %bb.0:
36 ; NONEON-NOSVE-NEXT: sub sp, sp, #48
37 ; NONEON-NOSVE-NEXT: stp x30, x19, [sp, #32] // 16-byte Folded Spill
38 ; NONEON-NOSVE-NEXT: mov x19, x0
39 ; NONEON-NOSVE-NEXT: add x0, sp, #28
40 ; NONEON-NOSVE-NEXT: bl def
41 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #30]
42 ; NONEON-NOSVE-NEXT: strh w8, [sp, #12]
43 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #28]
44 ; NONEON-NOSVE-NEXT: strh w8, [sp, #8]
45 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #8]
46 ; NONEON-NOSVE-NEXT: str d0, [sp, #16]
47 ; NONEON-NOSVE-NEXT: ldrh w8, [sp, #20]
48 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #16]
49 ; NONEON-NOSVE-NEXT: strb w8, [x19, #1]
50 ; NONEON-NOSVE-NEXT: strb w9, [x19]
51 ; NONEON-NOSVE-NEXT: ldp x30, x19, [sp, #32] // 16-byte Folded Reload
52 ; NONEON-NOSVE-NEXT: add sp, sp, #48
53 ; NONEON-NOSVE-NEXT: ret
54 %alloc = alloca [4 x i8]
55 call void @def(ptr %alloc)
56 %load = load <4 x i8>, ptr %alloc
57 %strided.vec = shufflevector <4 x i8> %load, <4 x i8> poison, <2 x i32> <i32 0, i32 2>
58 store <2 x i8> %strided.vec, ptr %st_ptr
62 define void @alloc_v6i8(ptr %st_ptr) nounwind {
63 ; CHECK-LABEL: alloc_v6i8:
65 ; CHECK-NEXT: sub sp, sp, #48
66 ; CHECK-NEXT: stp x30, x19, [sp, #32] // 16-byte Folded Spill
67 ; CHECK-NEXT: mov x19, x0
68 ; CHECK-NEXT: add x0, sp, #24
70 ; CHECK-NEXT: ldr d0, [sp, #24]
71 ; CHECK-NEXT: ptrue p0.h, vl4
72 ; CHECK-NEXT: ptrue p1.s, vl2
73 ; CHECK-NEXT: mov z1.b, z0.b[3]
74 ; CHECK-NEXT: mov z2.b, z0.b[5]
75 ; CHECK-NEXT: mov z0.b, z0.b[1]
76 ; CHECK-NEXT: fmov w8, s1
77 ; CHECK-NEXT: fmov w9, s2
78 ; CHECK-NEXT: strh w8, [sp, #10]
79 ; CHECK-NEXT: fmov w8, s0
80 ; CHECK-NEXT: strh w9, [sp, #12]
81 ; CHECK-NEXT: strh w8, [sp, #8]
82 ; CHECK-NEXT: add x8, sp, #20
83 ; CHECK-NEXT: ldr d0, [sp, #8]
84 ; CHECK-NEXT: st1b { z0.h }, p0, [x8]
85 ; CHECK-NEXT: ld1h { z0.s }, p1/z, [x8]
86 ; CHECK-NEXT: strb w9, [x19, #2]
87 ; CHECK-NEXT: fmov w8, s0
88 ; CHECK-NEXT: strh w8, [x19]
89 ; CHECK-NEXT: ldp x30, x19, [sp, #32] // 16-byte Folded Reload
90 ; CHECK-NEXT: add sp, sp, #48
93 ; NONEON-NOSVE-LABEL: alloc_v6i8:
94 ; NONEON-NOSVE: // %bb.0:
95 ; NONEON-NOSVE-NEXT: sub sp, sp, #48
96 ; NONEON-NOSVE-NEXT: stp x30, x19, [sp, #32] // 16-byte Folded Spill
97 ; NONEON-NOSVE-NEXT: mov x19, x0
98 ; NONEON-NOSVE-NEXT: add x0, sp, #24
99 ; NONEON-NOSVE-NEXT: bl def
100 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #24]
101 ; NONEON-NOSVE-NEXT: str x8, [sp]
102 ; NONEON-NOSVE-NEXT: ldr d0, [sp]
103 ; NONEON-NOSVE-NEXT: str d0, [sp, #8]
104 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #11]
105 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
106 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #9]
107 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
108 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #13]
109 ; NONEON-NOSVE-NEXT: ldrh w9, [sp, #20]
110 ; NONEON-NOSVE-NEXT: strb w8, [x19, #2]
111 ; NONEON-NOSVE-NEXT: strh w9, [x19]
112 ; NONEON-NOSVE-NEXT: ldp x30, x19, [sp, #32] // 16-byte Folded Reload
113 ; NONEON-NOSVE-NEXT: add sp, sp, #48
114 ; NONEON-NOSVE-NEXT: ret
115 %alloc = alloca [6 x i8]
116 call void @def(ptr %alloc)
117 %load = load <6 x i8>, ptr %alloc
118 %strided.vec = shufflevector <6 x i8> %load, <6 x i8> poison, <3 x i32> <i32 1, i32 3, i32 5>
119 store <3 x i8> %strided.vec, ptr %st_ptr
123 define void @alloc_v32i8(ptr %st_ptr) nounwind {
124 ; CHECK-LABEL: alloc_v32i8:
126 ; CHECK-NEXT: sub sp, sp, #48
127 ; CHECK-NEXT: stp x30, x19, [sp, #32] // 16-byte Folded Spill
128 ; CHECK-NEXT: mov x19, x0
129 ; CHECK-NEXT: mov x0, sp
131 ; CHECK-NEXT: adrp x8, .LCPI2_0
132 ; CHECK-NEXT: ldr q0, [sp]
133 ; CHECK-NEXT: ldr q1, [x8, :lo12:.LCPI2_0]
134 ; CHECK-NEXT: tbl z0.b, { z0.b }, z1.b
135 ; CHECK-NEXT: ldr q1, [sp, #16]
136 ; CHECK-NEXT: fmov w8, s1
137 ; CHECK-NEXT: strb w8, [x19, #8]
138 ; CHECK-NEXT: fmov x8, d0
139 ; CHECK-NEXT: str x8, [x19]
140 ; CHECK-NEXT: ldp x30, x19, [sp, #32] // 16-byte Folded Reload
141 ; CHECK-NEXT: add sp, sp, #48
144 ; NONEON-NOSVE-LABEL: alloc_v32i8:
145 ; NONEON-NOSVE: // %bb.0:
146 ; NONEON-NOSVE-NEXT: sub sp, sp, #112
147 ; NONEON-NOSVE-NEXT: stp x30, x19, [sp, #96] // 16-byte Folded Spill
148 ; NONEON-NOSVE-NEXT: mov x19, x0
149 ; NONEON-NOSVE-NEXT: add x0, sp, #64
150 ; NONEON-NOSVE-NEXT: bl def
151 ; NONEON-NOSVE-NEXT: ldp q0, q1, [sp, #64]
152 ; NONEON-NOSVE-NEXT: str q0, [sp]
153 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #14]
154 ; NONEON-NOSVE-NEXT: str q1, [sp, #32]
155 ; NONEON-NOSVE-NEXT: strb w8, [sp, #23]
156 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #12]
157 ; NONEON-NOSVE-NEXT: strb w8, [sp, #22]
158 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #10]
159 ; NONEON-NOSVE-NEXT: strb w8, [sp, #21]
160 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #8]
161 ; NONEON-NOSVE-NEXT: strb w8, [sp, #20]
162 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #6]
163 ; NONEON-NOSVE-NEXT: strb w8, [sp, #19]
164 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #4]
165 ; NONEON-NOSVE-NEXT: strb w8, [sp, #18]
166 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #2]
167 ; NONEON-NOSVE-NEXT: strb w8, [sp, #17]
168 ; NONEON-NOSVE-NEXT: ldrb w8, [sp]
169 ; NONEON-NOSVE-NEXT: strb w8, [sp, #16]
170 ; NONEON-NOSVE-NEXT: ldrb w8, [sp, #32]
171 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #16]
172 ; NONEON-NOSVE-NEXT: strb w8, [x19, #8]
173 ; NONEON-NOSVE-NEXT: str q0, [sp, #48]
174 ; NONEON-NOSVE-NEXT: ldr x8, [sp, #48]
175 ; NONEON-NOSVE-NEXT: str x8, [x19]
176 ; NONEON-NOSVE-NEXT: ldp x30, x19, [sp, #96] // 16-byte Folded Reload
177 ; NONEON-NOSVE-NEXT: add sp, sp, #112
178 ; NONEON-NOSVE-NEXT: ret
179 %alloc = alloca [32 x i8]
180 call void @def(ptr %alloc)
181 %load = load <32 x i8>, ptr %alloc
182 %strided.vec = shufflevector <32 x i8> %load, <32 x i8> poison, <9 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14, i32 16>
183 store <9 x i8> %strided.vec, ptr %st_ptr
188 define void @alloc_v8f64(ptr %st_ptr) nounwind {
189 ; CHECK-LABEL: alloc_v8f64:
191 ; CHECK-NEXT: sub sp, sp, #96
192 ; CHECK-NEXT: stp x20, x19, [sp, #80] // 16-byte Folded Spill
193 ; CHECK-NEXT: mov x19, x0
194 ; CHECK-NEXT: mov x0, sp
195 ; CHECK-NEXT: str x30, [sp, #64] // 8-byte Folded Spill
196 ; CHECK-NEXT: mov x20, sp
198 ; CHECK-NEXT: ptrue p0.d, vl2
199 ; CHECK-NEXT: mov x8, #4 // =0x4
200 ; CHECK-NEXT: ld2d { z0.d, z1.d }, p0/z, [x20]
201 ; CHECK-NEXT: ld2d { z2.d, z3.d }, p0/z, [x20, x8, lsl #3]
202 ; CHECK-NEXT: ldr x30, [sp, #64] // 8-byte Folded Reload
203 ; CHECK-NEXT: stp q0, q2, [x19]
204 ; CHECK-NEXT: ldp x20, x19, [sp, #80] // 16-byte Folded Reload
205 ; CHECK-NEXT: add sp, sp, #96
208 ; NONEON-NOSVE-LABEL: alloc_v8f64:
209 ; NONEON-NOSVE: // %bb.0:
210 ; NONEON-NOSVE-NEXT: sub sp, sp, #176
211 ; NONEON-NOSVE-NEXT: stp x30, x19, [sp, #160] // 16-byte Folded Spill
212 ; NONEON-NOSVE-NEXT: mov x19, x0
213 ; NONEON-NOSVE-NEXT: add x0, sp, #96
214 ; NONEON-NOSVE-NEXT: bl def
215 ; NONEON-NOSVE-NEXT: ldp q1, q0, [sp, #96]
216 ; NONEON-NOSVE-NEXT: ldp q2, q3, [sp, #128]
217 ; NONEON-NOSVE-NEXT: stp q1, q0, [sp, #48]
218 ; NONEON-NOSVE-NEXT: ldr d1, [sp, #64]
219 ; NONEON-NOSVE-NEXT: ldr d0, [sp, #48]
220 ; NONEON-NOSVE-NEXT: stp q2, q3, [sp]
221 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #80]
222 ; NONEON-NOSVE-NEXT: ldr d1, [sp, #16]
223 ; NONEON-NOSVE-NEXT: ldr d0, [sp]
224 ; NONEON-NOSVE-NEXT: stp d0, d1, [sp, #32]
225 ; NONEON-NOSVE-NEXT: ldr q1, [sp, #80]
226 ; NONEON-NOSVE-NEXT: ldr q0, [sp, #32]
227 ; NONEON-NOSVE-NEXT: stp q1, q0, [x19]
228 ; NONEON-NOSVE-NEXT: ldp x30, x19, [sp, #160] // 16-byte Folded Reload
229 ; NONEON-NOSVE-NEXT: add sp, sp, #176
230 ; NONEON-NOSVE-NEXT: ret
231 %alloc = alloca [8 x double]
232 call void @def(ptr %alloc)
233 %load = load <8 x double>, ptr %alloc
234 %strided.vec = shufflevector <8 x double> %load, <8 x double> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
235 store <4 x double> %strided.vec, ptr %st_ptr