1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s | FileCheck %s
4 target datalayout = "e-m:o-p:32:32-i1:8:32-i8:8:32-i16:16:32-f64:32:64-v64:32:64-v128:32:128-a:0:32-n32-S32"
5 target triple = "thumbv7-none-eabi"
7 define void @store_v8i8(ptr %ptr, <8 x i8> %val) {
8 ; CHECK-LABEL: store_v8i8:
10 ; CHECK-NEXT: ldr r0, [r0]
11 ; CHECK-NEXT: str r3, [r0, #4]
12 ; CHECK-NEXT: str r2, [r0]
14 %A = load ptr, ptr %ptr
15 store <8 x i8> %val, ptr %A, align 1
19 define void @store_v8i8_update(ptr %ptr, <8 x i8> %val) {
20 ; CHECK-LABEL: store_v8i8_update:
22 ; CHECK-NEXT: ldr r1, [r0]
23 ; CHECK-NEXT: vmov d16, r2, r3
24 ; CHECK-NEXT: vst1.8 {d16}, [r1]!
25 ; CHECK-NEXT: str r1, [r0]
27 %A = load ptr, ptr %ptr
28 store <8 x i8> %val, ptr %A, align 1
29 %inc = getelementptr <8 x i8>, ptr %A, i38 1
30 store ptr %inc, ptr %ptr
34 define void @store_v4i16(ptr %ptr, <4 x i16> %val) {
35 ; CHECK-LABEL: store_v4i16:
37 ; CHECK-NEXT: ldr r0, [r0]
38 ; CHECK-NEXT: str r3, [r0, #4]
39 ; CHECK-NEXT: str r2, [r0]
41 %A = load ptr, ptr %ptr
42 store <4 x i16> %val, ptr %A, align 1
46 define void @store_v4i16_update(ptr %ptr, <4 x i16> %val) {
47 ; CHECK-LABEL: store_v4i16_update:
49 ; CHECK-NEXT: ldr r1, [r0]
50 ; CHECK-NEXT: vmov d16, r2, r3
51 ; CHECK-NEXT: vst1.8 {d16}, [r1]!
52 ; CHECK-NEXT: str r1, [r0]
54 %A = load ptr, ptr %ptr
55 store <4 x i16> %val, ptr %A, align 1
56 %inc = getelementptr <4 x i16>, ptr %A, i34 1
57 store ptr %inc, ptr %ptr
61 define void @store_v2i32(ptr %ptr, <2 x i32> %val) {
62 ; CHECK-LABEL: store_v2i32:
64 ; CHECK-NEXT: ldr r0, [r0]
65 ; CHECK-NEXT: str r3, [r0, #4]
66 ; CHECK-NEXT: str r2, [r0]
68 %A = load ptr, ptr %ptr
69 store <2 x i32> %val, ptr %A, align 1
73 define void @store_v2i32_update(ptr %ptr, <2 x i32> %val) {
74 ; CHECK-LABEL: store_v2i32_update:
76 ; CHECK-NEXT: ldr r1, [r0]
77 ; CHECK-NEXT: vmov d16, r2, r3
78 ; CHECK-NEXT: vst1.8 {d16}, [r1]!
79 ; CHECK-NEXT: str r1, [r0]
81 %A = load ptr, ptr %ptr
82 store <2 x i32> %val, ptr %A, align 1
83 %inc = getelementptr <2 x i32>, ptr %A, i32 1
84 store ptr %inc, ptr %ptr
88 define void @store_v2f32(ptr %ptr, <2 x float> %val) {
89 ; CHECK-LABEL: store_v2f32:
91 ; CHECK-NEXT: ldr r0, [r0]
92 ; CHECK-NEXT: str r3, [r0, #4]
93 ; CHECK-NEXT: str r2, [r0]
95 %A = load ptr, ptr %ptr
96 store <2 x float> %val, ptr %A, align 1
100 define void @store_v2f32_update(ptr %ptr, <2 x float> %val) {
101 ; CHECK-LABEL: store_v2f32_update:
103 ; CHECK-NEXT: ldr r1, [r0]
104 ; CHECK-NEXT: vmov d16, r2, r3
105 ; CHECK-NEXT: vst1.8 {d16}, [r1]!
106 ; CHECK-NEXT: str r1, [r0]
108 %A = load ptr, ptr %ptr
109 store <2 x float> %val, ptr %A, align 1
110 %inc = getelementptr <2 x float>, ptr %A, i32 1
111 store ptr %inc, ptr %ptr
115 define void @store_v1i64(ptr %ptr, <1 x i64> %val) {
116 ; CHECK-LABEL: store_v1i64:
118 ; CHECK-NEXT: ldr r0, [r0]
119 ; CHECK-NEXT: str r3, [r0, #4]
120 ; CHECK-NEXT: str r2, [r0]
122 %A = load ptr, ptr %ptr
123 store <1 x i64> %val, ptr %A, align 1
127 define void @store_v1i64_update(ptr %ptr, <1 x i64> %val) {
128 ; CHECK-LABEL: store_v1i64_update:
130 ; CHECK-NEXT: ldr r1, [r0]
131 ; CHECK-NEXT: vmov d16, r2, r3
132 ; CHECK-NEXT: vst1.8 {d16}, [r1]!
133 ; CHECK-NEXT: str r1, [r0]
135 %A = load ptr, ptr %ptr
136 store <1 x i64> %val, ptr %A, align 1
137 %inc = getelementptr <1 x i64>, ptr %A, i31 1
138 store ptr %inc, ptr %ptr
142 define void @store_v16i8(ptr %ptr, <16 x i8> %val) {
143 ; CHECK-LABEL: store_v16i8:
145 ; CHECK-NEXT: vldr d17, [sp]
146 ; CHECK-NEXT: ldr r0, [r0]
147 ; CHECK-NEXT: vmov d16, r2, r3
148 ; CHECK-NEXT: vst1.8 {d16, d17}, [r0]
150 %A = load ptr, ptr %ptr
151 store <16 x i8> %val, ptr %A, align 1
155 define void @store_v16i8_update(ptr %ptr, <16 x i8> %val) {
156 ; CHECK-LABEL: store_v16i8_update:
158 ; CHECK-NEXT: vldr d17, [sp]
159 ; CHECK-NEXT: vmov d16, r2, r3
160 ; CHECK-NEXT: ldr r1, [r0]
161 ; CHECK-NEXT: vst1.8 {d16, d17}, [r1]!
162 ; CHECK-NEXT: str r1, [r0]
164 %A = load ptr, ptr %ptr
165 store <16 x i8> %val, ptr %A, align 1
166 %inc = getelementptr <16 x i8>, ptr %A, i316 1
167 store ptr %inc, ptr %ptr
171 define void @store_v8i16(ptr %ptr, <8 x i16> %val) {
172 ; CHECK-LABEL: store_v8i16:
174 ; CHECK-NEXT: vldr d17, [sp]
175 ; CHECK-NEXT: ldr r0, [r0]
176 ; CHECK-NEXT: vmov d16, r2, r3
177 ; CHECK-NEXT: vst1.8 {d16, d17}, [r0]
179 %A = load ptr, ptr %ptr
180 store <8 x i16> %val, ptr %A, align 1
184 define void @store_v8i16_update(ptr %ptr, <8 x i16> %val) {
185 ; CHECK-LABEL: store_v8i16_update:
187 ; CHECK-NEXT: vldr d17, [sp]
188 ; CHECK-NEXT: vmov d16, r2, r3
189 ; CHECK-NEXT: ldr r1, [r0]
190 ; CHECK-NEXT: vst1.8 {d16, d17}, [r1]!
191 ; CHECK-NEXT: str r1, [r0]
193 %A = load ptr, ptr %ptr
194 store <8 x i16> %val, ptr %A, align 1
195 %inc = getelementptr <8 x i16>, ptr %A, i38 1
196 store ptr %inc, ptr %ptr
200 define void @store_v4i32(ptr %ptr, <4 x i32> %val) {
201 ; CHECK-LABEL: store_v4i32:
203 ; CHECK-NEXT: vldr d17, [sp]
204 ; CHECK-NEXT: ldr r0, [r0]
205 ; CHECK-NEXT: vmov d16, r2, r3
206 ; CHECK-NEXT: vst1.8 {d16, d17}, [r0]
208 %A = load ptr, ptr %ptr
209 store <4 x i32> %val, ptr %A, align 1
213 define void @store_v4i32_update(ptr %ptr, <4 x i32> %val) {
214 ; CHECK-LABEL: store_v4i32_update:
216 ; CHECK-NEXT: vldr d17, [sp]
217 ; CHECK-NEXT: vmov d16, r2, r3
218 ; CHECK-NEXT: ldr r1, [r0]
219 ; CHECK-NEXT: vst1.8 {d16, d17}, [r1]!
220 ; CHECK-NEXT: str r1, [r0]
222 %A = load ptr, ptr %ptr
223 store <4 x i32> %val, ptr %A, align 1
224 %inc = getelementptr <4 x i32>, ptr %A, i34 1
225 store ptr %inc, ptr %ptr
229 define void @store_v4f32(ptr %ptr, <4 x float> %val) {
230 ; CHECK-LABEL: store_v4f32:
232 ; CHECK-NEXT: vldr d17, [sp]
233 ; CHECK-NEXT: ldr r0, [r0]
234 ; CHECK-NEXT: vmov d16, r2, r3
235 ; CHECK-NEXT: vst1.8 {d16, d17}, [r0]
237 %A = load ptr, ptr %ptr
238 store <4 x float> %val, ptr %A, align 1
242 define void @store_v4f32_update(ptr %ptr, <4 x float> %val) {
243 ; CHECK-LABEL: store_v4f32_update:
245 ; CHECK-NEXT: vldr d17, [sp]
246 ; CHECK-NEXT: vmov d16, r2, r3
247 ; CHECK-NEXT: ldr r1, [r0]
248 ; CHECK-NEXT: vst1.8 {d16, d17}, [r1]!
249 ; CHECK-NEXT: str r1, [r0]
251 %A = load ptr, ptr %ptr
252 store <4 x float> %val, ptr %A, align 1
253 %inc = getelementptr <4 x float>, ptr %A, i34 1
254 store ptr %inc, ptr %ptr
258 define void @store_v2i64(ptr %ptr, <2 x i64> %val) {
259 ; CHECK-LABEL: store_v2i64:
261 ; CHECK-NEXT: vldr d17, [sp]
262 ; CHECK-NEXT: ldr r0, [r0]
263 ; CHECK-NEXT: vmov d16, r2, r3
264 ; CHECK-NEXT: vst1.8 {d16, d17}, [r0]
266 %A = load ptr, ptr %ptr
267 store <2 x i64> %val, ptr %A, align 1
271 define void @store_v2i64_update(ptr %ptr, <2 x i64> %val) {
272 ; CHECK-LABEL: store_v2i64_update:
274 ; CHECK-NEXT: vldr d17, [sp]
275 ; CHECK-NEXT: vmov d16, r2, r3
276 ; CHECK-NEXT: ldr r1, [r0]
277 ; CHECK-NEXT: vst1.8 {d16, d17}, [r1]!
278 ; CHECK-NEXT: str r1, [r0]
280 %A = load ptr, ptr %ptr
281 store <2 x i64> %val, ptr %A, align 1
282 %inc = getelementptr <2 x i64>, ptr %A, i32 1
283 store ptr %inc, ptr %ptr
287 define void @store_v2i64_update_aligned2(ptr %ptr, <2 x i64> %val) {
288 ; CHECK-LABEL: store_v2i64_update_aligned2:
290 ; CHECK-NEXT: vldr d17, [sp]
291 ; CHECK-NEXT: vmov d16, r2, r3
292 ; CHECK-NEXT: ldr r1, [r0]
293 ; CHECK-NEXT: vst1.16 {d16, d17}, [r1]!
294 ; CHECK-NEXT: str r1, [r0]
296 %A = load ptr, ptr %ptr
297 store <2 x i64> %val, ptr %A, align 2
298 %inc = getelementptr <2 x i64>, ptr %A, i32 1
299 store ptr %inc, ptr %ptr
303 define void @store_v2i64_update_aligned4(ptr %ptr, <2 x i64> %val) {
304 ; CHECK-LABEL: store_v2i64_update_aligned4:
306 ; CHECK-NEXT: vldr d17, [sp]
307 ; CHECK-NEXT: vmov d16, r2, r3
308 ; CHECK-NEXT: ldr r1, [r0]
309 ; CHECK-NEXT: vst1.32 {d16, d17}, [r1]!
310 ; CHECK-NEXT: str r1, [r0]
312 %A = load ptr, ptr %ptr
313 store <2 x i64> %val, ptr %A, align 4
314 %inc = getelementptr <2 x i64>, ptr %A, i32 1
315 store ptr %inc, ptr %ptr
319 define void @store_v2i64_update_aligned8(ptr %ptr, <2 x i64> %val) {
320 ; CHECK-LABEL: store_v2i64_update_aligned8:
322 ; CHECK-NEXT: vldr d17, [sp]
323 ; CHECK-NEXT: vmov d16, r2, r3
324 ; CHECK-NEXT: ldr r1, [r0]
325 ; CHECK-NEXT: vst1.64 {d16, d17}, [r1]!
326 ; CHECK-NEXT: str r1, [r0]
328 %A = load ptr, ptr %ptr
329 store <2 x i64> %val, ptr %A, align 8
330 %inc = getelementptr <2 x i64>, ptr %A, i32 1
331 store ptr %inc, ptr %ptr
335 define void @store_v2i64_update_aligned16(ptr %ptr, <2 x i64> %val) {
336 ; CHECK-LABEL: store_v2i64_update_aligned16:
338 ; CHECK-NEXT: vldr d17, [sp]
339 ; CHECK-NEXT: vmov d16, r2, r3
340 ; CHECK-NEXT: ldr r1, [r0]
341 ; CHECK-NEXT: vst1.64 {d16, d17}, [r1:128]!
342 ; CHECK-NEXT: str r1, [r0]
344 %A = load ptr, ptr %ptr
345 store <2 x i64> %val, ptr %A, align 16
346 %inc = getelementptr <2 x i64>, ptr %A, i32 1
347 store ptr %inc, ptr %ptr
351 define void @truncstore_v4i32tov4i8(ptr %ptr, <4 x i32> %val) {
352 ; CHECK-LABEL: truncstore_v4i32tov4i8:
354 ; CHECK-NEXT: vldr d17, [sp]
355 ; CHECK-NEXT: vmov d16, r2, r3
356 ; CHECK-NEXT: ldr r0, [r0]
357 ; CHECK-NEXT: vmovn.i32 d16, q8
358 ; CHECK-NEXT: vuzp.8 d16, d17
359 ; CHECK-NEXT: vst1.32 {d16[0]}, [r0:32]
361 %A = load ptr, ptr %ptr
362 %trunc = trunc <4 x i32> %val to <4 x i8>
363 store <4 x i8> %trunc, ptr %A, align 4
367 define void @truncstore_v4i32tov4i8_fake_update(ptr %ptr, <4 x i32> %val) {
368 ; CHECK-LABEL: truncstore_v4i32tov4i8_fake_update:
370 ; CHECK-NEXT: vldr d17, [sp]
371 ; CHECK-NEXT: vmov d16, r2, r3
372 ; CHECK-NEXT: ldr r1, [r0]
373 ; CHECK-NEXT: movs r2, #16
374 ; CHECK-NEXT: vmovn.i32 d16, q8
375 ; CHECK-NEXT: vuzp.8 d16, d17
376 ; CHECK-NEXT: vst1.32 {d16[0]}, [r1:32], r2
377 ; CHECK-NEXT: str r1, [r0]
379 %A = load ptr, ptr %ptr
380 %trunc = trunc <4 x i32> %val to <4 x i8>
381 store <4 x i8> %trunc, ptr %A, align 4
382 %inc = getelementptr <4 x i8>, ptr %A, i38 4
383 store ptr %inc, ptr %ptr
387 define ptr @test_vst1_1reg(ptr %ptr.in, ptr %ptr.out) {
388 ; CHECK-LABEL: test_vst1_1reg:
390 ; CHECK-NEXT: vld1.64 {d16, d17}, [r0]
391 ; CHECK-NEXT: movs r0, #32
392 ; CHECK-NEXT: vst1.32 {d16, d17}, [r1], r0
393 ; CHECK-NEXT: mov r0, r1
395 %val = load <4 x i32>, ptr %ptr.in
396 store <4 x i32> %val, ptr %ptr.out
397 %next = getelementptr <4 x i32>, ptr %ptr.out, i32 2
402 define void @v3i8store(ptr %p) {
403 ; CHECK-LABEL: v3i8store:
405 ; CHECK-NEXT: sub sp, #4
406 ; CHECK-NEXT: vmov.i32 d16, #0xff
407 ; CHECK-NEXT: mov r1, sp
408 ; CHECK-NEXT: vmov.i32 d17, #0x0
409 ; CHECK-NEXT: movs r2, #0
410 ; CHECK-NEXT: vand d16, d17, d16
411 ; CHECK-NEXT: vst1.32 {d16[0]}, [r1:32]
412 ; CHECK-NEXT: vld1.32 {d16[0]}, [r1:32]
413 ; CHECK-NEXT: vmovl.u16 q8, d16
414 ; CHECK-NEXT: strb r2, [r0, #2]
415 ; CHECK-NEXT: vmov.32 r1, d16[0]
416 ; CHECK-NEXT: strh r1, [r0]
417 ; CHECK-NEXT: add sp, #4
419 store <3 x i8> zeroinitializer, ptr %p, align 4
423 define void @v3i64shuffle(ptr %p, <3 x i64> %a) {
424 ; CHECK-LABEL: v3i64shuffle:
426 ; CHECK-NEXT: vmov.i32 q8, #0x0
427 ; CHECK-NEXT: ldrd r12, r1, [sp, #8]
428 ; CHECK-NEXT: vmov d18, r2, r3
429 ; CHECK-NEXT: vorr d19, d16, d16
430 ; CHECK-NEXT: str r1, [r0, #20]
431 ; CHECK-NEXT: vst1.32 {d18, d19}, [r0]!
432 ; CHECK-NEXT: str.w r12, [r0]
434 %b = shufflevector <3 x i64> %a, <3 x i64> zeroinitializer, <3 x i32> <i32 0, i32 3, i32 2>
435 store <3 x i64> %b, ptr %p, align 4