| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv32gcv -mabi=ilp32 -O3 -ftree-vectorize -mrvv-max-lmul=dynamic -fdump-tree-vect-details" } */ |
| 3 |
|
| 4 |
#include <stdint-gcc.h> |
| 5 |
typedef int8_t v128qi __attribute__ ((vector_size (128))); |
| 6 |
|
| 7 |
v128qi global_v; |
| 8 |
|
| 9 |
v128qi |
| 10 |
foo (int32_t *__restrict a, int32_t *__restrict b, int32_t *__restrict c, |
| 11 |
int32_t *__restrict a2, int32_t *__restrict b2, int32_t *__restrict c2, |
| 12 |
int32_t *__restrict a3, int32_t *__restrict b3, int32_t *__restrict c3, |
| 13 |
int32_t *__restrict a4, int32_t *__restrict b4, int32_t *__restrict c4, |
| 14 |
int32_t *__restrict a5, int32_t *__restrict b5, int32_t *__restrict c5, |
| 15 |
int32_t *__restrict d, int32_t *__restrict d2, int32_t *__restrict d3, |
| 16 |
int32_t *__restrict d4, int32_t *__restrict d5, int n) |
| 17 |
{ |
| 18 |
for (int i = 0; i < 128; i++) |
| 19 |
b[i] = global_v[i] + 8; |
| 20 |
for (int i = 0; i < n; i++) |
| 21 |
{ |
| 22 |
a[i] = b[i] + c[i]; |
| 23 |
b5[i] = b[i] + c[i]; |
| 24 |
a2[i] = b2[i] + c2[i]; |
| 25 |
a3[i] = b3[i] + c3[i]; |
| 26 |
a4[i] = b4[i] + c4[i]; |
| 27 |
a5[i] = a[i] + a4[i]; |
| 28 |
d2[i] = a2[i] + c2[i]; |
| 29 |
d3[i] = a3[i] + c3[i]; |
| 30 |
d4[i] = a4[i] + c4[i]; |
| 31 |
d5[i] = a[i] + a4[i]; |
| 32 |
a[i] = a5[i] + b5[i] + a[i]; |
| 33 |
|
| 34 |
c2[i] = a[i] + c[i]; |
| 35 |
c3[i] = b5[i] * a5[i]; |
| 36 |
c4[i] = a2[i] * a3[i]; |
| 37 |
c5[i] = b5[i] * a2[i]; |
| 38 |
c[i] = a[i] + c3[i]; |
| 39 |
c2[i] = a[i] + c4[i]; |
| 40 |
a5[i] = a[i] + a4[i]; |
| 41 |
a[i] = a[i] + b5[i] |
| 42 |
+ a[i] * a2[i] * a3[i] * a4[i] * a5[i] * c[i] * c2[i] * c3[i] |
| 43 |
* c4[i] * c5[i] * d[i] * d2[i] * d3[i] * d4[i] * d5[i]; |
| 44 |
} |
| 45 |
return global_v + 3; |
| 46 |
} |
| 47 |
|
| 48 |
/* { dg-final { scan-assembler {e32,m2} } } */ |
| 49 |
/* { dg-final { scan-assembler {e8,m8} } } */ |
| 50 |
/* { dg-final { scan-assembler-not {csrr} } } */ |
| 51 |
/* { dg-final { scan-tree-dump-times "Preferring smaller LMUL loop because it has unexpected spills" 2 "vect" } } */ |