Debian Codegraph @

gcc/testsuite/gcc.target/loongarch/vect-extract.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-O2 -ffast-math -mlasx -fno-vect-cost-model -fno-unroll-loops" } */
3 /* { dg-final { scan-assembler-not "xvpickve.w" } } */
4 /* { dg-final { scan-assembler-not "xvpickve.d" } } */
5
6 float
7 sum_float (float *a, int n) {
8 float res = 0.0;
9 for (int i = 0; i < n; i++)
10 res += a[i];
11 return res;
12 }
13
14 double
15 sum_double (double *a, int n) {
16 double res = 0.0;
17 for (int i = 0; i < n; i++)
18 res += a[i];
19 return res;
20 }