Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc_strict-5.c

raw
1 /* { dg-do compile } */
2 /* { dg-additional-options "-march=rv32gcv_zvfh -mabi=ilp32d -mrvv-vector-bits=scalable -fno-vect-cost-model" } */
3
4 double mat[100][12];
5
6 double
7 slp_reduc_plus (int n)
8 {
9 double tmp = 0.0;
10 for (int i = 0; i < n; i++)
11 {
12 tmp = tmp + mat[i][0];
13 tmp = tmp + mat[i][1];
14 tmp = tmp + mat[i][2];
15 tmp = tmp + mat[i][3];
16 tmp = tmp + mat[i][4];
17 tmp = tmp + mat[i][5];
18 tmp = tmp + mat[i][6];
19 tmp = tmp + mat[i][7];
20 tmp = tmp + mat[i][8];
21 tmp = tmp + mat[i][9];
22 tmp = tmp + mat[i][10];
23 tmp = tmp + mat[i][11];
24 }
25 return tmp;
26 }
27
28 /* { dg-final { scan-assembler {vfredosum\.vs\s+v[0-9]+,\s*v[0-9]+,\s*v[0-9]+} } } */