| 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 f (int32_t * restrict in, int32_t * restrict out, int32_t * restrict in2, int32_t * restrict out2, int n, int cond, int cond2) |
| 7 |
{ |
| 8 |
if (cond == 0) |
| 9 |
{ |
| 10 |
if (cond2) { |
| 11 |
for (int i = 0; i < n; i++) |
| 12 |
{ |
| 13 |
vfloat32mf2_t v1 = *(vfloat32mf2_t*)(in + 1000); |
| 14 |
*(vfloat32mf2_t*)(out + i + 1000) = v1; |
| 15 |
} |
| 16 |
for (int i = 0; i < n; i++) |
| 17 |
{ |
| 18 |
vint32mf2_t v1 = *(vint32mf2_t*)in; |
| 19 |
*(vint32mf2_t*)(out + i + 10) = v1; |
| 20 |
} |
| 21 |
for (int i = 0; i < n; i++) |
| 22 |
{ |
| 23 |
vint16mf4_t v1 = *(vint16mf4_t*)(in + 100); |
| 24 |
*(vint16mf4_t*)(out + i + 100) = v1; |
| 25 |
} |
| 26 |
} else { |
| 27 |
for (int i = 0; i < n; i++) |
| 28 |
{ |
| 29 |
vfloat32mf2_t v1 = *(vfloat32mf2_t*)(in + 2000); |
| 30 |
*(vfloat32mf2_t*)(out + i + 2000) = v1; |
| 31 |
} |
| 32 |
for (int i = 0; i < n; i++) |
| 33 |
{ |
| 34 |
vint32mf2_t v1 = *(vint32mf2_t*)(in + 200); |
| 35 |
*(vint32mf2_t*)(out + i + 200) = v1; |
| 36 |
} |
| 37 |
for (int i = 0; i < n; i++) |
| 38 |
{ |
| 39 |
vint16mf4_t v1 = *(vint16mf4_t*)(in + 300); |
| 40 |
*(vint16mf4_t*)(out + i + 300) = v1; |
| 41 |
} |
| 42 |
} |
| 43 |
} |
| 44 |
else |
| 45 |
{ |
| 46 |
for (int i = 0; i < n; i++) |
| 47 |
{ |
| 48 |
vint16mf4_t v1 = *(vint16mf4_t*)(in + 30000); |
| 49 |
*(vint16mf4_t*)(out + i + 30000) = v1; |
| 50 |
} |
| 51 |
for (int i = 0; i < n; i++) |
| 52 |
{ |
| 53 |
vint32mf2_t v1 = *(vint32mf2_t*)(in + 40000); |
| 54 |
*(vint32mf2_t*)(out + i + 40000) = v1; |
| 55 |
} |
| 56 |
for (int i = 0; i < n; i++) |
| 57 |
{ |
| 58 |
vuint32mf2_t v1 = *(vuint32mf2_t*)(in + 50000); |
| 59 |
*(vuint32mf2_t*)(out + i + 50000) = v1; |
| 60 |
} |
| 61 |
} |
| 62 |
for (int i = 0; i < n; i++) |
| 63 |
{ |
| 64 |
vint8mf8_t v1; |
| 65 |
*(vint8mf8_t*)(out + i + 10) = v1; |
| 66 |
} |
| 67 |
} |
| 68 |
|
| 69 |
|
| 70 |
/* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 2 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |
| 71 |
/* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e16,\s*mf4,\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" } } } } */ |
| 72 |
/* { dg-final { scan-assembler-times {vsetvli\s+zero,\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" } } } } */ |
| 73 |
/* { dg-final { scan-assembler-times {vsetvli} 4 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |