aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/vect/costmodel/ppc/costmodel-slp-perm.c
blob: 624881b581f7e65db787ab3fa17c318cab0e073f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* Specify power9 to ensure the vectorization is profitable
   and test point stands, otherwise it could be not profitable
   to vectorize.  */
/* { dg-additional-options "-mdejagnu-cpu=power9 -mvsx" } */

/* Verify we cost the exact count for required vec_perm.  */

int x[1024], y[1024];

void
foo ()
{
  for (int i = 0; i < 512; ++i)
    {
      x[2 * i] = y[1023 - (2 * i)];
      x[2 * i + 1] = y[1023 - (2 * i + 1)];
    }
}

/* { dg-final { scan-tree-dump-times "2 times vec_perm" 1 "vect" } } */