Debian Codegraph @

gcc/testsuite/gcc.target/arm/mve/mve_store_memory_modes.c

raw
1 /* { dg-require-effective-target arm_v8_1m_mve_fp_ok } */
2 /* { dg-add-options arm_v8_1m_mve_fp } */
3 /* { dg-additional-options "-O2" } */
4 /* { dg-final { check-function-bodies "**" "" } } */
5
6 #include "arm_mve.h"
7 /*
8 **off_store8_0:
9 ** ...
10 ** vstrb.8 q[0-7], \[r0, #16\]
11 ** ...
12 */
13 uint8_t *off_store8_0 (uint8_t * a, uint8x16_t v)
14 {
15 vst1q_u8 (a + 16, v);
16 return a;
17 }
18
19 /*
20 **off_store8_1:
21 ** ...
22 ** vstrb.16 q[0-7], \[r0, #-1\]
23 ** ...
24 */
25 int8_t *off_store8_1 (int8_t * a, int16x8_t v)
26 {
27 vstrbq_s16 (a - 1, v);
28 return a;
29 }
30
31 /*
32 **off_store8_2:
33 ** ...
34 ** vstrb.32 q[0-7], \[r0, #-127\]
35 ** ...
36 */
37 uint8_t *off_store8_2 (uint8_t * a, uint32x4_t v)
38 {
39 vstrbq_u32 (a - 127, v);
40 return a;
41 }
42
43 /*
44 **off_store8_3:
45 ** ...
46 ** vstrb.8 q[0-7], \[r0, #127\]
47 ** ...
48 */
49 int8_t *off_store8_3 (int8_t * a, int8x16_t v)
50 {
51 vstrbq_s8 (a + 127, v);
52 return a;
53 }
54
55 /*
56 **not_off_store8_0:
57 ** ...
58 ** vstrb.8 q[0-7], \[r[0-7]+\]
59 ** ...
60 */
61 uint8_t *not_off_store8_0 (uint8_t * a, uint8x16_t v)
62 {
63 vst1q_u8 (a - 128, v);
64 return a;
65 }
66
67 /*
68 **off_storefp16_0:
69 ** ...
70 ** vstrh.16 q[0-7], \[r0, #250\]
71 ** ...
72 */
73 float16_t *off_storefp16_0 (float16_t *a, float16x8_t v)
74 {
75 vst1q_f16 (a + 125, v);
76 return a;
77 }
78
79 /*
80 **off_store16_0:
81 ** ...
82 ** vstrh.16 q[0-7], \[r0, #4\]
83 ** ...
84 */
85 int16_t *off_store16_0 (int16_t * a, int16x8_t v)
86 {
87 vst1q_s16 (a + 2, v);
88 return a;
89 }
90
91 /*
92 **off_store16_1:
93 ** ...
94 ** vstrh.32 q[0-7], \[r0, #-254\]
95 ** ...
96 */
97 int16_t *off_store16_1 (int16_t * a, int32x4_t v)
98 {
99 vstrhq_s32 (a - 127, v);
100 return a;
101 }
102
103 /*
104 **not_off_store16_0:
105 ** ...
106 ** vstrh.16 q[0-7], \[r[0-7]+\]
107 ** ...
108 */
109 uint8_t *not_off_store16_0 (uint8_t * a, uint16x8_t v)
110 {
111 vst1q_u16 ((uint16_t *)(a - 1), v);
112 return a;
113 }
114
115 /*
116 **not_off_store16_1:
117 ** ...
118 ** vstrh.32 q[0-7], \[r[0-7]+\]
119 ** ...
120 */
121 int16_t *not_off_store16_1 (int16_t * a, int32x4_t v)
122 {
123 vstrhq_s32 ((a + 128), v);
124 return a;
125 }
126
127 /*
128 **off_storefp32_0:
129 ** ...
130 ** vstrw.32 q[0-7], \[r0, #-412\]
131 ** ...
132 */
133 float32_t *off_storefp32_0 (float32_t *a, float32x4_t v)
134 {
135 vst1q_f32 (a - 103, v);
136 return a;
137 }
138
139 /*
140 **off_store32_0:
141 ** ...
142 ** vstrw.32 q[0-7], \[r0, #-4\]
143 ** ...
144 */
145 int32_t *off_store32_0 (int32_t * a, int32x4_t v)
146 {
147 vst1q_s32 (a - 1, v);
148 return a;
149 }
150
151 /*
152 **off_store32_1:
153 ** ...
154 ** vstrw.32 q[0-7], \[r0, #508\]
155 ** ...
156 */
157 uint32_t *off_store32_1 (uint32_t * a, uint32x4_t v)
158 {
159 vstrwq_u32 (a + 127, v);
160 return a;
161 }
162
163 /*
164 **pre_store8_0:
165 ** ...
166 ** vstrb.8 q[0-7], \[r0, #-16\]!
167 ** ...
168 */
169 uint8_t* pre_store8_0 (uint8_t * a, uint8x16_t v)
170 {
171 a -= 16;
172 vst1q_u8 (a, v);
173 return a;
174 }
175
176 /*
177 **pre_store8_1:
178 ** ...
179 ** vstrb.16 q[0-7], \[r0, #4\]!
180 ** ...
181 */
182 int8_t* pre_store8_1 (int8_t * a, int16x8_t v)
183 {
184 a += 4;
185 vstrbq_s16 (a, v);
186 return a;
187 }
188
189 /*
190 **pre_storefp16_0:
191 ** ...
192 ** vstrh.16 q[0-7], \[r0, #8\]!
193 ** ...
194 */
195 float16_t *pre_storefp16_0 (float16_t *a, float16x8_t v)
196 {
197 a += 4;
198 vst1q_f16 (a, v);
199 return a;
200 }
201
202 /*
203 **pre_store16_0:
204 ** ...
205 ** vstrh.16 q[0-7], \[r0, #254\]!
206 ** ...
207 */
208 uint16_t* pre_store16_0 (uint16_t * a, uint16x8_t v)
209 {
210 a += 127;
211 vstrhq_u16 (a, v);
212 return a;
213 }
214
215 /*
216 **pre_store16_1:
217 ** ...
218 ** vstrh.32 q[0-7], \[r0, #-52\]!
219 ** ...
220 */
221 int16_t* pre_store16_1 (int16_t * a, int32x4_t v)
222 {
223 a -= 26;
224 vstrhq_s32 (a, v);
225 return a;
226 }
227
228 /*
229 **pre_storefp32_0:
230 ** ...
231 ** vstrw.32 q[0-7], \[r0, #-4\]!
232 ** ...
233 */
234 float32_t *pre_storefp32_0 (float32_t *a, float32x4_t v)
235 {
236 a--;
237 vst1q_f32 (a, v);
238 return a;
239 }
240
241 /*
242 **pre_store32_0:
243 ** ...
244 ** vstrw.32 q[0-7], \[r0, #4\]!
245 ** ...
246 */
247 int32_t* pre_store32_0 (int32_t * a, int32x4_t v)
248 {
249 a += 1;
250 vst1q_s32 (a, v);
251 return a;
252 }
253
254
255 /*
256 **post_store8_0:
257 ** ...
258 ** vstrb.8 q[0-7], \[r0\], #-26
259 ** ...
260 */
261 int8_t* post_store8_0 (int8_t * a, int8x16_t v)
262 {
263 vst1q_s8 (a, v);
264 a -= 26;
265 return a;
266 }
267
268 /*
269 **post_store8_1:
270 ** ...
271 ** vstrb.16 q[0-7], \[r0\], #1
272 ** ...
273 */
274 uint8_t* post_store8_1 (uint8_t * a, uint16x8_t v)
275 {
276 vstrbq_u16 (a, v);
277 a++;
278 return a;
279 }
280
281 /*
282 **post_store8_2:
283 ** ...
284 ** vstrb.8 q[0-7], \[r0\], #-26
285 ** ...
286 */
287 int8_t* post_store8_2 (int8_t * a, int8x16_t v)
288 {
289 vst1q_s8 (a, v);
290 a -= 26;
291 return a;
292 }
293
294 /*
295 **post_store8_3:
296 ** ...
297 ** vstrb.16 q[0-7], \[r0\], #7
298 ** ...
299 */
300 uint8_t* post_store8_3 (uint8_t * a, uint16x8_t v)
301 {
302 vstrbq_u16 (a, v);
303 a += 7;
304 return a;
305 }
306
307 /*
308 **post_storefp16_0:
309 ** ...
310 ** vstrh.16 q[0-7], \[r0\], #-16
311 ** ...
312 */
313 float16_t *post_storefp16_0 (float16_t *a, float16x8_t v)
314 {
315 vst1q_f16 (a, v);
316 a -= 8;
317 return a;
318 }
319
320 /*
321 **post_store16_0:
322 ** ...
323 ** vstrh.16 q[0-7], \[r0\], #126
324 ** ...
325 */
326 int16_t* post_store16_0 (int16_t * a, int16x8_t v)
327 {
328 vstrhq_s16 (a, v);
329 a += 63;
330 return a;
331 }
332
333 /*
334 **post_store16_1:
335 ** ...
336 ** vstrh.32 q[0-7], \[r0\], #-16
337 ** ...
338 */
339 uint16_t* post_store16_1 (uint16_t * a, uint32x4_t v)
340 {
341 vstrhq_u32 (a, v);
342 a -= 8;
343 return a;
344 }
345
346 /*
347 **post_storefp32_0:
348 ** ...
349 ** vstrw.32 q[0-7], \[r0\], #-16
350 ** ...
351 */
352 float32_t* post_storefp32_0 (float32_t * a, float32x4_t v)
353 {
354 vst1q_f32 (a, v);
355 a -= 4;
356 return a;
357 }
358
359 /*
360 **post_store32_0:
361 ** ...
362 ** vstrw.32 q[0-7], \[r0\], #16
363 ** ...
364 */
365 int32_t* post_store32_0 (int32_t * a, int32x4_t v)
366 {
367 vst1q_s32 (a, v);
368 a += 4;
369 return a;
370 }