Debian Codegraph @

gcc/testsuite/gcc.dg/vect/vect-nest-cycle-1.c

raw
1 /* { dg-require-effective-target vect_float } */
2
3 #include <stdarg.h>
4 #include "tree-vect.h"
5
6 #define N 16
7
8 float in[N] = {232,132,32,432,532,321,327,323,321,324,322,329,432,832,932,232};
9 float out[N];
10 float check_res[N] = {112,-4,-120,264,348,121,111,91,73,60,42,33,120,504,588,-128};
11 float a[2*N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31};
12
13 /* Outer-loop vectorization. */
14
15 __attribute__ ((noinline)) void
16 foo ()
17 {
18 int i, j;
19 float res;
20
21 for (i = 0; i < N; i++)
22 {
23 res = in[i];
24
25 for (j = 0; j < N; j++)
26 res = res - a[i+j];
27
28 out[i] = res;
29 }
30
31 #pragma GCC novector
32 for (i = 0; i < N; i++)
33 if (out[i] != check_res[i])
34 abort ();
35
36 }
37
38 int main ()
39 {
40 check_vect ();
41
42 foo();
43
44 return 0;
45 }
46
47 /* { dg-final { scan-tree-dump-times "OUTER LOOP VECTORIZED" 1 "vect" { xfail { vect_no_align && { ! vect_hw_misalign } } } } } */
48