Debian Codegraph @

gcc/testsuite/gcc.target/i386/vect-perm-odd-1.c

raw
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
9 typedef struct
10 {
11 unsigned char real;
12 unsigned char imag;
13 } complex8_t;
14
15 void
16 __attribute__ ((noinline)) foo (unsigned char *a,
17 complex8_t *x, unsigned len)
18 {
19 unsigned i;
20 for (i = 0; i < len; i++)
21 a[i] = x[i].imag + x[i].real;
22 }
23
24 void
25 avx512bw_test ()
26 {
27 unsigned short i;
28 unsigned char j = 0;
29 complex8_t x [N];
30 unsigned char a [N];
31
32 for (i = 0; i < N; i++, j++)
33 {
34 x [i].real = j;
35 x [i].imag = j;
36 }
37
38 foo (a, x, N);
39
40 j = 0;
41 for (i = 0; i < N; i++, j++)
42 if ( a[i] != (unsigned char)(j+j) )
43 abort ();
44 }
45
46 /* { dg-final { scan-assembler-times "vpmovwb\[ \\t\]+\[^\n\]*%zmm" 4 } } */