Debian Codegraph @

gcc/testsuite/gcc.target/i386/avx512fp16-pr94680.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-mavx512fp16 -mavx512vl -O2" } */
3 /* { dg-final { scan-assembler-times "vmovdqa" 4 } } */
4 /* { dg-final { scan-assembler-times "vmovq" 2 } } */
5
6 typedef _Float16 v32hf __attribute__((vector_size (64)));
7 typedef _Float16 v16hf __attribute__((vector_size (32)));
8 typedef _Float16 v8hf __attribute__((vector_size (16)));
9 typedef short v32hi __attribute__((vector_size (64)));
10 typedef short v16hi __attribute__((vector_size (32)));
11 typedef short v8hi __attribute__((vector_size (16)));
12
13
14 #define PERM_CONST_CONCAT0_v32hi \
15 { 0, 1, 2, 3, 4, 5, 6, 7, \
16 8, 9, 10, 11, 12, 13, 14, 15, \
17 34, 53, 41, 55, 57, 43, 36, 39, \
18 62, 48, 50, 51, 49, 44, 60, 37 }
19
20 #define PERM_CONST_CONCAT0_v32hi_l \
21 { 32, 33, 34, 35, 36, 37, 38, 39, \
22 40, 41, 42, 43, 44, 45, 46, 47, \
23 31, 0, 29, 2, 27, 4, 25, 6, 23, \
24 8, 21, 10, 19, 12, 17, 14 }
25
26 #define PERM_CONST_CONCAT0_v16hi \
27 { 0, 1, 2, 3, 4, 5, 6, 7, \
28 21, 26, 17, 31, 24, 22, 30, 19 }
29
30 #define PERM_CONST_CONCAT0_v16hi_l \
31 { 16, 17, 18, 19, 20, 21, 22, 23, \
32 15, 0, 13, 2, 11, 4, 9, 6 }
33
34 #define PERM_CONST_CONCAT0_v8hi \
35 { 0, 1, 2, 3, 9, 11, 14, 12 }
36
37 #define PERM_CONST_CONCAT0_v8hi_l \
38 { 8, 9, 10, 11, 3, 5, 1, 7 }
39
40 #define PERM_CONST_CONCAT0(type) \
41 PERM_CONST_CONCAT0_##type
42
43 #define PERM_CONST_CONCAT0_L(type) \
44 PERM_CONST_CONCAT0_##type##_l
45
46 #define SHUFFLE_CONST_CONCAT0(type, itype) \
47 type foo_##type##shuffle_const_concat0 (type a) \
48 { \
49 return __builtin_shuffle (a, (type) {0}, \
50 (itype) PERM_CONST_CONCAT0 (itype)); \
51 } \
52 type foo_##type##shuffle_const_concat0_l (type a) \
53 { \
54 return __builtin_shuffle ((type) {0}, a, \
55 (itype) PERM_CONST_CONCAT0_L (itype)); \
56 }
57
58 SHUFFLE_CONST_CONCAT0 (v32hf, v32hi)
59 SHUFFLE_CONST_CONCAT0 (v16hf, v16hi)
60 SHUFFLE_CONST_CONCAT0 (v8hf, v8hi)
61