2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / pr56766-2.c
blobfa3a706caebad984da5b946e421b2c2317e6836f
1 /* PR target/56766 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model -mavx" } */
5 void test_v4sf (float * __restrict__ p, float * __restrict q)
7 p[0] = p[0] - q[0];
8 p[1] = p[1] + q[1];
9 p[2] = p[2] - q[2];
10 p[3] = p[3] + q[3];
13 void test_v8sf (float * __restrict__ p, float * __restrict q)
15 p[0] = p[0] - q[0];
16 p[1] = p[1] + q[1];
17 p[2] = p[2] - q[2];
18 p[3] = p[3] + q[3];
19 p[4] = p[4] - q[4];
20 p[5] = p[5] + q[5];
21 p[6] = p[6] - q[6];
22 p[7] = p[7] + q[7];
25 void test_v2df (double * __restrict__ p, double * __restrict q)
27 p[0] = p[0] - q[0];
28 p[1] = p[1] + q[1];
31 void test_v4df (double * __restrict__ p, double * __restrict q)
33 p[0] = p[0] - q[0];
34 p[1] = p[1] + q[1];
35 p[2] = p[2] - q[2];
36 p[3] = p[3] + q[3];
39 /* { dg-final { scan-assembler-times "vaddsubps" 2 } } */
40 /* { dg-final { scan-assembler-times "vaddsubpd" 2 } } */