1 /* { dg-require-effective-target vect_simd_clones } */
2 /* { dg-additional-options "-O3 -fopenmp-simd -ffast-math" } */
9 float *x1
, *z1
, *t1
, *t2
;
12 static void inline bar(const float cx
, float cy
,
13 float *vx
, float *vy
, int n
)
16 for (j
= 0; j
< n
; ++j
)
18 const float dx
= cx
- px
[j
];
19 const float dy
= cy
- py
[j
];
25 __attribute__((noinline
, noclone
)) void foo1 ()
31 bar(px
[i
], py
[i
], x1
+i
, z1
+i
, n
);
34 __attribute__((noinline
, noclone
)) void foo2 ()
39 bar(px
[i
], py
[i
], x1
+i
, z1
+i
, n
);
45 float *X
= (float*)malloc(N
* 8 * sizeof (float));
59 px
[i
] = (float) (i
+2);
60 tx
[i
] = (float) (i
+1);
61 py
[i
] = (float) (i
+4);
62 ty
[i
] = (float) (i
+3);
66 foo1 (); /* vector variant. */
69 t1
[i
] = x1
[i
]; x1
[i
] = 1.0f
;
70 t2
[i
] = z1
[i
]; z1
[i
] = 1.0f
;
72 foo2 (); /* scalar variant. */
75 if (x1
[i
] != t1
[i
] || z1
[i
] != t2
[i
])
79 /* { dg-final { scan-tree-dump "OUTER LOOP VECTORIZED" "vect" } } */