Debian Codegraph @

gcc/testsuite/gcc.target/i386/vect-gather-1.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-Ofast -msse2 -fdump-tree-vect-details -fdump-tree-forwprop4" } */
3
4 #ifndef INDEXTYPE
5 #define INDEXTYPE int
6 #endif
7 double vmul(INDEXTYPE *rowstart, INDEXTYPE *rowend,
8 double *luval, double *dst)
9 {
10 double res = 0;
11 for (const INDEXTYPE * col = rowstart; col != rowend; ++col, ++luval)
12 res += *luval * dst[*col];
13 return res;
14 }
15
16 /* With gather emulation this should be profitable to vectorize
17 even with plain SSE2. */
18 /* { dg-final { scan-tree-dump "loop vectorized" "vect" } } */
19 /* The index vector loads and promotions should be scalar after forwprop. */
20 /* { dg-final { scan-tree-dump-not "vec_unpack" "forwprop4" } } */