Daily bump.
[official-gcc.git] / gcc / testsuite / gcc.target / i386 / vect-perm-odd-1.c
blobe32d40a1bac6652ff924cf49a5a050dd19453425
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
9 typedef struct
11 unsigned char real;
12 unsigned char imag;
13 } complex8_t;
15 void
16 __attribute__ ((noinline)) foo (unsigned char *a,
17 complex8_t *x, unsigned len)
19 unsigned i;
20 for (i = 0; i < len; i++)
21 a[i] = x[i].imag + x[i].real;
24 void
25 avx512bw_test ()
27 unsigned short i;
28 unsigned char j = 0;
29 complex8_t x [N];
30 unsigned char a [N];
32 for (i = 0; i < N; i++, j++)
34 x [i].real = j;
35 x [i].imag = j;
38 foo (a, x, N);
40 j = 0;
41 for (i = 0; i < N; i++, j++)
42 if ( a[i] != (unsigned char)(j+j) )
43 abort ();
46 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\n\]*%zmm" 4 } } */