Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr95905-2.c

raw
1 /* PR target/95905 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -msse4.1" } */
4 /* { dg-final { scan-assembler-times "\tv?pmovzxbw\t" 4 } } */
5 /* { dg-final { scan-assembler-times "\tv?pmovzxwd\t" 4 } } */
6 /* { dg-final { scan-assembler-times "\tv?pmovzxdq\t" 4 } } */
7
8 typedef unsigned char V1 __attribute__((vector_size (16)));
9 typedef unsigned short V2 __attribute__((vector_size (16)));
10 typedef unsigned int V3 __attribute__((vector_size (16)));
11
12 V1
13 f1 (V1 x)
14 {
15 return __builtin_shuffle (x, (V1) {}, (V1) { 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23 });
16 }
17
18 V2
19 f2 (V2 x)
20 {
21 return __builtin_shuffle (x, (V2) {}, (V2) { 0, 8, 1, 9, 2, 10, 3, 11 });
22 }
23
24 V3
25 f3 (V3 x)
26 {
27 return __builtin_shuffle (x, (V3) {}, (V3) { 0, 4, 1, 5 });
28 }
29
30 V1
31 f4 (V1 *x)
32 {
33 return __builtin_shuffle (*x, (V1) {}, (V1) { 0, 16, 1, 17, 2, 18, 3, 19, 4, 20, 5, 21, 6, 22, 7, 23 });
34 }
35
36 V2
37 f5 (V2 *x)
38 {
39 return __builtin_shuffle (*x, (V2) {}, (V2) { 0, 8, 1, 9, 2, 10, 3, 11 });
40 }
41
42 V3
43 f6 (V3 *x)
44 {
45 return __builtin_shuffle (*x, (V3) {}, (V3) { 0, 4, 1, 5 });
46 }
47
48 V1
49 f7 (V1 x)
50 {
51 return __builtin_shuffle ((V1) {}, x, (V1) { 16, 0, 17, 1, 18, 2, 19, 3, 20, 4, 21, 5, 22, 6, 23, 7 });
52 }
53
54 V2
55 f8 (V2 x)
56 {
57 return __builtin_shuffle ((V2) {}, x, (V2) { 8, 0, 9, 1, 10, 2, 11, 3 });
58 }
59
60 V3
61 f9 (V3 x)
62 {
63 return __builtin_shuffle ((V3) {}, x, (V3) { 4, 0, 5, 1 });
64 }
65
66 V1
67 f10 (V1 *x)
68 {
69 return __builtin_shuffle ((V1) {}, *x, (V1) { 16, 0, 17, 1, 18, 2, 19, 3, 20, 4, 21, 5, 22, 6, 23, 7 });
70 }
71
72 V2
73 f11 (V2 *x)
74 {
75 return __builtin_shuffle ((V2) {}, *x, (V2) { 8, 0, 9, 1, 10, 2, 11, 3 });
76 }
77
78 V3
79 f12 (V3 *x)
80 {
81 return __builtin_shuffle ((V3) {}, *x, (V3) { 4, 0, 5, 1 });
82 }