summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.target/i386/vect-pack-trunc-2.c
blob: f3d899c1134477908c0573dbf746378673b6214b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-do run } */
/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
/* { dg-require-effective-target avx512bw } */

#include "avx512bw-check.h"

#define N 400
unsigned short yy[10000];

void
__attribute__ ((noinline)) foo (unsigned int s)
{
   unsigned int i;
   for (i = 0; i < s; i++)
     yy[i] = (unsigned short) i;
}

void
avx512bw_test ()
{
  unsigned int i;
  foo (N);
  for (i = 0; i < N; i++)
    if ( (unsigned short)i != yy [i] )
      abort ();
}

/* { dg-final { scan-assembler-times "vpermi2w\[ \\t\]+\[^\n\]*%zmm" 1 } } */