diff options
Diffstat (limited to 'gcc/testsuite/gcc.target/i386/vect-perm-even-1.c')
-rw-r--r-- | gcc/testsuite/gcc.target/i386/vect-perm-even-1.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c new file mode 100644 index 00000000000..a2ff73d2382 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/vect-perm-even-1.c @@ -0,0 +1,33 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -ftree-vectorize -ffast-math -mavx512bw -save-temps" } */ + +#include "avx512bw-check.h" + +#define N 400 +unsigned char yy[10000]; +unsigned char xx[10000]; + +void +__attribute__ ((noinline)) foo (unsigned short s) +{ + unsigned short i; + for (i = 0; i < s; i++) + yy[i] = xx [i*2 + 1]; +} + +void +avx512bw_test () +{ + unsigned short i; + unsigned char j = 0; + for (i = 0; i < 2 * N + 1; i++, j++) + xx [i] = j; + + foo (N); + + for (i = 0; i < N; i++) + if ( (unsigned char)(2*i+1) != yy [i] ) + abort (); +} + +/* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\n\]*%zmm" 2 } } */ |