Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-27.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32 -fno-tree-vectorize" } */
3
4 #include "riscv_vector.h"
5
6 void f (int8_t * restrict in, int8_t * restrict out, int n)
7 {
8 if (n == 0) {
9 vuint8mf8_t v = *(vuint8mf8_t*)(in + 500);
10 *(vuint8mf8_t*)(out + 500) = v;
11 } else if (n == 1) {
12 vuint8mf8_t v = *(vuint8mf8_t*)(in + 600);
13 *(vuint8mf8_t*)(out + 600) = v;
14 } else {
15 vuint8mf8_t v = *(vuint8mf8_t*)(in + 700);
16 *(vuint8mf8_t*)(out + 700) = v;
17 }
18
19 for (int i = 0 ; i < n * n; i++)
20 out[i] = out[i] + out[i];
21
22 for (int i = 0 ; i < n * n * n; i++)
23 out[i] = out[i] * out[i];
24
25 for (int i = 0 ; i < n * n * n * n; i++)
26 out[i] = out[i] * out[i];
27
28 for (int i = 0 ; i < n * n * n * n; i++) {
29 vuint8mf8_t v = *(vuint8mf8_t*)(in + 900 + i);
30 *(vuint8mf8_t*)(out + 900 + i) = v;
31 }
32
33 for (int i = 0 ; i < n * n; i++)
34 out[i] = out[i] + out[i];
35
36 for (int i = 0 ; i < n * n * n; i++)
37 out[i] = out[i] * out[i];
38
39 for (int i = 0 ; i < n * n * n * n; i++)
40 out[i] = out[i] * out[i];
41
42 for (int i = 0 ; i < n * n; i++)
43 out[i] = out[i] + out[i];
44
45 for (int i = 0 ; i < n * n * n; i++)
46 out[i] = out[i] * out[i];
47
48 for (int i = 0 ; i < n * n * n * n; i++)
49 out[i] = out[i] * out[i];
50
51 if (n == 0) {
52 vuint8mf8_t v = *(vuint8mf8_t*)(in + 500);
53 *(vuint8mf8_t*)(out + 500) = v;
54 } else if (n == 1) {
55 vuint8mf8_t v = *(vuint8mf8_t*)(in + 600);
56 *(vuint8mf8_t*)(out + 600) = v;
57 } else {
58 vuint8mf8_t v = *(vuint8mf8_t*)(in + 700);
59 *(vuint8mf8_t*)(out + 700) = v;
60 }
61
62 for (int i = 0 ; i < n * n; i++)
63 out[i] = out[i] + out[i];
64
65 for (int i = 0 ; i < n * n * n; i++)
66 out[i] = out[i] * out[i];
67
68 for (int i = 0 ; i < n * n * n * n; i++)
69 out[i] = out[i] * out[i];
70
71 for (int i = 0 ; i < n * n; i++)
72 out[i] = out[i] + out[i];
73
74 for (int i = 0 ; i < n * n * n; i++)
75 out[i] = out[i] * out[i];
76
77 for (int i = 0 ; i < n * n * n * n; i++)
78 out[i] = out[i] * out[i];
79
80 for (int i = 0 ; i < n * n * n * n; i++) {
81 vuint8mf8_t v = *(vuint8mf8_t*)(in + 900 + i);
82 *(vuint8mf8_t*)(out + 900 + i) = v;
83 }
84 }
85
86 void f2 (int8_t * restrict in, int8_t * restrict out, int n)
87 {
88 if (n == 0) {
89 vuint8mf4_t v = *(vuint8mf4_t*)(in + 500);
90 *(vuint8mf4_t*)(out + 500) = v;
91 } else if (n == 1) {
92 vuint8mf4_t v = *(vuint8mf4_t*)(in + 600);
93 *(vuint8mf4_t*)(out + 600) = v;
94 } else {
95 vuint8mf4_t v = *(vuint8mf4_t*)(in + 700);
96 *(vuint8mf4_t*)(out + 700) = v;
97 }
98
99 for (int i = 0 ; i < n * n; i++)
100 out[i] = out[i] + out[i];
101
102 for (int i = 0 ; i < n * n * n; i++)
103 out[i] = out[i] * out[i];
104
105 for (int i = 0 ; i < n * n * n * n; i++)
106 out[i] = out[i] * out[i];
107
108 for (int i = 0 ; i < n * n * n * n; i++) {
109 vuint8mf4_t v = *(vuint8mf4_t*)(in + 900 + i);
110 *(vuint8mf4_t*)(out + 900 + i) = v;
111 }
112
113 for (int i = 0 ; i < n * n; i++)
114 out[i] = out[i] + out[i];
115
116 for (int i = 0 ; i < n * n * n; i++)
117 out[i] = out[i] * out[i];
118
119 for (int i = 0 ; i < n * n * n * n; i++)
120 out[i] = out[i] * out[i];
121
122 for (int i = 0 ; i < n * n; i++)
123 out[i] = out[i] + out[i];
124
125 for (int i = 0 ; i < n * n * n; i++)
126 out[i] = out[i] * out[i];
127
128 for (int i = 0 ; i < n * n * n * n; i++)
129 out[i] = out[i] * out[i];
130
131 if (n == 0) {
132 vuint8mf4_t v = *(vuint8mf4_t*)(in + 500);
133 *(vuint8mf4_t*)(out + 500) = v;
134 } else if (n == 1) {
135 vuint8mf4_t v = *(vuint8mf4_t*)(in + 600);
136 *(vuint8mf4_t*)(out + 600) = v;
137 } else {
138 vuint8mf4_t v = *(vuint8mf4_t*)(in + 700);
139 *(vuint8mf4_t*)(out + 700) = v;
140 }
141
142 for (int i = 0 ; i < n * n; i++)
143 out[i] = out[i] + out[i];
144
145 for (int i = 0 ; i < n * n * n; i++)
146 out[i] = out[i] * out[i];
147
148 for (int i = 0 ; i < n * n * n * n; i++)
149 out[i] = out[i] * out[i];
150
151 for (int i = 0 ; i < n * n; i++)
152 out[i] = out[i] + out[i];
153
154 for (int i = 0 ; i < n * n * n; i++)
155 out[i] = out[i] * out[i];
156
157 for (int i = 0 ; i < n * n * n * n; i++)
158 out[i] = out[i] * out[i];
159
160 for (int i = 0 ; i < n * n * n * n; i++) {
161 vuint8mf4_t v = *(vuint8mf4_t*)(in + 900 + i);
162 *(vuint8mf4_t*)(out + 900 + i) = v;
163 }
164 }
165
166 void f3 (int8_t * restrict in, int8_t * restrict out, int n)
167 {
168 if (n == 0) {
169 vuint8mf2_t v = *(vuint8mf2_t*)(in + 500);
170 *(vuint8mf2_t*)(out + 500) = v;
171 } else if (n == 1) {
172 vuint8mf2_t v = *(vuint8mf2_t*)(in + 600);
173 *(vuint8mf2_t*)(out + 600) = v;
174 } else {
175 vuint8mf2_t v = *(vuint8mf2_t*)(in + 700);
176 *(vuint8mf2_t*)(out + 700) = v;
177 }
178
179 for (int i = 0 ; i < n * n; i++)
180 out[i] = out[i] + out[i];
181
182 for (int i = 0 ; i < n * n * n; i++)
183 out[i] = out[i] * out[i];
184
185 for (int i = 0 ; i < n * n * n * n; i++)
186 out[i] = out[i] * out[i];
187
188 for (int i = 0 ; i < n * n * n * n; i++) {
189 vuint8mf2_t v = *(vuint8mf2_t*)(in + 900 + i);
190 *(vuint8mf2_t*)(out + 900 + i) = v;
191 }
192
193 for (int i = 0 ; i < n * n; i++)
194 out[i] = out[i] + out[i];
195
196 for (int i = 0 ; i < n * n * n; i++)
197 out[i] = out[i] * out[i];
198
199 for (int i = 0 ; i < n * n * n * n; i++)
200 out[i] = out[i] * out[i];
201
202 for (int i = 0 ; i < n * n; i++)
203 out[i] = out[i] + out[i];
204
205 for (int i = 0 ; i < n * n * n; i++)
206 out[i] = out[i] * out[i];
207
208 for (int i = 0 ; i < n * n * n * n; i++)
209 out[i] = out[i] * out[i];
210
211 if (n == 0) {
212 vuint8mf2_t v = *(vuint8mf2_t*)(in + 500);
213 *(vuint8mf2_t*)(out + 500) = v;
214 } else if (n == 1) {
215 vuint8mf2_t v = *(vuint8mf2_t*)(in + 600);
216 *(vuint8mf2_t*)(out + 600) = v;
217 } else {
218 vuint8mf2_t v = *(vuint8mf2_t*)(in + 700);
219 *(vuint8mf2_t*)(out + 700) = v;
220 }
221
222 for (int i = 0 ; i < n * n; i++)
223 out[i] = out[i] + out[i];
224
225 for (int i = 0 ; i < n * n * n; i++)
226 out[i] = out[i] * out[i];
227
228 for (int i = 0 ; i < n * n * n * n; i++)
229 out[i] = out[i] * out[i];
230
231 for (int i = 0 ; i < n * n; i++)
232 out[i] = out[i] + out[i];
233
234 for (int i = 0 ; i < n * n * n; i++)
235 out[i] = out[i] * out[i];
236
237 for (int i = 0 ; i < n * n * n * n; i++)
238 out[i] = out[i] * out[i];
239
240 for (int i = 0 ; i < n * n * n * n; i++) {
241 vuint8mf2_t v = *(vuint8mf2_t*)(in + 900 + i);
242 *(vuint8mf2_t*)(out + 900 + i) = v;
243 }
244 }
245
246 void f4 (int8_t * restrict in, int8_t * restrict out, int n)
247 {
248 if (n == 0) {
249 vuint16mf4_t v = *(vuint16mf4_t*)(in + 500);
250 *(vuint16mf4_t*)(out + 500) = v;
251 } else if (n == 1) {
252 vuint16mf4_t v = *(vuint16mf4_t*)(in + 600);
253 *(vuint16mf4_t*)(out + 600) = v;
254 } else {
255 vuint16mf4_t v = *(vuint16mf4_t*)(in + 700);
256 *(vuint16mf4_t*)(out + 700) = v;
257 }
258
259 for (int i = 0 ; i < n * n; i++)
260 out[i] = out[i] + out[i];
261
262 for (int i = 0 ; i < n * n * n; i++)
263 out[i] = out[i] * out[i];
264
265 for (int i = 0 ; i < n * n * n * n; i++)
266 out[i] = out[i] * out[i];
267
268 for (int i = 0 ; i < n * n * n * n; i++) {
269 vuint16mf4_t v = *(vuint16mf4_t*)(in + 900 + i);
270 *(vuint16mf4_t*)(out + 900 + i) = v;
271 }
272
273 for (int i = 0 ; i < n * n; i++)
274 out[i] = out[i] + out[i];
275
276 for (int i = 0 ; i < n * n * n; i++)
277 out[i] = out[i] * out[i];
278
279 for (int i = 0 ; i < n * n * n * n; i++)
280 out[i] = out[i] * out[i];
281
282 for (int i = 0 ; i < n * n; i++)
283 out[i] = out[i] + out[i];
284
285 for (int i = 0 ; i < n * n * n; i++)
286 out[i] = out[i] * out[i];
287
288 for (int i = 0 ; i < n * n * n * n; i++)
289 out[i] = out[i] * out[i];
290
291 if (n == 0) {
292 vuint16mf4_t v = *(vuint16mf4_t*)(in + 500);
293 *(vuint16mf4_t*)(out + 500) = v;
294 } else if (n == 1) {
295 vuint16mf4_t v = *(vuint16mf4_t*)(in + 600);
296 *(vuint16mf4_t*)(out + 600) = v;
297 } else {
298 vuint16mf4_t v = *(vuint16mf4_t*)(in + 700);
299 *(vuint16mf4_t*)(out + 700) = v;
300 }
301
302 for (int i = 0 ; i < n * n; i++)
303 out[i] = out[i] + out[i];
304
305 for (int i = 0 ; i < n * n * n; i++)
306 out[i] = out[i] * out[i];
307
308 for (int i = 0 ; i < n * n * n * n; i++)
309 out[i] = out[i] * out[i];
310
311 for (int i = 0 ; i < n * n; i++)
312 out[i] = out[i] + out[i];
313
314 for (int i = 0 ; i < n * n * n; i++)
315 out[i] = out[i] * out[i];
316
317 for (int i = 0 ; i < n * n * n * n; i++)
318 out[i] = out[i] * out[i];
319
320 for (int i = 0 ; i < n * n * n * n; i++) {
321 vuint16mf4_t v = *(vuint16mf4_t*)(in + 900 + i);
322 *(vuint16mf4_t*)(out + 900 + i) = v;
323 }
324 }
325
326 void f5 (int8_t * restrict in, int8_t * restrict out, int n)
327 {
328 if (n == 0) {
329 vuint16mf2_t v = *(vuint16mf2_t*)(in + 500);
330 *(vuint16mf2_t*)(out + 500) = v;
331 } else if (n == 1) {
332 vuint16mf2_t v = *(vuint16mf2_t*)(in + 600);
333 *(vuint16mf2_t*)(out + 600) = v;
334 } else {
335 vuint16mf2_t v = *(vuint16mf2_t*)(in + 700);
336 *(vuint16mf2_t*)(out + 700) = v;
337 }
338
339 for (int i = 0 ; i < n * n; i++)
340 out[i] = out[i] + out[i];
341
342 for (int i = 0 ; i < n * n * n; i++)
343 out[i] = out[i] * out[i];
344
345 for (int i = 0 ; i < n * n * n * n; i++)
346 out[i] = out[i] * out[i];
347
348 for (int i = 0 ; i < n * n * n * n; i++) {
349 vuint16mf2_t v = *(vuint16mf2_t*)(in + 900 + i);
350 *(vuint16mf2_t*)(out + 900 + i) = v;
351 }
352
353 for (int i = 0 ; i < n * n; i++)
354 out[i] = out[i] + out[i];
355
356 for (int i = 0 ; i < n * n * n; i++)
357 out[i] = out[i] * out[i];
358
359 for (int i = 0 ; i < n * n * n * n; i++)
360 out[i] = out[i] * out[i];
361
362 for (int i = 0 ; i < n * n; i++)
363 out[i] = out[i] + out[i];
364
365 for (int i = 0 ; i < n * n * n; i++)
366 out[i] = out[i] * out[i];
367
368 for (int i = 0 ; i < n * n * n * n; i++)
369 out[i] = out[i] * out[i];
370
371 if (n == 0) {
372 vuint16mf2_t v = *(vuint16mf2_t*)(in + 500);
373 *(vuint16mf2_t*)(out + 500) = v;
374 } else if (n == 1) {
375 vuint16mf2_t v = *(vuint16mf2_t*)(in + 600);
376 *(vuint16mf2_t*)(out + 600) = v;
377 } else {
378 vuint16mf2_t v = *(vuint16mf2_t*)(in + 700);
379 *(vuint16mf2_t*)(out + 700) = v;
380 }
381
382 for (int i = 0 ; i < n * n; i++)
383 out[i] = out[i] + out[i];
384
385 for (int i = 0 ; i < n * n * n; i++)
386 out[i] = out[i] * out[i];
387
388 for (int i = 0 ; i < n * n * n * n; i++)
389 out[i] = out[i] * out[i];
390
391 for (int i = 0 ; i < n * n; i++)
392 out[i] = out[i] + out[i];
393
394 for (int i = 0 ; i < n * n * n; i++)
395 out[i] = out[i] * out[i];
396
397 for (int i = 0 ; i < n * n * n * n; i++)
398 out[i] = out[i] * out[i];
399
400 for (int i = 0 ; i < n * n * n * n; i++) {
401 vuint16mf2_t v = *(vuint16mf2_t*)(in + 900 + i);
402 *(vuint16mf2_t*)(out + 900 + i) = v;
403 }
404 }
405
406 void f6 (int8_t * restrict in, int8_t * restrict out, int n)
407 {
408 if (n == 0) {
409 vuint32mf2_t v = *(vuint32mf2_t*)(in + 500);
410 *(vuint32mf2_t*)(out + 500) = v;
411 } else if (n == 1) {
412 vuint32mf2_t v = *(vuint32mf2_t*)(in + 600);
413 *(vuint32mf2_t*)(out + 600) = v;
414 } else {
415 vuint32mf2_t v = *(vuint32mf2_t*)(in + 700);
416 *(vuint32mf2_t*)(out + 700) = v;
417 }
418
419 for (int i = 0 ; i < n * n; i++)
420 out[i] = out[i] + out[i];
421
422 for (int i = 0 ; i < n * n * n; i++)
423 out[i] = out[i] * out[i];
424
425 for (int i = 0 ; i < n * n * n * n; i++)
426 out[i] = out[i] * out[i];
427
428 for (int i = 0 ; i < n * n * n * n; i++) {
429 vuint32mf2_t v = *(vuint32mf2_t*)(in + 900 + i);
430 *(vuint32mf2_t*)(out + 900 + i) = v;
431 }
432
433 for (int i = 0 ; i < n * n; i++)
434 out[i] = out[i] + out[i];
435
436 for (int i = 0 ; i < n * n * n; i++)
437 out[i] = out[i] * out[i];
438
439 for (int i = 0 ; i < n * n * n * n; i++)
440 out[i] = out[i] * out[i];
441
442 for (int i = 0 ; i < n * n; i++)
443 out[i] = out[i] + out[i];
444
445 for (int i = 0 ; i < n * n * n; i++)
446 out[i] = out[i] * out[i];
447
448 for (int i = 0 ; i < n * n * n * n; i++)
449 out[i] = out[i] * out[i];
450
451 if (n == 0) {
452 vuint32mf2_t v = *(vuint32mf2_t*)(in + 500);
453 *(vuint32mf2_t*)(out + 500) = v;
454 } else if (n == 1) {
455 vuint32mf2_t v = *(vuint32mf2_t*)(in + 600);
456 *(vuint32mf2_t*)(out + 600) = v;
457 } else {
458 vuint32mf2_t v = *(vuint32mf2_t*)(in + 700);
459 *(vuint32mf2_t*)(out + 700) = v;
460 }
461
462 for (int i = 0 ; i < n * n; i++)
463 out[i] = out[i] + out[i];
464
465 for (int i = 0 ; i < n * n * n; i++)
466 out[i] = out[i] * out[i];
467
468 for (int i = 0 ; i < n * n * n * n; i++)
469 out[i] = out[i] * out[i];
470
471 for (int i = 0 ; i < n * n; i++)
472 out[i] = out[i] + out[i];
473
474 for (int i = 0 ; i < n * n * n; i++)
475 out[i] = out[i] * out[i];
476
477 for (int i = 0 ; i < n * n * n * n; i++)
478 out[i] = out[i] * out[i];
479
480 for (int i = 0 ; i < n * n * n * n; i++) {
481 vuint32mf2_t v = *(vuint32mf2_t*)(in + 900 + i);
482 *(vuint32mf2_t*)(out + 900 + i) = v;
483 }
484 }
485
486 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
487 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf4,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
488 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf2,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
489 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf4,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
490 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf2,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */
491 /* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */