1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp,+fp64 -mve-max-interleave-factor=4 -verify-machineinstrs %s -o - | FileCheck %s
6 define <16 x i32> *@vst4_v4i32(<4 x i32> *%src, <16 x i32> *%dst) {
7 ; CHECK-LABEL: vst4_v4i32:
8 ; CHECK: @ %bb.0: @ %entry
9 ; CHECK-NEXT: vldrw.u32 q3, [r0, #48]
10 ; CHECK-NEXT: vldrw.u32 q2, [r0, #32]
11 ; CHECK-NEXT: vldrw.u32 q1, [r0, #16]
12 ; CHECK-NEXT: vldrw.u32 q0, [r0]
13 ; CHECK-NEXT: vst40.32 {q0, q1, q2, q3}, [r1]
14 ; CHECK-NEXT: vst41.32 {q0, q1, q2, q3}, [r1]
15 ; CHECK-NEXT: vst42.32 {q0, q1, q2, q3}, [r1]
16 ; CHECK-NEXT: vst43.32 {q0, q1, q2, q3}, [r1]!
17 ; CHECK-NEXT: mov r0, r1
20 %s1 = getelementptr <4 x i32>, <4 x i32>* %src, i32 0
21 %l1 = load <4 x i32>, <4 x i32>* %s1, align 4
22 %s2 = getelementptr <4 x i32>, <4 x i32>* %src, i32 1
23 %l2 = load <4 x i32>, <4 x i32>* %s2, align 4
24 %s3 = getelementptr <4 x i32>, <4 x i32>* %src, i32 2
25 %l3 = load <4 x i32>, <4 x i32>* %s3, align 4
26 %s4 = getelementptr <4 x i32>, <4 x i32>* %src, i32 3
27 %l4 = load <4 x i32>, <4 x i32>* %s4, align 4
28 %t1 = shufflevector <4 x i32> %l1, <4 x i32> %l2, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
29 %t2 = shufflevector <4 x i32> %l3, <4 x i32> %l4, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
30 %s = shufflevector <8 x i32> %t1, <8 x i32> %t2, <16 x i32> <i32 0, i32 4, i32 8, i32 12, i32 1, i32 5, i32 9, i32 13, i32 2, i32 6, i32 10, i32 14, i32 3, i32 7, i32 11, i32 15>
31 store <16 x i32> %s, <16 x i32> *%dst
32 %ret = getelementptr inbounds <16 x i32>, <16 x i32>* %dst, i32 1
38 define <32 x i16> *@vst4_v8i16(<8 x i16> *%src, <32 x i16> *%dst) {
39 ; CHECK-LABEL: vst4_v8i16:
40 ; CHECK: @ %bb.0: @ %entry
41 ; CHECK-NEXT: vldrw.u32 q3, [r0, #48]
42 ; CHECK-NEXT: vldrw.u32 q2, [r0, #32]
43 ; CHECK-NEXT: vldrw.u32 q1, [r0, #16]
44 ; CHECK-NEXT: vldrw.u32 q0, [r0]
45 ; CHECK-NEXT: vst40.16 {q0, q1, q2, q3}, [r1]
46 ; CHECK-NEXT: vst41.16 {q0, q1, q2, q3}, [r1]
47 ; CHECK-NEXT: vst42.16 {q0, q1, q2, q3}, [r1]
48 ; CHECK-NEXT: vst43.16 {q0, q1, q2, q3}, [r1]!
49 ; CHECK-NEXT: mov r0, r1
52 %s1 = getelementptr <8 x i16>, <8 x i16>* %src, i32 0
53 %l1 = load <8 x i16>, <8 x i16>* %s1, align 4
54 %s2 = getelementptr <8 x i16>, <8 x i16>* %src, i32 1
55 %l2 = load <8 x i16>, <8 x i16>* %s2, align 4
56 %s3 = getelementptr <8 x i16>, <8 x i16>* %src, i32 2
57 %l3 = load <8 x i16>, <8 x i16>* %s3, align 4
58 %s4 = getelementptr <8 x i16>, <8 x i16>* %src, i32 3
59 %l4 = load <8 x i16>, <8 x i16>* %s4, align 4
60 %t1 = shufflevector <8 x i16> %l1, <8 x i16> %l2, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
61 %t2 = shufflevector <8 x i16> %l3, <8 x i16> %l4, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
62 %s = shufflevector <16 x i16> %t1, <16 x i16> %t2, <32 x i32> <i32 0, i32 8, i32 16, i32 24, i32 1, i32 9, i32 17, i32 25, i32 2, i32 10, i32 18, i32 26, i32 3, i32 11, i32 19, i32 27, i32 4, i32 12, i32 20, i32 28, i32 5, i32 13, i32 21, i32 29, i32 6, i32 14, i32 22, i32 30, i32 7, i32 15, i32 23, i32 31>
63 store <32 x i16> %s, <32 x i16> *%dst
64 %ret = getelementptr inbounds <32 x i16>, <32 x i16>* %dst, i32 1
70 define <64 x i8> *@vst4_v16i8(<16 x i8> *%src, <64 x i8> *%dst) {
71 ; CHECK-LABEL: vst4_v16i8:
72 ; CHECK: @ %bb.0: @ %entry
73 ; CHECK-NEXT: vldrw.u32 q3, [r0, #48]
74 ; CHECK-NEXT: vldrw.u32 q2, [r0, #32]
75 ; CHECK-NEXT: vldrw.u32 q1, [r0, #16]
76 ; CHECK-NEXT: vldrw.u32 q0, [r0]
77 ; CHECK-NEXT: vst40.8 {q0, q1, q2, q3}, [r1]
78 ; CHECK-NEXT: vst41.8 {q0, q1, q2, q3}, [r1]
79 ; CHECK-NEXT: vst42.8 {q0, q1, q2, q3}, [r1]
80 ; CHECK-NEXT: vst43.8 {q0, q1, q2, q3}, [r1]!
81 ; CHECK-NEXT: mov r0, r1
84 %s1 = getelementptr <16 x i8>, <16 x i8>* %src, i32 0
85 %l1 = load <16 x i8>, <16 x i8>* %s1, align 4
86 %s2 = getelementptr <16 x i8>, <16 x i8>* %src, i32 1
87 %l2 = load <16 x i8>, <16 x i8>* %s2, align 4
88 %s3 = getelementptr <16 x i8>, <16 x i8>* %src, i32 2
89 %l3 = load <16 x i8>, <16 x i8>* %s3, align 4
90 %s4 = getelementptr <16 x i8>, <16 x i8>* %src, i32 3
91 %l4 = load <16 x i8>, <16 x i8>* %s4, align 4
92 %t1 = shufflevector <16 x i8> %l1, <16 x i8> %l2, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
93 %t2 = shufflevector <16 x i8> %l3, <16 x i8> %l4, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
94 %s = shufflevector <32 x i8> %t1, <32 x i8> %t2, <64 x i32> <i32 0, i32 16, i32 32, i32 48, i32 1, i32 17, i32 33, i32 49, i32 2, i32 18, i32 34, i32 50, i32 3, i32 19, i32 35, i32 51, i32 4, i32 20, i32 36, i32 52, i32 5, i32 21, i32 37, i32 53, i32 6, i32 22, i32 38, i32 54, i32 7, i32 23, i32 39, i32 55, i32 8, i32 24, i32 40, i32 56, i32 9, i32 25, i32 41, i32 57, i32 10, i32 26, i32 42, i32 58, i32 11, i32 27, i32 43, i32 59, i32 12, i32 28, i32 44, i32 60, i32 13, i32 29, i32 45, i32 61, i32 14, i32 30, i32 46, i32 62, i32 15, i32 31, i32 47, i32 63>
95 store <64 x i8> %s, <64 x i8> *%dst
96 %ret = getelementptr inbounds <64 x i8>, <64 x i8>* %dst, i32 1
102 define <8 x i64> *@vst4_v2i64(<2 x i64> *%src, <8 x i64> *%dst) {
103 ; CHECK-LABEL: vst4_v2i64:
104 ; CHECK: @ %bb.0: @ %entry
105 ; CHECK-NEXT: .vsave {d8, d9}
106 ; CHECK-NEXT: vpush {d8, d9}
107 ; CHECK-NEXT: vldrw.u32 q0, [r0, #16]
108 ; CHECK-NEXT: vldrw.u32 q4, [r0]
109 ; CHECK-NEXT: vldrw.u32 q1, [r0, #48]
110 ; CHECK-NEXT: vldrw.u32 q3, [r0, #32]
111 ; CHECK-NEXT: vmov.f32 s8, s16
112 ; CHECK-NEXT: vmov.f32 s9, s17
113 ; CHECK-NEXT: vmov.f32 s10, s0
114 ; CHECK-NEXT: vmov.f32 s11, s1
115 ; CHECK-NEXT: vmov.f32 s0, s18
116 ; CHECK-NEXT: vmov.f32 s1, s19
117 ; CHECK-NEXT: vmov.f32 s18, s4
118 ; CHECK-NEXT: vstrw.32 q0, [r1, #32]
119 ; CHECK-NEXT: vmov.f32 s19, s5
120 ; CHECK-NEXT: vmov.f32 s16, s12
121 ; CHECK-NEXT: vmov.f32 s17, s13
122 ; CHECK-NEXT: vmov.f32 s4, s14
123 ; CHECK-NEXT: vstrw.32 q4, [r1, #16]
124 ; CHECK-NEXT: vmov.f32 s5, s15
125 ; CHECK-NEXT: vstrw.32 q1, [r1, #48]
126 ; CHECK-NEXT: vstrw.32 q2, [r1], #64
127 ; CHECK-NEXT: mov r0, r1
128 ; CHECK-NEXT: vpop {d8, d9}
131 %s1 = getelementptr <2 x i64>, <2 x i64>* %src, i32 0
132 %l1 = load <2 x i64>, <2 x i64>* %s1, align 4
133 %s2 = getelementptr <2 x i64>, <2 x i64>* %src, i32 1
134 %l2 = load <2 x i64>, <2 x i64>* %s2, align 4
135 %s3 = getelementptr <2 x i64>, <2 x i64>* %src, i32 2
136 %l3 = load <2 x i64>, <2 x i64>* %s3, align 4
137 %s4 = getelementptr <2 x i64>, <2 x i64>* %src, i32 3
138 %l4 = load <2 x i64>, <2 x i64>* %s4, align 4
139 %t1 = shufflevector <2 x i64> %l1, <2 x i64> %l2, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
140 %t2 = shufflevector <2 x i64> %l3, <2 x i64> %l4, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
141 %s = shufflevector <4 x i64> %t1, <4 x i64> %t2, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 1, i32 3, i32 5, i32 7>
142 store <8 x i64> %s, <8 x i64> *%dst
143 %ret = getelementptr inbounds <8 x i64>, <8 x i64>* %dst, i32 1
149 define <16 x float> *@vst4_v4f32(<4 x float> *%src, <16 x float> *%dst) {
150 ; CHECK-LABEL: vst4_v4f32:
151 ; CHECK: @ %bb.0: @ %entry
152 ; CHECK-NEXT: vldrw.u32 q3, [r0, #48]
153 ; CHECK-NEXT: vldrw.u32 q2, [r0, #32]
154 ; CHECK-NEXT: vldrw.u32 q1, [r0, #16]
155 ; CHECK-NEXT: vldrw.u32 q0, [r0]
156 ; CHECK-NEXT: vst40.32 {q0, q1, q2, q3}, [r1]
157 ; CHECK-NEXT: vst41.32 {q0, q1, q2, q3}, [r1]
158 ; CHECK-NEXT: vst42.32 {q0, q1, q2, q3}, [r1]
159 ; CHECK-NEXT: vst43.32 {q0, q1, q2, q3}, [r1]!
160 ; CHECK-NEXT: mov r0, r1
163 %s1 = getelementptr <4 x float>, <4 x float>* %src, i32 0
164 %l1 = load <4 x float>, <4 x float>* %s1, align 4
165 %s2 = getelementptr <4 x float>, <4 x float>* %src, i32 1
166 %l2 = load <4 x float>, <4 x float>* %s2, align 4
167 %s3 = getelementptr <4 x float>, <4 x float>* %src, i32 2
168 %l3 = load <4 x float>, <4 x float>* %s3, align 4
169 %s4 = getelementptr <4 x float>, <4 x float>* %src, i32 3
170 %l4 = load <4 x float>, <4 x float>* %s4, align 4
171 %t1 = shufflevector <4 x float> %l1, <4 x float> %l2, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
172 %t2 = shufflevector <4 x float> %l3, <4 x float> %l4, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
173 %s = shufflevector <8 x float> %t1, <8 x float> %t2, <16 x i32> <i32 0, i32 4, i32 8, i32 12, i32 1, i32 5, i32 9, i32 13, i32 2, i32 6, i32 10, i32 14, i32 3, i32 7, i32 11, i32 15>
174 store <16 x float> %s, <16 x float> *%dst
175 %ret = getelementptr inbounds <16 x float>, <16 x float>* %dst, i32 1
176 ret <16 x float> *%ret
181 define <32 x half> *@vst4_v8f16(<8 x half> *%src, <32 x half> *%dst) {
182 ; CHECK-LABEL: vst4_v8f16:
183 ; CHECK: @ %bb.0: @ %entry
184 ; CHECK-NEXT: vldrw.u32 q3, [r0, #48]
185 ; CHECK-NEXT: vldrw.u32 q2, [r0, #32]
186 ; CHECK-NEXT: vldrw.u32 q1, [r0, #16]
187 ; CHECK-NEXT: vldrw.u32 q0, [r0]
188 ; CHECK-NEXT: vst40.16 {q0, q1, q2, q3}, [r1]
189 ; CHECK-NEXT: vst41.16 {q0, q1, q2, q3}, [r1]
190 ; CHECK-NEXT: vst42.16 {q0, q1, q2, q3}, [r1]
191 ; CHECK-NEXT: vst43.16 {q0, q1, q2, q3}, [r1]!
192 ; CHECK-NEXT: mov r0, r1
195 %s1 = getelementptr <8 x half>, <8 x half>* %src, i32 0
196 %l1 = load <8 x half>, <8 x half>* %s1, align 4
197 %s2 = getelementptr <8 x half>, <8 x half>* %src, i32 1
198 %l2 = load <8 x half>, <8 x half>* %s2, align 4
199 %s3 = getelementptr <8 x half>, <8 x half>* %src, i32 2
200 %l3 = load <8 x half>, <8 x half>* %s3, align 4
201 %s4 = getelementptr <8 x half>, <8 x half>* %src, i32 3
202 %l4 = load <8 x half>, <8 x half>* %s4, align 4
203 %t1 = shufflevector <8 x half> %l1, <8 x half> %l2, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
204 %t2 = shufflevector <8 x half> %l3, <8 x half> %l4, <16 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>
205 %s = shufflevector <16 x half> %t1, <16 x half> %t2, <32 x i32> <i32 0, i32 8, i32 16, i32 24, i32 1, i32 9, i32 17, i32 25, i32 2, i32 10, i32 18, i32 26, i32 3, i32 11, i32 19, i32 27, i32 4, i32 12, i32 20, i32 28, i32 5, i32 13, i32 21, i32 29, i32 6, i32 14, i32 22, i32 30, i32 7, i32 15, i32 23, i32 31>
206 store <32 x half> %s, <32 x half> *%dst
207 %ret = getelementptr inbounds <32 x half>, <32 x half>* %dst, i32 1
208 ret <32 x half> *%ret
213 define <8 x double> *@vst4_v2f64(<2 x double> *%src, <8 x double> *%dst) {
214 ; CHECK-LABEL: vst4_v2f64:
215 ; CHECK: @ %bb.0: @ %entry
216 ; CHECK-NEXT: .vsave {d8, d9}
217 ; CHECK-NEXT: vpush {d8, d9}
218 ; CHECK-NEXT: vldrw.u32 q0, [r0, #16]
219 ; CHECK-NEXT: vldrw.u32 q3, [r0]
220 ; CHECK-NEXT: vldrw.u32 q2, [r0, #48]
221 ; CHECK-NEXT: vldrw.u32 q4, [r0, #32]
222 ; CHECK-NEXT: vmov.f64 d2, d6
223 ; CHECK-NEXT: vmov.f64 d3, d0
224 ; CHECK-NEXT: vmov.f64 d0, d7
225 ; CHECK-NEXT: vmov.f64 d7, d4
226 ; CHECK-NEXT: vstrw.32 q0, [r1, #32]
227 ; CHECK-NEXT: vmov.f64 d6, d8
228 ; CHECK-NEXT: vmov.f64 d4, d9
229 ; CHECK-NEXT: vstrw.32 q3, [r1, #16]
230 ; CHECK-NEXT: vstrw.32 q2, [r1, #48]
231 ; CHECK-NEXT: vstrw.32 q1, [r1], #64
232 ; CHECK-NEXT: mov r0, r1
233 ; CHECK-NEXT: vpop {d8, d9}
236 %s1 = getelementptr <2 x double>, <2 x double>* %src, i32 0
237 %l1 = load <2 x double>, <2 x double>* %s1, align 4
238 %s2 = getelementptr <2 x double>, <2 x double>* %src, i32 1
239 %l2 = load <2 x double>, <2 x double>* %s2, align 4
240 %s3 = getelementptr <2 x double>, <2 x double>* %src, i32 2
241 %l3 = load <2 x double>, <2 x double>* %s3, align 4
242 %s4 = getelementptr <2 x double>, <2 x double>* %src, i32 3
243 %l4 = load <2 x double>, <2 x double>* %s4, align 4
244 %t1 = shufflevector <2 x double> %l1, <2 x double> %l2, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
245 %t2 = shufflevector <2 x double> %l3, <2 x double> %l4, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
246 %s = shufflevector <4 x double> %t1, <4 x double> %t2, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 1, i32 3, i32 5, i32 7>
247 store <8 x double> %s, <8 x double> *%dst
248 %ret = getelementptr inbounds <8 x double>, <8 x double>* %dst, i32 1
249 ret <8 x double> *%ret