2016-12-21 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / vect-pack-trunc-2.c
blobf3d899c1134477908c0573dbf746378673b6214b
1 /* { dg-do run } */
2 /* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
3 /* { dg-require-effective-target avx512bw } */
5 #include "avx512bw-check.h"
7 #define N 400
8 unsigned short yy[10000];
10 void
11 __attribute__ ((noinline)) foo (unsigned int s)
13 unsigned int i;
14 for (i = 0; i < s; i++)
15 yy[i] = (unsigned short) i;
18 void
19 avx512bw_test ()
21 unsigned int i;
22 foo (N);
23 for (i = 0; i < N; i++)
24 if ( (unsigned short)i != yy [i] )
25 abort ();
28 /* { dg-final { scan-assembler-times "vpermi2w\[ \\t\]+\[^\n\]*%zmm" 1 } } */