Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/vsetvl/vlmax_bb_prop-15.c

raw
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 (int8_t * restrict in, int8_t * restrict out, int n)
7 {
8 switch (n)
9 {
10 case 0:{
11 vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 500);
12 *(vfloat32mf2_t*)(out + 500) = v;
13 break;
14 }
15 case 1:{
16 vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 500);
17 *(vfloat32mf2_t*)(out + 500) = v;
18 break;
19 }
20 default:{
21 break;
22 }
23 }
24
25 for (int i = 0 ; i < n * n; i++)
26 out[i] = out[i] + out[i];
27
28 for (int i = 0 ; i < n * n * n; i++)
29 out[i] = out[i] * out[i];
30
31 for (int i = 0 ; i < n * n * n * n; i++)
32 out[i] = out[i] * out[i];
33
34 for (int i = 0 ; i < n * n * n * n; i++) {
35 vfloat32mf2_t v = *(vfloat32mf2_t*)(in + 900 + i);
36 *(vfloat32mf2_t*)(out + 900 + i) = v;
37 }
38 }
39
40 /* { 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 "-Os" no-opts "-Oz" no-opts "-funroll-loops" no-opts "-g" } } } } */