1 /* PR target/56766 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -ftree-vectorize -fno-vect-cost-model -mavx" } */
4 
test_v4sf(float * __restrict__ p,float * __restrict q)5 void test_v4sf (float * __restrict__ p, float * __restrict q)
6 {
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];
11 }
12 
test_v8sf(float * __restrict__ p,float * __restrict q)13 void test_v8sf (float * __restrict__ p, float * __restrict q)
14 {
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];
23 }
24 
test_v2df(double * __restrict__ p,double * __restrict q)25 void test_v2df (double * __restrict__ p, double * __restrict q)
26 {
27   p[0] = p[0] - q[0];
28   p[1] = p[1] + q[1];
29 }
30 
test_v4df(double * __restrict__ p,double * __restrict q)31 void test_v4df (double * __restrict__ p, double * __restrict q)
32 {
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];
37 }
38 
39 /* { dg-final { scan-assembler-times "vaddsubps" 2 } } */
40 /* { dg-final { scan-assembler-times "vaddsubpd" 2 } } */
41