| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-march=rv64gcv -mabi=lp64d -O3 -fno-vect-cost-model" } */ |
| 3 |
|
| 4 |
void |
| 5 |
foo (int *__restrict a, int *__restrict b, int *__restrict c, |
| 6 |
int *__restrict a2, int *__restrict b2, int *__restrict c2, |
| 7 |
int *__restrict a3, int *__restrict b3, int *__restrict c3, |
| 8 |
int *__restrict a4, int *__restrict b4, int *__restrict c4, |
| 9 |
int *__restrict a5, int *__restrict b5, int *__restrict c5, |
| 10 |
int *__restrict d, int *__restrict d2, int *__restrict d3, |
| 11 |
int *__restrict d4, int *__restrict d5, int n, int m) |
| 12 |
{ |
| 13 |
for (int i = 0; i < n; i++) |
| 14 |
{ |
| 15 |
a[i] = b[i] + c[i]; |
| 16 |
a2[i] = b2[i] + c2[i]; |
| 17 |
a3[i] = b3[i] + c3[i]; |
| 18 |
a4[i] = b4[i] + c4[i]; |
| 19 |
a5[i] = a[i] + a4[i]; |
| 20 |
d[i] = a[i] - a2[i]; |
| 21 |
d2[i] = a2[i] * a[i]; |
| 22 |
d3[i] = a3[i] * a2[i]; |
| 23 |
d4[i] = a2[i] * d2[i]; |
| 24 |
d5[i] = a[i] * a2[i] * a3[i] * a4[i] * d[i]; |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
/* { dg-final { scan-assembler-times {vsetvli} 1 } } */ |
| 29 |
/* { dg-final { scan-assembler-not {vsetivli} } } */ |
| 30 |
/* { dg-final { scan-assembler-times {vsetvli\s*[a-x0-9]+,\s*[a-x0-9]+} 1 } } */ |
| 31 |
/* { dg-final { scan-assembler-not {vsetvli\s*[a-x0-9]+,\s*zero} } } */ |
| 32 |
/* { dg-final { scan-assembler-not {vsetvli\s*zero} } } */ |
| 33 |
/* { dg-final { scan-assembler-not {vsetivli\s*zero} } } */ |