Debian Codegraph @

gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-pr82255.c

raw
1 /* { dg-do compile } */
2 /* { dg-require-effective-target vect_int } */
3
4 /* PR82255: Ensure we don't require a vec_construct cost when we aren't
5 going to generate a strided load. */
6
7 extern int abs (int __x) __attribute__ ((__nothrow__, __leaf__))
8 __attribute__ ((__const__));
9
10 static int
11 foo (unsigned char *w, int i, unsigned char *x, int j)
12 {
13 int tot = 0;
14 for (int a = 0; a < 16; a++)
15 {
16 #pragma GCC unroll 16
17 for (int b = 0; b < 16; b++)
18 tot += abs (w[b] - x[b]);
19 w += i;
20 x += j;
21 }
22 return tot;
23 }
24
25 void
26 bar (unsigned char *w, unsigned char *x, int i, int *result)
27 {
28 *result = foo (w, 16, x, i);
29 }
30
31 /* { dg-final { scan-tree-dump-times "vec_construct" 0 "vect" } } */