1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -mtriple=x86_64-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=SSE,SSE2
3 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -mtriple=x86_64-unknown-unknown -mattr=+ssse3 | FileCheck %s --check-prefixes=SSE,SSSE3
4 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefixes=SSE,SSE41
5 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,AVX1
6 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX,AVX2
7 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=AVX,AVX512,AVX512F
8 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw | FileCheck %s --check-prefixes=AVX,AVX512,AVX512BW
10 ; Just two 32-bit runs to make sure we do reasonable things there.
11 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -mtriple=i686-unknown-unknown -mattr=+sse2 | FileCheck %s --check-prefixes=X32-SSE,X32-SSE2
12 ; RUN: llc < %s -x86-experimental-vector-widening-legalization -mtriple=i686-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefixes=X32-SSE,X32-SSE41
14 define <8 x i16> @sext_16i8_to_8i16(<16 x i8> %A) nounwind uwtable readnone ssp {
15 ; SSE2-LABEL: sext_16i8_to_8i16:
16 ; SSE2: # %bb.0: # %entry
17 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
18 ; SSE2-NEXT: psraw $8, %xmm0
21 ; SSSE3-LABEL: sext_16i8_to_8i16:
22 ; SSSE3: # %bb.0: # %entry
23 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
24 ; SSSE3-NEXT: psraw $8, %xmm0
27 ; SSE41-LABEL: sext_16i8_to_8i16:
28 ; SSE41: # %bb.0: # %entry
29 ; SSE41-NEXT: pmovsxbw %xmm0, %xmm0
32 ; AVX-LABEL: sext_16i8_to_8i16:
33 ; AVX: # %bb.0: # %entry
34 ; AVX-NEXT: vpmovsxbw %xmm0, %xmm0
37 ; X32-SSE2-LABEL: sext_16i8_to_8i16:
38 ; X32-SSE2: # %bb.0: # %entry
39 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
40 ; X32-SSE2-NEXT: psraw $8, %xmm0
43 ; X32-SSE41-LABEL: sext_16i8_to_8i16:
44 ; X32-SSE41: # %bb.0: # %entry
45 ; X32-SSE41-NEXT: pmovsxbw %xmm0, %xmm0
46 ; X32-SSE41-NEXT: retl
48 %B = shufflevector <16 x i8> %A, <16 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
49 %C = sext <8 x i8> %B to <8 x i16>
53 define <16 x i16> @sext_16i8_to_16i16(<16 x i8> %A) nounwind uwtable readnone ssp {
54 ; SSE2-LABEL: sext_16i8_to_16i16:
55 ; SSE2: # %bb.0: # %entry
56 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
57 ; SSE2-NEXT: psraw $8, %xmm2
58 ; SSE2-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
59 ; SSE2-NEXT: psraw $8, %xmm1
60 ; SSE2-NEXT: movdqa %xmm2, %xmm0
63 ; SSSE3-LABEL: sext_16i8_to_16i16:
64 ; SSSE3: # %bb.0: # %entry
65 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
66 ; SSSE3-NEXT: psraw $8, %xmm2
67 ; SSSE3-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
68 ; SSSE3-NEXT: psraw $8, %xmm1
69 ; SSSE3-NEXT: movdqa %xmm2, %xmm0
72 ; SSE41-LABEL: sext_16i8_to_16i16:
73 ; SSE41: # %bb.0: # %entry
74 ; SSE41-NEXT: pmovsxbw %xmm0, %xmm2
75 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
76 ; SSE41-NEXT: pmovsxbw %xmm0, %xmm1
77 ; SSE41-NEXT: movdqa %xmm2, %xmm0
80 ; AVX1-LABEL: sext_16i8_to_16i16:
81 ; AVX1: # %bb.0: # %entry
82 ; AVX1-NEXT: vpmovsxbw %xmm0, %xmm1
83 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
84 ; AVX1-NEXT: vpmovsxbw %xmm0, %xmm0
85 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
88 ; AVX2-LABEL: sext_16i8_to_16i16:
89 ; AVX2: # %bb.0: # %entry
90 ; AVX2-NEXT: vpmovsxbw %xmm0, %ymm0
93 ; AVX512-LABEL: sext_16i8_to_16i16:
94 ; AVX512: # %bb.0: # %entry
95 ; AVX512-NEXT: vpmovsxbw %xmm0, %ymm0
98 ; X32-SSE2-LABEL: sext_16i8_to_16i16:
99 ; X32-SSE2: # %bb.0: # %entry
100 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3],xmm2[4],xmm0[4],xmm2[5],xmm0[5],xmm2[6],xmm0[6],xmm2[7],xmm0[7]
101 ; X32-SSE2-NEXT: psraw $8, %xmm2
102 ; X32-SSE2-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8],xmm0[8],xmm1[9],xmm0[9],xmm1[10],xmm0[10],xmm1[11],xmm0[11],xmm1[12],xmm0[12],xmm1[13],xmm0[13],xmm1[14],xmm0[14],xmm1[15],xmm0[15]
103 ; X32-SSE2-NEXT: psraw $8, %xmm1
104 ; X32-SSE2-NEXT: movdqa %xmm2, %xmm0
105 ; X32-SSE2-NEXT: retl
107 ; X32-SSE41-LABEL: sext_16i8_to_16i16:
108 ; X32-SSE41: # %bb.0: # %entry
109 ; X32-SSE41-NEXT: pmovsxbw %xmm0, %xmm2
110 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
111 ; X32-SSE41-NEXT: pmovsxbw %xmm0, %xmm1
112 ; X32-SSE41-NEXT: movdqa %xmm2, %xmm0
113 ; X32-SSE41-NEXT: retl
115 %B = sext <16 x i8> %A to <16 x i16>
119 define <32 x i16> @sext_32i8_to_32i16(<32 x i8> %A) nounwind uwtable readnone ssp {
120 ; SSE2-LABEL: sext_32i8_to_32i16:
121 ; SSE2: # %bb.0: # %entry
122 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1],xmm4[2],xmm0[2],xmm4[3],xmm0[3],xmm4[4],xmm0[4],xmm4[5],xmm0[5],xmm4[6],xmm0[6],xmm4[7],xmm0[7]
123 ; SSE2-NEXT: psraw $8, %xmm4
124 ; SSE2-NEXT: punpckhbw {{.*#+}} xmm5 = xmm5[8],xmm0[8],xmm5[9],xmm0[9],xmm5[10],xmm0[10],xmm5[11],xmm0[11],xmm5[12],xmm0[12],xmm5[13],xmm0[13],xmm5[14],xmm0[14],xmm5[15],xmm0[15]
125 ; SSE2-NEXT: psraw $8, %xmm5
126 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
127 ; SSE2-NEXT: psraw $8, %xmm2
128 ; SSE2-NEXT: punpckhbw {{.*#+}} xmm3 = xmm3[8],xmm1[8],xmm3[9],xmm1[9],xmm3[10],xmm1[10],xmm3[11],xmm1[11],xmm3[12],xmm1[12],xmm3[13],xmm1[13],xmm3[14],xmm1[14],xmm3[15],xmm1[15]
129 ; SSE2-NEXT: psraw $8, %xmm3
130 ; SSE2-NEXT: movdqa %xmm4, %xmm0
131 ; SSE2-NEXT: movdqa %xmm5, %xmm1
134 ; SSSE3-LABEL: sext_32i8_to_32i16:
135 ; SSSE3: # %bb.0: # %entry
136 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1],xmm4[2],xmm0[2],xmm4[3],xmm0[3],xmm4[4],xmm0[4],xmm4[5],xmm0[5],xmm4[6],xmm0[6],xmm4[7],xmm0[7]
137 ; SSSE3-NEXT: psraw $8, %xmm4
138 ; SSSE3-NEXT: punpckhbw {{.*#+}} xmm5 = xmm5[8],xmm0[8],xmm5[9],xmm0[9],xmm5[10],xmm0[10],xmm5[11],xmm0[11],xmm5[12],xmm0[12],xmm5[13],xmm0[13],xmm5[14],xmm0[14],xmm5[15],xmm0[15]
139 ; SSSE3-NEXT: psraw $8, %xmm5
140 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
141 ; SSSE3-NEXT: psraw $8, %xmm2
142 ; SSSE3-NEXT: punpckhbw {{.*#+}} xmm3 = xmm3[8],xmm1[8],xmm3[9],xmm1[9],xmm3[10],xmm1[10],xmm3[11],xmm1[11],xmm3[12],xmm1[12],xmm3[13],xmm1[13],xmm3[14],xmm1[14],xmm3[15],xmm1[15]
143 ; SSSE3-NEXT: psraw $8, %xmm3
144 ; SSSE3-NEXT: movdqa %xmm4, %xmm0
145 ; SSSE3-NEXT: movdqa %xmm5, %xmm1
148 ; SSE41-LABEL: sext_32i8_to_32i16:
149 ; SSE41: # %bb.0: # %entry
150 ; SSE41-NEXT: pmovsxbw %xmm0, %xmm5
151 ; SSE41-NEXT: pmovsxbw %xmm1, %xmm2
152 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
153 ; SSE41-NEXT: pmovsxbw %xmm0, %xmm4
154 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
155 ; SSE41-NEXT: pmovsxbw %xmm0, %xmm3
156 ; SSE41-NEXT: movdqa %xmm5, %xmm0
157 ; SSE41-NEXT: movdqa %xmm4, %xmm1
160 ; AVX1-LABEL: sext_32i8_to_32i16:
161 ; AVX1: # %bb.0: # %entry
162 ; AVX1-NEXT: vpmovsxbw %xmm0, %xmm1
163 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[2,3,0,1]
164 ; AVX1-NEXT: vpmovsxbw %xmm2, %xmm2
165 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm2
166 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
167 ; AVX1-NEXT: vpmovsxbw %xmm0, %xmm1
168 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
169 ; AVX1-NEXT: vpmovsxbw %xmm0, %xmm0
170 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm1
171 ; AVX1-NEXT: vmovaps %ymm2, %ymm0
174 ; AVX2-LABEL: sext_32i8_to_32i16:
175 ; AVX2: # %bb.0: # %entry
176 ; AVX2-NEXT: vpmovsxbw %xmm0, %ymm2
177 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm0
178 ; AVX2-NEXT: vpmovsxbw %xmm0, %ymm1
179 ; AVX2-NEXT: vmovdqa %ymm2, %ymm0
182 ; AVX512F-LABEL: sext_32i8_to_32i16:
183 ; AVX512F: # %bb.0: # %entry
184 ; AVX512F-NEXT: vpmovsxbw %xmm0, %ymm2
185 ; AVX512F-NEXT: vextracti128 $1, %ymm0, %xmm0
186 ; AVX512F-NEXT: vpmovsxbw %xmm0, %ymm1
187 ; AVX512F-NEXT: vmovdqa %ymm2, %ymm0
190 ; AVX512BW-LABEL: sext_32i8_to_32i16:
191 ; AVX512BW: # %bb.0: # %entry
192 ; AVX512BW-NEXT: vpmovsxbw %ymm0, %zmm0
193 ; AVX512BW-NEXT: retq
195 ; X32-SSE2-LABEL: sext_32i8_to_32i16:
196 ; X32-SSE2: # %bb.0: # %entry
197 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1],xmm4[2],xmm0[2],xmm4[3],xmm0[3],xmm4[4],xmm0[4],xmm4[5],xmm0[5],xmm4[6],xmm0[6],xmm4[7],xmm0[7]
198 ; X32-SSE2-NEXT: psraw $8, %xmm4
199 ; X32-SSE2-NEXT: punpckhbw {{.*#+}} xmm5 = xmm5[8],xmm0[8],xmm5[9],xmm0[9],xmm5[10],xmm0[10],xmm5[11],xmm0[11],xmm5[12],xmm0[12],xmm5[13],xmm0[13],xmm5[14],xmm0[14],xmm5[15],xmm0[15]
200 ; X32-SSE2-NEXT: psraw $8, %xmm5
201 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3],xmm2[4],xmm1[4],xmm2[5],xmm1[5],xmm2[6],xmm1[6],xmm2[7],xmm1[7]
202 ; X32-SSE2-NEXT: psraw $8, %xmm2
203 ; X32-SSE2-NEXT: punpckhbw {{.*#+}} xmm3 = xmm3[8],xmm1[8],xmm3[9],xmm1[9],xmm3[10],xmm1[10],xmm3[11],xmm1[11],xmm3[12],xmm1[12],xmm3[13],xmm1[13],xmm3[14],xmm1[14],xmm3[15],xmm1[15]
204 ; X32-SSE2-NEXT: psraw $8, %xmm3
205 ; X32-SSE2-NEXT: movdqa %xmm4, %xmm0
206 ; X32-SSE2-NEXT: movdqa %xmm5, %xmm1
207 ; X32-SSE2-NEXT: retl
209 ; X32-SSE41-LABEL: sext_32i8_to_32i16:
210 ; X32-SSE41: # %bb.0: # %entry
211 ; X32-SSE41-NEXT: pmovsxbw %xmm0, %xmm5
212 ; X32-SSE41-NEXT: pmovsxbw %xmm1, %xmm2
213 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
214 ; X32-SSE41-NEXT: pmovsxbw %xmm0, %xmm4
215 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
216 ; X32-SSE41-NEXT: pmovsxbw %xmm0, %xmm3
217 ; X32-SSE41-NEXT: movdqa %xmm5, %xmm0
218 ; X32-SSE41-NEXT: movdqa %xmm4, %xmm1
219 ; X32-SSE41-NEXT: retl
221 %B = sext <32 x i8> %A to <32 x i16>
225 define <4 x i32> @sext_16i8_to_4i32(<16 x i8> %A) nounwind uwtable readnone ssp {
226 ; SSE2-LABEL: sext_16i8_to_4i32:
227 ; SSE2: # %bb.0: # %entry
228 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
229 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
230 ; SSE2-NEXT: psrad $24, %xmm0
233 ; SSSE3-LABEL: sext_16i8_to_4i32:
234 ; SSSE3: # %bb.0: # %entry
235 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
236 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
237 ; SSSE3-NEXT: psrad $24, %xmm0
240 ; SSE41-LABEL: sext_16i8_to_4i32:
241 ; SSE41: # %bb.0: # %entry
242 ; SSE41-NEXT: pmovsxbd %xmm0, %xmm0
245 ; AVX-LABEL: sext_16i8_to_4i32:
246 ; AVX: # %bb.0: # %entry
247 ; AVX-NEXT: vpmovsxbd %xmm0, %xmm0
250 ; X32-SSE2-LABEL: sext_16i8_to_4i32:
251 ; X32-SSE2: # %bb.0: # %entry
252 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
253 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
254 ; X32-SSE2-NEXT: psrad $24, %xmm0
255 ; X32-SSE2-NEXT: retl
257 ; X32-SSE41-LABEL: sext_16i8_to_4i32:
258 ; X32-SSE41: # %bb.0: # %entry
259 ; X32-SSE41-NEXT: pmovsxbd %xmm0, %xmm0
260 ; X32-SSE41-NEXT: retl
262 %B = shufflevector <16 x i8> %A, <16 x i8> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
263 %C = sext <4 x i8> %B to <4 x i32>
267 define <8 x i32> @sext_16i8_to_8i32(<16 x i8> %A) nounwind uwtable readnone ssp {
268 ; SSE2-LABEL: sext_16i8_to_8i32:
269 ; SSE2: # %bb.0: # %entry
270 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
271 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
272 ; SSE2-NEXT: psrad $24, %xmm2
273 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
274 ; SSE2-NEXT: psrad $24, %xmm1
275 ; SSE2-NEXT: movdqa %xmm2, %xmm0
278 ; SSSE3-LABEL: sext_16i8_to_8i32:
279 ; SSSE3: # %bb.0: # %entry
280 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
281 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
282 ; SSSE3-NEXT: psrad $24, %xmm2
283 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
284 ; SSSE3-NEXT: psrad $24, %xmm1
285 ; SSSE3-NEXT: movdqa %xmm2, %xmm0
288 ; SSE41-LABEL: sext_16i8_to_8i32:
289 ; SSE41: # %bb.0: # %entry
290 ; SSE41-NEXT: pmovsxbd %xmm0, %xmm2
291 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
292 ; SSE41-NEXT: pmovsxbd %xmm0, %xmm1
293 ; SSE41-NEXT: movdqa %xmm2, %xmm0
296 ; AVX1-LABEL: sext_16i8_to_8i32:
297 ; AVX1: # %bb.0: # %entry
298 ; AVX1-NEXT: vpmovsxbd %xmm0, %xmm1
299 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
300 ; AVX1-NEXT: vpmovsxbd %xmm0, %xmm0
301 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
304 ; AVX2-LABEL: sext_16i8_to_8i32:
305 ; AVX2: # %bb.0: # %entry
306 ; AVX2-NEXT: vpmovsxbd %xmm0, %ymm0
309 ; AVX512-LABEL: sext_16i8_to_8i32:
310 ; AVX512: # %bb.0: # %entry
311 ; AVX512-NEXT: vpmovsxbd %xmm0, %ymm0
314 ; X32-SSE2-LABEL: sext_16i8_to_8i32:
315 ; X32-SSE2: # %bb.0: # %entry
316 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
317 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
318 ; X32-SSE2-NEXT: psrad $24, %xmm2
319 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
320 ; X32-SSE2-NEXT: psrad $24, %xmm1
321 ; X32-SSE2-NEXT: movdqa %xmm2, %xmm0
322 ; X32-SSE2-NEXT: retl
324 ; X32-SSE41-LABEL: sext_16i8_to_8i32:
325 ; X32-SSE41: # %bb.0: # %entry
326 ; X32-SSE41-NEXT: pmovsxbd %xmm0, %xmm2
327 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
328 ; X32-SSE41-NEXT: pmovsxbd %xmm0, %xmm1
329 ; X32-SSE41-NEXT: movdqa %xmm2, %xmm0
330 ; X32-SSE41-NEXT: retl
332 %B = shufflevector <16 x i8> %A, <16 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
333 %C = sext <8 x i8> %B to <8 x i32>
337 define <16 x i32> @sext_16i8_to_16i32(<16 x i8> %A) nounwind uwtable readnone ssp {
338 ; SSE2-LABEL: sext_16i8_to_16i32:
339 ; SSE2: # %bb.0: # %entry
340 ; SSE2-NEXT: movdqa %xmm0, %xmm1
341 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
342 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1],xmm4[2],xmm1[2],xmm4[3],xmm1[3]
343 ; SSE2-NEXT: psrad $24, %xmm4
344 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
345 ; SSE2-NEXT: psrad $24, %xmm1
346 ; SSE2-NEXT: punpckhbw {{.*#+}} xmm0 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
347 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
348 ; SSE2-NEXT: psrad $24, %xmm2
349 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
350 ; SSE2-NEXT: psrad $24, %xmm3
351 ; SSE2-NEXT: movdqa %xmm4, %xmm0
354 ; SSSE3-LABEL: sext_16i8_to_16i32:
355 ; SSSE3: # %bb.0: # %entry
356 ; SSSE3-NEXT: movdqa %xmm0, %xmm1
357 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
358 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1],xmm4[2],xmm1[2],xmm4[3],xmm1[3]
359 ; SSSE3-NEXT: psrad $24, %xmm4
360 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
361 ; SSSE3-NEXT: psrad $24, %xmm1
362 ; SSSE3-NEXT: punpckhbw {{.*#+}} xmm0 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
363 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
364 ; SSSE3-NEXT: psrad $24, %xmm2
365 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
366 ; SSSE3-NEXT: psrad $24, %xmm3
367 ; SSSE3-NEXT: movdqa %xmm4, %xmm0
370 ; SSE41-LABEL: sext_16i8_to_16i32:
371 ; SSE41: # %bb.0: # %entry
372 ; SSE41-NEXT: pmovsxbd %xmm0, %xmm4
373 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
374 ; SSE41-NEXT: pmovsxbd %xmm1, %xmm1
375 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm0[2,3,0,1]
376 ; SSE41-NEXT: pmovsxbd %xmm2, %xmm2
377 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[3,1,2,3]
378 ; SSE41-NEXT: pmovsxbd %xmm0, %xmm3
379 ; SSE41-NEXT: movdqa %xmm4, %xmm0
382 ; AVX1-LABEL: sext_16i8_to_16i32:
383 ; AVX1: # %bb.0: # %entry
384 ; AVX1-NEXT: vpmovsxbd %xmm0, %xmm1
385 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[1,1,2,3]
386 ; AVX1-NEXT: vpmovsxbd %xmm2, %xmm2
387 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm2
388 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
389 ; AVX1-NEXT: vpmovsxbd %xmm1, %xmm1
390 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[3,3,0,1]
391 ; AVX1-NEXT: vpmovsxbd %xmm0, %xmm0
392 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm1
393 ; AVX1-NEXT: vmovaps %ymm2, %ymm0
396 ; AVX2-LABEL: sext_16i8_to_16i32:
397 ; AVX2: # %bb.0: # %entry
398 ; AVX2-NEXT: vpmovsxbd %xmm0, %ymm2
399 ; AVX2-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
400 ; AVX2-NEXT: vpmovsxbd %xmm0, %ymm1
401 ; AVX2-NEXT: vmovdqa %ymm2, %ymm0
404 ; AVX512-LABEL: sext_16i8_to_16i32:
405 ; AVX512: # %bb.0: # %entry
406 ; AVX512-NEXT: vpmovsxbd %xmm0, %zmm0
409 ; X32-SSE2-LABEL: sext_16i8_to_16i32:
410 ; X32-SSE2: # %bb.0: # %entry
411 ; X32-SSE2-NEXT: movdqa %xmm0, %xmm1
412 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3],xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
413 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm4 = xmm4[0],xmm1[0],xmm4[1],xmm1[1],xmm4[2],xmm1[2],xmm4[3],xmm1[3]
414 ; X32-SSE2-NEXT: psrad $24, %xmm4
415 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
416 ; X32-SSE2-NEXT: psrad $24, %xmm1
417 ; X32-SSE2-NEXT: punpckhbw {{.*#+}} xmm0 = xmm0[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
418 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
419 ; X32-SSE2-NEXT: psrad $24, %xmm2
420 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
421 ; X32-SSE2-NEXT: psrad $24, %xmm3
422 ; X32-SSE2-NEXT: movdqa %xmm4, %xmm0
423 ; X32-SSE2-NEXT: retl
425 ; X32-SSE41-LABEL: sext_16i8_to_16i32:
426 ; X32-SSE41: # %bb.0: # %entry
427 ; X32-SSE41-NEXT: pmovsxbd %xmm0, %xmm4
428 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
429 ; X32-SSE41-NEXT: pmovsxbd %xmm1, %xmm1
430 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm0[2,3,0,1]
431 ; X32-SSE41-NEXT: pmovsxbd %xmm2, %xmm2
432 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[3,1,2,3]
433 ; X32-SSE41-NEXT: pmovsxbd %xmm0, %xmm3
434 ; X32-SSE41-NEXT: movdqa %xmm4, %xmm0
435 ; X32-SSE41-NEXT: retl
437 %B = sext <16 x i8> %A to <16 x i32>
441 define <2 x i64> @sext_16i8_to_2i64(<16 x i8> %A) nounwind uwtable readnone ssp {
442 ; SSE2-LABEL: sext_16i8_to_2i64:
443 ; SSE2: # %bb.0: # %entry
444 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
445 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
446 ; SSE2-NEXT: pxor %xmm1, %xmm1
447 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
448 ; SSE2-NEXT: psrad $24, %xmm0
449 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
452 ; SSSE3-LABEL: sext_16i8_to_2i64:
453 ; SSSE3: # %bb.0: # %entry
454 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
455 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
456 ; SSSE3-NEXT: pxor %xmm1, %xmm1
457 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm1
458 ; SSSE3-NEXT: psrad $24, %xmm0
459 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
462 ; SSE41-LABEL: sext_16i8_to_2i64:
463 ; SSE41: # %bb.0: # %entry
464 ; SSE41-NEXT: pmovsxbq %xmm0, %xmm0
467 ; AVX-LABEL: sext_16i8_to_2i64:
468 ; AVX: # %bb.0: # %entry
469 ; AVX-NEXT: vpmovsxbq %xmm0, %xmm0
472 ; X32-SSE2-LABEL: sext_16i8_to_2i64:
473 ; X32-SSE2: # %bb.0: # %entry
474 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
475 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
476 ; X32-SSE2-NEXT: pxor %xmm1, %xmm1
477 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm1
478 ; X32-SSE2-NEXT: psrad $24, %xmm0
479 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
480 ; X32-SSE2-NEXT: retl
482 ; X32-SSE41-LABEL: sext_16i8_to_2i64:
483 ; X32-SSE41: # %bb.0: # %entry
484 ; X32-SSE41-NEXT: pmovsxbq %xmm0, %xmm0
485 ; X32-SSE41-NEXT: retl
487 %B = shufflevector <16 x i8> %A, <16 x i8> undef, <2 x i32> <i32 0, i32 1>
488 %C = sext <2 x i8> %B to <2 x i64>
492 define <4 x i64> @sext_16i8_to_4i64(<16 x i8> %A) nounwind uwtable readnone ssp {
493 ; SSE2-LABEL: sext_16i8_to_4i64:
494 ; SSE2: # %bb.0: # %entry
495 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
496 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
497 ; SSE2-NEXT: psrad $24, %xmm1
498 ; SSE2-NEXT: pxor %xmm2, %xmm2
499 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
500 ; SSE2-NEXT: movdqa %xmm1, %xmm0
501 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
502 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
505 ; SSSE3-LABEL: sext_16i8_to_4i64:
506 ; SSSE3: # %bb.0: # %entry
507 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
508 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
509 ; SSSE3-NEXT: psrad $24, %xmm1
510 ; SSSE3-NEXT: pxor %xmm2, %xmm2
511 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
512 ; SSSE3-NEXT: movdqa %xmm1, %xmm0
513 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
514 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
517 ; SSE41-LABEL: sext_16i8_to_4i64:
518 ; SSE41: # %bb.0: # %entry
519 ; SSE41-NEXT: pmovsxbq %xmm0, %xmm2
520 ; SSE41-NEXT: psrld $16, %xmm0
521 ; SSE41-NEXT: pmovsxbq %xmm0, %xmm1
522 ; SSE41-NEXT: movdqa %xmm2, %xmm0
525 ; AVX1-LABEL: sext_16i8_to_4i64:
526 ; AVX1: # %bb.0: # %entry
527 ; AVX1-NEXT: vpmovsxbq %xmm0, %xmm1
528 ; AVX1-NEXT: vpsrld $16, %xmm0, %xmm0
529 ; AVX1-NEXT: vpmovsxbq %xmm0, %xmm0
530 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
533 ; AVX2-LABEL: sext_16i8_to_4i64:
534 ; AVX2: # %bb.0: # %entry
535 ; AVX2-NEXT: vpmovsxbq %xmm0, %ymm0
538 ; AVX512-LABEL: sext_16i8_to_4i64:
539 ; AVX512: # %bb.0: # %entry
540 ; AVX512-NEXT: vpmovsxbq %xmm0, %ymm0
543 ; X32-SSE2-LABEL: sext_16i8_to_4i64:
544 ; X32-SSE2: # %bb.0: # %entry
545 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
546 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
547 ; X32-SSE2-NEXT: psrad $24, %xmm1
548 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
549 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
550 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm0
551 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
552 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
553 ; X32-SSE2-NEXT: retl
555 ; X32-SSE41-LABEL: sext_16i8_to_4i64:
556 ; X32-SSE41: # %bb.0: # %entry
557 ; X32-SSE41-NEXT: pmovsxbq %xmm0, %xmm2
558 ; X32-SSE41-NEXT: psrld $16, %xmm0
559 ; X32-SSE41-NEXT: pmovsxbq %xmm0, %xmm1
560 ; X32-SSE41-NEXT: movdqa %xmm2, %xmm0
561 ; X32-SSE41-NEXT: retl
563 %B = shufflevector <16 x i8> %A, <16 x i8> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
564 %C = sext <4 x i8> %B to <4 x i64>
568 define <8 x i64> @sext_16i8_to_8i64(<16 x i8> %A) nounwind uwtable readnone ssp {
569 ; SSE2-LABEL: sext_16i8_to_8i64:
570 ; SSE2: # %bb.0: # %entry
571 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
572 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
573 ; SSE2-NEXT: psrad $24, %xmm1
574 ; SSE2-NEXT: pxor %xmm5, %xmm5
575 ; SSE2-NEXT: pxor %xmm2, %xmm2
576 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
577 ; SSE2-NEXT: movdqa %xmm1, %xmm4
578 ; SSE2-NEXT: punpckldq {{.*#+}} xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
579 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
580 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
581 ; SSE2-NEXT: psrad $24, %xmm3
582 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm5
583 ; SSE2-NEXT: movdqa %xmm3, %xmm2
584 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
585 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm5[2],xmm3[3],xmm5[3]
586 ; SSE2-NEXT: movdqa %xmm4, %xmm0
589 ; SSSE3-LABEL: sext_16i8_to_8i64:
590 ; SSSE3: # %bb.0: # %entry
591 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
592 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
593 ; SSSE3-NEXT: psrad $24, %xmm1
594 ; SSSE3-NEXT: pxor %xmm5, %xmm5
595 ; SSSE3-NEXT: pxor %xmm2, %xmm2
596 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
597 ; SSSE3-NEXT: movdqa %xmm1, %xmm4
598 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
599 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
600 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
601 ; SSSE3-NEXT: psrad $24, %xmm3
602 ; SSSE3-NEXT: pcmpgtd %xmm3, %xmm5
603 ; SSSE3-NEXT: movdqa %xmm3, %xmm2
604 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
605 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm5[2],xmm3[3],xmm5[3]
606 ; SSSE3-NEXT: movdqa %xmm4, %xmm0
609 ; SSE41-LABEL: sext_16i8_to_8i64:
610 ; SSE41: # %bb.0: # %entry
611 ; SSE41-NEXT: pmovsxbq %xmm0, %xmm4
612 ; SSE41-NEXT: movdqa %xmm0, %xmm1
613 ; SSE41-NEXT: psrld $16, %xmm1
614 ; SSE41-NEXT: pmovsxbq %xmm1, %xmm1
615 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,2,3]
616 ; SSE41-NEXT: pmovsxbq %xmm2, %xmm2
617 ; SSE41-NEXT: psrlq $48, %xmm0
618 ; SSE41-NEXT: pmovsxbq %xmm0, %xmm3
619 ; SSE41-NEXT: movdqa %xmm4, %xmm0
622 ; AVX1-LABEL: sext_16i8_to_8i64:
623 ; AVX1: # %bb.0: # %entry
624 ; AVX1-NEXT: vpmovsxbq %xmm0, %xmm1
625 ; AVX1-NEXT: vpsrld $16, %xmm0, %xmm2
626 ; AVX1-NEXT: vpmovsxbq %xmm2, %xmm2
627 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm2
628 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
629 ; AVX1-NEXT: vpmovsxbq %xmm0, %xmm1
630 ; AVX1-NEXT: vpsrld $16, %xmm0, %xmm0
631 ; AVX1-NEXT: vpmovsxbq %xmm0, %xmm0
632 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm1
633 ; AVX1-NEXT: vmovaps %ymm2, %ymm0
636 ; AVX2-LABEL: sext_16i8_to_8i64:
637 ; AVX2: # %bb.0: # %entry
638 ; AVX2-NEXT: vpmovsxbq %xmm0, %ymm2
639 ; AVX2-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
640 ; AVX2-NEXT: vpmovsxbq %xmm0, %ymm1
641 ; AVX2-NEXT: vmovdqa %ymm2, %ymm0
644 ; AVX512-LABEL: sext_16i8_to_8i64:
645 ; AVX512: # %bb.0: # %entry
646 ; AVX512-NEXT: vpmovsxbq %xmm0, %zmm0
649 ; X32-SSE2-LABEL: sext_16i8_to_8i64:
650 ; X32-SSE2: # %bb.0: # %entry
651 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
652 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
653 ; X32-SSE2-NEXT: psrad $24, %xmm1
654 ; X32-SSE2-NEXT: pxor %xmm5, %xmm5
655 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
656 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
657 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm4
658 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
659 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
660 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
661 ; X32-SSE2-NEXT: psrad $24, %xmm3
662 ; X32-SSE2-NEXT: pcmpgtd %xmm3, %xmm5
663 ; X32-SSE2-NEXT: movdqa %xmm3, %xmm2
664 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
665 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm5[2],xmm3[3],xmm5[3]
666 ; X32-SSE2-NEXT: movdqa %xmm4, %xmm0
667 ; X32-SSE2-NEXT: retl
669 ; X32-SSE41-LABEL: sext_16i8_to_8i64:
670 ; X32-SSE41: # %bb.0: # %entry
671 ; X32-SSE41-NEXT: pmovsxbq %xmm0, %xmm4
672 ; X32-SSE41-NEXT: movdqa %xmm0, %xmm1
673 ; X32-SSE41-NEXT: psrld $16, %xmm1
674 ; X32-SSE41-NEXT: pmovsxbq %xmm1, %xmm1
675 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm0[1,1,2,3]
676 ; X32-SSE41-NEXT: pmovsxbq %xmm2, %xmm2
677 ; X32-SSE41-NEXT: psrlq $48, %xmm0
678 ; X32-SSE41-NEXT: pmovsxbq %xmm0, %xmm3
679 ; X32-SSE41-NEXT: movdqa %xmm4, %xmm0
680 ; X32-SSE41-NEXT: retl
682 %B = shufflevector <16 x i8> %A, <16 x i8> undef, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
683 %C = sext <8 x i8> %B to <8 x i64>
687 define <4 x i32> @sext_8i16_to_4i32(<8 x i16> %A) nounwind uwtable readnone ssp {
688 ; SSE2-LABEL: sext_8i16_to_4i32:
689 ; SSE2: # %bb.0: # %entry
690 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
691 ; SSE2-NEXT: psrad $16, %xmm0
694 ; SSSE3-LABEL: sext_8i16_to_4i32:
695 ; SSSE3: # %bb.0: # %entry
696 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
697 ; SSSE3-NEXT: psrad $16, %xmm0
700 ; SSE41-LABEL: sext_8i16_to_4i32:
701 ; SSE41: # %bb.0: # %entry
702 ; SSE41-NEXT: pmovsxwd %xmm0, %xmm0
705 ; AVX-LABEL: sext_8i16_to_4i32:
706 ; AVX: # %bb.0: # %entry
707 ; AVX-NEXT: vpmovsxwd %xmm0, %xmm0
710 ; X32-SSE2-LABEL: sext_8i16_to_4i32:
711 ; X32-SSE2: # %bb.0: # %entry
712 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
713 ; X32-SSE2-NEXT: psrad $16, %xmm0
714 ; X32-SSE2-NEXT: retl
716 ; X32-SSE41-LABEL: sext_8i16_to_4i32:
717 ; X32-SSE41: # %bb.0: # %entry
718 ; X32-SSE41-NEXT: pmovsxwd %xmm0, %xmm0
719 ; X32-SSE41-NEXT: retl
721 %B = shufflevector <8 x i16> %A, <8 x i16> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
722 %C = sext <4 x i16> %B to <4 x i32>
726 define <8 x i32> @sext_8i16_to_8i32(<8 x i16> %A) nounwind uwtable readnone ssp {
727 ; SSE2-LABEL: sext_8i16_to_8i32:
728 ; SSE2: # %bb.0: # %entry
729 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
730 ; SSE2-NEXT: psrad $16, %xmm2
731 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
732 ; SSE2-NEXT: psrad $16, %xmm1
733 ; SSE2-NEXT: movdqa %xmm2, %xmm0
736 ; SSSE3-LABEL: sext_8i16_to_8i32:
737 ; SSSE3: # %bb.0: # %entry
738 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
739 ; SSSE3-NEXT: psrad $16, %xmm2
740 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
741 ; SSSE3-NEXT: psrad $16, %xmm1
742 ; SSSE3-NEXT: movdqa %xmm2, %xmm0
745 ; SSE41-LABEL: sext_8i16_to_8i32:
746 ; SSE41: # %bb.0: # %entry
747 ; SSE41-NEXT: pmovsxwd %xmm0, %xmm2
748 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
749 ; SSE41-NEXT: pmovsxwd %xmm0, %xmm1
750 ; SSE41-NEXT: movdqa %xmm2, %xmm0
753 ; AVX1-LABEL: sext_8i16_to_8i32:
754 ; AVX1: # %bb.0: # %entry
755 ; AVX1-NEXT: vpmovsxwd %xmm0, %xmm1
756 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
757 ; AVX1-NEXT: vpmovsxwd %xmm0, %xmm0
758 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
761 ; AVX2-LABEL: sext_8i16_to_8i32:
762 ; AVX2: # %bb.0: # %entry
763 ; AVX2-NEXT: vpmovsxwd %xmm0, %ymm0
766 ; AVX512-LABEL: sext_8i16_to_8i32:
767 ; AVX512: # %bb.0: # %entry
768 ; AVX512-NEXT: vpmovsxwd %xmm0, %ymm0
771 ; X32-SSE2-LABEL: sext_8i16_to_8i32:
772 ; X32-SSE2: # %bb.0: # %entry
773 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1],xmm2[2],xmm0[2],xmm2[3],xmm0[3]
774 ; X32-SSE2-NEXT: psrad $16, %xmm2
775 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4],xmm0[4],xmm1[5],xmm0[5],xmm1[6],xmm0[6],xmm1[7],xmm0[7]
776 ; X32-SSE2-NEXT: psrad $16, %xmm1
777 ; X32-SSE2-NEXT: movdqa %xmm2, %xmm0
778 ; X32-SSE2-NEXT: retl
780 ; X32-SSE41-LABEL: sext_8i16_to_8i32:
781 ; X32-SSE41: # %bb.0: # %entry
782 ; X32-SSE41-NEXT: pmovsxwd %xmm0, %xmm2
783 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
784 ; X32-SSE41-NEXT: pmovsxwd %xmm0, %xmm1
785 ; X32-SSE41-NEXT: movdqa %xmm2, %xmm0
786 ; X32-SSE41-NEXT: retl
788 %B = sext <8 x i16> %A to <8 x i32>
792 define <16 x i32> @sext_16i16_to_16i32(<16 x i16> %A) nounwind uwtable readnone ssp {
793 ; SSE2-LABEL: sext_16i16_to_16i32:
794 ; SSE2: # %bb.0: # %entry
795 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1],xmm4[2],xmm0[2],xmm4[3],xmm0[3]
796 ; SSE2-NEXT: psrad $16, %xmm4
797 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm5 = xmm5[4],xmm0[4],xmm5[5],xmm0[5],xmm5[6],xmm0[6],xmm5[7],xmm0[7]
798 ; SSE2-NEXT: psrad $16, %xmm5
799 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
800 ; SSE2-NEXT: psrad $16, %xmm2
801 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm1[4],xmm3[5],xmm1[5],xmm3[6],xmm1[6],xmm3[7],xmm1[7]
802 ; SSE2-NEXT: psrad $16, %xmm3
803 ; SSE2-NEXT: movdqa %xmm4, %xmm0
804 ; SSE2-NEXT: movdqa %xmm5, %xmm1
807 ; SSSE3-LABEL: sext_16i16_to_16i32:
808 ; SSSE3: # %bb.0: # %entry
809 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1],xmm4[2],xmm0[2],xmm4[3],xmm0[3]
810 ; SSSE3-NEXT: psrad $16, %xmm4
811 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm5 = xmm5[4],xmm0[4],xmm5[5],xmm0[5],xmm5[6],xmm0[6],xmm5[7],xmm0[7]
812 ; SSSE3-NEXT: psrad $16, %xmm5
813 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
814 ; SSSE3-NEXT: psrad $16, %xmm2
815 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm1[4],xmm3[5],xmm1[5],xmm3[6],xmm1[6],xmm3[7],xmm1[7]
816 ; SSSE3-NEXT: psrad $16, %xmm3
817 ; SSSE3-NEXT: movdqa %xmm4, %xmm0
818 ; SSSE3-NEXT: movdqa %xmm5, %xmm1
821 ; SSE41-LABEL: sext_16i16_to_16i32:
822 ; SSE41: # %bb.0: # %entry
823 ; SSE41-NEXT: pmovsxwd %xmm0, %xmm5
824 ; SSE41-NEXT: pmovsxwd %xmm1, %xmm2
825 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
826 ; SSE41-NEXT: pmovsxwd %xmm0, %xmm4
827 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
828 ; SSE41-NEXT: pmovsxwd %xmm0, %xmm3
829 ; SSE41-NEXT: movdqa %xmm5, %xmm0
830 ; SSE41-NEXT: movdqa %xmm4, %xmm1
833 ; AVX1-LABEL: sext_16i16_to_16i32:
834 ; AVX1: # %bb.0: # %entry
835 ; AVX1-NEXT: vpmovsxwd %xmm0, %xmm1
836 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[2,3,0,1]
837 ; AVX1-NEXT: vpmovsxwd %xmm2, %xmm2
838 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm2
839 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
840 ; AVX1-NEXT: vpmovsxwd %xmm0, %xmm1
841 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
842 ; AVX1-NEXT: vpmovsxwd %xmm0, %xmm0
843 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm1
844 ; AVX1-NEXT: vmovaps %ymm2, %ymm0
847 ; AVX2-LABEL: sext_16i16_to_16i32:
848 ; AVX2: # %bb.0: # %entry
849 ; AVX2-NEXT: vpmovsxwd %xmm0, %ymm2
850 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm0
851 ; AVX2-NEXT: vpmovsxwd %xmm0, %ymm1
852 ; AVX2-NEXT: vmovdqa %ymm2, %ymm0
855 ; AVX512-LABEL: sext_16i16_to_16i32:
856 ; AVX512: # %bb.0: # %entry
857 ; AVX512-NEXT: vpmovsxwd %ymm0, %zmm0
860 ; X32-SSE2-LABEL: sext_16i16_to_16i32:
861 ; X32-SSE2: # %bb.0: # %entry
862 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm4 = xmm4[0],xmm0[0],xmm4[1],xmm0[1],xmm4[2],xmm0[2],xmm4[3],xmm0[3]
863 ; X32-SSE2-NEXT: psrad $16, %xmm4
864 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm5 = xmm5[4],xmm0[4],xmm5[5],xmm0[5],xmm5[6],xmm0[6],xmm5[7],xmm0[7]
865 ; X32-SSE2-NEXT: psrad $16, %xmm5
866 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1],xmm2[2],xmm1[2],xmm2[3],xmm1[3]
867 ; X32-SSE2-NEXT: psrad $16, %xmm2
868 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm1[4],xmm3[5],xmm1[5],xmm3[6],xmm1[6],xmm3[7],xmm1[7]
869 ; X32-SSE2-NEXT: psrad $16, %xmm3
870 ; X32-SSE2-NEXT: movdqa %xmm4, %xmm0
871 ; X32-SSE2-NEXT: movdqa %xmm5, %xmm1
872 ; X32-SSE2-NEXT: retl
874 ; X32-SSE41-LABEL: sext_16i16_to_16i32:
875 ; X32-SSE41: # %bb.0: # %entry
876 ; X32-SSE41-NEXT: pmovsxwd %xmm0, %xmm5
877 ; X32-SSE41-NEXT: pmovsxwd %xmm1, %xmm2
878 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
879 ; X32-SSE41-NEXT: pmovsxwd %xmm0, %xmm4
880 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
881 ; X32-SSE41-NEXT: pmovsxwd %xmm0, %xmm3
882 ; X32-SSE41-NEXT: movdqa %xmm5, %xmm0
883 ; X32-SSE41-NEXT: movdqa %xmm4, %xmm1
884 ; X32-SSE41-NEXT: retl
886 %B = sext <16 x i16> %A to <16 x i32>
890 define <2 x i64> @sext_8i16_to_2i64(<8 x i16> %A) nounwind uwtable readnone ssp {
891 ; SSE2-LABEL: sext_8i16_to_2i64:
892 ; SSE2: # %bb.0: # %entry
893 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
894 ; SSE2-NEXT: pxor %xmm1, %xmm1
895 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
896 ; SSE2-NEXT: psrad $16, %xmm0
897 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
900 ; SSSE3-LABEL: sext_8i16_to_2i64:
901 ; SSSE3: # %bb.0: # %entry
902 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
903 ; SSSE3-NEXT: pxor %xmm1, %xmm1
904 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm1
905 ; SSSE3-NEXT: psrad $16, %xmm0
906 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
909 ; SSE41-LABEL: sext_8i16_to_2i64:
910 ; SSE41: # %bb.0: # %entry
911 ; SSE41-NEXT: pmovsxwq %xmm0, %xmm0
914 ; AVX-LABEL: sext_8i16_to_2i64:
915 ; AVX: # %bb.0: # %entry
916 ; AVX-NEXT: vpmovsxwq %xmm0, %xmm0
919 ; X32-SSE2-LABEL: sext_8i16_to_2i64:
920 ; X32-SSE2: # %bb.0: # %entry
921 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
922 ; X32-SSE2-NEXT: pxor %xmm1, %xmm1
923 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm1
924 ; X32-SSE2-NEXT: psrad $16, %xmm0
925 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
926 ; X32-SSE2-NEXT: retl
928 ; X32-SSE41-LABEL: sext_8i16_to_2i64:
929 ; X32-SSE41: # %bb.0: # %entry
930 ; X32-SSE41-NEXT: pmovsxwq %xmm0, %xmm0
931 ; X32-SSE41-NEXT: retl
933 %B = shufflevector <8 x i16> %A, <8 x i16> undef, <2 x i32> <i32 0, i32 1>
934 %C = sext <2 x i16> %B to <2 x i64>
938 define <4 x i64> @sext_8i16_to_4i64(<8 x i16> %A) nounwind uwtable readnone ssp {
939 ; SSE2-LABEL: sext_8i16_to_4i64:
940 ; SSE2: # %bb.0: # %entry
941 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
942 ; SSE2-NEXT: psrad $16, %xmm1
943 ; SSE2-NEXT: pxor %xmm2, %xmm2
944 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
945 ; SSE2-NEXT: movdqa %xmm1, %xmm0
946 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
947 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
950 ; SSSE3-LABEL: sext_8i16_to_4i64:
951 ; SSSE3: # %bb.0: # %entry
952 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
953 ; SSSE3-NEXT: psrad $16, %xmm1
954 ; SSSE3-NEXT: pxor %xmm2, %xmm2
955 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
956 ; SSSE3-NEXT: movdqa %xmm1, %xmm0
957 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
958 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
961 ; SSE41-LABEL: sext_8i16_to_4i64:
962 ; SSE41: # %bb.0: # %entry
963 ; SSE41-NEXT: pmovsxwq %xmm0, %xmm2
964 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
965 ; SSE41-NEXT: pmovsxwq %xmm0, %xmm1
966 ; SSE41-NEXT: movdqa %xmm2, %xmm0
969 ; AVX1-LABEL: sext_8i16_to_4i64:
970 ; AVX1: # %bb.0: # %entry
971 ; AVX1-NEXT: vpmovsxwq %xmm0, %xmm1
972 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
973 ; AVX1-NEXT: vpmovsxwq %xmm0, %xmm0
974 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
977 ; AVX2-LABEL: sext_8i16_to_4i64:
978 ; AVX2: # %bb.0: # %entry
979 ; AVX2-NEXT: vpmovsxwq %xmm0, %ymm0
982 ; AVX512-LABEL: sext_8i16_to_4i64:
983 ; AVX512: # %bb.0: # %entry
984 ; AVX512-NEXT: vpmovsxwq %xmm0, %ymm0
987 ; X32-SSE2-LABEL: sext_8i16_to_4i64:
988 ; X32-SSE2: # %bb.0: # %entry
989 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
990 ; X32-SSE2-NEXT: psrad $16, %xmm1
991 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
992 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
993 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm0
994 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
995 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
996 ; X32-SSE2-NEXT: retl
998 ; X32-SSE41-LABEL: sext_8i16_to_4i64:
999 ; X32-SSE41: # %bb.0: # %entry
1000 ; X32-SSE41-NEXT: pmovsxwq %xmm0, %xmm2
1001 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,2,3]
1002 ; X32-SSE41-NEXT: pmovsxwq %xmm0, %xmm1
1003 ; X32-SSE41-NEXT: movdqa %xmm2, %xmm0
1004 ; X32-SSE41-NEXT: retl
1006 %B = shufflevector <8 x i16> %A, <8 x i16> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
1007 %C = sext <4 x i16> %B to <4 x i64>
1011 define <8 x i64> @sext_8i16_to_8i64(<8 x i16> %A) nounwind uwtable readnone ssp {
1012 ; SSE2-LABEL: sext_8i16_to_8i64:
1013 ; SSE2: # %bb.0: # %entry
1014 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1015 ; SSE2-NEXT: psrad $16, %xmm1
1016 ; SSE2-NEXT: pxor %xmm5, %xmm5
1017 ; SSE2-NEXT: pxor %xmm2, %xmm2
1018 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
1019 ; SSE2-NEXT: movdqa %xmm1, %xmm4
1020 ; SSE2-NEXT: punpckldq {{.*#+}} xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
1021 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
1022 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
1023 ; SSE2-NEXT: psrad $16, %xmm3
1024 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm5
1025 ; SSE2-NEXT: movdqa %xmm3, %xmm2
1026 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
1027 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm5[2],xmm3[3],xmm5[3]
1028 ; SSE2-NEXT: movdqa %xmm4, %xmm0
1031 ; SSSE3-LABEL: sext_8i16_to_8i64:
1032 ; SSSE3: # %bb.0: # %entry
1033 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1034 ; SSSE3-NEXT: psrad $16, %xmm1
1035 ; SSSE3-NEXT: pxor %xmm5, %xmm5
1036 ; SSSE3-NEXT: pxor %xmm2, %xmm2
1037 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
1038 ; SSSE3-NEXT: movdqa %xmm1, %xmm4
1039 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
1040 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
1041 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
1042 ; SSSE3-NEXT: psrad $16, %xmm3
1043 ; SSSE3-NEXT: pcmpgtd %xmm3, %xmm5
1044 ; SSSE3-NEXT: movdqa %xmm3, %xmm2
1045 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
1046 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm5[2],xmm3[3],xmm5[3]
1047 ; SSSE3-NEXT: movdqa %xmm4, %xmm0
1050 ; SSE41-LABEL: sext_8i16_to_8i64:
1051 ; SSE41: # %bb.0: # %entry
1052 ; SSE41-NEXT: pmovsxwq %xmm0, %xmm4
1053 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
1054 ; SSE41-NEXT: pmovsxwq %xmm1, %xmm1
1055 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm0[2,3,0,1]
1056 ; SSE41-NEXT: pmovsxwq %xmm2, %xmm2
1057 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[3,1,2,3]
1058 ; SSE41-NEXT: pmovsxwq %xmm0, %xmm3
1059 ; SSE41-NEXT: movdqa %xmm4, %xmm0
1062 ; AVX1-LABEL: sext_8i16_to_8i64:
1063 ; AVX1: # %bb.0: # %entry
1064 ; AVX1-NEXT: vpmovsxwq %xmm0, %xmm1
1065 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[1,1,2,3]
1066 ; AVX1-NEXT: vpmovsxwq %xmm2, %xmm2
1067 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm2
1068 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
1069 ; AVX1-NEXT: vpmovsxwq %xmm1, %xmm1
1070 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[3,3,0,1]
1071 ; AVX1-NEXT: vpmovsxwq %xmm0, %xmm0
1072 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm1
1073 ; AVX1-NEXT: vmovaps %ymm2, %ymm0
1076 ; AVX2-LABEL: sext_8i16_to_8i64:
1077 ; AVX2: # %bb.0: # %entry
1078 ; AVX2-NEXT: vpmovsxwq %xmm0, %ymm2
1079 ; AVX2-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
1080 ; AVX2-NEXT: vpmovsxwq %xmm0, %ymm1
1081 ; AVX2-NEXT: vmovdqa %ymm2, %ymm0
1084 ; AVX512-LABEL: sext_8i16_to_8i64:
1085 ; AVX512: # %bb.0: # %entry
1086 ; AVX512-NEXT: vpmovsxwq %xmm0, %zmm0
1089 ; X32-SSE2-LABEL: sext_8i16_to_8i64:
1090 ; X32-SSE2: # %bb.0: # %entry
1091 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1092 ; X32-SSE2-NEXT: psrad $16, %xmm1
1093 ; X32-SSE2-NEXT: pxor %xmm5, %xmm5
1094 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
1095 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
1096 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm4
1097 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm4 = xmm4[0],xmm2[0],xmm4[1],xmm2[1]
1098 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
1099 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm0[4],xmm3[5],xmm0[5],xmm3[6],xmm0[6],xmm3[7],xmm0[7]
1100 ; X32-SSE2-NEXT: psrad $16, %xmm3
1101 ; X32-SSE2-NEXT: pcmpgtd %xmm3, %xmm5
1102 ; X32-SSE2-NEXT: movdqa %xmm3, %xmm2
1103 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
1104 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm5[2],xmm3[3],xmm5[3]
1105 ; X32-SSE2-NEXT: movdqa %xmm4, %xmm0
1106 ; X32-SSE2-NEXT: retl
1108 ; X32-SSE41-LABEL: sext_8i16_to_8i64:
1109 ; X32-SSE41: # %bb.0: # %entry
1110 ; X32-SSE41-NEXT: pmovsxwq %xmm0, %xmm4
1111 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
1112 ; X32-SSE41-NEXT: pmovsxwq %xmm1, %xmm1
1113 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm0[2,3,0,1]
1114 ; X32-SSE41-NEXT: pmovsxwq %xmm2, %xmm2
1115 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[3,1,2,3]
1116 ; X32-SSE41-NEXT: pmovsxwq %xmm0, %xmm3
1117 ; X32-SSE41-NEXT: movdqa %xmm4, %xmm0
1118 ; X32-SSE41-NEXT: retl
1120 %B = sext <8 x i16> %A to <8 x i64>
1124 define <2 x i64> @sext_4i32_to_2i64(<4 x i32> %A) nounwind uwtable readnone ssp {
1125 ; SSE2-LABEL: sext_4i32_to_2i64:
1126 ; SSE2: # %bb.0: # %entry
1127 ; SSE2-NEXT: pxor %xmm1, %xmm1
1128 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
1129 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1132 ; SSSE3-LABEL: sext_4i32_to_2i64:
1133 ; SSSE3: # %bb.0: # %entry
1134 ; SSSE3-NEXT: pxor %xmm1, %xmm1
1135 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm1
1136 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1139 ; SSE41-LABEL: sext_4i32_to_2i64:
1140 ; SSE41: # %bb.0: # %entry
1141 ; SSE41-NEXT: pmovsxdq %xmm0, %xmm0
1144 ; AVX-LABEL: sext_4i32_to_2i64:
1145 ; AVX: # %bb.0: # %entry
1146 ; AVX-NEXT: vpmovsxdq %xmm0, %xmm0
1149 ; X32-SSE2-LABEL: sext_4i32_to_2i64:
1150 ; X32-SSE2: # %bb.0: # %entry
1151 ; X32-SSE2-NEXT: pxor %xmm1, %xmm1
1152 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm1
1153 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1154 ; X32-SSE2-NEXT: retl
1156 ; X32-SSE41-LABEL: sext_4i32_to_2i64:
1157 ; X32-SSE41: # %bb.0: # %entry
1158 ; X32-SSE41-NEXT: pmovsxdq %xmm0, %xmm0
1159 ; X32-SSE41-NEXT: retl
1161 %B = shufflevector <4 x i32> %A, <4 x i32> undef, <2 x i32> <i32 0, i32 1>
1162 %C = sext <2 x i32> %B to <2 x i64>
1166 define <4 x i64> @sext_4i32_to_4i64(<4 x i32> %A) nounwind uwtable readnone ssp {
1167 ; SSE2-LABEL: sext_4i32_to_4i64:
1168 ; SSE2: # %bb.0: # %entry
1169 ; SSE2-NEXT: pxor %xmm2, %xmm2
1170 ; SSE2-NEXT: pxor %xmm3, %xmm3
1171 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm3
1172 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
1173 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
1174 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
1175 ; SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
1178 ; SSSE3-LABEL: sext_4i32_to_4i64:
1179 ; SSSE3: # %bb.0: # %entry
1180 ; SSSE3-NEXT: pxor %xmm2, %xmm2
1181 ; SSSE3-NEXT: pxor %xmm3, %xmm3
1182 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm3
1183 ; SSSE3-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
1184 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
1185 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
1186 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
1189 ; SSE41-LABEL: sext_4i32_to_4i64:
1190 ; SSE41: # %bb.0: # %entry
1191 ; SSE41-NEXT: pmovsxdq %xmm0, %xmm2
1192 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
1193 ; SSE41-NEXT: pmovsxdq %xmm0, %xmm1
1194 ; SSE41-NEXT: movdqa %xmm2, %xmm0
1197 ; AVX1-LABEL: sext_4i32_to_4i64:
1198 ; AVX1: # %bb.0: # %entry
1199 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm1
1200 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
1201 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm0
1202 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1205 ; AVX2-LABEL: sext_4i32_to_4i64:
1206 ; AVX2: # %bb.0: # %entry
1207 ; AVX2-NEXT: vpmovsxdq %xmm0, %ymm0
1210 ; AVX512-LABEL: sext_4i32_to_4i64:
1211 ; AVX512: # %bb.0: # %entry
1212 ; AVX512-NEXT: vpmovsxdq %xmm0, %ymm0
1215 ; X32-SSE2-LABEL: sext_4i32_to_4i64:
1216 ; X32-SSE2: # %bb.0: # %entry
1217 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
1218 ; X32-SSE2-NEXT: pxor %xmm3, %xmm3
1219 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm3
1220 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
1221 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
1222 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
1223 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
1224 ; X32-SSE2-NEXT: retl
1226 ; X32-SSE41-LABEL: sext_4i32_to_4i64:
1227 ; X32-SSE41: # %bb.0: # %entry
1228 ; X32-SSE41-NEXT: pmovsxdq %xmm0, %xmm2
1229 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
1230 ; X32-SSE41-NEXT: pmovsxdq %xmm0, %xmm1
1231 ; X32-SSE41-NEXT: movdqa %xmm2, %xmm0
1232 ; X32-SSE41-NEXT: retl
1234 %B = sext <4 x i32> %A to <4 x i64>
1238 define <8 x i64> @sext_8i32_to_8i64(<8 x i32> %A) nounwind uwtable readnone ssp {
1239 ; SSE2-LABEL: sext_8i32_to_8i64:
1240 ; SSE2: # %bb.0: # %entry
1241 ; SSE2-NEXT: movdqa %xmm1, %xmm2
1242 ; SSE2-NEXT: pxor %xmm4, %xmm4
1243 ; SSE2-NEXT: pxor %xmm3, %xmm3
1244 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm3
1245 ; SSE2-NEXT: pxor %xmm5, %xmm5
1246 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm5
1247 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
1248 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
1249 ; SSE2-NEXT: pxor %xmm3, %xmm3
1250 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm3
1251 ; SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
1252 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[2,3,0,1]
1253 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
1254 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm4
1255 ; SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
1258 ; SSSE3-LABEL: sext_8i32_to_8i64:
1259 ; SSSE3: # %bb.0: # %entry
1260 ; SSSE3-NEXT: movdqa %xmm1, %xmm2
1261 ; SSSE3-NEXT: pxor %xmm4, %xmm4
1262 ; SSSE3-NEXT: pxor %xmm3, %xmm3
1263 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm3
1264 ; SSSE3-NEXT: pxor %xmm5, %xmm5
1265 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm5
1266 ; SSSE3-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
1267 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
1268 ; SSSE3-NEXT: pxor %xmm3, %xmm3
1269 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm3
1270 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
1271 ; SSSE3-NEXT: pshufd {{.*#+}} xmm3 = xmm2[2,3,0,1]
1272 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
1273 ; SSSE3-NEXT: pcmpgtd %xmm3, %xmm4
1274 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
1277 ; SSE41-LABEL: sext_8i32_to_8i64:
1278 ; SSE41: # %bb.0: # %entry
1279 ; SSE41-NEXT: pmovsxdq %xmm0, %xmm5
1280 ; SSE41-NEXT: pmovsxdq %xmm1, %xmm2
1281 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
1282 ; SSE41-NEXT: pmovsxdq %xmm0, %xmm4
1283 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
1284 ; SSE41-NEXT: pmovsxdq %xmm0, %xmm3
1285 ; SSE41-NEXT: movdqa %xmm5, %xmm0
1286 ; SSE41-NEXT: movdqa %xmm4, %xmm1
1289 ; AVX1-LABEL: sext_8i32_to_8i64:
1290 ; AVX1: # %bb.0: # %entry
1291 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm1
1292 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm0[2,3,0,1]
1293 ; AVX1-NEXT: vpmovsxdq %xmm2, %xmm2
1294 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm1, %ymm2
1295 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
1296 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm1
1297 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
1298 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm0
1299 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm1
1300 ; AVX1-NEXT: vmovaps %ymm2, %ymm0
1303 ; AVX2-LABEL: sext_8i32_to_8i64:
1304 ; AVX2: # %bb.0: # %entry
1305 ; AVX2-NEXT: vpmovsxdq %xmm0, %ymm2
1306 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm0
1307 ; AVX2-NEXT: vpmovsxdq %xmm0, %ymm1
1308 ; AVX2-NEXT: vmovdqa %ymm2, %ymm0
1311 ; AVX512-LABEL: sext_8i32_to_8i64:
1312 ; AVX512: # %bb.0: # %entry
1313 ; AVX512-NEXT: vpmovsxdq %ymm0, %zmm0
1316 ; X32-SSE2-LABEL: sext_8i32_to_8i64:
1317 ; X32-SSE2: # %bb.0: # %entry
1318 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm2
1319 ; X32-SSE2-NEXT: pxor %xmm4, %xmm4
1320 ; X32-SSE2-NEXT: pxor %xmm3, %xmm3
1321 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm3
1322 ; X32-SSE2-NEXT: pxor %xmm5, %xmm5
1323 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm5
1324 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
1325 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
1326 ; X32-SSE2-NEXT: pxor %xmm3, %xmm3
1327 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm3
1328 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
1329 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm2[2,3,0,1]
1330 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm5[0],xmm2[1],xmm5[1]
1331 ; X32-SSE2-NEXT: pcmpgtd %xmm3, %xmm4
1332 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
1333 ; X32-SSE2-NEXT: retl
1335 ; X32-SSE41-LABEL: sext_8i32_to_8i64:
1336 ; X32-SSE41: # %bb.0: # %entry
1337 ; X32-SSE41-NEXT: pmovsxdq %xmm0, %xmm5
1338 ; X32-SSE41-NEXT: pmovsxdq %xmm1, %xmm2
1339 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
1340 ; X32-SSE41-NEXT: pmovsxdq %xmm0, %xmm4
1341 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm1[2,3,0,1]
1342 ; X32-SSE41-NEXT: pmovsxdq %xmm0, %xmm3
1343 ; X32-SSE41-NEXT: movdqa %xmm5, %xmm0
1344 ; X32-SSE41-NEXT: movdqa %xmm4, %xmm1
1345 ; X32-SSE41-NEXT: retl
1347 %B = sext <8 x i32> %A to <8 x i64>
1351 define <2 x i64> @load_sext_2i1_to_2i64(<2 x i1> *%ptr) {
1352 ; SSE-LABEL: load_sext_2i1_to_2i64:
1353 ; SSE: # %bb.0: # %entry
1354 ; SSE-NEXT: movzbl (%rdi), %eax
1355 ; SSE-NEXT: movq %rax, %rcx
1356 ; SSE-NEXT: shlq $62, %rcx
1357 ; SSE-NEXT: movq %rcx, %xmm0
1358 ; SSE-NEXT: shlq $63, %rax
1359 ; SSE-NEXT: movq %rax, %xmm1
1360 ; SSE-NEXT: punpcklqdq {{.*#+}} xmm1 = xmm1[0],xmm0[0]
1361 ; SSE-NEXT: psrad $31, %xmm1
1362 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm1[1,1,3,3]
1365 ; AVX1-LABEL: load_sext_2i1_to_2i64:
1366 ; AVX1: # %bb.0: # %entry
1367 ; AVX1-NEXT: movzbl (%rdi), %eax
1368 ; AVX1-NEXT: movq %rax, %rcx
1369 ; AVX1-NEXT: shlq $62, %rcx
1370 ; AVX1-NEXT: vmovq %rcx, %xmm0
1371 ; AVX1-NEXT: shlq $63, %rax
1372 ; AVX1-NEXT: vmovq %rax, %xmm1
1373 ; AVX1-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm1[0],xmm0[0]
1374 ; AVX1-NEXT: vpxor %xmm1, %xmm1, %xmm1
1375 ; AVX1-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm0
1378 ; AVX2-LABEL: load_sext_2i1_to_2i64:
1379 ; AVX2: # %bb.0: # %entry
1380 ; AVX2-NEXT: movzbl (%rdi), %eax
1381 ; AVX2-NEXT: movq %rax, %rcx
1382 ; AVX2-NEXT: shlq $62, %rcx
1383 ; AVX2-NEXT: vmovq %rcx, %xmm0
1384 ; AVX2-NEXT: shlq $63, %rax
1385 ; AVX2-NEXT: vmovq %rax, %xmm1
1386 ; AVX2-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm1[0],xmm0[0]
1387 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1388 ; AVX2-NEXT: vpcmpgtq %xmm0, %xmm1, %xmm0
1391 ; AVX512-LABEL: load_sext_2i1_to_2i64:
1392 ; AVX512: # %bb.0: # %entry
1393 ; AVX512-NEXT: kmovw (%rdi), %k1
1394 ; AVX512-NEXT: vpternlogq $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1395 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1396 ; AVX512-NEXT: vzeroupper
1399 ; X32-SSE2-LABEL: load_sext_2i1_to_2i64:
1400 ; X32-SSE2: # %bb.0: # %entry
1401 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
1402 ; X32-SSE2-NEXT: movzbl (%eax), %eax
1403 ; X32-SSE2-NEXT: movl %eax, %ecx
1404 ; X32-SSE2-NEXT: shll $30, %ecx
1405 ; X32-SSE2-NEXT: movd %ecx, %xmm0
1406 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[0,0,1,1]
1407 ; X32-SSE2-NEXT: shll $31, %eax
1408 ; X32-SSE2-NEXT: movd %eax, %xmm0
1409 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
1410 ; X32-SSE2-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
1411 ; X32-SSE2-NEXT: psrad $31, %xmm0
1412 ; X32-SSE2-NEXT: retl
1414 ; X32-SSE41-LABEL: load_sext_2i1_to_2i64:
1415 ; X32-SSE41: # %bb.0: # %entry
1416 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
1417 ; X32-SSE41-NEXT: movzbl (%eax), %eax
1418 ; X32-SSE41-NEXT: movl %eax, %ecx
1419 ; X32-SSE41-NEXT: shll $31, %ecx
1420 ; X32-SSE41-NEXT: movd %ecx, %xmm0
1421 ; X32-SSE41-NEXT: pinsrd $1, %ecx, %xmm0
1422 ; X32-SSE41-NEXT: shll $30, %eax
1423 ; X32-SSE41-NEXT: pinsrd $2, %eax, %xmm0
1424 ; X32-SSE41-NEXT: pinsrd $3, %eax, %xmm0
1425 ; X32-SSE41-NEXT: psrad $31, %xmm0
1426 ; X32-SSE41-NEXT: retl
1428 %X = load <2 x i1>, <2 x i1>* %ptr
1429 %Y = sext <2 x i1> %X to <2 x i64>
1433 define <2 x i64> @load_sext_2i8_to_2i64(<2 x i8> *%ptr) {
1434 ; SSE2-LABEL: load_sext_2i8_to_2i64:
1435 ; SSE2: # %bb.0: # %entry
1436 ; SSE2-NEXT: movzwl (%rdi), %eax
1437 ; SSE2-NEXT: movd %eax, %xmm0
1438 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1439 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1440 ; SSE2-NEXT: pxor %xmm1, %xmm1
1441 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
1442 ; SSE2-NEXT: psrad $24, %xmm0
1443 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1446 ; SSSE3-LABEL: load_sext_2i8_to_2i64:
1447 ; SSSE3: # %bb.0: # %entry
1448 ; SSSE3-NEXT: movzwl (%rdi), %eax
1449 ; SSSE3-NEXT: movd %eax, %xmm0
1450 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1451 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1452 ; SSSE3-NEXT: pxor %xmm1, %xmm1
1453 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm1
1454 ; SSSE3-NEXT: psrad $24, %xmm0
1455 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1458 ; SSE41-LABEL: load_sext_2i8_to_2i64:
1459 ; SSE41: # %bb.0: # %entry
1460 ; SSE41-NEXT: pmovsxbq (%rdi), %xmm0
1463 ; AVX-LABEL: load_sext_2i8_to_2i64:
1464 ; AVX: # %bb.0: # %entry
1465 ; AVX-NEXT: vpmovsxbq (%rdi), %xmm0
1468 ; X32-SSE2-LABEL: load_sext_2i8_to_2i64:
1469 ; X32-SSE2: # %bb.0: # %entry
1470 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
1471 ; X32-SSE2-NEXT: movzwl (%eax), %eax
1472 ; X32-SSE2-NEXT: movd %eax, %xmm0
1473 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1474 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1475 ; X32-SSE2-NEXT: pxor %xmm1, %xmm1
1476 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm1
1477 ; X32-SSE2-NEXT: psrad $24, %xmm0
1478 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
1479 ; X32-SSE2-NEXT: retl
1481 ; X32-SSE41-LABEL: load_sext_2i8_to_2i64:
1482 ; X32-SSE41: # %bb.0: # %entry
1483 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
1484 ; X32-SSE41-NEXT: pmovsxbq (%eax), %xmm0
1485 ; X32-SSE41-NEXT: retl
1487 %X = load <2 x i8>, <2 x i8>* %ptr
1488 %Y = sext <2 x i8> %X to <2 x i64>
1492 define <4 x i32> @load_sext_4i1_to_4i32(<4 x i1> *%ptr) {
1493 ; SSE2-LABEL: load_sext_4i1_to_4i32:
1494 ; SSE2: # %bb.0: # %entry
1495 ; SSE2-NEXT: movl (%rdi), %eax
1496 ; SSE2-NEXT: movq %rax, %rcx
1497 ; SSE2-NEXT: shlq $60, %rcx
1498 ; SSE2-NEXT: sarq $63, %rcx
1499 ; SSE2-NEXT: movd %ecx, %xmm0
1500 ; SSE2-NEXT: movq %rax, %rcx
1501 ; SSE2-NEXT: shlq $61, %rcx
1502 ; SSE2-NEXT: sarq $63, %rcx
1503 ; SSE2-NEXT: movd %ecx, %xmm1
1504 ; SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1505 ; SSE2-NEXT: movq %rax, %rcx
1506 ; SSE2-NEXT: shlq $62, %rcx
1507 ; SSE2-NEXT: sarq $63, %rcx
1508 ; SSE2-NEXT: movd %ecx, %xmm2
1509 ; SSE2-NEXT: shlq $63, %rax
1510 ; SSE2-NEXT: sarq $63, %rax
1511 ; SSE2-NEXT: movd %eax, %xmm0
1512 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
1513 ; SSE2-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
1516 ; SSSE3-LABEL: load_sext_4i1_to_4i32:
1517 ; SSSE3: # %bb.0: # %entry
1518 ; SSSE3-NEXT: movl (%rdi), %eax
1519 ; SSSE3-NEXT: movq %rax, %rcx
1520 ; SSSE3-NEXT: shlq $60, %rcx
1521 ; SSSE3-NEXT: sarq $63, %rcx
1522 ; SSSE3-NEXT: movd %ecx, %xmm0
1523 ; SSSE3-NEXT: movq %rax, %rcx
1524 ; SSSE3-NEXT: shlq $61, %rcx
1525 ; SSSE3-NEXT: sarq $63, %rcx
1526 ; SSSE3-NEXT: movd %ecx, %xmm1
1527 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1528 ; SSSE3-NEXT: movq %rax, %rcx
1529 ; SSSE3-NEXT: shlq $62, %rcx
1530 ; SSSE3-NEXT: sarq $63, %rcx
1531 ; SSSE3-NEXT: movd %ecx, %xmm2
1532 ; SSSE3-NEXT: shlq $63, %rax
1533 ; SSSE3-NEXT: sarq $63, %rax
1534 ; SSSE3-NEXT: movd %eax, %xmm0
1535 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
1536 ; SSSE3-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
1539 ; SSE41-LABEL: load_sext_4i1_to_4i32:
1540 ; SSE41: # %bb.0: # %entry
1541 ; SSE41-NEXT: movl (%rdi), %eax
1542 ; SSE41-NEXT: movq %rax, %rcx
1543 ; SSE41-NEXT: shlq $62, %rcx
1544 ; SSE41-NEXT: sarq $63, %rcx
1545 ; SSE41-NEXT: movq %rax, %rdx
1546 ; SSE41-NEXT: shlq $63, %rdx
1547 ; SSE41-NEXT: sarq $63, %rdx
1548 ; SSE41-NEXT: movd %edx, %xmm0
1549 ; SSE41-NEXT: pinsrd $1, %ecx, %xmm0
1550 ; SSE41-NEXT: movq %rax, %rcx
1551 ; SSE41-NEXT: shlq $61, %rcx
1552 ; SSE41-NEXT: sarq $63, %rcx
1553 ; SSE41-NEXT: pinsrd $2, %ecx, %xmm0
1554 ; SSE41-NEXT: shlq $60, %rax
1555 ; SSE41-NEXT: sarq $63, %rax
1556 ; SSE41-NEXT: pinsrd $3, %eax, %xmm0
1559 ; AVX1-LABEL: load_sext_4i1_to_4i32:
1560 ; AVX1: # %bb.0: # %entry
1561 ; AVX1-NEXT: movl (%rdi), %eax
1562 ; AVX1-NEXT: movq %rax, %rcx
1563 ; AVX1-NEXT: shlq $62, %rcx
1564 ; AVX1-NEXT: sarq $63, %rcx
1565 ; AVX1-NEXT: movq %rax, %rdx
1566 ; AVX1-NEXT: shlq $63, %rdx
1567 ; AVX1-NEXT: sarq $63, %rdx
1568 ; AVX1-NEXT: vmovd %edx, %xmm0
1569 ; AVX1-NEXT: vpinsrd $1, %ecx, %xmm0, %xmm0
1570 ; AVX1-NEXT: movq %rax, %rcx
1571 ; AVX1-NEXT: shlq $61, %rcx
1572 ; AVX1-NEXT: sarq $63, %rcx
1573 ; AVX1-NEXT: vpinsrd $2, %ecx, %xmm0, %xmm0
1574 ; AVX1-NEXT: shlq $60, %rax
1575 ; AVX1-NEXT: sarq $63, %rax
1576 ; AVX1-NEXT: vpinsrd $3, %eax, %xmm0, %xmm0
1579 ; AVX2-LABEL: load_sext_4i1_to_4i32:
1580 ; AVX2: # %bb.0: # %entry
1581 ; AVX2-NEXT: movl (%rdi), %eax
1582 ; AVX2-NEXT: movq %rax, %rcx
1583 ; AVX2-NEXT: shlq $62, %rcx
1584 ; AVX2-NEXT: sarq $63, %rcx
1585 ; AVX2-NEXT: movq %rax, %rdx
1586 ; AVX2-NEXT: shlq $63, %rdx
1587 ; AVX2-NEXT: sarq $63, %rdx
1588 ; AVX2-NEXT: vmovd %edx, %xmm0
1589 ; AVX2-NEXT: vpinsrd $1, %ecx, %xmm0, %xmm0
1590 ; AVX2-NEXT: movq %rax, %rcx
1591 ; AVX2-NEXT: shlq $61, %rcx
1592 ; AVX2-NEXT: sarq $63, %rcx
1593 ; AVX2-NEXT: vpinsrd $2, %ecx, %xmm0, %xmm0
1594 ; AVX2-NEXT: shlq $60, %rax
1595 ; AVX2-NEXT: sarq $63, %rax
1596 ; AVX2-NEXT: vpinsrd $3, %eax, %xmm0, %xmm0
1599 ; AVX512-LABEL: load_sext_4i1_to_4i32:
1600 ; AVX512: # %bb.0: # %entry
1601 ; AVX512-NEXT: kmovw (%rdi), %k1
1602 ; AVX512-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1603 ; AVX512-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
1604 ; AVX512-NEXT: vzeroupper
1607 ; X32-SSE2-LABEL: load_sext_4i1_to_4i32:
1608 ; X32-SSE2: # %bb.0: # %entry
1609 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
1610 ; X32-SSE2-NEXT: movl (%eax), %eax
1611 ; X32-SSE2-NEXT: movl %eax, %ecx
1612 ; X32-SSE2-NEXT: shll $28, %ecx
1613 ; X32-SSE2-NEXT: movd %ecx, %xmm0
1614 ; X32-SSE2-NEXT: movl %eax, %ecx
1615 ; X32-SSE2-NEXT: shll $29, %ecx
1616 ; X32-SSE2-NEXT: movd %ecx, %xmm1
1617 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1618 ; X32-SSE2-NEXT: movl %eax, %ecx
1619 ; X32-SSE2-NEXT: shll $30, %ecx
1620 ; X32-SSE2-NEXT: movd %ecx, %xmm2
1621 ; X32-SSE2-NEXT: shll $31, %eax
1622 ; X32-SSE2-NEXT: movd %eax, %xmm0
1623 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
1624 ; X32-SSE2-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
1625 ; X32-SSE2-NEXT: psrad $31, %xmm0
1626 ; X32-SSE2-NEXT: retl
1628 ; X32-SSE41-LABEL: load_sext_4i1_to_4i32:
1629 ; X32-SSE41: # %bb.0: # %entry
1630 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
1631 ; X32-SSE41-NEXT: movl (%eax), %eax
1632 ; X32-SSE41-NEXT: movl %eax, %ecx
1633 ; X32-SSE41-NEXT: shll $30, %ecx
1634 ; X32-SSE41-NEXT: movl %eax, %edx
1635 ; X32-SSE41-NEXT: shll $31, %edx
1636 ; X32-SSE41-NEXT: movd %edx, %xmm0
1637 ; X32-SSE41-NEXT: pinsrd $1, %ecx, %xmm0
1638 ; X32-SSE41-NEXT: movl %eax, %ecx
1639 ; X32-SSE41-NEXT: shll $29, %ecx
1640 ; X32-SSE41-NEXT: pinsrd $2, %ecx, %xmm0
1641 ; X32-SSE41-NEXT: shll $28, %eax
1642 ; X32-SSE41-NEXT: pinsrd $3, %eax, %xmm0
1643 ; X32-SSE41-NEXT: psrad $31, %xmm0
1644 ; X32-SSE41-NEXT: retl
1646 %X = load <4 x i1>, <4 x i1>* %ptr
1647 %Y = sext <4 x i1> %X to <4 x i32>
1651 define <4 x i32> @load_sext_4i8_to_4i32(<4 x i8> *%ptr) {
1652 ; SSE2-LABEL: load_sext_4i8_to_4i32:
1653 ; SSE2: # %bb.0: # %entry
1654 ; SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
1655 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1656 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1657 ; SSE2-NEXT: psrad $24, %xmm0
1660 ; SSSE3-LABEL: load_sext_4i8_to_4i32:
1661 ; SSSE3: # %bb.0: # %entry
1662 ; SSSE3-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
1663 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1664 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1665 ; SSSE3-NEXT: psrad $24, %xmm0
1668 ; SSE41-LABEL: load_sext_4i8_to_4i32:
1669 ; SSE41: # %bb.0: # %entry
1670 ; SSE41-NEXT: pmovsxbd (%rdi), %xmm0
1673 ; AVX-LABEL: load_sext_4i8_to_4i32:
1674 ; AVX: # %bb.0: # %entry
1675 ; AVX-NEXT: vpmovsxbd (%rdi), %xmm0
1678 ; X32-SSE2-LABEL: load_sext_4i8_to_4i32:
1679 ; X32-SSE2: # %bb.0: # %entry
1680 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
1681 ; X32-SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
1682 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1683 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1684 ; X32-SSE2-NEXT: psrad $24, %xmm0
1685 ; X32-SSE2-NEXT: retl
1687 ; X32-SSE41-LABEL: load_sext_4i8_to_4i32:
1688 ; X32-SSE41: # %bb.0: # %entry
1689 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
1690 ; X32-SSE41-NEXT: pmovsxbd (%eax), %xmm0
1691 ; X32-SSE41-NEXT: retl
1693 %X = load <4 x i8>, <4 x i8>* %ptr
1694 %Y = sext <4 x i8> %X to <4 x i32>
1698 define <4 x i64> @load_sext_4i1_to_4i64(<4 x i1> *%ptr) {
1699 ; SSE2-LABEL: load_sext_4i1_to_4i64:
1700 ; SSE2: # %bb.0: # %entry
1701 ; SSE2-NEXT: movl (%rdi), %eax
1702 ; SSE2-NEXT: movl %eax, %ecx
1703 ; SSE2-NEXT: shrl $3, %ecx
1704 ; SSE2-NEXT: movd %ecx, %xmm0
1705 ; SSE2-NEXT: movl %eax, %ecx
1706 ; SSE2-NEXT: shrl $2, %ecx
1707 ; SSE2-NEXT: movd %ecx, %xmm1
1708 ; SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1709 ; SSE2-NEXT: movd %eax, %xmm2
1710 ; SSE2-NEXT: shrl %eax
1711 ; SSE2-NEXT: movd %eax, %xmm0
1712 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
1713 ; SSE2-NEXT: punpcklqdq {{.*#+}} xmm2 = xmm2[0],xmm1[0]
1714 ; SSE2-NEXT: pand {{.*}}(%rip), %xmm2
1715 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm2[0,1,1,3]
1716 ; SSE2-NEXT: psllq $63, %xmm0
1717 ; SSE2-NEXT: psrad $31, %xmm0
1718 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
1719 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[2,1,3,3]
1720 ; SSE2-NEXT: psllq $63, %xmm1
1721 ; SSE2-NEXT: psrad $31, %xmm1
1722 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
1725 ; SSSE3-LABEL: load_sext_4i1_to_4i64:
1726 ; SSSE3: # %bb.0: # %entry
1727 ; SSSE3-NEXT: movl (%rdi), %eax
1728 ; SSSE3-NEXT: movl %eax, %ecx
1729 ; SSSE3-NEXT: shrl $3, %ecx
1730 ; SSSE3-NEXT: movd %ecx, %xmm0
1731 ; SSSE3-NEXT: movl %eax, %ecx
1732 ; SSSE3-NEXT: shrl $2, %ecx
1733 ; SSSE3-NEXT: movd %ecx, %xmm1
1734 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1735 ; SSSE3-NEXT: movd %eax, %xmm2
1736 ; SSSE3-NEXT: shrl %eax
1737 ; SSSE3-NEXT: movd %eax, %xmm0
1738 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
1739 ; SSSE3-NEXT: punpcklqdq {{.*#+}} xmm2 = xmm2[0],xmm1[0]
1740 ; SSSE3-NEXT: pand {{.*}}(%rip), %xmm2
1741 ; SSSE3-NEXT: pshufd {{.*#+}} xmm0 = xmm2[0,1,1,3]
1742 ; SSSE3-NEXT: psllq $63, %xmm0
1743 ; SSSE3-NEXT: psrad $31, %xmm0
1744 ; SSSE3-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
1745 ; SSSE3-NEXT: pshufd {{.*#+}} xmm1 = xmm2[2,1,3,3]
1746 ; SSSE3-NEXT: psllq $63, %xmm1
1747 ; SSSE3-NEXT: psrad $31, %xmm1
1748 ; SSSE3-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
1751 ; SSE41-LABEL: load_sext_4i1_to_4i64:
1752 ; SSE41: # %bb.0: # %entry
1753 ; SSE41-NEXT: movl (%rdi), %eax
1754 ; SSE41-NEXT: movl %eax, %ecx
1755 ; SSE41-NEXT: shrl %ecx
1756 ; SSE41-NEXT: movd %eax, %xmm1
1757 ; SSE41-NEXT: pinsrd $1, %ecx, %xmm1
1758 ; SSE41-NEXT: movl %eax, %ecx
1759 ; SSE41-NEXT: shrl $2, %ecx
1760 ; SSE41-NEXT: pinsrd $2, %ecx, %xmm1
1761 ; SSE41-NEXT: shrl $3, %eax
1762 ; SSE41-NEXT: pinsrd $3, %eax, %xmm1
1763 ; SSE41-NEXT: pand {{.*}}(%rip), %xmm1
1764 ; SSE41-NEXT: pmovzxdq {{.*#+}} xmm0 = xmm1[0],zero,xmm1[1],zero
1765 ; SSE41-NEXT: psllq $63, %xmm0
1766 ; SSE41-NEXT: psrad $31, %xmm0
1767 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
1768 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,2,3,3]
1769 ; SSE41-NEXT: psllq $63, %xmm1
1770 ; SSE41-NEXT: psrad $31, %xmm1
1771 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
1774 ; AVX1-LABEL: load_sext_4i1_to_4i64:
1775 ; AVX1: # %bb.0: # %entry
1776 ; AVX1-NEXT: movl (%rdi), %eax
1777 ; AVX1-NEXT: movq %rax, %rcx
1778 ; AVX1-NEXT: shlq $62, %rcx
1779 ; AVX1-NEXT: sarq $63, %rcx
1780 ; AVX1-NEXT: movq %rax, %rdx
1781 ; AVX1-NEXT: shlq $63, %rdx
1782 ; AVX1-NEXT: sarq $63, %rdx
1783 ; AVX1-NEXT: vmovd %edx, %xmm0
1784 ; AVX1-NEXT: vpinsrd $1, %ecx, %xmm0, %xmm0
1785 ; AVX1-NEXT: movq %rax, %rcx
1786 ; AVX1-NEXT: shlq $61, %rcx
1787 ; AVX1-NEXT: sarq $63, %rcx
1788 ; AVX1-NEXT: vpinsrd $2, %ecx, %xmm0, %xmm0
1789 ; AVX1-NEXT: shlq $60, %rax
1790 ; AVX1-NEXT: sarq $63, %rax
1791 ; AVX1-NEXT: vpinsrd $3, %eax, %xmm0, %xmm0
1792 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm1
1793 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
1794 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm0
1795 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1798 ; AVX2-LABEL: load_sext_4i1_to_4i64:
1799 ; AVX2: # %bb.0: # %entry
1800 ; AVX2-NEXT: movl (%rdi), %eax
1801 ; AVX2-NEXT: movq %rax, %rcx
1802 ; AVX2-NEXT: shlq $60, %rcx
1803 ; AVX2-NEXT: vmovq %rcx, %xmm0
1804 ; AVX2-NEXT: movq %rax, %rcx
1805 ; AVX2-NEXT: shlq $61, %rcx
1806 ; AVX2-NEXT: vmovq %rcx, %xmm1
1807 ; AVX2-NEXT: vpunpcklqdq {{.*#+}} xmm0 = xmm1[0],xmm0[0]
1808 ; AVX2-NEXT: movq %rax, %rcx
1809 ; AVX2-NEXT: shlq $62, %rcx
1810 ; AVX2-NEXT: vmovq %rcx, %xmm1
1811 ; AVX2-NEXT: shlq $63, %rax
1812 ; AVX2-NEXT: vmovq %rax, %xmm2
1813 ; AVX2-NEXT: vpunpcklqdq {{.*#+}} xmm1 = xmm2[0],xmm1[0]
1814 ; AVX2-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0
1815 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
1816 ; AVX2-NEXT: vpcmpgtq %ymm0, %ymm1, %ymm0
1819 ; AVX512-LABEL: load_sext_4i1_to_4i64:
1820 ; AVX512: # %bb.0: # %entry
1821 ; AVX512-NEXT: kmovw (%rdi), %k1
1822 ; AVX512-NEXT: vpternlogq $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
1823 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
1826 ; X32-SSE2-LABEL: load_sext_4i1_to_4i64:
1827 ; X32-SSE2: # %bb.0: # %entry
1828 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
1829 ; X32-SSE2-NEXT: movzbl (%eax), %eax
1830 ; X32-SSE2-NEXT: movl %eax, %ecx
1831 ; X32-SSE2-NEXT: shrl $3, %ecx
1832 ; X32-SSE2-NEXT: movd %ecx, %xmm0
1833 ; X32-SSE2-NEXT: movl %eax, %ecx
1834 ; X32-SSE2-NEXT: shrl $2, %ecx
1835 ; X32-SSE2-NEXT: movd %ecx, %xmm1
1836 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
1837 ; X32-SSE2-NEXT: movd %eax, %xmm2
1838 ; X32-SSE2-NEXT: shrl %eax
1839 ; X32-SSE2-NEXT: movd %eax, %xmm0
1840 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm0[0],xmm2[1],xmm0[1]
1841 ; X32-SSE2-NEXT: punpcklqdq {{.*#+}} xmm2 = xmm2[0],xmm1[0]
1842 ; X32-SSE2-NEXT: pand {{\.LCPI.*}}, %xmm2
1843 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm2[0,1,1,3]
1844 ; X32-SSE2-NEXT: psllq $63, %xmm0
1845 ; X32-SSE2-NEXT: psrad $31, %xmm0
1846 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
1847 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm2[2,1,3,3]
1848 ; X32-SSE2-NEXT: psllq $63, %xmm1
1849 ; X32-SSE2-NEXT: psrad $31, %xmm1
1850 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
1851 ; X32-SSE2-NEXT: retl
1853 ; X32-SSE41-LABEL: load_sext_4i1_to_4i64:
1854 ; X32-SSE41: # %bb.0: # %entry
1855 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
1856 ; X32-SSE41-NEXT: movzbl (%eax), %eax
1857 ; X32-SSE41-NEXT: movl %eax, %ecx
1858 ; X32-SSE41-NEXT: shrl %ecx
1859 ; X32-SSE41-NEXT: movd %eax, %xmm1
1860 ; X32-SSE41-NEXT: pinsrd $1, %ecx, %xmm1
1861 ; X32-SSE41-NEXT: movl %eax, %ecx
1862 ; X32-SSE41-NEXT: shrl $2, %ecx
1863 ; X32-SSE41-NEXT: pinsrd $2, %ecx, %xmm1
1864 ; X32-SSE41-NEXT: shrl $3, %eax
1865 ; X32-SSE41-NEXT: pinsrd $3, %eax, %xmm1
1866 ; X32-SSE41-NEXT: pand {{\.LCPI.*}}, %xmm1
1867 ; X32-SSE41-NEXT: pmovzxdq {{.*#+}} xmm0 = xmm1[0],zero,xmm1[1],zero
1868 ; X32-SSE41-NEXT: psllq $63, %xmm0
1869 ; X32-SSE41-NEXT: psrad $31, %xmm0
1870 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
1871 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,2,3,3]
1872 ; X32-SSE41-NEXT: psllq $63, %xmm1
1873 ; X32-SSE41-NEXT: psrad $31, %xmm1
1874 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
1875 ; X32-SSE41-NEXT: retl
1877 %X = load <4 x i1>, <4 x i1>* %ptr
1878 %Y = sext <4 x i1> %X to <4 x i64>
1882 define <4 x i64> @load_sext_4i8_to_4i64(<4 x i8> *%ptr) {
1883 ; SSE2-LABEL: load_sext_4i8_to_4i64:
1884 ; SSE2: # %bb.0: # %entry
1885 ; SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
1886 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1887 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1888 ; SSE2-NEXT: psrad $24, %xmm1
1889 ; SSE2-NEXT: pxor %xmm2, %xmm2
1890 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
1891 ; SSE2-NEXT: movdqa %xmm1, %xmm0
1892 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
1893 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
1896 ; SSSE3-LABEL: load_sext_4i8_to_4i64:
1897 ; SSSE3: # %bb.0: # %entry
1898 ; SSSE3-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
1899 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1900 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1901 ; SSSE3-NEXT: psrad $24, %xmm1
1902 ; SSSE3-NEXT: pxor %xmm2, %xmm2
1903 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
1904 ; SSSE3-NEXT: movdqa %xmm1, %xmm0
1905 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
1906 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
1909 ; SSE41-LABEL: load_sext_4i8_to_4i64:
1910 ; SSE41: # %bb.0: # %entry
1911 ; SSE41-NEXT: pmovsxbq (%rdi), %xmm0
1912 ; SSE41-NEXT: pmovsxbq 2(%rdi), %xmm1
1915 ; AVX1-LABEL: load_sext_4i8_to_4i64:
1916 ; AVX1: # %bb.0: # %entry
1917 ; AVX1-NEXT: vpmovsxbq 2(%rdi), %xmm0
1918 ; AVX1-NEXT: vpmovsxbq (%rdi), %xmm1
1919 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
1922 ; AVX2-LABEL: load_sext_4i8_to_4i64:
1923 ; AVX2: # %bb.0: # %entry
1924 ; AVX2-NEXT: vpmovsxbq (%rdi), %ymm0
1927 ; AVX512-LABEL: load_sext_4i8_to_4i64:
1928 ; AVX512: # %bb.0: # %entry
1929 ; AVX512-NEXT: vpmovsxbq (%rdi), %ymm0
1932 ; X32-SSE2-LABEL: load_sext_4i8_to_4i64:
1933 ; X32-SSE2: # %bb.0: # %entry
1934 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
1935 ; X32-SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
1936 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1937 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
1938 ; X32-SSE2-NEXT: psrad $24, %xmm1
1939 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
1940 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
1941 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm0
1942 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
1943 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
1944 ; X32-SSE2-NEXT: retl
1946 ; X32-SSE41-LABEL: load_sext_4i8_to_4i64:
1947 ; X32-SSE41: # %bb.0: # %entry
1948 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
1949 ; X32-SSE41-NEXT: pmovsxbq (%eax), %xmm0
1950 ; X32-SSE41-NEXT: pmovsxbq 2(%eax), %xmm1
1951 ; X32-SSE41-NEXT: retl
1953 %X = load <4 x i8>, <4 x i8>* %ptr
1954 %Y = sext <4 x i8> %X to <4 x i64>
1958 define <2 x i64> @load_sext_4i8_to_4i64_extract(<4 x i8> *%ptr) {
1959 ; SSE2-LABEL: load_sext_4i8_to_4i64_extract:
1961 ; SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
1962 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1963 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1964 ; SSE2-NEXT: psrad $24, %xmm0
1965 ; SSE2-NEXT: pxor %xmm1, %xmm1
1966 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
1967 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
1970 ; SSSE3-LABEL: load_sext_4i8_to_4i64_extract:
1972 ; SSSE3-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
1973 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
1974 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
1975 ; SSSE3-NEXT: psrad $24, %xmm0
1976 ; SSSE3-NEXT: pxor %xmm1, %xmm1
1977 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm1
1978 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
1981 ; SSE41-LABEL: load_sext_4i8_to_4i64_extract:
1983 ; SSE41-NEXT: pmovsxbq 2(%rdi), %xmm0
1986 ; AVX1-LABEL: load_sext_4i8_to_4i64_extract:
1988 ; AVX1-NEXT: vpmovsxbq 2(%rdi), %xmm0
1991 ; AVX2-LABEL: load_sext_4i8_to_4i64_extract:
1993 ; AVX2-NEXT: vpmovsxbq (%rdi), %ymm0
1994 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm0
1995 ; AVX2-NEXT: vzeroupper
1998 ; AVX512-LABEL: load_sext_4i8_to_4i64_extract:
2000 ; AVX512-NEXT: vpmovsxbq (%rdi), %ymm0
2001 ; AVX512-NEXT: vextracti128 $1, %ymm0, %xmm0
2002 ; AVX512-NEXT: vzeroupper
2005 ; X32-SSE2-LABEL: load_sext_4i8_to_4i64_extract:
2006 ; X32-SSE2: # %bb.0:
2007 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2008 ; X32-SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2009 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2010 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
2011 ; X32-SSE2-NEXT: psrad $24, %xmm0
2012 ; X32-SSE2-NEXT: pxor %xmm1, %xmm1
2013 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm1
2014 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm0 = xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2015 ; X32-SSE2-NEXT: retl
2017 ; X32-SSE41-LABEL: load_sext_4i8_to_4i64_extract:
2018 ; X32-SSE41: # %bb.0:
2019 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2020 ; X32-SSE41-NEXT: pmovsxbq 2(%eax), %xmm0
2021 ; X32-SSE41-NEXT: retl
2022 %ld = load <4 x i8>, <4 x i8>* %ptr
2023 %sext = sext <4 x i8> %ld to <4 x i64>
2024 %extract = shufflevector <4 x i64> %sext, <4 x i64> undef, <2 x i32> <i32 2, i32 3>
2025 ret <2 x i64> %extract
2028 define <8 x i16> @load_sext_8i1_to_8i16(<8 x i1> *%ptr) {
2029 ; SSE-LABEL: load_sext_8i1_to_8i16:
2030 ; SSE: # %bb.0: # %entry
2031 ; SSE-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2032 ; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
2033 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
2034 ; SSE-NEXT: movdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
2035 ; SSE-NEXT: pand %xmm1, %xmm0
2036 ; SSE-NEXT: pcmpeqw %xmm1, %xmm0
2039 ; AVX1-LABEL: load_sext_8i1_to_8i16:
2040 ; AVX1: # %bb.0: # %entry
2041 ; AVX1-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2042 ; AVX1-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
2043 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
2044 ; AVX1-NEXT: vmovdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
2045 ; AVX1-NEXT: vpand %xmm1, %xmm0, %xmm0
2046 ; AVX1-NEXT: vpcmpeqw %xmm1, %xmm0, %xmm0
2049 ; AVX2-LABEL: load_sext_8i1_to_8i16:
2050 ; AVX2: # %bb.0: # %entry
2051 ; AVX2-NEXT: vpbroadcastw (%rdi), %xmm0
2052 ; AVX2-NEXT: vmovdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
2053 ; AVX2-NEXT: vpand %xmm1, %xmm0, %xmm0
2054 ; AVX2-NEXT: vpcmpeqw %xmm1, %xmm0, %xmm0
2057 ; AVX512F-LABEL: load_sext_8i1_to_8i16:
2058 ; AVX512F: # %bb.0: # %entry
2059 ; AVX512F-NEXT: kmovw (%rdi), %k1
2060 ; AVX512F-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
2061 ; AVX512F-NEXT: vpmovdw %zmm0, %ymm0
2062 ; AVX512F-NEXT: # kill: def $xmm0 killed $xmm0 killed $ymm0
2063 ; AVX512F-NEXT: vzeroupper
2064 ; AVX512F-NEXT: retq
2066 ; AVX512BW-LABEL: load_sext_8i1_to_8i16:
2067 ; AVX512BW: # %bb.0: # %entry
2068 ; AVX512BW-NEXT: kmovw (%rdi), %k0
2069 ; AVX512BW-NEXT: vpmovm2w %k0, %zmm0
2070 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2071 ; AVX512BW-NEXT: vzeroupper
2072 ; AVX512BW-NEXT: retq
2074 ; X32-SSE-LABEL: load_sext_8i1_to_8i16:
2075 ; X32-SSE: # %bb.0: # %entry
2076 ; X32-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
2077 ; X32-SSE-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2078 ; X32-SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
2079 ; X32-SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
2080 ; X32-SSE-NEXT: movdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128]
2081 ; X32-SSE-NEXT: pand %xmm1, %xmm0
2082 ; X32-SSE-NEXT: pcmpeqw %xmm1, %xmm0
2083 ; X32-SSE-NEXT: retl
2085 %X = load <8 x i1>, <8 x i1>* %ptr
2086 %Y = sext <8 x i1> %X to <8 x i16>
2090 define <8 x i16> @load_sext_8i8_to_8i16(<8 x i8> *%ptr) {
2091 ; SSE2-LABEL: load_sext_8i8_to_8i16:
2092 ; SSE2: # %bb.0: # %entry
2093 ; SSE2-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2094 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2095 ; SSE2-NEXT: psraw $8, %xmm0
2098 ; SSSE3-LABEL: load_sext_8i8_to_8i16:
2099 ; SSSE3: # %bb.0: # %entry
2100 ; SSSE3-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2101 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2102 ; SSSE3-NEXT: psraw $8, %xmm0
2105 ; SSE41-LABEL: load_sext_8i8_to_8i16:
2106 ; SSE41: # %bb.0: # %entry
2107 ; SSE41-NEXT: pmovsxbw (%rdi), %xmm0
2110 ; AVX-LABEL: load_sext_8i8_to_8i16:
2111 ; AVX: # %bb.0: # %entry
2112 ; AVX-NEXT: vpmovsxbw (%rdi), %xmm0
2115 ; X32-SSE2-LABEL: load_sext_8i8_to_8i16:
2116 ; X32-SSE2: # %bb.0: # %entry
2117 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2118 ; X32-SSE2-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2119 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2120 ; X32-SSE2-NEXT: psraw $8, %xmm0
2121 ; X32-SSE2-NEXT: retl
2123 ; X32-SSE41-LABEL: load_sext_8i8_to_8i16:
2124 ; X32-SSE41: # %bb.0: # %entry
2125 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2126 ; X32-SSE41-NEXT: pmovsxbw (%eax), %xmm0
2127 ; X32-SSE41-NEXT: retl
2129 %X = load <8 x i8>, <8 x i8>* %ptr
2130 %Y = sext <8 x i8> %X to <8 x i16>
2134 define <8 x i64> @load_sext_8i8_to_8i64(<8 x i8> *%ptr) {
2135 ; SSE2-LABEL: load_sext_8i8_to_8i64:
2136 ; SSE2: # %bb.0: # %entry
2137 ; SSE2-NEXT: movq {{.*#+}} xmm2 = mem[0],zero
2138 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2139 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
2140 ; SSE2-NEXT: psrad $24, %xmm1
2141 ; SSE2-NEXT: pxor %xmm4, %xmm4
2142 ; SSE2-NEXT: pxor %xmm3, %xmm3
2143 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm3
2144 ; SSE2-NEXT: movdqa %xmm1, %xmm0
2145 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
2146 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm3[2],xmm1[3],xmm3[3]
2147 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm2[4],xmm3[5],xmm2[5],xmm3[6],xmm2[6],xmm3[7],xmm2[7]
2148 ; SSE2-NEXT: psrad $24, %xmm3
2149 ; SSE2-NEXT: pcmpgtd %xmm3, %xmm4
2150 ; SSE2-NEXT: movdqa %xmm3, %xmm2
2151 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
2152 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm4[2],xmm3[3],xmm4[3]
2155 ; SSSE3-LABEL: load_sext_8i8_to_8i64:
2156 ; SSSE3: # %bb.0: # %entry
2157 ; SSSE3-NEXT: movq {{.*#+}} xmm2 = mem[0],zero
2158 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2159 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
2160 ; SSSE3-NEXT: psrad $24, %xmm1
2161 ; SSSE3-NEXT: pxor %xmm4, %xmm4
2162 ; SSSE3-NEXT: pxor %xmm3, %xmm3
2163 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm3
2164 ; SSSE3-NEXT: movdqa %xmm1, %xmm0
2165 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
2166 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm3[2],xmm1[3],xmm3[3]
2167 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm2[4],xmm3[5],xmm2[5],xmm3[6],xmm2[6],xmm3[7],xmm2[7]
2168 ; SSSE3-NEXT: psrad $24, %xmm3
2169 ; SSSE3-NEXT: pcmpgtd %xmm3, %xmm4
2170 ; SSSE3-NEXT: movdqa %xmm3, %xmm2
2171 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
2172 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm4[2],xmm3[3],xmm4[3]
2175 ; SSE41-LABEL: load_sext_8i8_to_8i64:
2176 ; SSE41: # %bb.0: # %entry
2177 ; SSE41-NEXT: pmovsxbq (%rdi), %xmm0
2178 ; SSE41-NEXT: pmovsxbq 2(%rdi), %xmm1
2179 ; SSE41-NEXT: pmovsxbq 4(%rdi), %xmm2
2180 ; SSE41-NEXT: pmovsxbq 6(%rdi), %xmm3
2183 ; AVX1-LABEL: load_sext_8i8_to_8i64:
2184 ; AVX1: # %bb.0: # %entry
2185 ; AVX1-NEXT: vpmovsxbq 6(%rdi), %xmm1
2186 ; AVX1-NEXT: vpmovsxbq 4(%rdi), %xmm2
2187 ; AVX1-NEXT: vpmovsxbq 2(%rdi), %xmm0
2188 ; AVX1-NEXT: vpmovsxbq (%rdi), %xmm3
2189 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm3, %ymm0
2190 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
2193 ; AVX2-LABEL: load_sext_8i8_to_8i64:
2194 ; AVX2: # %bb.0: # %entry
2195 ; AVX2-NEXT: vpmovsxbq (%rdi), %ymm0
2196 ; AVX2-NEXT: vpmovsxbq 4(%rdi), %ymm1
2199 ; AVX512-LABEL: load_sext_8i8_to_8i64:
2200 ; AVX512: # %bb.0: # %entry
2201 ; AVX512-NEXT: vpmovsxbq (%rdi), %zmm0
2204 ; X32-SSE2-LABEL: load_sext_8i8_to_8i64:
2205 ; X32-SSE2: # %bb.0: # %entry
2206 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2207 ; X32-SSE2-NEXT: movq {{.*#+}} xmm2 = mem[0],zero
2208 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm2 = xmm2[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2209 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1],xmm1[2],xmm2[2],xmm1[3],xmm2[3]
2210 ; X32-SSE2-NEXT: psrad $24, %xmm1
2211 ; X32-SSE2-NEXT: pxor %xmm4, %xmm4
2212 ; X32-SSE2-NEXT: pxor %xmm3, %xmm3
2213 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm3
2214 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm0
2215 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
2216 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm3[2],xmm1[3],xmm3[3]
2217 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm3 = xmm3[4],xmm2[4],xmm3[5],xmm2[5],xmm3[6],xmm2[6],xmm3[7],xmm2[7]
2218 ; X32-SSE2-NEXT: psrad $24, %xmm3
2219 ; X32-SSE2-NEXT: pcmpgtd %xmm3, %xmm4
2220 ; X32-SSE2-NEXT: movdqa %xmm3, %xmm2
2221 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
2222 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm3 = xmm3[2],xmm4[2],xmm3[3],xmm4[3]
2223 ; X32-SSE2-NEXT: retl
2225 ; X32-SSE41-LABEL: load_sext_8i8_to_8i64:
2226 ; X32-SSE41: # %bb.0: # %entry
2227 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2228 ; X32-SSE41-NEXT: pmovsxbq (%eax), %xmm0
2229 ; X32-SSE41-NEXT: pmovsxbq 2(%eax), %xmm1
2230 ; X32-SSE41-NEXT: pmovsxbq 4(%eax), %xmm2
2231 ; X32-SSE41-NEXT: pmovsxbq 6(%eax), %xmm3
2232 ; X32-SSE41-NEXT: retl
2234 %X = load <8 x i8>, <8 x i8>* %ptr
2235 %Y = sext <8 x i8> %X to <8 x i64>
2239 define <8 x i32> @load_sext_8i1_to_8i32(<8 x i1> *%ptr) {
2240 ; SSE-LABEL: load_sext_8i1_to_8i32:
2241 ; SSE: # %bb.0: # %entry
2242 ; SSE-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2243 ; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[0,0,0,0]
2244 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [1,2,4,8]
2245 ; SSE-NEXT: movdqa %xmm1, %xmm0
2246 ; SSE-NEXT: pand %xmm2, %xmm0
2247 ; SSE-NEXT: pcmpeqd %xmm2, %xmm0
2248 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [16,32,64,128]
2249 ; SSE-NEXT: pand %xmm2, %xmm1
2250 ; SSE-NEXT: pcmpeqd %xmm2, %xmm1
2253 ; AVX1-LABEL: load_sext_8i1_to_8i32:
2254 ; AVX1: # %bb.0: # %entry
2255 ; AVX1-NEXT: vmovss {{.*#+}} xmm0 = mem[0],zero,zero,zero
2256 ; AVX1-NEXT: vpermilps {{.*#+}} xmm0 = xmm0[0,0,0,0]
2257 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2258 ; AVX1-NEXT: vandps {{.*}}(%rip), %ymm0, %ymm0
2259 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
2260 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
2261 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm1, %xmm1
2262 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm3, %xmm3
2263 ; AVX1-NEXT: vpxor %xmm3, %xmm1, %xmm1
2264 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm0, %xmm0
2265 ; AVX1-NEXT: vpxor %xmm3, %xmm0, %xmm0
2266 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2269 ; AVX2-LABEL: load_sext_8i1_to_8i32:
2270 ; AVX2: # %bb.0: # %entry
2271 ; AVX2-NEXT: vpbroadcastd (%rdi), %ymm0
2272 ; AVX2-NEXT: vmovdqa {{.*#+}} ymm1 = [1,2,4,8,16,32,64,128]
2273 ; AVX2-NEXT: vpand %ymm1, %ymm0, %ymm0
2274 ; AVX2-NEXT: vpcmpeqd %ymm1, %ymm0, %ymm0
2277 ; AVX512-LABEL: load_sext_8i1_to_8i32:
2278 ; AVX512: # %bb.0: # %entry
2279 ; AVX512-NEXT: kmovw (%rdi), %k1
2280 ; AVX512-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
2281 ; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2284 ; X32-SSE-LABEL: load_sext_8i1_to_8i32:
2285 ; X32-SSE: # %bb.0: # %entry
2286 ; X32-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
2287 ; X32-SSE-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2288 ; X32-SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[0,0,0,0]
2289 ; X32-SSE-NEXT: movdqa {{.*#+}} xmm2 = [1,2,4,8]
2290 ; X32-SSE-NEXT: movdqa %xmm1, %xmm0
2291 ; X32-SSE-NEXT: pand %xmm2, %xmm0
2292 ; X32-SSE-NEXT: pcmpeqd %xmm2, %xmm0
2293 ; X32-SSE-NEXT: movdqa {{.*#+}} xmm2 = [16,32,64,128]
2294 ; X32-SSE-NEXT: pand %xmm2, %xmm1
2295 ; X32-SSE-NEXT: pcmpeqd %xmm2, %xmm1
2296 ; X32-SSE-NEXT: retl
2298 %X = load <8 x i1>, <8 x i1>* %ptr
2299 %Y = sext <8 x i1> %X to <8 x i32>
2303 define <8 x i32> @load_sext_8i8_to_8i32(<8 x i8> *%ptr) {
2304 ; SSE2-LABEL: load_sext_8i8_to_8i32:
2305 ; SSE2: # %bb.0: # %entry
2306 ; SSE2-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
2307 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2308 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2309 ; SSE2-NEXT: psrad $24, %xmm0
2310 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
2311 ; SSE2-NEXT: psrad $24, %xmm1
2314 ; SSSE3-LABEL: load_sext_8i8_to_8i32:
2315 ; SSSE3: # %bb.0: # %entry
2316 ; SSSE3-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
2317 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2318 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2319 ; SSSE3-NEXT: psrad $24, %xmm0
2320 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
2321 ; SSSE3-NEXT: psrad $24, %xmm1
2324 ; SSE41-LABEL: load_sext_8i8_to_8i32:
2325 ; SSE41: # %bb.0: # %entry
2326 ; SSE41-NEXT: pmovsxbd (%rdi), %xmm0
2327 ; SSE41-NEXT: pmovsxbd 4(%rdi), %xmm1
2330 ; AVX1-LABEL: load_sext_8i8_to_8i32:
2331 ; AVX1: # %bb.0: # %entry
2332 ; AVX1-NEXT: vpmovsxbd 4(%rdi), %xmm0
2333 ; AVX1-NEXT: vpmovsxbd (%rdi), %xmm1
2334 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
2337 ; AVX2-LABEL: load_sext_8i8_to_8i32:
2338 ; AVX2: # %bb.0: # %entry
2339 ; AVX2-NEXT: vpmovsxbd (%rdi), %ymm0
2342 ; AVX512-LABEL: load_sext_8i8_to_8i32:
2343 ; AVX512: # %bb.0: # %entry
2344 ; AVX512-NEXT: vpmovsxbd (%rdi), %ymm0
2347 ; X32-SSE2-LABEL: load_sext_8i8_to_8i32:
2348 ; X32-SSE2: # %bb.0: # %entry
2349 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2350 ; X32-SSE2-NEXT: movq {{.*#+}} xmm1 = mem[0],zero
2351 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2352 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2353 ; X32-SSE2-NEXT: psrad $24, %xmm0
2354 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
2355 ; X32-SSE2-NEXT: psrad $24, %xmm1
2356 ; X32-SSE2-NEXT: retl
2358 ; X32-SSE41-LABEL: load_sext_8i8_to_8i32:
2359 ; X32-SSE41: # %bb.0: # %entry
2360 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2361 ; X32-SSE41-NEXT: pmovsxbd (%eax), %xmm0
2362 ; X32-SSE41-NEXT: pmovsxbd 4(%eax), %xmm1
2363 ; X32-SSE41-NEXT: retl
2365 %X = load <8 x i8>, <8 x i8>* %ptr
2366 %Y = sext <8 x i8> %X to <8 x i32>
2370 define <16 x i8> @load_sext_16i1_to_16i8(<16 x i1> *%ptr) nounwind readnone {
2371 ; SSE2-LABEL: load_sext_16i1_to_16i8:
2372 ; SSE2: # %bb.0: # %entry
2373 ; SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2374 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2375 ; SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,1,1,4,5,6,7]
2376 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
2377 ; SSE2-NEXT: movdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128]
2378 ; SSE2-NEXT: pand %xmm1, %xmm0
2379 ; SSE2-NEXT: pcmpeqb %xmm1, %xmm0
2382 ; SSSE3-LABEL: load_sext_16i1_to_16i8:
2383 ; SSSE3: # %bb.0: # %entry
2384 ; SSSE3-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2385 ; SSSE3-NEXT: pshufb {{.*#+}} xmm0 = xmm0[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1]
2386 ; SSSE3-NEXT: movdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128]
2387 ; SSSE3-NEXT: pand %xmm1, %xmm0
2388 ; SSSE3-NEXT: pcmpeqb %xmm1, %xmm0
2391 ; SSE41-LABEL: load_sext_16i1_to_16i8:
2392 ; SSE41: # %bb.0: # %entry
2393 ; SSE41-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2394 ; SSE41-NEXT: pshufb {{.*#+}} xmm0 = xmm0[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1]
2395 ; SSE41-NEXT: movdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128]
2396 ; SSE41-NEXT: pand %xmm1, %xmm0
2397 ; SSE41-NEXT: pcmpeqb %xmm1, %xmm0
2400 ; AVX1-LABEL: load_sext_16i1_to_16i8:
2401 ; AVX1: # %bb.0: # %entry
2402 ; AVX1-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2403 ; AVX1-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1]
2404 ; AVX1-NEXT: vmovddup {{.*#+}} xmm1 = [-1.7939930131212661E-307,-1.7939930131212661E-307]
2405 ; AVX1-NEXT: # xmm1 = mem[0,0]
2406 ; AVX1-NEXT: vpand %xmm1, %xmm0, %xmm0
2407 ; AVX1-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
2410 ; AVX2-LABEL: load_sext_16i1_to_16i8:
2411 ; AVX2: # %bb.0: # %entry
2412 ; AVX2-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2413 ; AVX2-NEXT: vpshufb {{.*#+}} xmm0 = xmm0[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1]
2414 ; AVX2-NEXT: vpbroadcastq {{.*#+}} xmm1 = [9241421688590303745,9241421688590303745]
2415 ; AVX2-NEXT: vpand %xmm1, %xmm0, %xmm0
2416 ; AVX2-NEXT: vpcmpeqb %xmm1, %xmm0, %xmm0
2419 ; AVX512F-LABEL: load_sext_16i1_to_16i8:
2420 ; AVX512F: # %bb.0: # %entry
2421 ; AVX512F-NEXT: kmovw (%rdi), %k1
2422 ; AVX512F-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
2423 ; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
2424 ; AVX512F-NEXT: vzeroupper
2425 ; AVX512F-NEXT: retq
2427 ; AVX512BW-LABEL: load_sext_16i1_to_16i8:
2428 ; AVX512BW: # %bb.0: # %entry
2429 ; AVX512BW-NEXT: kmovw (%rdi), %k0
2430 ; AVX512BW-NEXT: vpmovm2b %k0, %zmm0
2431 ; AVX512BW-NEXT: # kill: def $xmm0 killed $xmm0 killed $zmm0
2432 ; AVX512BW-NEXT: vzeroupper
2433 ; AVX512BW-NEXT: retq
2435 ; X32-SSE2-LABEL: load_sext_16i1_to_16i8:
2436 ; X32-SSE2: # %bb.0: # %entry
2437 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2438 ; X32-SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2439 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2440 ; X32-SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,1,1,4,5,6,7]
2441 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
2442 ; X32-SSE2-NEXT: movdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128]
2443 ; X32-SSE2-NEXT: pand %xmm1, %xmm0
2444 ; X32-SSE2-NEXT: pcmpeqb %xmm1, %xmm0
2445 ; X32-SSE2-NEXT: retl
2447 ; X32-SSE41-LABEL: load_sext_16i1_to_16i8:
2448 ; X32-SSE41: # %bb.0: # %entry
2449 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2450 ; X32-SSE41-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2451 ; X32-SSE41-NEXT: pshufb {{.*#+}} xmm0 = xmm0[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1]
2452 ; X32-SSE41-NEXT: movdqa {{.*#+}} xmm1 = [1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128]
2453 ; X32-SSE41-NEXT: pand %xmm1, %xmm0
2454 ; X32-SSE41-NEXT: pcmpeqb %xmm1, %xmm0
2455 ; X32-SSE41-NEXT: retl
2457 %X = load <16 x i1>, <16 x i1>* %ptr
2458 %Y = sext <16 x i1> %X to <16 x i8>
2462 define <16 x i16> @load_sext_16i1_to_16i16(<16 x i1> *%ptr) {
2463 ; SSE-LABEL: load_sext_16i1_to_16i16:
2464 ; SSE: # %bb.0: # %entry
2465 ; SSE-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2466 ; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
2467 ; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[0,0,0,0]
2468 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [1,2,4,8,16,32,64,128]
2469 ; SSE-NEXT: movdqa %xmm1, %xmm0
2470 ; SSE-NEXT: pand %xmm2, %xmm0
2471 ; SSE-NEXT: pcmpeqw %xmm2, %xmm0
2472 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [256,512,1024,2048,4096,8192,16384,32768]
2473 ; SSE-NEXT: pand %xmm2, %xmm1
2474 ; SSE-NEXT: pcmpeqw %xmm2, %xmm1
2477 ; AVX1-LABEL: load_sext_16i1_to_16i16:
2478 ; AVX1: # %bb.0: # %entry
2479 ; AVX1-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2480 ; AVX1-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
2481 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
2482 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
2483 ; AVX1-NEXT: vandps {{.*}}(%rip), %ymm0, %ymm0
2484 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
2485 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
2486 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm1, %xmm1
2487 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm3, %xmm3
2488 ; AVX1-NEXT: vpxor %xmm3, %xmm1, %xmm1
2489 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm0, %xmm0
2490 ; AVX1-NEXT: vpxor %xmm3, %xmm0, %xmm0
2491 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2494 ; AVX2-LABEL: load_sext_16i1_to_16i16:
2495 ; AVX2: # %bb.0: # %entry
2496 ; AVX2-NEXT: vpbroadcastw (%rdi), %ymm0
2497 ; AVX2-NEXT: vmovdqa {{.*#+}} ymm1 = [1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768]
2498 ; AVX2-NEXT: vpand %ymm1, %ymm0, %ymm0
2499 ; AVX2-NEXT: vpcmpeqw %ymm1, %ymm0, %ymm0
2502 ; AVX512F-LABEL: load_sext_16i1_to_16i16:
2503 ; AVX512F: # %bb.0: # %entry
2504 ; AVX512F-NEXT: kmovw (%rdi), %k1
2505 ; AVX512F-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
2506 ; AVX512F-NEXT: vpmovdw %zmm0, %ymm0
2507 ; AVX512F-NEXT: retq
2509 ; AVX512BW-LABEL: load_sext_16i1_to_16i16:
2510 ; AVX512BW: # %bb.0: # %entry
2511 ; AVX512BW-NEXT: kmovw (%rdi), %k0
2512 ; AVX512BW-NEXT: vpmovm2w %k0, %zmm0
2513 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2514 ; AVX512BW-NEXT: retq
2516 ; X32-SSE-LABEL: load_sext_16i1_to_16i16:
2517 ; X32-SSE: # %bb.0: # %entry
2518 ; X32-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
2519 ; X32-SSE-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2520 ; X32-SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
2521 ; X32-SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm0[0,0,0,0]
2522 ; X32-SSE-NEXT: movdqa {{.*#+}} xmm2 = [1,2,4,8,16,32,64,128]
2523 ; X32-SSE-NEXT: movdqa %xmm1, %xmm0
2524 ; X32-SSE-NEXT: pand %xmm2, %xmm0
2525 ; X32-SSE-NEXT: pcmpeqw %xmm2, %xmm0
2526 ; X32-SSE-NEXT: movdqa {{.*#+}} xmm2 = [256,512,1024,2048,4096,8192,16384,32768]
2527 ; X32-SSE-NEXT: pand %xmm2, %xmm1
2528 ; X32-SSE-NEXT: pcmpeqw %xmm2, %xmm1
2529 ; X32-SSE-NEXT: retl
2531 %X = load <16 x i1>, <16 x i1>* %ptr
2532 %Y = sext <16 x i1> %X to <16 x i16>
2536 define <32 x i8> @load_sext_32i1_to_32i8(<32 x i1> *%ptr) nounwind readnone {
2537 ; SSE-LABEL: load_sext_32i1_to_32i8:
2538 ; SSE: # %bb.0: # %entry
2539 ; SSE-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero
2540 ; SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2541 ; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm1[0,0,1,1,4,5,6,7]
2542 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
2543 ; SSE-NEXT: movdqa {{.*#+}} xmm2 = [1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128]
2544 ; SSE-NEXT: pand %xmm2, %xmm0
2545 ; SSE-NEXT: pcmpeqb %xmm2, %xmm0
2546 ; SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[2,2,3,3,4,5,6,7]
2547 ; SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,0,1,1]
2548 ; SSE-NEXT: pand %xmm2, %xmm1
2549 ; SSE-NEXT: pcmpeqb %xmm2, %xmm1
2552 ; AVX1-LABEL: load_sext_32i1_to_32i8:
2553 ; AVX1: # %bb.0: # %entry
2554 ; AVX1-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2555 ; AVX1-NEXT: vpunpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2556 ; AVX1-NEXT: vpshuflw {{.*#+}} xmm1 = xmm0[0,0,1,1,4,5,6,7]
2557 ; AVX1-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[2,2,3,3,4,5,6,7]
2558 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
2559 ; AVX1-NEXT: vpermilps {{.*#+}} ymm0 = ymm0[0,0,1,1,4,4,5,5]
2560 ; AVX1-NEXT: vandps {{.*}}(%rip), %ymm0, %ymm0
2561 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm1
2562 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
2563 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm1, %xmm1
2564 ; AVX1-NEXT: vpcmpeqd %xmm3, %xmm3, %xmm3
2565 ; AVX1-NEXT: vpxor %xmm3, %xmm1, %xmm1
2566 ; AVX1-NEXT: vpcmpeqb %xmm2, %xmm0, %xmm0
2567 ; AVX1-NEXT: vpxor %xmm3, %xmm0, %xmm0
2568 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
2571 ; AVX2-LABEL: load_sext_32i1_to_32i8:
2572 ; AVX2: # %bb.0: # %entry
2573 ; AVX2-NEXT: vmovd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2574 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,1,0,1]
2575 ; AVX2-NEXT: vpshufb {{.*#+}} ymm0 = ymm0[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19]
2576 ; AVX2-NEXT: vpbroadcastq {{.*#+}} ymm1 = [9241421688590303745,9241421688590303745,9241421688590303745,9241421688590303745]
2577 ; AVX2-NEXT: vpand %ymm1, %ymm0, %ymm0
2578 ; AVX2-NEXT: vpcmpeqb %ymm1, %ymm0, %ymm0
2581 ; AVX512F-LABEL: load_sext_32i1_to_32i8:
2582 ; AVX512F: # %bb.0: # %entry
2583 ; AVX512F-NEXT: kmovw (%rdi), %k1
2584 ; AVX512F-NEXT: kmovw 2(%rdi), %k2
2585 ; AVX512F-NEXT: vpternlogd $255, %zmm0, %zmm0, %zmm0 {%k1} {z}
2586 ; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
2587 ; AVX512F-NEXT: vpternlogd $255, %zmm1, %zmm1, %zmm1 {%k2} {z}
2588 ; AVX512F-NEXT: vpmovdb %zmm1, %xmm1
2589 ; AVX512F-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
2590 ; AVX512F-NEXT: retq
2592 ; AVX512BW-LABEL: load_sext_32i1_to_32i8:
2593 ; AVX512BW: # %bb.0: # %entry
2594 ; AVX512BW-NEXT: kmovd (%rdi), %k0
2595 ; AVX512BW-NEXT: vpmovm2b %k0, %zmm0
2596 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
2597 ; AVX512BW-NEXT: retq
2599 ; X32-SSE-LABEL: load_sext_32i1_to_32i8:
2600 ; X32-SSE: # %bb.0: # %entry
2601 ; X32-SSE-NEXT: movl {{[0-9]+}}(%esp), %eax
2602 ; X32-SSE-NEXT: movd {{.*#+}} xmm1 = mem[0],zero,zero,zero
2603 ; X32-SSE-NEXT: punpcklbw {{.*#+}} xmm1 = xmm1[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
2604 ; X32-SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm1[0,0,1,1,4,5,6,7]
2605 ; X32-SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]
2606 ; X32-SSE-NEXT: movdqa {{.*#+}} xmm2 = [1,2,4,8,16,32,64,128,1,2,4,8,16,32,64,128]
2607 ; X32-SSE-NEXT: pand %xmm2, %xmm0
2608 ; X32-SSE-NEXT: pcmpeqb %xmm2, %xmm0
2609 ; X32-SSE-NEXT: pshuflw {{.*#+}} xmm1 = xmm1[2,2,3,3,4,5,6,7]
2610 ; X32-SSE-NEXT: pshufd {{.*#+}} xmm1 = xmm1[0,0,1,1]
2611 ; X32-SSE-NEXT: pand %xmm2, %xmm1
2612 ; X32-SSE-NEXT: pcmpeqb %xmm2, %xmm1
2613 ; X32-SSE-NEXT: retl
2615 %X = load <32 x i1>, <32 x i1>* %ptr
2616 %Y = sext <32 x i1> %X to <32 x i8>
2620 define <16 x i16> @load_sext_16i8_to_16i16(<16 x i8> *%ptr) {
2621 ; SSE2-LABEL: load_sext_16i8_to_16i16:
2622 ; SSE2: # %bb.0: # %entry
2623 ; SSE2-NEXT: movdqa (%rdi), %xmm1
2624 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
2625 ; SSE2-NEXT: psraw $8, %xmm0
2626 ; SSE2-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
2627 ; SSE2-NEXT: psraw $8, %xmm1
2630 ; SSSE3-LABEL: load_sext_16i8_to_16i16:
2631 ; SSSE3: # %bb.0: # %entry
2632 ; SSSE3-NEXT: movdqa (%rdi), %xmm1
2633 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
2634 ; SSSE3-NEXT: psraw $8, %xmm0
2635 ; SSSE3-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
2636 ; SSSE3-NEXT: psraw $8, %xmm1
2639 ; SSE41-LABEL: load_sext_16i8_to_16i16:
2640 ; SSE41: # %bb.0: # %entry
2641 ; SSE41-NEXT: pmovsxbw (%rdi), %xmm0
2642 ; SSE41-NEXT: pmovsxbw 8(%rdi), %xmm1
2645 ; AVX1-LABEL: load_sext_16i8_to_16i16:
2646 ; AVX1: # %bb.0: # %entry
2647 ; AVX1-NEXT: vpmovsxbw 8(%rdi), %xmm0
2648 ; AVX1-NEXT: vpmovsxbw (%rdi), %xmm1
2649 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
2652 ; AVX2-LABEL: load_sext_16i8_to_16i16:
2653 ; AVX2: # %bb.0: # %entry
2654 ; AVX2-NEXT: vpmovsxbw (%rdi), %ymm0
2657 ; AVX512-LABEL: load_sext_16i8_to_16i16:
2658 ; AVX512: # %bb.0: # %entry
2659 ; AVX512-NEXT: vpmovsxbw (%rdi), %ymm0
2662 ; X32-SSE2-LABEL: load_sext_16i8_to_16i16:
2663 ; X32-SSE2: # %bb.0: # %entry
2664 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2665 ; X32-SSE2-NEXT: movdqa (%eax), %xmm1
2666 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
2667 ; X32-SSE2-NEXT: psraw $8, %xmm0
2668 ; X32-SSE2-NEXT: punpckhbw {{.*#+}} xmm1 = xmm1[8,8,9,9,10,10,11,11,12,12,13,13,14,14,15,15]
2669 ; X32-SSE2-NEXT: psraw $8, %xmm1
2670 ; X32-SSE2-NEXT: retl
2672 ; X32-SSE41-LABEL: load_sext_16i8_to_16i16:
2673 ; X32-SSE41: # %bb.0: # %entry
2674 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2675 ; X32-SSE41-NEXT: pmovsxbw (%eax), %xmm0
2676 ; X32-SSE41-NEXT: pmovsxbw 8(%eax), %xmm1
2677 ; X32-SSE41-NEXT: retl
2679 %X = load <16 x i8>, <16 x i8>* %ptr
2680 %Y = sext <16 x i8> %X to <16 x i16>
2684 define <2 x i64> @load_sext_2i16_to_2i64(<2 x i16> *%ptr) {
2685 ; SSE2-LABEL: load_sext_2i16_to_2i64:
2686 ; SSE2: # %bb.0: # %entry
2687 ; SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2688 ; SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,1,4,5,6,7]
2689 ; SSE2-NEXT: pxor %xmm1, %xmm1
2690 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
2691 ; SSE2-NEXT: psrad $16, %xmm0
2692 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
2695 ; SSSE3-LABEL: load_sext_2i16_to_2i64:
2696 ; SSSE3: # %bb.0: # %entry
2697 ; SSSE3-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2698 ; SSSE3-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,1,4,5,6,7]
2699 ; SSSE3-NEXT: pxor %xmm1, %xmm1
2700 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm1
2701 ; SSSE3-NEXT: psrad $16, %xmm0
2702 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
2705 ; SSE41-LABEL: load_sext_2i16_to_2i64:
2706 ; SSE41: # %bb.0: # %entry
2707 ; SSE41-NEXT: pmovsxwq (%rdi), %xmm0
2710 ; AVX-LABEL: load_sext_2i16_to_2i64:
2711 ; AVX: # %bb.0: # %entry
2712 ; AVX-NEXT: vpmovsxwq (%rdi), %xmm0
2715 ; X32-SSE2-LABEL: load_sext_2i16_to_2i64:
2716 ; X32-SSE2: # %bb.0: # %entry
2717 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2718 ; X32-SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
2719 ; X32-SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,1,4,5,6,7]
2720 ; X32-SSE2-NEXT: pxor %xmm1, %xmm1
2721 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm1
2722 ; X32-SSE2-NEXT: psrad $16, %xmm0
2723 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
2724 ; X32-SSE2-NEXT: retl
2726 ; X32-SSE41-LABEL: load_sext_2i16_to_2i64:
2727 ; X32-SSE41: # %bb.0: # %entry
2728 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2729 ; X32-SSE41-NEXT: pmovsxwq (%eax), %xmm0
2730 ; X32-SSE41-NEXT: retl
2732 %X = load <2 x i16>, <2 x i16>* %ptr
2733 %Y = sext <2 x i16> %X to <2 x i64>
2737 define <4 x i32> @load_sext_4i16_to_4i32(<4 x i16> *%ptr) {
2738 ; SSE2-LABEL: load_sext_4i16_to_4i32:
2739 ; SSE2: # %bb.0: # %entry
2740 ; SSE2-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2741 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
2742 ; SSE2-NEXT: psrad $16, %xmm0
2745 ; SSSE3-LABEL: load_sext_4i16_to_4i32:
2746 ; SSSE3: # %bb.0: # %entry
2747 ; SSSE3-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2748 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
2749 ; SSSE3-NEXT: psrad $16, %xmm0
2752 ; SSE41-LABEL: load_sext_4i16_to_4i32:
2753 ; SSE41: # %bb.0: # %entry
2754 ; SSE41-NEXT: pmovsxwd (%rdi), %xmm0
2757 ; AVX-LABEL: load_sext_4i16_to_4i32:
2758 ; AVX: # %bb.0: # %entry
2759 ; AVX-NEXT: vpmovsxwd (%rdi), %xmm0
2762 ; X32-SSE2-LABEL: load_sext_4i16_to_4i32:
2763 ; X32-SSE2: # %bb.0: # %entry
2764 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2765 ; X32-SSE2-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2766 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
2767 ; X32-SSE2-NEXT: psrad $16, %xmm0
2768 ; X32-SSE2-NEXT: retl
2770 ; X32-SSE41-LABEL: load_sext_4i16_to_4i32:
2771 ; X32-SSE41: # %bb.0: # %entry
2772 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2773 ; X32-SSE41-NEXT: pmovsxwd (%eax), %xmm0
2774 ; X32-SSE41-NEXT: retl
2776 %X = load <4 x i16>, <4 x i16>* %ptr
2777 %Y = sext <4 x i16> %X to <4 x i32>
2781 define <4 x i64> @load_sext_4i16_to_4i64(<4 x i16> *%ptr) {
2782 ; SSE2-LABEL: load_sext_4i16_to_4i64:
2783 ; SSE2: # %bb.0: # %entry
2784 ; SSE2-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2785 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
2786 ; SSE2-NEXT: psrad $16, %xmm1
2787 ; SSE2-NEXT: pxor %xmm2, %xmm2
2788 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
2789 ; SSE2-NEXT: movdqa %xmm1, %xmm0
2790 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
2791 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
2794 ; SSSE3-LABEL: load_sext_4i16_to_4i64:
2795 ; SSSE3: # %bb.0: # %entry
2796 ; SSSE3-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2797 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
2798 ; SSSE3-NEXT: psrad $16, %xmm1
2799 ; SSSE3-NEXT: pxor %xmm2, %xmm2
2800 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
2801 ; SSSE3-NEXT: movdqa %xmm1, %xmm0
2802 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
2803 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
2806 ; SSE41-LABEL: load_sext_4i16_to_4i64:
2807 ; SSE41: # %bb.0: # %entry
2808 ; SSE41-NEXT: pmovsxwq (%rdi), %xmm0
2809 ; SSE41-NEXT: pmovsxwq 4(%rdi), %xmm1
2812 ; AVX1-LABEL: load_sext_4i16_to_4i64:
2813 ; AVX1: # %bb.0: # %entry
2814 ; AVX1-NEXT: vpmovsxwq 4(%rdi), %xmm0
2815 ; AVX1-NEXT: vpmovsxwq (%rdi), %xmm1
2816 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
2819 ; AVX2-LABEL: load_sext_4i16_to_4i64:
2820 ; AVX2: # %bb.0: # %entry
2821 ; AVX2-NEXT: vpmovsxwq (%rdi), %ymm0
2824 ; AVX512-LABEL: load_sext_4i16_to_4i64:
2825 ; AVX512: # %bb.0: # %entry
2826 ; AVX512-NEXT: vpmovsxwq (%rdi), %ymm0
2829 ; X32-SSE2-LABEL: load_sext_4i16_to_4i64:
2830 ; X32-SSE2: # %bb.0: # %entry
2831 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2832 ; X32-SSE2-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2833 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
2834 ; X32-SSE2-NEXT: psrad $16, %xmm1
2835 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
2836 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
2837 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm0
2838 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
2839 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
2840 ; X32-SSE2-NEXT: retl
2842 ; X32-SSE41-LABEL: load_sext_4i16_to_4i64:
2843 ; X32-SSE41: # %bb.0: # %entry
2844 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2845 ; X32-SSE41-NEXT: pmovsxwq (%eax), %xmm0
2846 ; X32-SSE41-NEXT: pmovsxwq 4(%eax), %xmm1
2847 ; X32-SSE41-NEXT: retl
2849 %X = load <4 x i16>, <4 x i16>* %ptr
2850 %Y = sext <4 x i16> %X to <4 x i64>
2854 define <8 x i32> @load_sext_8i16_to_8i32(<8 x i16> *%ptr) {
2855 ; SSE2-LABEL: load_sext_8i16_to_8i32:
2856 ; SSE2: # %bb.0: # %entry
2857 ; SSE2-NEXT: movdqa (%rdi), %xmm1
2858 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2859 ; SSE2-NEXT: psrad $16, %xmm0
2860 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
2861 ; SSE2-NEXT: psrad $16, %xmm1
2864 ; SSSE3-LABEL: load_sext_8i16_to_8i32:
2865 ; SSSE3: # %bb.0: # %entry
2866 ; SSSE3-NEXT: movdqa (%rdi), %xmm1
2867 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2868 ; SSSE3-NEXT: psrad $16, %xmm0
2869 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
2870 ; SSSE3-NEXT: psrad $16, %xmm1
2873 ; SSE41-LABEL: load_sext_8i16_to_8i32:
2874 ; SSE41: # %bb.0: # %entry
2875 ; SSE41-NEXT: pmovsxwd (%rdi), %xmm0
2876 ; SSE41-NEXT: pmovsxwd 8(%rdi), %xmm1
2879 ; AVX1-LABEL: load_sext_8i16_to_8i32:
2880 ; AVX1: # %bb.0: # %entry
2881 ; AVX1-NEXT: vpmovsxwd 8(%rdi), %xmm0
2882 ; AVX1-NEXT: vpmovsxwd (%rdi), %xmm1
2883 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
2886 ; AVX2-LABEL: load_sext_8i16_to_8i32:
2887 ; AVX2: # %bb.0: # %entry
2888 ; AVX2-NEXT: vpmovsxwd (%rdi), %ymm0
2891 ; AVX512-LABEL: load_sext_8i16_to_8i32:
2892 ; AVX512: # %bb.0: # %entry
2893 ; AVX512-NEXT: vpmovsxwd (%rdi), %ymm0
2896 ; X32-SSE2-LABEL: load_sext_8i16_to_8i32:
2897 ; X32-SSE2: # %bb.0: # %entry
2898 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2899 ; X32-SSE2-NEXT: movdqa (%eax), %xmm1
2900 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
2901 ; X32-SSE2-NEXT: psrad $16, %xmm0
2902 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
2903 ; X32-SSE2-NEXT: psrad $16, %xmm1
2904 ; X32-SSE2-NEXT: retl
2906 ; X32-SSE41-LABEL: load_sext_8i16_to_8i32:
2907 ; X32-SSE41: # %bb.0: # %entry
2908 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2909 ; X32-SSE41-NEXT: pmovsxwd (%eax), %xmm0
2910 ; X32-SSE41-NEXT: pmovsxwd 8(%eax), %xmm1
2911 ; X32-SSE41-NEXT: retl
2913 %X = load <8 x i16>, <8 x i16>* %ptr
2914 %Y = sext <8 x i16> %X to <8 x i32>
2918 define <2 x i64> @load_sext_2i32_to_2i64(<2 x i32> *%ptr) {
2919 ; SSE2-LABEL: load_sext_2i32_to_2i64:
2920 ; SSE2: # %bb.0: # %entry
2921 ; SSE2-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2922 ; SSE2-NEXT: pxor %xmm1, %xmm1
2923 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm1
2924 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
2927 ; SSSE3-LABEL: load_sext_2i32_to_2i64:
2928 ; SSSE3: # %bb.0: # %entry
2929 ; SSSE3-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2930 ; SSSE3-NEXT: pxor %xmm1, %xmm1
2931 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm1
2932 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
2935 ; SSE41-LABEL: load_sext_2i32_to_2i64:
2936 ; SSE41: # %bb.0: # %entry
2937 ; SSE41-NEXT: pmovsxdq (%rdi), %xmm0
2940 ; AVX-LABEL: load_sext_2i32_to_2i64:
2941 ; AVX: # %bb.0: # %entry
2942 ; AVX-NEXT: vpmovsxdq (%rdi), %xmm0
2945 ; X32-SSE2-LABEL: load_sext_2i32_to_2i64:
2946 ; X32-SSE2: # %bb.0: # %entry
2947 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
2948 ; X32-SSE2-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
2949 ; X32-SSE2-NEXT: pxor %xmm1, %xmm1
2950 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm1
2951 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
2952 ; X32-SSE2-NEXT: retl
2954 ; X32-SSE41-LABEL: load_sext_2i32_to_2i64:
2955 ; X32-SSE41: # %bb.0: # %entry
2956 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
2957 ; X32-SSE41-NEXT: pmovsxdq (%eax), %xmm0
2958 ; X32-SSE41-NEXT: retl
2960 %X = load <2 x i32>, <2 x i32>* %ptr
2961 %Y = sext <2 x i32> %X to <2 x i64>
2965 define <4 x i64> @load_sext_4i32_to_4i64(<4 x i32> *%ptr) {
2966 ; SSE2-LABEL: load_sext_4i32_to_4i64:
2967 ; SSE2: # %bb.0: # %entry
2968 ; SSE2-NEXT: movdqa (%rdi), %xmm0
2969 ; SSE2-NEXT: pxor %xmm2, %xmm2
2970 ; SSE2-NEXT: pxor %xmm3, %xmm3
2971 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm3
2972 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
2973 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
2974 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
2975 ; SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
2978 ; SSSE3-LABEL: load_sext_4i32_to_4i64:
2979 ; SSSE3: # %bb.0: # %entry
2980 ; SSSE3-NEXT: movdqa (%rdi), %xmm0
2981 ; SSSE3-NEXT: pxor %xmm2, %xmm2
2982 ; SSSE3-NEXT: pxor %xmm3, %xmm3
2983 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm3
2984 ; SSSE3-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
2985 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
2986 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
2987 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
2990 ; SSE41-LABEL: load_sext_4i32_to_4i64:
2991 ; SSE41: # %bb.0: # %entry
2992 ; SSE41-NEXT: pmovsxdq (%rdi), %xmm0
2993 ; SSE41-NEXT: pmovsxdq 8(%rdi), %xmm1
2996 ; AVX1-LABEL: load_sext_4i32_to_4i64:
2997 ; AVX1: # %bb.0: # %entry
2998 ; AVX1-NEXT: vpmovsxdq 8(%rdi), %xmm0
2999 ; AVX1-NEXT: vpmovsxdq (%rdi), %xmm1
3000 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
3003 ; AVX2-LABEL: load_sext_4i32_to_4i64:
3004 ; AVX2: # %bb.0: # %entry
3005 ; AVX2-NEXT: vpmovsxdq (%rdi), %ymm0
3008 ; AVX512-LABEL: load_sext_4i32_to_4i64:
3009 ; AVX512: # %bb.0: # %entry
3010 ; AVX512-NEXT: vpmovsxdq (%rdi), %ymm0
3013 ; X32-SSE2-LABEL: load_sext_4i32_to_4i64:
3014 ; X32-SSE2: # %bb.0: # %entry
3015 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
3016 ; X32-SSE2-NEXT: movdqa (%eax), %xmm0
3017 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
3018 ; X32-SSE2-NEXT: pxor %xmm3, %xmm3
3019 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm3
3020 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
3021 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
3022 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
3023 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
3024 ; X32-SSE2-NEXT: retl
3026 ; X32-SSE41-LABEL: load_sext_4i32_to_4i64:
3027 ; X32-SSE41: # %bb.0: # %entry
3028 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
3029 ; X32-SSE41-NEXT: pmovsxdq (%eax), %xmm0
3030 ; X32-SSE41-NEXT: pmovsxdq 8(%eax), %xmm1
3031 ; X32-SSE41-NEXT: retl
3033 %X = load <4 x i32>, <4 x i32>* %ptr
3034 %Y = sext <4 x i32> %X to <4 x i64>
3038 define i32 @sext_2i8_to_i32(<16 x i8> %A) nounwind uwtable readnone ssp {
3039 ; SSE2-LABEL: sext_2i8_to_i32:
3040 ; SSE2: # %bb.0: # %entry
3041 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
3042 ; SSE2-NEXT: psraw $8, %xmm0
3043 ; SSE2-NEXT: movd %xmm0, %eax
3046 ; SSSE3-LABEL: sext_2i8_to_i32:
3047 ; SSSE3: # %bb.0: # %entry
3048 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
3049 ; SSSE3-NEXT: psraw $8, %xmm0
3050 ; SSSE3-NEXT: movd %xmm0, %eax
3053 ; SSE41-LABEL: sext_2i8_to_i32:
3054 ; SSE41: # %bb.0: # %entry
3055 ; SSE41-NEXT: pmovsxbw %xmm0, %xmm0
3056 ; SSE41-NEXT: movd %xmm0, %eax
3059 ; AVX-LABEL: sext_2i8_to_i32:
3060 ; AVX: # %bb.0: # %entry
3061 ; AVX-NEXT: vpmovsxbw %xmm0, %xmm0
3062 ; AVX-NEXT: vmovd %xmm0, %eax
3065 ; X32-SSE2-LABEL: sext_2i8_to_i32:
3066 ; X32-SSE2: # %bb.0: # %entry
3067 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
3068 ; X32-SSE2-NEXT: psraw $8, %xmm0
3069 ; X32-SSE2-NEXT: movd %xmm0, %eax
3070 ; X32-SSE2-NEXT: retl
3072 ; X32-SSE41-LABEL: sext_2i8_to_i32:
3073 ; X32-SSE41: # %bb.0: # %entry
3074 ; X32-SSE41-NEXT: pmovsxbw %xmm0, %xmm0
3075 ; X32-SSE41-NEXT: movd %xmm0, %eax
3076 ; X32-SSE41-NEXT: retl
3078 %Shuf = shufflevector <16 x i8> %A, <16 x i8> undef, <2 x i32> <i32 0, i32 1>
3079 %Ex = sext <2 x i8> %Shuf to <2 x i16>
3080 %Bc = bitcast <2 x i16> %Ex to i32
3084 define <4 x i64> @sext_4i1_to_4i64(<4 x i1> %mask) {
3085 ; SSE2-LABEL: sext_4i1_to_4i64:
3087 ; SSE2-NEXT: pslld $31, %xmm0
3088 ; SSE2-NEXT: psrad $31, %xmm0
3089 ; SSE2-NEXT: pxor %xmm2, %xmm2
3090 ; SSE2-NEXT: pxor %xmm3, %xmm3
3091 ; SSE2-NEXT: pcmpgtd %xmm0, %xmm3
3092 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
3093 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
3094 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
3095 ; SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
3098 ; SSSE3-LABEL: sext_4i1_to_4i64:
3100 ; SSSE3-NEXT: pslld $31, %xmm0
3101 ; SSSE3-NEXT: psrad $31, %xmm0
3102 ; SSSE3-NEXT: pxor %xmm2, %xmm2
3103 ; SSSE3-NEXT: pxor %xmm3, %xmm3
3104 ; SSSE3-NEXT: pcmpgtd %xmm0, %xmm3
3105 ; SSSE3-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
3106 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
3107 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
3108 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
3111 ; SSE41-LABEL: sext_4i1_to_4i64:
3113 ; SSE41-NEXT: pslld $31, %xmm0
3114 ; SSE41-NEXT: psrad $31, %xmm0
3115 ; SSE41-NEXT: pmovsxdq %xmm0, %xmm2
3116 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
3117 ; SSE41-NEXT: pmovsxdq %xmm0, %xmm1
3118 ; SSE41-NEXT: movdqa %xmm2, %xmm0
3121 ; AVX1-LABEL: sext_4i1_to_4i64:
3123 ; AVX1-NEXT: vpslld $31, %xmm0, %xmm0
3124 ; AVX1-NEXT: vpsrad $31, %xmm0, %xmm0
3125 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm1
3126 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
3127 ; AVX1-NEXT: vpmovsxdq %xmm0, %xmm0
3128 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
3131 ; AVX2-LABEL: sext_4i1_to_4i64:
3133 ; AVX2-NEXT: vpslld $31, %xmm0, %xmm0
3134 ; AVX2-NEXT: vpsrad $31, %xmm0, %xmm0
3135 ; AVX2-NEXT: vpmovsxdq %xmm0, %ymm0
3138 ; AVX512-LABEL: sext_4i1_to_4i64:
3140 ; AVX512-NEXT: vpslld $31, %xmm0, %xmm0
3141 ; AVX512-NEXT: vpsrad $31, %xmm0, %xmm0
3142 ; AVX512-NEXT: vpmovsxdq %xmm0, %ymm0
3145 ; X32-SSE2-LABEL: sext_4i1_to_4i64:
3146 ; X32-SSE2: # %bb.0:
3147 ; X32-SSE2-NEXT: pslld $31, %xmm0
3148 ; X32-SSE2-NEXT: psrad $31, %xmm0
3149 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
3150 ; X32-SSE2-NEXT: pxor %xmm3, %xmm3
3151 ; X32-SSE2-NEXT: pcmpgtd %xmm0, %xmm3
3152 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm0[2,3,0,1]
3153 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
3154 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
3155 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
3156 ; X32-SSE2-NEXT: retl
3158 ; X32-SSE41-LABEL: sext_4i1_to_4i64:
3159 ; X32-SSE41: # %bb.0:
3160 ; X32-SSE41-NEXT: pslld $31, %xmm0
3161 ; X32-SSE41-NEXT: psrad $31, %xmm0
3162 ; X32-SSE41-NEXT: pmovsxdq %xmm0, %xmm2
3163 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[2,3,0,1]
3164 ; X32-SSE41-NEXT: pmovsxdq %xmm0, %xmm1
3165 ; X32-SSE41-NEXT: movdqa %xmm2, %xmm0
3166 ; X32-SSE41-NEXT: retl
3167 %extmask = sext <4 x i1> %mask to <4 x i64>
3168 ret <4 x i64> %extmask
3171 define <4 x i64> @sext_4i8_to_4i64(<4 x i8> %mask) {
3172 ; SSE2-LABEL: sext_4i8_to_4i64:
3174 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
3175 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
3176 ; SSE2-NEXT: psrad $24, %xmm1
3177 ; SSE2-NEXT: pxor %xmm2, %xmm2
3178 ; SSE2-NEXT: pcmpgtd %xmm1, %xmm2
3179 ; SSE2-NEXT: movdqa %xmm1, %xmm0
3180 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
3181 ; SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
3184 ; SSSE3-LABEL: sext_4i8_to_4i64:
3186 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
3187 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
3188 ; SSSE3-NEXT: psrad $24, %xmm1
3189 ; SSSE3-NEXT: pxor %xmm2, %xmm2
3190 ; SSSE3-NEXT: pcmpgtd %xmm1, %xmm2
3191 ; SSSE3-NEXT: movdqa %xmm1, %xmm0
3192 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
3193 ; SSSE3-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
3196 ; SSE41-LABEL: sext_4i8_to_4i64:
3198 ; SSE41-NEXT: pmovsxbq %xmm0, %xmm2
3199 ; SSE41-NEXT: psrld $16, %xmm0
3200 ; SSE41-NEXT: pmovsxbq %xmm0, %xmm1
3201 ; SSE41-NEXT: movdqa %xmm2, %xmm0
3204 ; AVX1-LABEL: sext_4i8_to_4i64:
3206 ; AVX1-NEXT: vpmovsxbq %xmm0, %xmm1
3207 ; AVX1-NEXT: vpsrld $16, %xmm0, %xmm0
3208 ; AVX1-NEXT: vpmovsxbq %xmm0, %xmm0
3209 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
3212 ; AVX2-LABEL: sext_4i8_to_4i64:
3214 ; AVX2-NEXT: vpmovsxbq %xmm0, %ymm0
3217 ; AVX512-LABEL: sext_4i8_to_4i64:
3219 ; AVX512-NEXT: vpmovsxbq %xmm0, %ymm0
3222 ; X32-SSE2-LABEL: sext_4i8_to_4i64:
3223 ; X32-SSE2: # %bb.0:
3224 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
3225 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1],xmm1[2],xmm0[2],xmm1[3],xmm0[3]
3226 ; X32-SSE2-NEXT: psrad $24, %xmm1
3227 ; X32-SSE2-NEXT: pxor %xmm2, %xmm2
3228 ; X32-SSE2-NEXT: pcmpgtd %xmm1, %xmm2
3229 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm0
3230 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
3231 ; X32-SSE2-NEXT: punpckhdq {{.*#+}} xmm1 = xmm1[2],xmm2[2],xmm1[3],xmm2[3]
3232 ; X32-SSE2-NEXT: retl
3234 ; X32-SSE41-LABEL: sext_4i8_to_4i64:
3235 ; X32-SSE41: # %bb.0:
3236 ; X32-SSE41-NEXT: pmovsxbq %xmm0, %xmm2
3237 ; X32-SSE41-NEXT: psrld $16, %xmm0
3238 ; X32-SSE41-NEXT: pmovsxbq %xmm0, %xmm1
3239 ; X32-SSE41-NEXT: movdqa %xmm2, %xmm0
3240 ; X32-SSE41-NEXT: retl
3241 %extmask = sext <4 x i8> %mask to <4 x i64>
3242 ret <4 x i64> %extmask
3245 define <32 x i8> @sext_32xi1_to_32xi8(<32 x i16> %c1, <32 x i16> %c2)nounwind {
3246 ; SSE-LABEL: sext_32xi1_to_32xi8:
3248 ; SSE-NEXT: pcmpeqw %xmm5, %xmm1
3249 ; SSE-NEXT: pcmpeqw %xmm4, %xmm0
3250 ; SSE-NEXT: packsswb %xmm1, %xmm0
3251 ; SSE-NEXT: pcmpeqw %xmm7, %xmm3
3252 ; SSE-NEXT: pcmpeqw %xmm6, %xmm2
3253 ; SSE-NEXT: packsswb %xmm3, %xmm2
3254 ; SSE-NEXT: movdqa %xmm2, %xmm1
3257 ; AVX1-LABEL: sext_32xi1_to_32xi8:
3259 ; AVX1-NEXT: vextractf128 $1, %ymm3, %xmm4
3260 ; AVX1-NEXT: vextractf128 $1, %ymm1, %xmm5
3261 ; AVX1-NEXT: vpcmpeqw %xmm4, %xmm5, %xmm4
3262 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm1, %xmm1
3263 ; AVX1-NEXT: vpacksswb %xmm4, %xmm1, %xmm1
3264 ; AVX1-NEXT: vextractf128 $1, %ymm2, %xmm3
3265 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm4
3266 ; AVX1-NEXT: vpcmpeqw %xmm3, %xmm4, %xmm3
3267 ; AVX1-NEXT: vpcmpeqw %xmm2, %xmm0, %xmm0
3268 ; AVX1-NEXT: vpacksswb %xmm3, %xmm0, %xmm0
3269 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3272 ; AVX2-LABEL: sext_32xi1_to_32xi8:
3274 ; AVX2-NEXT: vpcmpeqw %ymm3, %ymm1, %ymm1
3275 ; AVX2-NEXT: vpcmpeqw %ymm2, %ymm0, %ymm0
3276 ; AVX2-NEXT: vpacksswb %ymm1, %ymm0, %ymm0
3277 ; AVX2-NEXT: vpermq {{.*#+}} ymm0 = ymm0[0,2,1,3]
3280 ; AVX512F-LABEL: sext_32xi1_to_32xi8:
3282 ; AVX512F-NEXT: vpcmpeqw %ymm2, %ymm0, %ymm0
3283 ; AVX512F-NEXT: vpmovzxwd {{.*#+}} zmm0 = ymm0[0],zero,ymm0[1],zero,ymm0[2],zero,ymm0[3],zero,ymm0[4],zero,ymm0[5],zero,ymm0[6],zero,ymm0[7],zero,ymm0[8],zero,ymm0[9],zero,ymm0[10],zero,ymm0[11],zero,ymm0[12],zero,ymm0[13],zero,ymm0[14],zero,ymm0[15],zero
3284 ; AVX512F-NEXT: vpmovdb %zmm0, %xmm0
3285 ; AVX512F-NEXT: vpcmpeqw %ymm3, %ymm1, %ymm1
3286 ; AVX512F-NEXT: vpmovzxwd {{.*#+}} zmm1 = ymm1[0],zero,ymm1[1],zero,ymm1[2],zero,ymm1[3],zero,ymm1[4],zero,ymm1[5],zero,ymm1[6],zero,ymm1[7],zero,ymm1[8],zero,ymm1[9],zero,ymm1[10],zero,ymm1[11],zero,ymm1[12],zero,ymm1[13],zero,ymm1[14],zero,ymm1[15],zero
3287 ; AVX512F-NEXT: vpmovdb %zmm1, %xmm1
3288 ; AVX512F-NEXT: vinserti128 $1, %xmm1, %ymm0, %ymm0
3289 ; AVX512F-NEXT: retq
3291 ; AVX512BW-LABEL: sext_32xi1_to_32xi8:
3292 ; AVX512BW: # %bb.0:
3293 ; AVX512BW-NEXT: vpcmpeqw %zmm1, %zmm0, %k0
3294 ; AVX512BW-NEXT: vpmovm2b %k0, %zmm0
3295 ; AVX512BW-NEXT: # kill: def $ymm0 killed $ymm0 killed $zmm0
3296 ; AVX512BW-NEXT: retq
3298 ; X32-SSE-LABEL: sext_32xi1_to_32xi8:
3300 ; X32-SSE-NEXT: pushl %ebp
3301 ; X32-SSE-NEXT: movl %esp, %ebp
3302 ; X32-SSE-NEXT: andl $-16, %esp
3303 ; X32-SSE-NEXT: subl $16, %esp
3304 ; X32-SSE-NEXT: movdqa 8(%ebp), %xmm3
3305 ; X32-SSE-NEXT: pcmpeqw 40(%ebp), %xmm1
3306 ; X32-SSE-NEXT: pcmpeqw 24(%ebp), %xmm0
3307 ; X32-SSE-NEXT: packsswb %xmm1, %xmm0
3308 ; X32-SSE-NEXT: pcmpeqw 72(%ebp), %xmm3
3309 ; X32-SSE-NEXT: pcmpeqw 56(%ebp), %xmm2
3310 ; X32-SSE-NEXT: packsswb %xmm3, %xmm2
3311 ; X32-SSE-NEXT: movdqa %xmm2, %xmm1
3312 ; X32-SSE-NEXT: movl %ebp, %esp
3313 ; X32-SSE-NEXT: popl %ebp
3314 ; X32-SSE-NEXT: retl
3315 %a = icmp eq <32 x i16> %c1, %c2
3316 %b = sext <32 x i1> %a to <32 x i8>
3320 define <2 x i32> @sext_2i8_to_2i32(<2 x i8>* %addr) {
3321 ; SSE2-LABEL: sext_2i8_to_2i32:
3323 ; SSE2-NEXT: movzwl (%rdi), %eax
3324 ; SSE2-NEXT: movd %eax, %xmm0
3325 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
3326 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
3327 ; SSE2-NEXT: psrad $24, %xmm0
3328 ; SSE2-NEXT: paddd %xmm0, %xmm0
3331 ; SSSE3-LABEL: sext_2i8_to_2i32:
3333 ; SSSE3-NEXT: movzwl (%rdi), %eax
3334 ; SSSE3-NEXT: movd %eax, %xmm0
3335 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
3336 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
3337 ; SSSE3-NEXT: psrad $24, %xmm0
3338 ; SSSE3-NEXT: paddd %xmm0, %xmm0
3341 ; SSE41-LABEL: sext_2i8_to_2i32:
3343 ; SSE41-NEXT: movzwl (%rdi), %eax
3344 ; SSE41-NEXT: movd %eax, %xmm0
3345 ; SSE41-NEXT: pmovsxbd %xmm0, %xmm0
3346 ; SSE41-NEXT: paddd %xmm0, %xmm0
3349 ; AVX-LABEL: sext_2i8_to_2i32:
3351 ; AVX-NEXT: movzwl (%rdi), %eax
3352 ; AVX-NEXT: vmovd %eax, %xmm0
3353 ; AVX-NEXT: vpmovsxbd %xmm0, %xmm0
3354 ; AVX-NEXT: vpaddd %xmm0, %xmm0, %xmm0
3357 ; X32-SSE2-LABEL: sext_2i8_to_2i32:
3358 ; X32-SSE2: # %bb.0:
3359 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
3360 ; X32-SSE2-NEXT: movzwl (%eax), %eax
3361 ; X32-SSE2-NEXT: movd %eax, %xmm0
3362 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
3363 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3]
3364 ; X32-SSE2-NEXT: psrad $24, %xmm0
3365 ; X32-SSE2-NEXT: paddd %xmm0, %xmm0
3366 ; X32-SSE2-NEXT: retl
3368 ; X32-SSE41-LABEL: sext_2i8_to_2i32:
3369 ; X32-SSE41: # %bb.0:
3370 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
3371 ; X32-SSE41-NEXT: movzwl (%eax), %eax
3372 ; X32-SSE41-NEXT: movd %eax, %xmm0
3373 ; X32-SSE41-NEXT: pmovsxbd %xmm0, %xmm0
3374 ; X32-SSE41-NEXT: paddd %xmm0, %xmm0
3375 ; X32-SSE41-NEXT: retl
3376 %x = load <2 x i8>, <2 x i8>* %addr, align 1
3377 %y = sext <2 x i8> %x to <2 x i32>
3378 %z = add <2 x i32>%y, %y
3382 define <4 x i32> @sext_4i17_to_4i32(<4 x i17>* %ptr) {
3383 ; SSE2-LABEL: sext_4i17_to_4i32:
3385 ; SSE2-NEXT: movq (%rdi), %rax
3386 ; SSE2-NEXT: movq %rax, %rcx
3387 ; SSE2-NEXT: shlq $30, %rcx
3388 ; SSE2-NEXT: sarq $47, %rcx
3389 ; SSE2-NEXT: movd %ecx, %xmm1
3390 ; SSE2-NEXT: movq %rax, %rcx
3391 ; SSE2-NEXT: shlq $47, %rcx
3392 ; SSE2-NEXT: sarq $47, %rcx
3393 ; SSE2-NEXT: movd %ecx, %xmm0
3394 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
3395 ; SSE2-NEXT: movl 8(%rdi), %ecx
3396 ; SSE2-NEXT: shll $13, %ecx
3397 ; SSE2-NEXT: movq %rax, %rdx
3398 ; SSE2-NEXT: shrq $51, %rdx
3399 ; SSE2-NEXT: orl %ecx, %edx
3400 ; SSE2-NEXT: shlq $47, %rdx
3401 ; SSE2-NEXT: sarq $47, %rdx
3402 ; SSE2-NEXT: movd %edx, %xmm1
3403 ; SSE2-NEXT: shlq $13, %rax
3404 ; SSE2-NEXT: sarq $47, %rax
3405 ; SSE2-NEXT: movd %eax, %xmm2
3406 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
3407 ; SSE2-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm2[0]
3410 ; SSSE3-LABEL: sext_4i17_to_4i32:
3412 ; SSSE3-NEXT: movq (%rdi), %rax
3413 ; SSSE3-NEXT: movq %rax, %rcx
3414 ; SSSE3-NEXT: shlq $30, %rcx
3415 ; SSSE3-NEXT: sarq $47, %rcx
3416 ; SSSE3-NEXT: movd %ecx, %xmm1
3417 ; SSSE3-NEXT: movq %rax, %rcx
3418 ; SSSE3-NEXT: shlq $47, %rcx
3419 ; SSSE3-NEXT: sarq $47, %rcx
3420 ; SSSE3-NEXT: movd %ecx, %xmm0
3421 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
3422 ; SSSE3-NEXT: movl 8(%rdi), %ecx
3423 ; SSSE3-NEXT: shll $13, %ecx
3424 ; SSSE3-NEXT: movq %rax, %rdx
3425 ; SSSE3-NEXT: shrq $51, %rdx
3426 ; SSSE3-NEXT: orl %ecx, %edx
3427 ; SSSE3-NEXT: shlq $47, %rdx
3428 ; SSSE3-NEXT: sarq $47, %rdx
3429 ; SSSE3-NEXT: movd %edx, %xmm1
3430 ; SSSE3-NEXT: shlq $13, %rax
3431 ; SSSE3-NEXT: sarq $47, %rax
3432 ; SSSE3-NEXT: movd %eax, %xmm2
3433 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm1[0],xmm2[1],xmm1[1]
3434 ; SSSE3-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm2[0]
3437 ; SSE41-LABEL: sext_4i17_to_4i32:
3439 ; SSE41-NEXT: movq (%rdi), %rax
3440 ; SSE41-NEXT: movq %rax, %rcx
3441 ; SSE41-NEXT: shlq $30, %rcx
3442 ; SSE41-NEXT: sarq $47, %rcx
3443 ; SSE41-NEXT: movq %rax, %rdx
3444 ; SSE41-NEXT: shlq $47, %rdx
3445 ; SSE41-NEXT: sarq $47, %rdx
3446 ; SSE41-NEXT: movd %edx, %xmm0
3447 ; SSE41-NEXT: pinsrd $1, %ecx, %xmm0
3448 ; SSE41-NEXT: movq %rax, %rcx
3449 ; SSE41-NEXT: shlq $13, %rcx
3450 ; SSE41-NEXT: sarq $47, %rcx
3451 ; SSE41-NEXT: pinsrd $2, %ecx, %xmm0
3452 ; SSE41-NEXT: movl 8(%rdi), %ecx
3453 ; SSE41-NEXT: shll $13, %ecx
3454 ; SSE41-NEXT: shrq $51, %rax
3455 ; SSE41-NEXT: orl %ecx, %eax
3456 ; SSE41-NEXT: shlq $47, %rax
3457 ; SSE41-NEXT: sarq $47, %rax
3458 ; SSE41-NEXT: pinsrd $3, %eax, %xmm0
3461 ; AVX-LABEL: sext_4i17_to_4i32:
3463 ; AVX-NEXT: movq (%rdi), %rax
3464 ; AVX-NEXT: movq %rax, %rcx
3465 ; AVX-NEXT: shlq $30, %rcx
3466 ; AVX-NEXT: sarq $47, %rcx
3467 ; AVX-NEXT: movq %rax, %rdx
3468 ; AVX-NEXT: shlq $47, %rdx
3469 ; AVX-NEXT: sarq $47, %rdx
3470 ; AVX-NEXT: vmovd %edx, %xmm0
3471 ; AVX-NEXT: vpinsrd $1, %ecx, %xmm0, %xmm0
3472 ; AVX-NEXT: movq %rax, %rcx
3473 ; AVX-NEXT: shlq $13, %rcx
3474 ; AVX-NEXT: sarq $47, %rcx
3475 ; AVX-NEXT: vpinsrd $2, %ecx, %xmm0, %xmm0
3476 ; AVX-NEXT: movl 8(%rdi), %ecx
3477 ; AVX-NEXT: shll $13, %ecx
3478 ; AVX-NEXT: shrq $51, %rax
3479 ; AVX-NEXT: orl %ecx, %eax
3480 ; AVX-NEXT: shlq $47, %rax
3481 ; AVX-NEXT: sarq $47, %rax
3482 ; AVX-NEXT: vpinsrd $3, %eax, %xmm0, %xmm0
3485 ; X32-SSE2-LABEL: sext_4i17_to_4i32:
3486 ; X32-SSE2: # %bb.0:
3487 ; X32-SSE2-NEXT: movl {{[0-9]+}}(%esp), %eax
3488 ; X32-SSE2-NEXT: movl (%eax), %ecx
3489 ; X32-SSE2-NEXT: movl 4(%eax), %edx
3490 ; X32-SSE2-NEXT: movl 8(%eax), %eax
3491 ; X32-SSE2-NEXT: shldl $13, %edx, %eax
3492 ; X32-SSE2-NEXT: shll $15, %eax
3493 ; X32-SSE2-NEXT: movd %eax, %xmm0
3494 ; X32-SSE2-NEXT: movl %edx, %eax
3495 ; X32-SSE2-NEXT: shll $13, %eax
3496 ; X32-SSE2-NEXT: movd %eax, %xmm1
3497 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm0[0],xmm1[1],xmm0[1]
3498 ; X32-SSE2-NEXT: shldl $15, %ecx, %edx
3499 ; X32-SSE2-NEXT: shll $15, %ecx
3500 ; X32-SSE2-NEXT: movd %ecx, %xmm0
3501 ; X32-SSE2-NEXT: shll $15, %edx
3502 ; X32-SSE2-NEXT: movd %edx, %xmm2
3503 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
3504 ; X32-SSE2-NEXT: punpcklqdq {{.*#+}} xmm0 = xmm0[0],xmm1[0]
3505 ; X32-SSE2-NEXT: psrad $15, %xmm0
3506 ; X32-SSE2-NEXT: retl
3508 ; X32-SSE41-LABEL: sext_4i17_to_4i32:
3509 ; X32-SSE41: # %bb.0:
3510 ; X32-SSE41-NEXT: pushl %esi
3511 ; X32-SSE41-NEXT: .cfi_def_cfa_offset 8
3512 ; X32-SSE41-NEXT: .cfi_offset %esi, -8
3513 ; X32-SSE41-NEXT: movl {{[0-9]+}}(%esp), %eax
3514 ; X32-SSE41-NEXT: movl (%eax), %ecx
3515 ; X32-SSE41-NEXT: movl 4(%eax), %edx
3516 ; X32-SSE41-NEXT: movl %edx, %esi
3517 ; X32-SSE41-NEXT: movl 8(%eax), %eax
3518 ; X32-SSE41-NEXT: shldl $13, %edx, %eax
3519 ; X32-SSE41-NEXT: shldl $15, %ecx, %edx
3520 ; X32-SSE41-NEXT: shll $15, %edx
3521 ; X32-SSE41-NEXT: shll $15, %ecx
3522 ; X32-SSE41-NEXT: movd %ecx, %xmm0
3523 ; X32-SSE41-NEXT: pinsrd $1, %edx, %xmm0
3524 ; X32-SSE41-NEXT: shll $13, %esi
3525 ; X32-SSE41-NEXT: pinsrd $2, %esi, %xmm0
3526 ; X32-SSE41-NEXT: shll $15, %eax
3527 ; X32-SSE41-NEXT: pinsrd $3, %eax, %xmm0
3528 ; X32-SSE41-NEXT: psrad $15, %xmm0
3529 ; X32-SSE41-NEXT: popl %esi
3530 ; X32-SSE41-NEXT: .cfi_def_cfa_offset 4
3531 ; X32-SSE41-NEXT: retl
3532 %a = load <4 x i17>, <4 x i17>* %ptr
3533 %b = sext <4 x i17> %a to <4 x i32>
3537 define <8 x i64> @sext_8i6_to_8i64(i32 %x) nounwind uwtable readnone ssp {
3538 ; SSE2-LABEL: sext_8i6_to_8i64:
3539 ; SSE2: # %bb.0: # %entry
3540 ; SSE2-NEXT: movd %edi, %xmm0
3541 ; SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
3542 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[0,0,0,0]
3543 ; SSE2-NEXT: paddw {{.*}}(%rip), %xmm3
3544 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm3[0,1,0,3]
3545 ; SSE2-NEXT: pshufhw {{.*#+}} xmm0 = xmm0[0,1,2,3,5,5,6,7]
3546 ; SSE2-NEXT: psllq $58, %xmm0
3547 ; SSE2-NEXT: movdqa %xmm0, %xmm1
3548 ; SSE2-NEXT: psrad $31, %xmm1
3549 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,3,2,3]
3550 ; SSE2-NEXT: psrad $26, %xmm0
3551 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,3,2,3]
3552 ; SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
3553 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,1,1,3]
3554 ; SSE2-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,5,5,6,7]
3555 ; SSE2-NEXT: psllq $58, %xmm1
3556 ; SSE2-NEXT: movdqa %xmm1, %xmm2
3557 ; SSE2-NEXT: psrad $31, %xmm2
3558 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
3559 ; SSE2-NEXT: psrad $26, %xmm1
3560 ; SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,3,2,3]
3561 ; SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
3562 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,1,2,3]
3563 ; SSE2-NEXT: pshufhw {{.*#+}} xmm2 = xmm2[0,1,2,3,5,5,6,7]
3564 ; SSE2-NEXT: psllq $58, %xmm2
3565 ; SSE2-NEXT: movdqa %xmm2, %xmm4
3566 ; SSE2-NEXT: psrad $31, %xmm4
3567 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm4[1,3,2,3]
3568 ; SSE2-NEXT: psrad $26, %xmm2
3569 ; SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
3570 ; SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
3571 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm3[3,1,3,3]
3572 ; SSE2-NEXT: pshufhw {{.*#+}} xmm3 = xmm3[0,1,2,3,5,5,6,7]
3573 ; SSE2-NEXT: psllq $58, %xmm3
3574 ; SSE2-NEXT: movdqa %xmm3, %xmm4
3575 ; SSE2-NEXT: psrad $31, %xmm4
3576 ; SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm4[1,3,2,3]
3577 ; SSE2-NEXT: psrad $26, %xmm3
3578 ; SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,3,2,3]
3579 ; SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
3582 ; SSSE3-LABEL: sext_8i6_to_8i64:
3583 ; SSSE3: # %bb.0: # %entry
3584 ; SSSE3-NEXT: movd %edi, %xmm0
3585 ; SSSE3-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
3586 ; SSSE3-NEXT: pshufd {{.*#+}} xmm3 = xmm0[0,0,0,0]
3587 ; SSSE3-NEXT: paddw {{.*}}(%rip), %xmm3
3588 ; SSSE3-NEXT: pshufd {{.*#+}} xmm0 = xmm3[0,1,0,3]
3589 ; SSSE3-NEXT: pshufhw {{.*#+}} xmm0 = xmm0[0,1,2,3,5,5,6,7]
3590 ; SSSE3-NEXT: psllq $58, %xmm0
3591 ; SSSE3-NEXT: movdqa %xmm0, %xmm1
3592 ; SSSE3-NEXT: psrad $31, %xmm1
3593 ; SSSE3-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,3,2,3]
3594 ; SSSE3-NEXT: psrad $26, %xmm0
3595 ; SSSE3-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,3,2,3]
3596 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
3597 ; SSSE3-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,1,1,3]
3598 ; SSSE3-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,5,5,6,7]
3599 ; SSSE3-NEXT: psllq $58, %xmm1
3600 ; SSSE3-NEXT: movdqa %xmm1, %xmm2
3601 ; SSSE3-NEXT: psrad $31, %xmm2
3602 ; SSSE3-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
3603 ; SSSE3-NEXT: psrad $26, %xmm1
3604 ; SSSE3-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,3,2,3]
3605 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
3606 ; SSSE3-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,1,2,3]
3607 ; SSSE3-NEXT: pshufhw {{.*#+}} xmm2 = xmm2[0,1,2,3,5,5,6,7]
3608 ; SSSE3-NEXT: psllq $58, %xmm2
3609 ; SSSE3-NEXT: movdqa %xmm2, %xmm4
3610 ; SSSE3-NEXT: psrad $31, %xmm4
3611 ; SSSE3-NEXT: pshufd {{.*#+}} xmm4 = xmm4[1,3,2,3]
3612 ; SSSE3-NEXT: psrad $26, %xmm2
3613 ; SSSE3-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
3614 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
3615 ; SSSE3-NEXT: pshufd {{.*#+}} xmm3 = xmm3[3,1,3,3]
3616 ; SSSE3-NEXT: pshufhw {{.*#+}} xmm3 = xmm3[0,1,2,3,5,5,6,7]
3617 ; SSSE3-NEXT: psllq $58, %xmm3
3618 ; SSSE3-NEXT: movdqa %xmm3, %xmm4
3619 ; SSSE3-NEXT: psrad $31, %xmm4
3620 ; SSSE3-NEXT: pshufd {{.*#+}} xmm4 = xmm4[1,3,2,3]
3621 ; SSSE3-NEXT: psrad $26, %xmm3
3622 ; SSSE3-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,3,2,3]
3623 ; SSSE3-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
3626 ; SSE41-LABEL: sext_8i6_to_8i64:
3627 ; SSE41: # %bb.0: # %entry
3628 ; SSE41-NEXT: movd %edi, %xmm0
3629 ; SSE41-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
3630 ; SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm0[0,0,0,0]
3631 ; SSE41-NEXT: paddw {{.*}}(%rip), %xmm3
3632 ; SSE41-NEXT: pmovzxwq {{.*#+}} xmm0 = xmm3[0],zero,zero,zero,xmm3[1],zero,zero,zero
3633 ; SSE41-NEXT: psllq $58, %xmm0
3634 ; SSE41-NEXT: movdqa %xmm0, %xmm1
3635 ; SSE41-NEXT: psrad $31, %xmm1
3636 ; SSE41-NEXT: psrad $26, %xmm0
3637 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
3638 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3],xmm0[4,5],xmm1[6,7]
3639 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,1,2,3]
3640 ; SSE41-NEXT: pmovzxwq {{.*#+}} xmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero
3641 ; SSE41-NEXT: psllq $58, %xmm1
3642 ; SSE41-NEXT: movdqa %xmm1, %xmm2
3643 ; SSE41-NEXT: psrad $31, %xmm2
3644 ; SSE41-NEXT: psrad $26, %xmm1
3645 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
3646 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1],xmm2[2,3],xmm1[4,5],xmm2[6,7]
3647 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,3,0,1]
3648 ; SSE41-NEXT: pmovzxwq {{.*#+}} xmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero
3649 ; SSE41-NEXT: psllq $58, %xmm2
3650 ; SSE41-NEXT: movdqa %xmm2, %xmm4
3651 ; SSE41-NEXT: psrad $31, %xmm4
3652 ; SSE41-NEXT: psrad $26, %xmm2
3653 ; SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3]
3654 ; SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1],xmm4[2,3],xmm2[4,5],xmm4[6,7]
3655 ; SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm3[3,1,2,3]
3656 ; SSE41-NEXT: pmovzxwq {{.*#+}} xmm3 = xmm3[0],zero,zero,zero,xmm3[1],zero,zero,zero
3657 ; SSE41-NEXT: psllq $58, %xmm3
3658 ; SSE41-NEXT: movdqa %xmm3, %xmm4
3659 ; SSE41-NEXT: psrad $31, %xmm4
3660 ; SSE41-NEXT: psrad $26, %xmm3
3661 ; SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,1,3,3]
3662 ; SSE41-NEXT: pblendw {{.*#+}} xmm3 = xmm3[0,1],xmm4[2,3],xmm3[4,5],xmm4[6,7]
3665 ; AVX1-LABEL: sext_8i6_to_8i64:
3666 ; AVX1: # %bb.0: # %entry
3667 ; AVX1-NEXT: vmovd %edi, %xmm0
3668 ; AVX1-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
3669 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
3670 ; AVX1-NEXT: vpaddw {{.*}}(%rip), %xmm0, %xmm0
3671 ; AVX1-NEXT: vpsllw $10, %xmm0, %xmm0
3672 ; AVX1-NEXT: vpsraw $10, %xmm0, %xmm1
3673 ; AVX1-NEXT: vpmovsxwq %xmm1, %xmm0
3674 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm1[1,1,2,3]
3675 ; AVX1-NEXT: vpmovsxwq %xmm2, %xmm2
3676 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm0, %ymm0
3677 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm1[2,3,0,1]
3678 ; AVX1-NEXT: vpmovsxwq %xmm2, %xmm2
3679 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[3,3,0,1]
3680 ; AVX1-NEXT: vpmovsxwq %xmm1, %xmm1
3681 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
3684 ; AVX2-LABEL: sext_8i6_to_8i64:
3685 ; AVX2: # %bb.0: # %entry
3686 ; AVX2-NEXT: vmovd %edi, %xmm0
3687 ; AVX2-NEXT: vpbroadcastw %xmm0, %xmm0
3688 ; AVX2-NEXT: vpaddw {{.*}}(%rip), %xmm0, %xmm0
3689 ; AVX2-NEXT: vpsllw $10, %xmm0, %xmm0
3690 ; AVX2-NEXT: vpsraw $10, %xmm0, %xmm1
3691 ; AVX2-NEXT: vpmovsxwq %xmm1, %ymm0
3692 ; AVX2-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
3693 ; AVX2-NEXT: vpmovsxwq %xmm1, %ymm1
3696 ; AVX512-LABEL: sext_8i6_to_8i64:
3697 ; AVX512: # %bb.0: # %entry
3698 ; AVX512-NEXT: vmovd %edi, %xmm0
3699 ; AVX512-NEXT: vpbroadcastw %xmm0, %xmm0
3700 ; AVX512-NEXT: vpaddw {{.*}}(%rip), %xmm0, %xmm0
3701 ; AVX512-NEXT: vpmovzxwq {{.*#+}} zmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero
3702 ; AVX512-NEXT: vpsllq $58, %zmm0, %zmm0
3703 ; AVX512-NEXT: vpsraq $58, %zmm0, %zmm0
3706 ; X32-SSE2-LABEL: sext_8i6_to_8i64:
3707 ; X32-SSE2: # %bb.0: # %entry
3708 ; X32-SSE2-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
3709 ; X32-SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
3710 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm0[0,0,0,0]
3711 ; X32-SSE2-NEXT: paddw {{\.LCPI.*}}, %xmm3
3712 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm3[0,1,0,3]
3713 ; X32-SSE2-NEXT: pshufhw {{.*#+}} xmm0 = xmm0[0,1,2,3,5,5,6,7]
3714 ; X32-SSE2-NEXT: psllq $58, %xmm0
3715 ; X32-SSE2-NEXT: movdqa %xmm0, %xmm1
3716 ; X32-SSE2-NEXT: psrad $31, %xmm1
3717 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,3,2,3]
3718 ; X32-SSE2-NEXT: psrad $26, %xmm0
3719 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,3,2,3]
3720 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
3721 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,1,1,3]
3722 ; X32-SSE2-NEXT: pshufhw {{.*#+}} xmm1 = xmm1[0,1,2,3,5,5,6,7]
3723 ; X32-SSE2-NEXT: psllq $58, %xmm1
3724 ; X32-SSE2-NEXT: movdqa %xmm1, %xmm2
3725 ; X32-SSE2-NEXT: psrad $31, %xmm2
3726 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
3727 ; X32-SSE2-NEXT: psrad $26, %xmm1
3728 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,3,2,3]
3729 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
3730 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,1,2,3]
3731 ; X32-SSE2-NEXT: pshufhw {{.*#+}} xmm2 = xmm2[0,1,2,3,5,5,6,7]
3732 ; X32-SSE2-NEXT: psllq $58, %xmm2
3733 ; X32-SSE2-NEXT: movdqa %xmm2, %xmm4
3734 ; X32-SSE2-NEXT: psrad $31, %xmm4
3735 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm4[1,3,2,3]
3736 ; X32-SSE2-NEXT: psrad $26, %xmm2
3737 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,3,2,3]
3738 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm2 = xmm2[0],xmm4[0],xmm2[1],xmm4[1]
3739 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm3[3,1,3,3]
3740 ; X32-SSE2-NEXT: pshufhw {{.*#+}} xmm3 = xmm3[0,1,2,3,5,5,6,7]
3741 ; X32-SSE2-NEXT: psllq $58, %xmm3
3742 ; X32-SSE2-NEXT: movdqa %xmm3, %xmm4
3743 ; X32-SSE2-NEXT: psrad $31, %xmm4
3744 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm4 = xmm4[1,3,2,3]
3745 ; X32-SSE2-NEXT: psrad $26, %xmm3
3746 ; X32-SSE2-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,3,2,3]
3747 ; X32-SSE2-NEXT: punpckldq {{.*#+}} xmm3 = xmm3[0],xmm4[0],xmm3[1],xmm4[1]
3748 ; X32-SSE2-NEXT: retl
3750 ; X32-SSE41-LABEL: sext_8i6_to_8i64:
3751 ; X32-SSE41: # %bb.0: # %entry
3752 ; X32-SSE41-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
3753 ; X32-SSE41-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,2,3,4,5,6,7]
3754 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm0[0,0,0,0]
3755 ; X32-SSE41-NEXT: paddw {{\.LCPI.*}}, %xmm3
3756 ; X32-SSE41-NEXT: pmovzxwq {{.*#+}} xmm0 = xmm3[0],zero,zero,zero,xmm3[1],zero,zero,zero
3757 ; X32-SSE41-NEXT: psllq $58, %xmm0
3758 ; X32-SSE41-NEXT: movdqa %xmm0, %xmm1
3759 ; X32-SSE41-NEXT: psrad $31, %xmm1
3760 ; X32-SSE41-NEXT: psrad $26, %xmm0
3761 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[1,1,3,3]
3762 ; X32-SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1],xmm1[2,3],xmm0[4,5],xmm1[6,7]
3763 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm3[1,1,2,3]
3764 ; X32-SSE41-NEXT: pmovzxwq {{.*#+}} xmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero
3765 ; X32-SSE41-NEXT: psllq $58, %xmm1
3766 ; X32-SSE41-NEXT: movdqa %xmm1, %xmm2
3767 ; X32-SSE41-NEXT: psrad $31, %xmm2
3768 ; X32-SSE41-NEXT: psrad $26, %xmm1
3769 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[1,1,3,3]
3770 ; X32-SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1],xmm2[2,3],xmm1[4,5],xmm2[6,7]
3771 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm3[2,3,0,1]
3772 ; X32-SSE41-NEXT: pmovzxwq {{.*#+}} xmm2 = xmm2[0],zero,zero,zero,xmm2[1],zero,zero,zero
3773 ; X32-SSE41-NEXT: psllq $58, %xmm2
3774 ; X32-SSE41-NEXT: movdqa %xmm2, %xmm4
3775 ; X32-SSE41-NEXT: psrad $31, %xmm4
3776 ; X32-SSE41-NEXT: psrad $26, %xmm2
3777 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm2 = xmm2[1,1,3,3]
3778 ; X32-SSE41-NEXT: pblendw {{.*#+}} xmm2 = xmm2[0,1],xmm4[2,3],xmm2[4,5],xmm4[6,7]
3779 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm3[3,1,2,3]
3780 ; X32-SSE41-NEXT: pmovzxwq {{.*#+}} xmm3 = xmm3[0],zero,zero,zero,xmm3[1],zero,zero,zero
3781 ; X32-SSE41-NEXT: psllq $58, %xmm3
3782 ; X32-SSE41-NEXT: movdqa %xmm3, %xmm4
3783 ; X32-SSE41-NEXT: psrad $31, %xmm4
3784 ; X32-SSE41-NEXT: psrad $26, %xmm3
3785 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm3 = xmm3[1,1,3,3]
3786 ; X32-SSE41-NEXT: pblendw {{.*#+}} xmm3 = xmm3[0,1],xmm4[2,3],xmm3[4,5],xmm4[6,7]
3787 ; X32-SSE41-NEXT: retl
3789 %a = trunc i32 %x to i6
3790 %b = insertelement <8 x i6> undef, i6 %a, i32 0
3791 %c = shufflevector <8 x i6> %b, <8 x i6> undef, <8 x i32> zeroinitializer
3792 %d = add <8 x i6> %c, <i6 0, i6 1, i6 2, i6 3, i6 4, i6 5, i6 6, i6 7>
3793 %e = sext <8 x i6> %d to <8 x i64>
3797 define <8 x i32> @zext_negate_sext(<8 x i8> %x) {
3798 ; SSE2-LABEL: zext_negate_sext:
3800 ; SSE2-NEXT: pxor %xmm1, %xmm1
3801 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
3802 ; SSE2-NEXT: psubw %xmm0, %xmm1
3803 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3804 ; SSE2-NEXT: psrad $16, %xmm0
3805 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
3806 ; SSE2-NEXT: psrad $16, %xmm1
3809 ; SSSE3-LABEL: zext_negate_sext:
3811 ; SSSE3-NEXT: pxor %xmm1, %xmm1
3812 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
3813 ; SSSE3-NEXT: psubw %xmm0, %xmm1
3814 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3815 ; SSSE3-NEXT: psrad $16, %xmm0
3816 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
3817 ; SSSE3-NEXT: psrad $16, %xmm1
3820 ; SSE41-LABEL: zext_negate_sext:
3822 ; SSE41-NEXT: pmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
3823 ; SSE41-NEXT: pxor %xmm1, %xmm1
3824 ; SSE41-NEXT: psubw %xmm0, %xmm1
3825 ; SSE41-NEXT: pmovsxwd %xmm1, %xmm0
3826 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
3827 ; SSE41-NEXT: pmovsxwd %xmm1, %xmm1
3830 ; AVX1-LABEL: zext_negate_sext:
3832 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
3833 ; AVX1-NEXT: vpmovzxbd {{.*#+}} xmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero
3834 ; AVX1-NEXT: vpxor %xmm2, %xmm2, %xmm2
3835 ; AVX1-NEXT: vpsubd %xmm1, %xmm2, %xmm1
3836 ; AVX1-NEXT: vpmovzxbd {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero
3837 ; AVX1-NEXT: vpsubd %xmm0, %xmm2, %xmm0
3838 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3841 ; AVX2-LABEL: zext_negate_sext:
3843 ; AVX2-NEXT: vpmovzxbd {{.*#+}} ymm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero
3844 ; AVX2-NEXT: vpxor %xmm1, %xmm1, %xmm1
3845 ; AVX2-NEXT: vpsubd %ymm0, %ymm1, %ymm0
3848 ; AVX512-LABEL: zext_negate_sext:
3850 ; AVX512-NEXT: vpmovzxbd {{.*#+}} ymm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero
3851 ; AVX512-NEXT: vpxor %xmm1, %xmm1, %xmm1
3852 ; AVX512-NEXT: vpsubd %ymm0, %ymm1, %ymm0
3855 ; X32-SSE2-LABEL: zext_negate_sext:
3856 ; X32-SSE2: # %bb.0:
3857 ; X32-SSE2-NEXT: pxor %xmm1, %xmm1
3858 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
3859 ; X32-SSE2-NEXT: psubw %xmm0, %xmm1
3860 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3861 ; X32-SSE2-NEXT: psrad $16, %xmm0
3862 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
3863 ; X32-SSE2-NEXT: psrad $16, %xmm1
3864 ; X32-SSE2-NEXT: retl
3866 ; X32-SSE41-LABEL: zext_negate_sext:
3867 ; X32-SSE41: # %bb.0:
3868 ; X32-SSE41-NEXT: pmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
3869 ; X32-SSE41-NEXT: pxor %xmm1, %xmm1
3870 ; X32-SSE41-NEXT: psubw %xmm0, %xmm1
3871 ; X32-SSE41-NEXT: pmovsxwd %xmm1, %xmm0
3872 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
3873 ; X32-SSE41-NEXT: pmovsxwd %xmm1, %xmm1
3874 ; X32-SSE41-NEXT: retl
3875 %z = zext <8 x i8> %x to <8 x i16>
3876 %neg = sub nsw <8 x i16> zeroinitializer, %z
3877 %r = sext <8 x i16> %neg to <8 x i32>
3881 define <8 x i32> @zext_decremenet_sext(<8 x i8> %x) {
3882 ; SSE2-LABEL: zext_decremenet_sext:
3884 ; SSE2-NEXT: pxor %xmm1, %xmm1
3885 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
3886 ; SSE2-NEXT: pcmpeqd %xmm1, %xmm1
3887 ; SSE2-NEXT: paddw %xmm0, %xmm1
3888 ; SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3889 ; SSE2-NEXT: psrad $16, %xmm0
3890 ; SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
3891 ; SSE2-NEXT: psrad $16, %xmm1
3894 ; SSSE3-LABEL: zext_decremenet_sext:
3896 ; SSSE3-NEXT: pxor %xmm1, %xmm1
3897 ; SSSE3-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
3898 ; SSSE3-NEXT: pcmpeqd %xmm1, %xmm1
3899 ; SSSE3-NEXT: paddw %xmm0, %xmm1
3900 ; SSSE3-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3901 ; SSSE3-NEXT: psrad $16, %xmm0
3902 ; SSSE3-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
3903 ; SSSE3-NEXT: psrad $16, %xmm1
3906 ; SSE41-LABEL: zext_decremenet_sext:
3908 ; SSE41-NEXT: pmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
3909 ; SSE41-NEXT: pcmpeqd %xmm1, %xmm1
3910 ; SSE41-NEXT: paddw %xmm0, %xmm1
3911 ; SSE41-NEXT: pmovsxwd %xmm1, %xmm0
3912 ; SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
3913 ; SSE41-NEXT: pmovsxwd %xmm1, %xmm1
3916 ; AVX1-LABEL: zext_decremenet_sext:
3918 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm0[1,1,2,3]
3919 ; AVX1-NEXT: vpmovzxbd {{.*#+}} xmm1 = xmm1[0],zero,zero,zero,xmm1[1],zero,zero,zero,xmm1[2],zero,zero,zero,xmm1[3],zero,zero,zero
3920 ; AVX1-NEXT: vpcmpeqd %xmm2, %xmm2, %xmm2
3921 ; AVX1-NEXT: vpaddd %xmm2, %xmm1, %xmm1
3922 ; AVX1-NEXT: vpmovzxbd {{.*#+}} xmm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero
3923 ; AVX1-NEXT: vpaddd %xmm2, %xmm0, %xmm0
3924 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm0, %ymm0
3927 ; AVX2-LABEL: zext_decremenet_sext:
3929 ; AVX2-NEXT: vpmovzxbd {{.*#+}} ymm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero
3930 ; AVX2-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
3931 ; AVX2-NEXT: vpaddd %ymm1, %ymm0, %ymm0
3934 ; AVX512-LABEL: zext_decremenet_sext:
3936 ; AVX512-NEXT: vpmovzxbd {{.*#+}} ymm0 = xmm0[0],zero,zero,zero,xmm0[1],zero,zero,zero,xmm0[2],zero,zero,zero,xmm0[3],zero,zero,zero,xmm0[4],zero,zero,zero,xmm0[5],zero,zero,zero,xmm0[6],zero,zero,zero,xmm0[7],zero,zero,zero
3937 ; AVX512-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
3938 ; AVX512-NEXT: vpaddd %ymm1, %ymm0, %ymm0
3941 ; X32-SSE2-LABEL: zext_decremenet_sext:
3942 ; X32-SSE2: # %bb.0:
3943 ; X32-SSE2-NEXT: pxor %xmm1, %xmm1
3944 ; X32-SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3],xmm0[4],xmm1[4],xmm0[5],xmm1[5],xmm0[6],xmm1[6],xmm0[7],xmm1[7]
3945 ; X32-SSE2-NEXT: pcmpeqd %xmm1, %xmm1
3946 ; X32-SSE2-NEXT: paddw %xmm0, %xmm1
3947 ; X32-SSE2-NEXT: punpcklwd {{.*#+}} xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1],xmm0[2],xmm1[2],xmm0[3],xmm1[3]
3948 ; X32-SSE2-NEXT: psrad $16, %xmm0
3949 ; X32-SSE2-NEXT: punpckhwd {{.*#+}} xmm1 = xmm1[4,4,5,5,6,6,7,7]
3950 ; X32-SSE2-NEXT: psrad $16, %xmm1
3951 ; X32-SSE2-NEXT: retl
3953 ; X32-SSE41-LABEL: zext_decremenet_sext:
3954 ; X32-SSE41: # %bb.0:
3955 ; X32-SSE41-NEXT: pmovzxbw {{.*#+}} xmm0 = xmm0[0],zero,xmm0[1],zero,xmm0[2],zero,xmm0[3],zero,xmm0[4],zero,xmm0[5],zero,xmm0[6],zero,xmm0[7],zero
3956 ; X32-SSE41-NEXT: pcmpeqd %xmm1, %xmm1
3957 ; X32-SSE41-NEXT: paddw %xmm0, %xmm1
3958 ; X32-SSE41-NEXT: pmovsxwd %xmm1, %xmm0
3959 ; X32-SSE41-NEXT: pshufd {{.*#+}} xmm1 = xmm1[2,3,0,1]
3960 ; X32-SSE41-NEXT: pmovsxwd %xmm1, %xmm1
3961 ; X32-SSE41-NEXT: retl
3962 %z = zext <8 x i8> %x to <8 x i16>
3963 %dec = add <8 x i16> %z, <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>
3964 %r = sext <8 x i16> %dec to <8 x i32>