Debian Codegraph @

gcc/testsuite/gcc.target/riscv/rvv/autovec/reduc/reduc_call-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
5 foo (double *restrict r, const double *restrict a, const double *restrict b,
6 const double *restrict c, double res)
7 {
8 for (int i = 0; i < 1024; i++)
9 {
10 double x = __builtin_fma (a[i], b[i], c[i]);
11 res += __builtin_fma (a[i], b[i], x);
12 }
13 return res;
14 }
15
16 /* { dg-final { scan-assembler-times {vfredosum\.vs\s+v[0-9]+,v[0-9]+,v[0-9]+} 1 } } */