blob: bddd9f909a620ed467f70d797d818d0b01e04b16 (
plain)
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
32
|
/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */
/* { dg-require-effective-target vect_condition } */
#define N 16
typedef struct {
int x;
int y;
} Point;
void
foo(Point *p1, Point *p2, Point *p3, int *data)
{
int m, m1, m2;
int i;
for (i = 0; i < N; i++) {
m = *data++;
m1 = p1->x - m;
m2 = p2->x + m;
p3->y = (m1 >= m2) ? p1->y : p2->y;
p1++;
p2++;
p3++;
}
}
/* { dg-final { scan-tree-dump "vectorized 1 loops" "vect" } } */
|