2018-05-17 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / vect-perm-even-1.c
blob3de4dfabeea01c78d1861082f8467784384244d6
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 char yy[10000];
9 unsigned char xx[10000];
11 void
12 __attribute__ ((noinline)) foo (unsigned short s)
14 unsigned short i;
15 for (i = 0; i < s; i++)
16 yy[i] = xx [i*2 + 1];
19 void
20 avx512bw_test ()
22 unsigned short i;
23 unsigned char j = 0;
24 for (i = 0; i < 2 * N + 1; i++, j++)
25 xx [i] = j;
27 foo (N);
29 for (i = 0; i < N; i++)
30 if ( (unsigned char)(2*i+1) != yy [i] )
31 abort ();
34 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\n\]*%zmm" 2 } } */