Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / gcc.dg / vect / vect-latch.c
blob0e8b44132578d8719ffa37c39ffc601d6ab245a5
1 /* { dg-do compile { target powerpc*-*-* } } */
2 #define N 64
4 void
5 foo (short * __restrict__ pmetric,
6 short * __restrict__ p1,
7 short * __restrict__ p2,
8 short * __restrict__ out1,
9 short * __restrict__ out2)
11 int i;
12 short metric, m1, m2;
13 short x1, x2;
14 short y1, y2;
16 for (i = 0; i < N; i++) {
17 metric = *pmetric++;
19 m1 = *p1 - metric;
20 m2 = *p2 + metric;
21 if (m1 >= m2) {
22 x1 = m1;
23 y1 = m1>>1;
25 else {
26 x1 = m2;
27 y1 = m2>>1;
30 m1 = *p1 + metric;
31 m2 = *p2 - metric;
32 if (m1 >= m2) {
33 x2 = m1;
34 y2 = m1>>1;
36 else {
37 x2 = m2;
38 y2 = m2>>1;
40 *out1 = x1;
41 *out2 = y1;
42 out1++;
43 out2++;
44 *out1 = x2;
45 *out2 = y2;
46 out1++;
47 out2++;
48 p1++;
49 p2++;
53 /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
54 /* { dg-final { cleanup-tree-dump "vect" } } */