Debian Codegraph @

gcc/testsuite/gcc.target/i386/pr92658-sse4-2.c

raw
1 /* PR target/92658 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2 -mtune=icelake-server -ftree-vectorize -msse4.1" } */
4
5 typedef char v16qi __attribute__((vector_size (16)));
6 typedef short v8hi __attribute__((vector_size (16)));
7 typedef int v4si __attribute__((vector_size (16)));
8 typedef long long v2di __attribute__((vector_size (16)));
9
10 void
11 foo_s8_s16 (v8hi * dst, v16qi * __restrict src)
12 {
13 short tem[8];
14 tem[0] = (*src)[0];
15 tem[1] = (*src)[1];
16 tem[2] = (*src)[2];
17 tem[3] = (*src)[3];
18 tem[4] = (*src)[4];
19 tem[5] = (*src)[5];
20 tem[6] = (*src)[6];
21 tem[7] = (*src)[7];
22 dst[0] = *(v8hi *) tem;
23 }
24
25 void
26 bar_s8_s16 (v8hi * dst, v16qi src)
27 {
28 short tem[8];
29 tem[0] = src[0];
30 tem[1] = src[1];
31 tem[2] = src[2];
32 tem[3] = src[3];
33 tem[4] = src[4];
34 tem[5] = src[5];
35 tem[6] = src[6];
36 tem[7] = src[7];
37 dst[0] = *(v8hi *) tem;
38 }
39
40 /* { dg-final { scan-assembler-times "pmovsxbw" 2 } } */
41
42 void
43 foo_s8_s32 (v4si * dst, v16qi * __restrict src)
44 {
45 int tem[4];
46 tem[0] = (*src)[0];
47 tem[1] = (*src)[1];
48 tem[2] = (*src)[2];
49 tem[3] = (*src)[3];
50 dst[0] = *(v4si *) tem;
51 }
52
53 void
54 bar_s8_s32 (v4si * dst, v16qi src)
55 {
56 int tem[4];
57 tem[0] = src[0];
58 tem[1] = src[1];
59 tem[2] = src[2];
60 tem[3] = src[3];
61 dst[0] = *(v4si *) tem;
62 }
63
64 /* { dg-final { scan-assembler-times "pmovsxbd" 2 } } */
65
66 void
67 foo_s8_s64 (v2di * dst, v16qi * __restrict src)
68 {
69 long long tem[2];
70 tem[0] = (*src)[0];
71 tem[1] = (*src)[1];
72 dst[0] = *(v2di *) tem;
73 }
74
75 void
76 bar_s8_s64 (v2di * dst, v16qi src)
77 {
78 long long tem[2];
79 tem[0] = src[0];
80 tem[1] = src[1];
81 dst[0] = *(v2di *) tem;
82 }
83
84 /* { dg-final { scan-assembler-times "pmovsxbq" 2 } } */
85
86 void
87 foo_s16_s32 (v4si * dst, v8hi * __restrict src)
88 {
89 int tem[4];
90 tem[0] = (*src)[0];
91 tem[1] = (*src)[1];
92 tem[2] = (*src)[2];
93 tem[3] = (*src)[3];
94 dst[0] = *(v4si *) tem;
95 }
96
97 void
98 bar_s16_s32 (v4si * dst, v8hi src)
99 {
100 int tem[4];
101 tem[0] = src[0];
102 tem[1] = src[1];
103 tem[2] = src[2];
104 tem[3] = src[3];
105 dst[0] = *(v4si *) tem;
106 }
107
108 /* { dg-final { scan-assembler-times "pmovsxwd" 2 } } */
109
110 void
111 foo_s16_s64 (v2di * dst, v8hi * __restrict src)
112 {
113 long long tem[2];
114 tem[0] = (*src)[0];
115 tem[1] = (*src)[1];
116 dst[0] = *(v2di *) tem;
117 }
118
119 void
120 bar_s16_s64 (v2di * dst, v8hi src)
121 {
122 long long tem[2];
123 tem[0] = src[0];
124 tem[1] = src[1];
125 dst[0] = *(v2di *) tem;
126 }
127
128 /* { dg-final { scan-assembler-times "pmovsxwq" 2 } } */
129
130 void
131 foo_s32_s64 (v2di * dst, v4si * __restrict src)
132 {
133 long long tem[2];
134 tem[0] = (*src)[0];
135 tem[1] = (*src)[1];
136 dst[0] = *(v2di *) tem;
137 }
138
139 void
140 bar_s32_s64 (v2di * dst, v4si src)
141 {
142 long long tem[2];
143 tem[0] = src[0];
144 tem[1] = src[1];
145 dst[0] = *(v2di *) tem;
146 }
147
148 /* { dg-final { scan-assembler-times "pmovsxdq" 2 } } */