| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options " -march=rv64gcv_zvl128b -mabi=lp64d -O3 -mrvv-vector-bits=scalable -mrvv-max-lmul=m1" } */ |
| 3 |
|
| 4 |
void foo1 (int* restrict a, int* restrict b, int n) |
| 5 |
{ |
| 6 |
for (int i = 0; i < 4; i += 1) |
| 7 |
a[i] += b[i]; |
| 8 |
} |
| 9 |
|
| 10 |
void foo2 (int* restrict a, int* restrict b, int n) |
| 11 |
{ |
| 12 |
for (int i = 0; i < 3; i += 1) |
| 13 |
a[i] += b[i]; |
| 14 |
} |
| 15 |
|
| 16 |
void foo3 (int* restrict a, int* restrict b, int n) |
| 17 |
{ |
| 18 |
for (int i = 0; i < 5; i += 1) |
| 19 |
a[i] += b[i]; |
| 20 |
} |
| 21 |
|
| 22 |
/* { dg-final { scan-assembler-not {\tcsrr\t} } } */ |
| 23 |
/* { dg-final { scan-assembler {\tvsetivli\tzero,4,e32,m1,t[au],m[au]} } } */ |
| 24 |
/* { dg-final { scan-assembler {\tvsetivli\tzero,3,e32,m1,t[au],m[au]} } } */ |