1 /* { dg-do run } */
2 /* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */
3 /* { dg-require-effective-target avx512bw } */
4 
5 #include "avx512bw-check.h"
6 
7 #define N 400
8 unsigned short yy[10000];
9 
10 void
foo(unsigned int s)11 __attribute__ ((noinline)) foo (unsigned int s)
12 {
13    unsigned int i;
14    for (i = 0; i < s; i++)
15      yy[i] = (unsigned short) i;
16 }
17 
18 void
avx512bw_test()19 avx512bw_test ()
20 {
21   unsigned int i;
22   foo (N);
23   for (i = 0; i < N; i++)
24     if ( (unsigned short)i != yy [i] )
25       abort ();
26 }
27 
28 /* { dg-final { scan-assembler-times "vperm\[it]2w\[ \\t\]+\[^\n\]*%zmm" 1 } } */
29