| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-mrvv-vector-bits=scalable -march=rv32gcv -mabi=ilp32" } */ |
| 3 |
|
| 4 |
#include "riscv_vector.h" |
| 5 |
|
| 6 |
void f (void * restrict in, void * restrict out, int n, int cond) |
| 7 |
{ |
| 8 |
for (int i = 0; i < n; i++) { |
| 9 |
vint8mf8_t v = *(vint8mf8_t*)in; |
| 10 |
*(vint8mf8_t*)(out + i + 200) = v; |
| 11 |
} |
| 12 |
for (int i = 0; i < n; i++) { |
| 13 |
vint32mf2_t v = *(vint32mf2_t*)(in + 200); |
| 14 |
*(vint32mf2_t*)(out + i + 400) = v; |
| 15 |
} |
| 16 |
for (int i = 0; i < n; i++) { |
| 17 |
vint64m1_t v = *(vint64m1_t*)(in + 300); |
| 18 |
*(vint64m1_t*)(out + i + 400) = v; |
| 19 |
} |
| 20 |
for (int i = 0; i < n; i++) { |
| 21 |
vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 400); |
| 22 |
*(vfloat32mf2_t*)(out + i + 500) = v; |
| 23 |
} |
| 24 |
for (int i = 0; i < n; i++) { |
| 25 |
vfloat64m1_t v = *(vfloat64m1_t*)(in + 500); |
| 26 |
*(vfloat64m1_t*)(out + i + 600) = v; |
| 27 |
} |
| 28 |
for (int i = 0; i < n; i++) { |
| 29 |
vint16mf4_t v; |
| 30 |
*(vint16mf4_t*)(out + i + 700) = v; |
| 31 |
} |
| 32 |
} |
| 33 |
|
| 34 |
/* { 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 "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |
| 35 |
/* { dg-final { scan-assembler-times {vsetvli\s+zero,\s*zero,\s*e16,\s*mf4,\s*t[au],\s*m[au]} 1 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |
| 36 |
/* { dg-final { scan-assembler-times {vsetvli} 2 { target { no-opts "-O0" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |