Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr110206.c

raw
1 /* PR target/110206 */
2 /* { dg-do run } */
3 /* { dg-options "-Os -mavx512bw -mavx512vl" } */
4 /* { dg-require-effective-target avx512bw } */
5 /* { dg-require-effective-target avx512vl } */
6
7 #define AVX512BW
8 #define AVX512VL
9
10 #include "avx512f-check.h"
11
12 typedef unsigned char __attribute__((__vector_size__ (4))) U;
13 typedef unsigned char __attribute__((__vector_size__ (8))) V;
14 typedef unsigned short u16;
15
16 V g;
17
18 void
19 __attribute__((noinline))
20 foo (U u, u16 c, V *r)
21 {
22 if (!c)
23 abort ();
24 V x = __builtin_shufflevector (u, (204 >> u), 7, 0, 5, 1, 3, 5, 0, 2);
25 V y = __builtin_shufflevector (g, (V) { }, 7, 6, 6, 7, 2, 6, 3, 5);
26 V z = __builtin_shufflevector (y, 204 * x, 3, 9, 8, 1, 4, 6, 14, 5);
27 *r = z;
28 }
29
30 static void test_256 (void) { };
31
32 static void
33 test_128 (void)
34 {
35 V r;
36 foo ((U){4}, 5, &r);
37 if (r[6] != 0x30)
38 abort();
39 }