| 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 fn3 (void); |
| 7 |
|
| 8 |
void f (int32_t * restrict in, int32_t * restrict out, int32_t * restrict in2, int32_t * restrict out2, int n, int cond) |
| 9 |
{ |
| 10 |
if (cond == 0) |
| 11 |
{ |
| 12 |
for (int i = 0; i < n; i++) |
| 13 |
{ |
| 14 |
vfloat32mf2_t v1 = *(vfloat32mf2_t*)(in + 1000); |
| 15 |
*(vfloat32mf2_t*)(out + i + 1000) = v1; |
| 16 |
} |
| 17 |
for (int i = 0; i < n; i++) |
| 18 |
{ |
| 19 |
vint32mf2_t v1 = *(vint32mf2_t*)in; |
| 20 |
*(vint32mf2_t*)(out + i + 10) = v1; |
| 21 |
} |
| 22 |
for (int i = 0; i < n; i++) |
| 23 |
{ |
| 24 |
vint16mf4_t v1 = *(vint16mf4_t*)(in + 100); |
| 25 |
*(vint16mf4_t*)(out + i + 100) = v1; |
| 26 |
} |
| 27 |
} |
| 28 |
else |
| 29 |
{ |
| 30 |
fn3 (); |
| 31 |
} |
| 32 |
for (int i = 0; i < n; i++) |
| 33 |
{ |
| 34 |
vint8mf8_t v1; |
| 35 |
*(vint8mf8_t*)(out + i + 10) = v1; |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
/* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |
| 40 |
/* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e8,\s*mf8,\s*t[au],\s*m[au]} 1 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |
| 41 |
/* { dg-final { scan-assembler-times {vsetvli} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |