xref: /llvm-project/llvm/test/CodeGen/ARM/unaligned_load_store_vector.ll (revision bed1c7f061aa12417aa081e334afdba45767b938)
1;RUN: llc -mtriple=arm-eabi -mattr=+v7 -mattr=+neon %s -o - | FileCheck %s
2
3;ALIGN = 1
4;SIZE  = 64
5;TYPE  = <8 x i8>
6define void @v64_v8i8_1(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
7;CHECK-LABEL: v64_v8i8_1:
8entry:
9;CHECK: vld1.8
10  %v1 = load  <8 x i8>,  ptr %in, align 1
11;CHECK: vst1.8
12  store <8 x i8> %v1, ptr %out, align 1
13  ret void
14}
15
16
17;ALIGN = 1
18;SIZE  = 64
19;TYPE  = <4 x i16>
20define void @v64_v4i16_1(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
21;CHECK-LABEL: v64_v4i16_1:
22entry:
23;CHECK: vld1.8
24  %v1 = load  <4 x i16>,  ptr %in, align 1
25;CHECK: vst1.8
26  store <4 x i16> %v1, ptr %out, align 1
27  ret void
28}
29
30
31;ALIGN = 1
32;SIZE  = 64
33;TYPE  = <2 x i32>
34define void @v64_v2i32_1(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
35;CHECK-LABEL: v64_v2i32_1:
36entry:
37;CHECK: vld1.8
38  %v1 = load  <2 x i32>,  ptr %in, align 1
39;CHECK: vst1.8
40  store <2 x i32> %v1, ptr %out, align 1
41  ret void
42}
43
44
45;ALIGN = 1
46;SIZE  = 64
47;TYPE  = <2 x float>
48define void @v64_v2f32_1(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
49;CHECK-LABEL: v64_v2f32_1:
50entry:
51;CHECK: vld1.8
52  %v1 = load  <2 x float>,  ptr %in, align 1
53;CHECK: vst1.8
54  store <2 x float> %v1, ptr %out, align 1
55  ret void
56}
57
58
59;ALIGN = 1
60;SIZE  = 128
61;TYPE  = <16 x i8>
62define void @v128_v16i8_1(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
63;CHECK-LABEL: v128_v16i8_1:
64entry:
65;CHECK: vld1.8
66  %v1 = load  <16 x i8>,  ptr %in, align 1
67;CHECK: vst1.8
68  store <16 x i8> %v1, ptr %out, align 1
69  ret void
70}
71
72
73;ALIGN = 1
74;SIZE  = 128
75;TYPE  = <8 x i16>
76define void @v128_v8i16_1(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
77;CHECK-LABEL: v128_v8i16_1:
78entry:
79;CHECK: vld1.8
80  %v1 = load  <8 x i16>,  ptr %in, align 1
81;CHECK: vst1.8
82  store <8 x i16> %v1, ptr %out, align 1
83  ret void
84}
85
86
87;ALIGN = 1
88;SIZE  = 128
89;TYPE  = <4 x i32>
90define void @v128_v4i32_1(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
91;CHECK-LABEL: v128_v4i32_1:
92entry:
93;CHECK: vld1.8
94  %v1 = load  <4 x i32>,  ptr %in, align 1
95;CHECK: vst1.8
96  store <4 x i32> %v1, ptr %out, align 1
97  ret void
98}
99
100
101;ALIGN = 1
102;SIZE  = 128
103;TYPE  = <2 x i64>
104define void @v128_v2i64_1(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
105;CHECK-LABEL: v128_v2i64_1:
106entry:
107;CHECK: vld1.8
108  %v1 = load  <2 x i64>,  ptr %in, align 1
109;CHECK: vst1.8
110  store <2 x i64> %v1, ptr %out, align 1
111  ret void
112}
113
114
115;ALIGN = 1
116;SIZE  = 128
117;TYPE  = <4 x float>
118define void @v128_v4f32_1(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
119;CHECK-LABEL: v128_v4f32_1:
120entry:
121;CHECK: vld1.8
122  %v1 = load  <4 x float>,  ptr %in, align 1
123;CHECK: vst1.8
124  store <4 x float> %v1, ptr %out, align 1
125  ret void
126}
127
128
129;ALIGN = 2
130;SIZE  = 64
131;TYPE  = <8 x i8>
132define void @v64_v8i8_2(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
133;CHECK-LABEL: v64_v8i8_2:
134entry:
135;CHECK: vld1.16
136  %v1 = load  <8 x i8>,  ptr %in, align 2
137;CHECK: vst1.16
138  store <8 x i8> %v1, ptr %out, align 2
139  ret void
140}
141
142
143;ALIGN = 2
144;SIZE  = 64
145;TYPE  = <4 x i16>
146define void @v64_v4i16_2(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
147;CHECK-LABEL: v64_v4i16_2:
148entry:
149;CHECK: vld1.16
150  %v1 = load  <4 x i16>,  ptr %in, align 2
151;CHECK: vst1.16
152  store <4 x i16> %v1, ptr %out, align 2
153  ret void
154}
155
156
157;ALIGN = 2
158;SIZE  = 64
159;TYPE  = <2 x i32>
160define void @v64_v2i32_2(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
161;CHECK-LABEL: v64_v2i32_2:
162entry:
163;CHECK: vld1.16
164  %v1 = load  <2 x i32>,  ptr %in, align 2
165;CHECK: vst1.16
166  store <2 x i32> %v1, ptr %out, align 2
167  ret void
168}
169
170
171;ALIGN = 2
172;SIZE  = 64
173;TYPE  = <2 x float>
174define void @v64_v2f32_2(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
175;CHECK-LABEL: v64_v2f32_2:
176entry:
177;CHECK: vld1.16
178  %v1 = load  <2 x float>,  ptr %in, align 2
179;CHECK: vst1.16
180  store <2 x float> %v1, ptr %out, align 2
181  ret void
182}
183
184
185;ALIGN = 2
186;SIZE  = 128
187;TYPE  = <16 x i8>
188define void @v128_v16i8_2(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
189;CHECK-LABEL: v128_v16i8_2:
190entry:
191;CHECK: vld1.16
192  %v1 = load  <16 x i8>,  ptr %in, align 2
193;CHECK: vst1.16
194  store <16 x i8> %v1, ptr %out, align 2
195  ret void
196}
197
198
199;ALIGN = 2
200;SIZE  = 128
201;TYPE  = <8 x i16>
202define void @v128_v8i16_2(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
203;CHECK-LABEL: v128_v8i16_2:
204entry:
205;CHECK: vld1.16
206  %v1 = load  <8 x i16>,  ptr %in, align 2
207;CHECK: vst1.16
208  store <8 x i16> %v1, ptr %out, align 2
209  ret void
210}
211
212
213;ALIGN = 2
214;SIZE  = 128
215;TYPE  = <4 x i32>
216define void @v128_v4i32_2(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
217;CHECK-LABEL: v128_v4i32_2:
218entry:
219;CHECK: vld1.16
220  %v1 = load  <4 x i32>,  ptr %in, align 2
221;CHECK: vst1.16
222  store <4 x i32> %v1, ptr %out, align 2
223  ret void
224}
225
226
227;ALIGN = 2
228;SIZE  = 128
229;TYPE  = <2 x i64>
230define void @v128_v2i64_2(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
231;CHECK-LABEL: v128_v2i64_2:
232entry:
233;CHECK: vld1.16
234  %v1 = load  <2 x i64>,  ptr %in, align 2
235;CHECK: vst1.16
236  store <2 x i64> %v1, ptr %out, align 2
237  ret void
238}
239
240
241;ALIGN = 2
242;SIZE  = 128
243;TYPE  = <4 x float>
244define void @v128_v4f32_2(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
245;CHECK-LABEL: v128_v4f32_2:
246entry:
247;CHECK: vld1.16
248  %v1 = load  <4 x float>,  ptr %in, align 2
249;CHECK: vst1.16
250  store <4 x float> %v1, ptr %out, align 2
251  ret void
252}
253
254
255;ALIGN = 4
256;SIZE  = 64
257;TYPE  = <8 x i8>
258define void @v64_v8i8_4(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
259;CHECK-LABEL: v64_v8i8_4:
260entry:
261;CHECK: vldr
262  %v1 = load  <8 x i8>,  ptr %in, align 4
263;CHECK: vstr
264  store <8 x i8> %v1, ptr %out, align 4
265  ret void
266}
267
268
269;ALIGN = 4
270;SIZE  = 64
271;TYPE  = <4 x i16>
272define void @v64_v4i16_4(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
273;CHECK-LABEL: v64_v4i16_4:
274entry:
275;CHECK: vldr
276  %v1 = load  <4 x i16>,  ptr %in, align 4
277;CHECK: vstr
278  store <4 x i16> %v1, ptr %out, align 4
279  ret void
280}
281
282
283;ALIGN = 4
284;SIZE  = 64
285;TYPE  = <2 x i32>
286define void @v64_v2i32_4(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
287;CHECK-LABEL: v64_v2i32_4:
288entry:
289;CHECK: vldr
290  %v1 = load  <2 x i32>,  ptr %in, align 4
291;CHECK: vstr
292  store <2 x i32> %v1, ptr %out, align 4
293  ret void
294}
295
296
297;ALIGN = 4
298;SIZE  = 64
299;TYPE  = <2 x float>
300define void @v64_v2f32_4(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
301;CHECK-LABEL: v64_v2f32_4:
302entry:
303;CHECK: vldr
304  %v1 = load  <2 x float>,  ptr %in, align 4
305;CHECK: vstr
306  store <2 x float> %v1, ptr %out, align 4
307  ret void
308}
309
310
311;ALIGN = 4
312;SIZE  = 128
313;TYPE  = <16 x i8>
314define void @v128_v16i8_4(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
315;CHECK-LABEL: v128_v16i8_4:
316entry:
317;CHECK: vld1.32
318  %v1 = load  <16 x i8>,  ptr %in, align 4
319;CHECK: vst1.32
320  store <16 x i8> %v1, ptr %out, align 4
321  ret void
322}
323
324
325;ALIGN = 4
326;SIZE  = 128
327;TYPE  = <8 x i16>
328define void @v128_v8i16_4(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
329;CHECK-LABEL: v128_v8i16_4:
330entry:
331;CHECK: vld1.32
332  %v1 = load  <8 x i16>,  ptr %in, align 4
333;CHECK: vst1.32
334  store <8 x i16> %v1, ptr %out, align 4
335  ret void
336}
337
338
339;ALIGN = 4
340;SIZE  = 128
341;TYPE  = <4 x i32>
342define void @v128_v4i32_4(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
343;CHECK-LABEL: v128_v4i32_4:
344entry:
345;CHECK: vld1.32
346  %v1 = load  <4 x i32>,  ptr %in, align 4
347;CHECK: vst1.32
348  store <4 x i32> %v1, ptr %out, align 4
349  ret void
350}
351
352
353;ALIGN = 4
354;SIZE  = 128
355;TYPE  = <2 x i64>
356define void @v128_v2i64_4(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
357;CHECK-LABEL: v128_v2i64_4:
358entry:
359;CHECK: vld1.32
360  %v1 = load  <2 x i64>,  ptr %in, align 4
361;CHECK: vst1.32
362  store <2 x i64> %v1, ptr %out, align 4
363  ret void
364}
365
366
367;ALIGN = 4
368;SIZE  = 128
369;TYPE  = <4 x float>
370define void @v128_v4f32_4(ptr noalias nocapture %out, ptr noalias nocapture %in) nounwind {
371;CHECK-LABEL: v128_v4f32_4:
372entry:
373;CHECK: vld1.32
374  %v1 = load  <4 x float>,  ptr %in, align 4
375;CHECK: vst1.32
376  store <4 x float> %v1, ptr %out, align 4
377  ret void
378}
379
380define void @test_weird_type(<3 x double> %in, ptr %ptr) {
381; CHECK-LABEL: test_weird_type:
382; CHECK: vst1
383
384  %vec.int = bitcast <3 x double> %in to <3 x i64>
385  store <3 x i64> %vec.int, ptr %ptr, align 8
386  ret void
387}
388