1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefix=SSE2
3 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse3 | FileCheck %s --check-prefix=SSE3
4 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+ssse3 | FileCheck %s --check-prefix=SSSE3
5 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+sse4.1 | FileCheck %s --check-prefix=SSE41
6 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx | FileCheck %s --check-prefixes=AVX,AVX1
7 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=AVX,AVX2
8 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,avx512bw | FileCheck %s --check-prefixes=AVX,AVX512
9 ; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f,+avx512bw,+avx512vl | FileCheck %s --check-prefixes=AVX,AVX512
11 define <2 x i64> @insert_v2i64_x1(<2 x i64> %a) {
12 ; SSE2-LABEL: insert_v2i64_x1:
14 ; SSE2-NEXT: movlps {{.*#+}} xmm0 = mem[0,1],xmm0[2,3]
17 ; SSE3-LABEL: insert_v2i64_x1:
19 ; SSE3-NEXT: movlps {{.*#+}} xmm0 = mem[0,1],xmm0[2,3]
22 ; SSSE3-LABEL: insert_v2i64_x1:
24 ; SSSE3-NEXT: movlps {{.*#+}} xmm0 = mem[0,1],xmm0[2,3]
27 ; SSE41-LABEL: insert_v2i64_x1:
29 ; SSE41-NEXT: pcmpeqd %xmm1, %xmm1
30 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm1[0,1,2,3],xmm0[4,5,6,7]
33 ; AVX1-LABEL: insert_v2i64_x1:
35 ; AVX1-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
36 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm1[0,1,2,3],xmm0[4,5,6,7]
39 ; AVX2-LABEL: insert_v2i64_x1:
41 ; AVX2-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
42 ; AVX2-NEXT: vpblendd {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]
45 ; AVX512-LABEL: insert_v2i64_x1:
47 ; AVX512-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
48 ; AVX512-NEXT: vpblendd {{.*#+}} xmm0 = xmm1[0,1],xmm0[2,3]
50 %1 = insertelement <2 x i64> %a, i64 -1, i32 0
54 define <4 x i64> @insert_v4i64_01x3(<4 x i64> %a) {
55 ; SSE2-LABEL: insert_v4i64_01x3:
57 ; SSE2-NEXT: movlps {{.*#+}} xmm1 = mem[0,1],xmm1[2,3]
60 ; SSE3-LABEL: insert_v4i64_01x3:
62 ; SSE3-NEXT: movlps {{.*#+}} xmm1 = mem[0,1],xmm1[2,3]
65 ; SSSE3-LABEL: insert_v4i64_01x3:
67 ; SSSE3-NEXT: movlps {{.*#+}} xmm1 = mem[0,1],xmm1[2,3]
70 ; SSE41-LABEL: insert_v4i64_01x3:
72 ; SSE41-NEXT: pcmpeqd %xmm2, %xmm2
73 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm2[0,1,2,3],xmm1[4,5,6,7]
76 ; AVX1-LABEL: insert_v4i64_01x3:
78 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
79 ; AVX1-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
80 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
83 ; AVX2-LABEL: insert_v4i64_01x3:
85 ; AVX2-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
86 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
89 ; AVX512-LABEL: insert_v4i64_01x3:
91 ; AVX512-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
92 ; AVX512-NEXT: vpblendd {{.*#+}} ymm0 = ymm0[0,1,2,3],ymm1[4,5],ymm0[6,7]
94 %1 = insertelement <4 x i64> %a, i64 -1, i32 2
98 define <4 x i32> @insert_v4i32_01x3(<4 x i32> %a) {
99 ; SSE2-LABEL: insert_v4i32_01x3:
101 ; SSE2-NEXT: movl $-1, %eax
102 ; SSE2-NEXT: movd %eax, %xmm1
103 ; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0],xmm0[3,0]
104 ; SSE2-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,2]
107 ; SSE3-LABEL: insert_v4i32_01x3:
109 ; SSE3-NEXT: movl $-1, %eax
110 ; SSE3-NEXT: movd %eax, %xmm1
111 ; SSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0],xmm0[3,0]
112 ; SSE3-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,2]
115 ; SSSE3-LABEL: insert_v4i32_01x3:
117 ; SSSE3-NEXT: movl $-1, %eax
118 ; SSSE3-NEXT: movd %eax, %xmm1
119 ; SSSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0],xmm0[3,0]
120 ; SSSE3-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,1],xmm1[0,2]
123 ; SSE41-LABEL: insert_v4i32_01x3:
125 ; SSE41-NEXT: pcmpeqd %xmm1, %xmm1
126 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[4,5],xmm0[6,7]
129 ; AVX1-LABEL: insert_v4i32_01x3:
131 ; AVX1-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
132 ; AVX1-NEXT: vpblendw {{.*#+}} xmm0 = xmm0[0,1,2,3],xmm1[4,5],xmm0[6,7]
135 ; AVX2-LABEL: insert_v4i32_01x3:
137 ; AVX2-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
138 ; AVX2-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0,1],xmm1[2],xmm0[3]
141 ; AVX512-LABEL: insert_v4i32_01x3:
143 ; AVX512-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
144 ; AVX512-NEXT: vpblendd {{.*#+}} xmm0 = xmm0[0,1],xmm1[2],xmm0[3]
146 %1 = insertelement <4 x i32> %a, i32 -1, i32 2
150 define <8 x i32> @insert_v8i32_x12345x7(<8 x i32> %a) {
151 ; SSE2-LABEL: insert_v8i32_x12345x7:
153 ; SSE2-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero
154 ; SSE2-NEXT: movss {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3]
155 ; SSE2-NEXT: movl $-1, %eax
156 ; SSE2-NEXT: movd %eax, %xmm2
157 ; SSE2-NEXT: shufps {{.*#+}} xmm2 = xmm2[0,0],xmm1[3,0]
158 ; SSE2-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0,2]
161 ; SSE3-LABEL: insert_v8i32_x12345x7:
163 ; SSE3-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero
164 ; SSE3-NEXT: movss {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3]
165 ; SSE3-NEXT: movl $-1, %eax
166 ; SSE3-NEXT: movd %eax, %xmm2
167 ; SSE3-NEXT: shufps {{.*#+}} xmm2 = xmm2[0,0],xmm1[3,0]
168 ; SSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0,2]
171 ; SSSE3-LABEL: insert_v8i32_x12345x7:
173 ; SSSE3-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero
174 ; SSSE3-NEXT: movss {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3]
175 ; SSSE3-NEXT: movl $-1, %eax
176 ; SSSE3-NEXT: movd %eax, %xmm2
177 ; SSSE3-NEXT: shufps {{.*#+}} xmm2 = xmm2[0,0],xmm1[3,0]
178 ; SSSE3-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,1],xmm2[0,2]
181 ; SSE41-LABEL: insert_v8i32_x12345x7:
183 ; SSE41-NEXT: pcmpeqd %xmm2, %xmm2
184 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm2[0,1],xmm0[2,3,4,5,6,7]
185 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3],xmm2[4,5],xmm1[6,7]
188 ; AVX1-LABEL: insert_v8i32_x12345x7:
190 ; AVX1-NEXT: vxorps %xmm1, %xmm1, %xmm1
191 ; AVX1-NEXT: vcmptrueps %ymm1, %ymm1, %ymm1
192 ; AVX1-NEXT: vblendps {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5],ymm1[6],ymm0[7]
195 ; AVX2-LABEL: insert_v8i32_x12345x7:
197 ; AVX2-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
198 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5],ymm1[6],ymm0[7]
201 ; AVX512-LABEL: insert_v8i32_x12345x7:
203 ; AVX512-NEXT: vpcmpeqd %ymm1, %ymm1, %ymm1
204 ; AVX512-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0],ymm0[1,2,3,4,5],ymm1[6],ymm0[7]
206 %1 = insertelement <8 x i32> %a, i32 -1, i32 0
207 %2 = insertelement <8 x i32> %1, i32 -1, i32 6
211 define <8 x i16> @insert_v8i16_x12345x7(<8 x i16> %a) {
212 ; SSE2-LABEL: insert_v8i16_x12345x7:
214 ; SSE2-NEXT: movl $65535, %eax # imm = 0xFFFF
215 ; SSE2-NEXT: pinsrw $0, %eax, %xmm0
216 ; SSE2-NEXT: pinsrw $6, %eax, %xmm0
219 ; SSE3-LABEL: insert_v8i16_x12345x7:
221 ; SSE3-NEXT: movl $65535, %eax # imm = 0xFFFF
222 ; SSE3-NEXT: pinsrw $0, %eax, %xmm0
223 ; SSE3-NEXT: pinsrw $6, %eax, %xmm0
226 ; SSSE3-LABEL: insert_v8i16_x12345x7:
228 ; SSSE3-NEXT: movl $65535, %eax # imm = 0xFFFF
229 ; SSSE3-NEXT: pinsrw $0, %eax, %xmm0
230 ; SSSE3-NEXT: pinsrw $6, %eax, %xmm0
233 ; SSE41-LABEL: insert_v8i16_x12345x7:
235 ; SSE41-NEXT: pcmpeqd %xmm1, %xmm1
236 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3,4,5],xmm1[6],xmm0[7]
239 ; AVX-LABEL: insert_v8i16_x12345x7:
241 ; AVX-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
242 ; AVX-NEXT: vpblendw {{.*#+}} xmm0 = xmm1[0],xmm0[1,2,3,4,5],xmm1[6],xmm0[7]
244 %1 = insertelement <8 x i16> %a, i16 -1, i32 0
245 %2 = insertelement <8 x i16> %1, i16 -1, i32 6
249 define <16 x i16> @insert_v16i16_x12345x789ABCDEx(<16 x i16> %a) {
250 ; SSE2-LABEL: insert_v16i16_x12345x789ABCDEx:
252 ; SSE2-NEXT: movl $65535, %eax # imm = 0xFFFF
253 ; SSE2-NEXT: pinsrw $0, %eax, %xmm0
254 ; SSE2-NEXT: pinsrw $6, %eax, %xmm0
255 ; SSE2-NEXT: pinsrw $7, %eax, %xmm1
258 ; SSE3-LABEL: insert_v16i16_x12345x789ABCDEx:
260 ; SSE3-NEXT: movl $65535, %eax # imm = 0xFFFF
261 ; SSE3-NEXT: pinsrw $0, %eax, %xmm0
262 ; SSE3-NEXT: pinsrw $6, %eax, %xmm0
263 ; SSE3-NEXT: pinsrw $7, %eax, %xmm1
266 ; SSSE3-LABEL: insert_v16i16_x12345x789ABCDEx:
268 ; SSSE3-NEXT: movl $65535, %eax # imm = 0xFFFF
269 ; SSSE3-NEXT: pinsrw $0, %eax, %xmm0
270 ; SSSE3-NEXT: pinsrw $6, %eax, %xmm0
271 ; SSSE3-NEXT: pinsrw $7, %eax, %xmm1
274 ; SSE41-LABEL: insert_v16i16_x12345x789ABCDEx:
276 ; SSE41-NEXT: pcmpeqd %xmm2, %xmm2
277 ; SSE41-NEXT: pblendw {{.*#+}} xmm0 = xmm2[0],xmm0[1,2,3,4,5],xmm2[6],xmm0[7]
278 ; SSE41-NEXT: pblendw {{.*#+}} xmm1 = xmm1[0,1,2,3,4,5,6],xmm2[7]
281 ; AVX1-LABEL: insert_v16i16_x12345x789ABCDEx:
283 ; AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
284 ; AVX1-NEXT: vorps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
285 ; AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
286 ; AVX1-NEXT: vorps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
287 ; AVX1-NEXT: vandps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
288 ; AVX1-NEXT: vorps {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm0, %ymm0
291 ; AVX2-LABEL: insert_v16i16_x12345x789ABCDEx:
293 ; AVX2-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
294 ; AVX2-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0],xmm0[1,2,3,4,5],xmm1[6],xmm0[7]
295 ; AVX2-NEXT: vpcmpeqd %ymm2, %ymm2, %ymm2
296 ; AVX2-NEXT: vpblendw {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5,6],ymm2[7],ymm0[8,9,10,11,12,13,14],ymm2[15]
297 ; AVX2-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
300 ; AVX512-LABEL: insert_v16i16_x12345x789ABCDEx:
302 ; AVX512-NEXT: vpcmpeqd %xmm1, %xmm1, %xmm1
303 ; AVX512-NEXT: vpblendw {{.*#+}} xmm1 = xmm1[0],xmm0[1,2,3,4,5],xmm1[6],xmm0[7]
304 ; AVX512-NEXT: vpcmpeqd %ymm2, %ymm2, %ymm2
305 ; AVX512-NEXT: vpblendw {{.*#+}} ymm0 = ymm0[0,1,2,3,4,5,6],ymm2[7],ymm0[8,9,10,11,12,13,14],ymm2[15]
306 ; AVX512-NEXT: vpblendd {{.*#+}} ymm0 = ymm1[0,1,2,3],ymm0[4,5,6,7]
308 %1 = insertelement <16 x i16> %a, i16 -1, i32 0
309 %2 = insertelement <16 x i16> %1, i16 -1, i32 6
310 %3 = insertelement <16 x i16> %2, i16 -1, i32 15
314 define <16 x i8> @insert_v16i8_x123456789ABCDEx(<16 x i8> %a) {
315 ; SSE2-LABEL: insert_v16i8_x123456789ABCDEx:
317 ; SSE2-NEXT: movdqa {{.*#+}} xmm1 = [0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]
318 ; SSE2-NEXT: pand %xmm1, %xmm0
319 ; SSE2-NEXT: movl $255, %eax
320 ; SSE2-NEXT: movd %eax, %xmm2
321 ; SSE2-NEXT: pandn %xmm2, %xmm1
322 ; SSE2-NEXT: por %xmm1, %xmm0
323 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
324 ; SSE2-NEXT: pslldq {{.*#+}} xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0]
325 ; SSE2-NEXT: por %xmm2, %xmm0
328 ; SSE3-LABEL: insert_v16i8_x123456789ABCDEx:
330 ; SSE3-NEXT: movdqa {{.*#+}} xmm1 = [0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]
331 ; SSE3-NEXT: pand %xmm1, %xmm0
332 ; SSE3-NEXT: movl $255, %eax
333 ; SSE3-NEXT: movd %eax, %xmm2
334 ; SSE3-NEXT: pandn %xmm2, %xmm1
335 ; SSE3-NEXT: por %xmm1, %xmm0
336 ; SSE3-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
337 ; SSE3-NEXT: pslldq {{.*#+}} xmm2 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm2[0]
338 ; SSE3-NEXT: por %xmm2, %xmm0
341 ; SSSE3-LABEL: insert_v16i8_x123456789ABCDEx:
343 ; SSSE3-NEXT: movl $255, %eax
344 ; SSSE3-NEXT: movd %eax, %xmm1
345 ; SSSE3-NEXT: movdqa %xmm1, %xmm2
346 ; SSSE3-NEXT: palignr {{.*#+}} xmm2 = xmm0[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],xmm2[0]
347 ; SSSE3-NEXT: pshufb {{.*#+}} xmm2 = xmm2[15,0,1,2,3,4,5,6,7,8,9,10,11,12,13],zero
348 ; SSSE3-NEXT: pslldq {{.*#+}} xmm1 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm1[0]
349 ; SSSE3-NEXT: por %xmm2, %xmm1
350 ; SSSE3-NEXT: movdqa %xmm1, %xmm0
353 ; SSE41-LABEL: insert_v16i8_x123456789ABCDEx:
355 ; SSE41-NEXT: movl $255, %eax
356 ; SSE41-NEXT: pinsrb $0, %eax, %xmm0
357 ; SSE41-NEXT: pinsrb $15, %eax, %xmm0
360 ; AVX-LABEL: insert_v16i8_x123456789ABCDEx:
362 ; AVX-NEXT: movl $255, %eax
363 ; AVX-NEXT: vpinsrb $0, %eax, %xmm0, %xmm0
364 ; AVX-NEXT: vpinsrb $15, %eax, %xmm0, %xmm0
366 %1 = insertelement <16 x i8> %a, i8 -1, i32 0
367 %2 = insertelement <16 x i8> %1, i8 -1, i32 15
371 define <32 x i8> @insert_v32i8_x123456789ABCDEzGHIJKLMNOPQRSTxx(<32 x i8> %a) {
372 ; SSE2-LABEL: insert_v32i8_x123456789ABCDEzGHIJKLMNOPQRSTxx:
374 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]
375 ; SSE2-NEXT: pand %xmm2, %xmm0
376 ; SSE2-NEXT: movl $255, %eax
377 ; SSE2-NEXT: movd %eax, %xmm3
378 ; SSE2-NEXT: pandn %xmm3, %xmm2
379 ; SSE2-NEXT: por %xmm2, %xmm0
380 ; SSE2-NEXT: movdqa {{.*#+}} xmm2 = [255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0]
381 ; SSE2-NEXT: pand %xmm2, %xmm0
382 ; SSE2-NEXT: movdqa %xmm3, %xmm4
383 ; SSE2-NEXT: pslldq {{.*#+}} xmm4 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm4[0]
384 ; SSE2-NEXT: por %xmm4, %xmm0
385 ; SSE2-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
386 ; SSE2-NEXT: pslldq {{.*#+}} xmm3 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm3[0,1]
387 ; SSE2-NEXT: por %xmm3, %xmm1
388 ; SSE2-NEXT: pand %xmm2, %xmm1
389 ; SSE2-NEXT: por %xmm4, %xmm1
392 ; SSE3-LABEL: insert_v32i8_x123456789ABCDEzGHIJKLMNOPQRSTxx:
394 ; SSE3-NEXT: movdqa {{.*#+}} xmm2 = [0,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255]
395 ; SSE3-NEXT: pand %xmm2, %xmm0
396 ; SSE3-NEXT: movl $255, %eax
397 ; SSE3-NEXT: movd %eax, %xmm3
398 ; SSE3-NEXT: pandn %xmm3, %xmm2
399 ; SSE3-NEXT: por %xmm2, %xmm0
400 ; SSE3-NEXT: movdqa {{.*#+}} xmm2 = [255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0]
401 ; SSE3-NEXT: pand %xmm2, %xmm0
402 ; SSE3-NEXT: movdqa %xmm3, %xmm4
403 ; SSE3-NEXT: pslldq {{.*#+}} xmm4 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm4[0]
404 ; SSE3-NEXT: por %xmm4, %xmm0
405 ; SSE3-NEXT: pand {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1
406 ; SSE3-NEXT: pslldq {{.*#+}} xmm3 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm3[0,1]
407 ; SSE3-NEXT: por %xmm3, %xmm1
408 ; SSE3-NEXT: pand %xmm2, %xmm1
409 ; SSE3-NEXT: por %xmm4, %xmm1
412 ; SSSE3-LABEL: insert_v32i8_x123456789ABCDEzGHIJKLMNOPQRSTxx:
414 ; SSSE3-NEXT: movl $255, %eax
415 ; SSSE3-NEXT: movd %eax, %xmm3
416 ; SSSE3-NEXT: movdqa %xmm3, %xmm2
417 ; SSSE3-NEXT: palignr {{.*#+}} xmm2 = xmm0[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15],xmm2[0]
418 ; SSSE3-NEXT: pshufb {{.*#+}} xmm2 = xmm2[15,0,1,2,3,4,5,6,7,8,9,10,11,12,13],zero
419 ; SSSE3-NEXT: movdqa %xmm3, %xmm0
420 ; SSSE3-NEXT: pslldq {{.*#+}} xmm0 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm0[0]
421 ; SSSE3-NEXT: por %xmm0, %xmm2
422 ; SSSE3-NEXT: pshufb {{.*#+}} xmm1 = xmm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13],zero,xmm1[u]
423 ; SSSE3-NEXT: pslldq {{.*#+}} xmm3 = zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,zero,xmm3[0,1]
424 ; SSSE3-NEXT: por %xmm3, %xmm1
425 ; SSSE3-NEXT: pshufb {{.*#+}} xmm1 = xmm1[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14],zero
426 ; SSSE3-NEXT: por %xmm0, %xmm1
427 ; SSSE3-NEXT: movdqa %xmm2, %xmm0
430 ; SSE41-LABEL: insert_v32i8_x123456789ABCDEzGHIJKLMNOPQRSTxx:
432 ; SSE41-NEXT: movl $255, %eax
433 ; SSE41-NEXT: pinsrb $0, %eax, %xmm0
434 ; SSE41-NEXT: pinsrb $15, %eax, %xmm0
435 ; SSE41-NEXT: pinsrb $14, %eax, %xmm1
436 ; SSE41-NEXT: pinsrb $15, %eax, %xmm1
439 ; AVX1-LABEL: insert_v32i8_x123456789ABCDEzGHIJKLMNOPQRSTxx:
441 ; AVX1-NEXT: movl $255, %eax
442 ; AVX1-NEXT: vpinsrb $0, %eax, %xmm0, %xmm1
443 ; AVX1-NEXT: vpinsrb $15, %eax, %xmm1, %xmm1
444 ; AVX1-NEXT: vextractf128 $1, %ymm0, %xmm0
445 ; AVX1-NEXT: vpinsrb $14, %eax, %xmm0, %xmm0
446 ; AVX1-NEXT: vpinsrb $15, %eax, %xmm0, %xmm0
447 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm1, %ymm0
450 ; AVX2-LABEL: insert_v32i8_x123456789ABCDEzGHIJKLMNOPQRSTxx:
452 ; AVX2-NEXT: movl $255, %eax
453 ; AVX2-NEXT: vpinsrb $0, %eax, %xmm0, %xmm1
454 ; AVX2-NEXT: vpinsrb $15, %eax, %xmm1, %xmm1
455 ; AVX2-NEXT: vextracti128 $1, %ymm0, %xmm0
456 ; AVX2-NEXT: vpinsrb $14, %eax, %xmm0, %xmm0
457 ; AVX2-NEXT: vpinsrb $15, %eax, %xmm0, %xmm0
458 ; AVX2-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0
461 ; AVX512-LABEL: insert_v32i8_x123456789ABCDEzGHIJKLMNOPQRSTxx:
463 ; AVX512-NEXT: movl $255, %eax
464 ; AVX512-NEXT: vpinsrb $0, %eax, %xmm0, %xmm1
465 ; AVX512-NEXT: vpinsrb $15, %eax, %xmm1, %xmm1
466 ; AVX512-NEXT: vextracti128 $1, %ymm0, %xmm0
467 ; AVX512-NEXT: vpinsrb $14, %eax, %xmm0, %xmm0
468 ; AVX512-NEXT: vpinsrb $15, %eax, %xmm0, %xmm0
469 ; AVX512-NEXT: vinserti128 $1, %xmm0, %ymm1, %ymm0
471 %1 = insertelement <32 x i8> %a, i8 -1, i32 0
472 %2 = insertelement <32 x i8> %1, i8 -1, i32 15
473 %3 = insertelement <32 x i8> %2, i8 -1, i32 30
474 %4 = insertelement <32 x i8> %3, i8 -1, i32 31