aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/vect-addsub.c
blob: 2d7532882a7e9f0f8ac4178558b555489b5c269d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/* { dg-do compile } */
/* { dg-options "-O2 -ftree-vectorize -msse4 -mtune=generic" } */

/* We need SSE4 so the backend recognizes a { 0, 5, 2, 7 } constant
   permutation as supported as the vectorizer wants to generate

     vect__6.10_24 = vect__3.6_20 - vect__5.9_23;
     vect__6.11_25 = vect__3.6_20 + vect__5.9_23;
     _26 = VEC_PERM_EXPR <vect__6.10_24, vect__6.11_25, { 0, 5, 2, 7 }>;

   See also the ??? comment about using and/andn/or in expand_vec_perm_blend
   for non-SSE4 targets.  */

void testf (float * __restrict__ p, float * __restrict q)
{
  p[0] = p[0] - q[0];
  p[1] = p[1] + q[1];
  p[2] = p[2] - q[2];
  p[3] = p[3] + q[3];
}

/* { dg-final { scan-assembler "addsubps" } } */