annotate gcc/testsuite/gcc.dg/vect/pr43430-1.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-require-effective-target vect_int } */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 #include <stdarg.h>
kono
parents:
diff changeset
4 #include "tree-vect.h"
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 #define N 16
kono
parents:
diff changeset
7
kono
parents:
diff changeset
8 typedef int myint;
kono
parents:
diff changeset
9 myint data_ch1[N + 1] =
kono
parents:
diff changeset
10 { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
kono
parents:
diff changeset
11 myint data_ch2[N + 1] =
kono
parents:
diff changeset
12 { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30 };
kono
parents:
diff changeset
13 #define SUM 480
kono
parents:
diff changeset
14
kono
parents:
diff changeset
15 __attribute__ ((noinline)) int
kono
parents:
diff changeset
16 foo (myint * s1, myint * s2, int stride)
kono
parents:
diff changeset
17 {
kono
parents:
diff changeset
18 int score = 0;
kono
parents:
diff changeset
19 int x;
kono
parents:
diff changeset
20 for (x = 0; x < N; x++)
kono
parents:
diff changeset
21 score += ((s1[x] - s1[x + stride] + s2[x + stride]) >= 0 ?
kono
parents:
diff changeset
22 s1[x] + s2[x + stride] :
kono
parents:
diff changeset
23 s2[x + stride]);
kono
parents:
diff changeset
24
kono
parents:
diff changeset
25 if (score != SUM)
kono
parents:
diff changeset
26 abort ();
kono
parents:
diff changeset
27
kono
parents:
diff changeset
28 return 0;
kono
parents:
diff changeset
29 }
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 int
kono
parents:
diff changeset
32 main (void)
kono
parents:
diff changeset
33 {
kono
parents:
diff changeset
34 check_vect ();
kono
parents:
diff changeset
35 return foo (data_ch1, data_ch2, 1);
kono
parents:
diff changeset
36 }
kono
parents:
diff changeset
37
kono
parents:
diff changeset
38 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_condition } } } */