Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr101846-3.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mavx512vl -mavx512vbmi -O2" } */
3 /* { dg-final { scan-assembler-times "vpermb" "2" } } */
4 /* { dg-final { scan-assembler-times "vpermw" "2" } } */
5 /* { dg-final { scan-assembler-times "vpermd" "2" } } */
6
7 typedef short v4hi __attribute__((vector_size (8)));
8 typedef short v8hi __attribute__((vector_size (16)));
9 typedef short v16hi __attribute__((vector_size (32)));
10 typedef short v32hi __attribute__((vector_size (64)));
11 typedef char v8qi __attribute__((vector_size (8)));
12 typedef char v16qi __attribute__((vector_size (16)));
13 typedef char v32qi __attribute__((vector_size (32)));
14 typedef char v64qi __attribute__((vector_size (64)));
15 typedef int v2si __attribute__((vector_size (8)));
16 typedef int v4si __attribute__((vector_size (16)));
17 typedef int v8si __attribute__((vector_size (32)));
18 typedef int v16si __attribute__((vector_size (64)));
19
20 v32hi
21 foow_512 (v32hi x)
22 {
23 return __builtin_shufflevector (x, x,
24 0, 2, 4, 6, 8, 10, 12, 14,
25 16, 18, 20, 22, 24, 26, 28, 30,
26 16, 17, 18, 19, 20, 21, 22, 23,
27 24, 25, 26, 27, 28, 29, 30, 31);
28 }
29
30 v16hi
31 foow_256 (v16hi x)
32 {
33 return __builtin_shufflevector (x, x, 0, 2, 4, 6, 8, 10, 12, 14,
34 8, 9, 10, 11, 12, 13, 14, 15);
35 }
36
37
38 v16si
39 food_512 (v16si x)
40 {
41 return __builtin_shufflevector (x, x, 0, 2, 4, 6, 8, 10, 12, 14,
42 8, 9, 10, 11, 12, 13, 14, 15);
43 }
44
45 v8si
46 food_256 (v8si x)
47 {
48 return __builtin_shufflevector (x, x, 0, 2, 4, 6, 4, 5, 6, 7);
49 }
50
51 v64qi
52 foob_512 (v64qi x)
53 {
54 return __builtin_shufflevector (x, x,
55 0, 2, 4, 6, 8, 10, 12, 14,
56 16, 18, 20, 22, 24, 26, 28, 30,
57 32, 34, 36, 38, 40, 42, 44, 46,
58 48, 50, 52, 54, 56, 58, 60, 62,
59 32, 33, 34, 35, 36, 37, 38, 39,
60 40, 41, 42, 43, 44, 45, 46, 47,
61 48, 49, 50, 51, 52, 53, 54, 55,
62 56, 57, 58, 59, 60, 61, 62, 63);
63 }
64
65 v32qi
66 foob_256 (v32qi x)
67 {
68 return __builtin_shufflevector (x, x,
69 0, 2, 4, 6, 8, 10, 12, 14,
70 16, 18, 20, 22, 24, 26, 28, 30,
71 16, 17, 18, 19, 20, 21, 22, 23,
72 24, 25, 26, 27, 28, 29, 30, 31);
73 }