| 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 f6 (int8_t * restrict in, int8_t * restrict out, int n) |
| 7 |
{ |
| 8 |
if (n == 0) { |
| 9 |
vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 500); |
| 10 |
*(vfloat32mf2_t*)(out + 500) = v; |
| 11 |
} else if (n == 1) { |
| 12 |
vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 600); |
| 13 |
*(vfloat32mf2_t*)(out + 600) = v; |
| 14 |
} else { |
| 15 |
vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 700); |
| 16 |
*(vfloat32mf2_t*)(out + 700) = v; |
| 17 |
} |
| 18 |
|
| 19 |
for (int i = 0 ; i < n * n; i++) |
| 20 |
out[i] = out[i] + out[i]; |
| 21 |
|
| 22 |
for (int i = 0 ; i < n * n * n; i++) |
| 23 |
out[i] = out[i] * out[i]; |
| 24 |
|
| 25 |
for (int i = 0 ; i < n * n * n * n; i++) |
| 26 |
out[i] = out[i] * out[i]; |
| 27 |
|
| 28 |
for (int i = 0 ; i < n * n * n * n; i++) { |
| 29 |
vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 900 + i); |
| 30 |
*(vfloat32mf2_t*)(out + 900 + i) = v; |
| 31 |
} |
| 32 |
|
| 33 |
for (int i = 0 ; i < n * n; i++) |
| 34 |
out[i] = out[i] + out[i]; |
| 35 |
|
| 36 |
for (int i = 0 ; i < n * n * n; i++) |
| 37 |
out[i] = out[i] * out[i]; |
| 38 |
|
| 39 |
for (int i = 0 ; i < n * n * n * n; i++) |
| 40 |
out[i] = out[i] * out[i]; |
| 41 |
|
| 42 |
for (int i = 0 ; i < n * n; i++) |
| 43 |
out[i] = out[i] + out[i]; |
| 44 |
|
| 45 |
for (int i = 0 ; i < n * n * n; i++) |
| 46 |
out[i] = out[i] * out[i]; |
| 47 |
|
| 48 |
for (int i = 0 ; i < n * n * n * n; i++) |
| 49 |
out[i] = out[i] * out[i]; |
| 50 |
|
| 51 |
if (n == 0) { |
| 52 |
vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 500); |
| 53 |
*(vfloat32mf2_t*)(out + 500) = v; |
| 54 |
} else if (n == 1) { |
| 55 |
vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 600); |
| 56 |
*(vfloat32mf2_t*)(out + 600) = v; |
| 57 |
} else { |
| 58 |
vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 700); |
| 59 |
*(vfloat32mf2_t*)(out + 700) = v; |
| 60 |
} |
| 61 |
|
| 62 |
for (int i = 0 ; i < n * n; i++) |
| 63 |
out[i] = out[i] + out[i]; |
| 64 |
|
| 65 |
for (int i = 0 ; i < n * n * n; i++) |
| 66 |
out[i] = out[i] * out[i]; |
| 67 |
|
| 68 |
for (int i = 0 ; i < n * n * n * n; i++) |
| 69 |
out[i] = out[i] * out[i]; |
| 70 |
|
| 71 |
for (int i = 0 ; i < n * n; i++) |
| 72 |
out[i] = out[i] + out[i]; |
| 73 |
|
| 74 |
for (int i = 0 ; i < n * n * n; i++) |
| 75 |
out[i] = out[i] * out[i]; |
| 76 |
|
| 77 |
for (int i = 0 ; i < n * n * n * n; i++) |
| 78 |
out[i] = out[i] * out[i]; |
| 79 |
|
| 80 |
for (int i = 0 ; i < n * n * n * n; i++) { |
| 81 |
vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 900 + i); |
| 82 |
*(vfloat32mf2_t*)(out + 900 + i) = v; |
| 83 |
} |
| 84 |
} |
| 85 |
|
| 86 |
/* { dg-final { scan-assembler-times {vsetvli\s+[a-x0-9]+,\s*zero,\s*e32,\s*mf2,\s*t[au],\s*m[au]} 3 { target { no-opts "-O0" no-opts "-O1" no-opts "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */ |