1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+sse2 | FileCheck %s --check-prefixes=ALL,SSE,SSE2
3 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+sse4.1 | FileCheck %s --check-prefixes=ALL,SSE,SSE41
4 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx | FileCheck %s --check-prefixes=ALL,AVX,AVX1OR2,AVX1
5 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx2 | FileCheck %s --check-prefixes=ALL,AVX,AVX1OR2,AVX2
6 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx512f,+avx512vl | FileCheck %s --check-prefixes=ALL,AVX,AVX512,AVX512F
7 ; RUN: llc < %s -mtriple=x86_64-- -mattr=+avx512bw,+avx512vl | FileCheck %s --check-prefixes=ALL,AVX,AVX512,AVX512BW
8 ; RUN: llc < %s -mtriple=i686-- -mattr=+avx2 | FileCheck %s --check-prefixes=ALL,X86AVX2
10 define <16 x i8> @undef_index(i8 %x) nounwind {
11 ; ALL-LABEL: undef_index:
13 ; ALL-NEXT: ret{{[l|q]}}
14 %ins = insertelement <16 x i8> undef, i8 %x, i64 undef
18 define <16 x i8> @undef_scalar(<16 x i8> %x, i32 %index) nounwind {
19 ; ALL-LABEL: undef_scalar:
21 ; ALL-NEXT: ret{{[l|q]}}
22 %ins = insertelement <16 x i8> %x, i8 undef, i32 %index
27 ; Insertion into undef vectors
30 define <16 x i8> @arg_i8_v16i8_undef(i8 %x, i32 %y) nounwind {
31 ; SSE2-LABEL: arg_i8_v16i8_undef:
33 ; SSE2-NEXT: movd %edi, %xmm0
34 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
35 ; SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
36 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
39 ; SSE41-LABEL: arg_i8_v16i8_undef:
41 ; SSE41-NEXT: movd %edi, %xmm0
42 ; SSE41-NEXT: pxor %xmm1, %xmm1
43 ; SSE41-NEXT: pshufb %xmm1, %xmm0
46 ; AVX1-LABEL: arg_i8_v16i8_undef:
48 ; AVX1-NEXT: vmovd %edi, %xmm0
49 ; AVX1-NEXT: vpxor %xmm1, %xmm1, %xmm1
50 ; AVX1-NEXT: vpshufb %xmm1, %xmm0, %xmm0
53 ; AVX2-LABEL: arg_i8_v16i8_undef:
55 ; AVX2-NEXT: vmovd %edi, %xmm0
56 ; AVX2-NEXT: vpbroadcastb %xmm0, %xmm0
59 ; AVX512F-LABEL: arg_i8_v16i8_undef:
61 ; AVX512F-NEXT: vmovd %edi, %xmm0
62 ; AVX512F-NEXT: vpbroadcastb %xmm0, %xmm0
65 ; AVX512BW-LABEL: arg_i8_v16i8_undef:
67 ; AVX512BW-NEXT: vpbroadcastb %edi, %xmm0
70 ; X86AVX2-LABEL: arg_i8_v16i8_undef:
72 ; X86AVX2-NEXT: vpbroadcastb {{[0-9]+}}(%esp), %xmm0
74 %ins = insertelement <16 x i8> undef, i8 %x, i32 %y
78 define <8 x i16> @arg_i16_v8i16_undef(i16 %x, i32 %y) nounwind {
79 ; SSE-LABEL: arg_i16_v8i16_undef:
81 ; SSE-NEXT: movd %edi, %xmm0
82 ; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
83 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
86 ; AVX1-LABEL: arg_i16_v8i16_undef:
88 ; AVX1-NEXT: vmovd %edi, %xmm0
89 ; AVX1-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
90 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
93 ; AVX2-LABEL: arg_i16_v8i16_undef:
95 ; AVX2-NEXT: vmovd %edi, %xmm0
96 ; AVX2-NEXT: vpbroadcastw %xmm0, %xmm0
99 ; AVX512F-LABEL: arg_i16_v8i16_undef:
101 ; AVX512F-NEXT: vmovd %edi, %xmm0
102 ; AVX512F-NEXT: vpbroadcastw %xmm0, %xmm0
105 ; AVX512BW-LABEL: arg_i16_v8i16_undef:
107 ; AVX512BW-NEXT: vpbroadcastw %edi, %xmm0
108 ; AVX512BW-NEXT: retq
110 ; X86AVX2-LABEL: arg_i16_v8i16_undef:
112 ; X86AVX2-NEXT: vpbroadcastw {{[0-9]+}}(%esp), %xmm0
114 %ins = insertelement <8 x i16> undef, i16 %x, i32 %y
118 define <4 x i32> @arg_i32_v4i32_undef(i32 %x, i32 %y) nounwind {
119 ; SSE-LABEL: arg_i32_v4i32_undef:
121 ; SSE-NEXT: movd %edi, %xmm0
122 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
125 ; AVX1-LABEL: arg_i32_v4i32_undef:
127 ; AVX1-NEXT: vmovd %edi, %xmm0
128 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
131 ; AVX2-LABEL: arg_i32_v4i32_undef:
133 ; AVX2-NEXT: vmovd %edi, %xmm0
134 ; AVX2-NEXT: vpbroadcastd %xmm0, %xmm0
137 ; AVX512-LABEL: arg_i32_v4i32_undef:
139 ; AVX512-NEXT: vpbroadcastd %edi, %xmm0
142 ; X86AVX2-LABEL: arg_i32_v4i32_undef:
144 ; X86AVX2-NEXT: vbroadcastss {{[0-9]+}}(%esp), %xmm0
146 %ins = insertelement <4 x i32> undef, i32 %x, i32 %y
150 define <2 x i64> @arg_i64_v2i64_undef(i64 %x, i32 %y) nounwind {
151 ; SSE-LABEL: arg_i64_v2i64_undef:
153 ; SSE-NEXT: movq %rdi, %xmm0
154 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,1,0,1]
157 ; AVX1-LABEL: arg_i64_v2i64_undef:
159 ; AVX1-NEXT: vmovq %rdi, %xmm0
160 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,1,0,1]
163 ; AVX2-LABEL: arg_i64_v2i64_undef:
165 ; AVX2-NEXT: vmovq %rdi, %xmm0
166 ; AVX2-NEXT: vpbroadcastq %xmm0, %xmm0
169 ; AVX512-LABEL: arg_i64_v2i64_undef:
171 ; AVX512-NEXT: vpbroadcastq %rdi, %xmm0
174 ; X86AVX2-LABEL: arg_i64_v2i64_undef:
176 ; X86AVX2-NEXT: vmovddup {{.*#+}} xmm0 = mem[0,0]
178 %ins = insertelement <2 x i64> undef, i64 %x, i32 %y
182 define <4 x float> @arg_f32_v4f32_undef(float %x, i32 %y) nounwind {
183 ; SSE-LABEL: arg_f32_v4f32_undef:
185 ; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,0,0,0]
188 ; AVX1-LABEL: arg_f32_v4f32_undef:
190 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,0,0,0]
193 ; AVX2-LABEL: arg_f32_v4f32_undef:
195 ; AVX2-NEXT: vbroadcastss %xmm0, %xmm0
198 ; AVX512-LABEL: arg_f32_v4f32_undef:
200 ; AVX512-NEXT: vbroadcastss %xmm0, %xmm0
203 ; X86AVX2-LABEL: arg_f32_v4f32_undef:
205 ; X86AVX2-NEXT: vbroadcastss {{[0-9]+}}(%esp), %xmm0
207 %ins = insertelement <4 x float> undef, float %x, i32 %y
211 define <2 x double> @arg_f64_v2f64_undef(double %x, i32 %y) nounwind {
212 ; SSE2-LABEL: arg_f64_v2f64_undef:
214 ; SSE2-NEXT: movlhps {{.*#+}} xmm0 = xmm0[0,0]
217 ; SSE41-LABEL: arg_f64_v2f64_undef:
219 ; SSE41-NEXT: movddup {{.*#+}} xmm0 = xmm0[0,0]
222 ; AVX-LABEL: arg_f64_v2f64_undef:
224 ; AVX-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
227 ; X86AVX2-LABEL: arg_f64_v2f64_undef:
229 ; X86AVX2-NEXT: vmovddup {{.*#+}} xmm0 = mem[0,0]
231 %ins = insertelement <2 x double> undef, double %x, i32 %y
232 ret <2 x double> %ins
235 define <16 x i8> @load_i8_v16i8_undef(ptr %p, i32 %y) nounwind {
236 ; SSE2-LABEL: load_i8_v16i8_undef:
238 ; SSE2-NEXT: movzbl (%rdi), %eax
239 ; SSE2-NEXT: movd %eax, %xmm0
240 ; SSE2-NEXT: punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
241 ; SSE2-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
242 ; SSE2-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
245 ; SSE41-LABEL: load_i8_v16i8_undef:
247 ; SSE41-NEXT: movzbl (%rdi), %eax
248 ; SSE41-NEXT: movd %eax, %xmm0
249 ; SSE41-NEXT: pxor %xmm1, %xmm1
250 ; SSE41-NEXT: pshufb %xmm1, %xmm0
253 ; AVX1-LABEL: load_i8_v16i8_undef:
255 ; AVX1-NEXT: movzbl (%rdi), %eax
256 ; AVX1-NEXT: vmovd %eax, %xmm0
257 ; AVX1-NEXT: vpxor %xmm1, %xmm1, %xmm1
258 ; AVX1-NEXT: vpshufb %xmm1, %xmm0, %xmm0
261 ; AVX2-LABEL: load_i8_v16i8_undef:
263 ; AVX2-NEXT: vpbroadcastb (%rdi), %xmm0
266 ; AVX512-LABEL: load_i8_v16i8_undef:
268 ; AVX512-NEXT: vpbroadcastb (%rdi), %xmm0
271 ; X86AVX2-LABEL: load_i8_v16i8_undef:
273 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
274 ; X86AVX2-NEXT: vpbroadcastb (%eax), %xmm0
277 %ins = insertelement <16 x i8> undef, i8 %x, i32 %y
281 define <8 x i16> @load_i16_v8i16_undef(ptr %p, i32 %y) nounwind {
282 ; SSE-LABEL: load_i16_v8i16_undef:
284 ; SSE-NEXT: movzwl (%rdi), %eax
285 ; SSE-NEXT: movd %eax, %xmm0
286 ; SSE-NEXT: pshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
287 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
290 ; AVX1-LABEL: load_i16_v8i16_undef:
292 ; AVX1-NEXT: movzwl (%rdi), %eax
293 ; AVX1-NEXT: vmovd %eax, %xmm0
294 ; AVX1-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
295 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
298 ; AVX2-LABEL: load_i16_v8i16_undef:
300 ; AVX2-NEXT: vpbroadcastw (%rdi), %xmm0
303 ; AVX512-LABEL: load_i16_v8i16_undef:
305 ; AVX512-NEXT: vpbroadcastw (%rdi), %xmm0
308 ; X86AVX2-LABEL: load_i16_v8i16_undef:
310 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
311 ; X86AVX2-NEXT: vpbroadcastw (%eax), %xmm0
313 %x = load i16, ptr %p
314 %ins = insertelement <8 x i16> undef, i16 %x, i32 %y
318 define <4 x i32> @load_i32_v4i32_undef(ptr %p, i32 %y) nounwind {
319 ; SSE-LABEL: load_i32_v4i32_undef:
321 ; SSE-NEXT: movd {{.*#+}} xmm0 = mem[0],zero,zero,zero
322 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
325 ; AVX-LABEL: load_i32_v4i32_undef:
327 ; AVX-NEXT: vbroadcastss (%rdi), %xmm0
330 ; X86AVX2-LABEL: load_i32_v4i32_undef:
332 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
333 ; X86AVX2-NEXT: vbroadcastss (%eax), %xmm0
335 %x = load i32, ptr %p
336 %ins = insertelement <4 x i32> undef, i32 %x, i32 %y
340 define <2 x i64> @load_i64_v2i64_undef(ptr %p, i32 %y) nounwind {
341 ; SSE-LABEL: load_i64_v2i64_undef:
343 ; SSE-NEXT: movq {{.*#+}} xmm0 = mem[0],zero
344 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,1,0,1]
347 ; AVX-LABEL: load_i64_v2i64_undef:
349 ; AVX-NEXT: vmovddup {{.*#+}} xmm0 = mem[0,0]
352 ; X86AVX2-LABEL: load_i64_v2i64_undef:
354 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
355 ; X86AVX2-NEXT: vmovddup {{.*#+}} xmm0 = mem[0,0]
357 %x = load i64, ptr %p
358 %ins = insertelement <2 x i64> undef, i64 %x, i32 %y
362 define <4 x float> @load_f32_v4f32_undef(ptr %p, i32 %y) nounwind {
363 ; SSE-LABEL: load_f32_v4f32_undef:
365 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
366 ; SSE-NEXT: shufps {{.*#+}} xmm0 = xmm0[0,0,0,0]
369 ; AVX-LABEL: load_f32_v4f32_undef:
371 ; AVX-NEXT: vbroadcastss (%rdi), %xmm0
374 ; X86AVX2-LABEL: load_f32_v4f32_undef:
376 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
377 ; X86AVX2-NEXT: vbroadcastss (%eax), %xmm0
379 %x = load float, ptr %p
380 %ins = insertelement <4 x float> undef, float %x, i32 %y
384 define <2 x double> @load_f64_v2f64_undef(ptr %p, i32 %y) nounwind {
385 ; SSE2-LABEL: load_f64_v2f64_undef:
387 ; SSE2-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
388 ; SSE2-NEXT: movlhps {{.*#+}} xmm0 = xmm0[0,0]
391 ; SSE41-LABEL: load_f64_v2f64_undef:
393 ; SSE41-NEXT: movddup {{.*#+}} xmm0 = mem[0,0]
396 ; AVX-LABEL: load_f64_v2f64_undef:
398 ; AVX-NEXT: vmovddup {{.*#+}} xmm0 = mem[0,0]
401 ; X86AVX2-LABEL: load_f64_v2f64_undef:
403 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
404 ; X86AVX2-NEXT: vmovddup {{.*#+}} xmm0 = mem[0,0]
406 %x = load double, ptr %p
407 %ins = insertelement <2 x double> undef, double %x, i32 %y
408 ret <2 x double> %ins
411 define <32 x i8> @arg_i8_v32i8_undef(i8 %x, i32 %y) nounwind {
412 ; SSE-LABEL: arg_i8_v32i8_undef:
414 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
415 ; SSE-NEXT: andl $31, %esi
416 ; SSE-NEXT: movb %dil, -40(%rsp,%rsi)
417 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
418 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
421 ; AVX1-LABEL: arg_i8_v32i8_undef:
423 ; AVX1-NEXT: vmovd %edi, %xmm0
424 ; AVX1-NEXT: vpxor %xmm1, %xmm1, %xmm1
425 ; AVX1-NEXT: vpshufb %xmm1, %xmm0, %xmm0
426 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
429 ; AVX2-LABEL: arg_i8_v32i8_undef:
431 ; AVX2-NEXT: vmovd %edi, %xmm0
432 ; AVX2-NEXT: vpbroadcastb %xmm0, %ymm0
435 ; AVX512F-LABEL: arg_i8_v32i8_undef:
437 ; AVX512F-NEXT: vmovd %edi, %xmm0
438 ; AVX512F-NEXT: vpbroadcastb %xmm0, %ymm0
441 ; AVX512BW-LABEL: arg_i8_v32i8_undef:
443 ; AVX512BW-NEXT: vpbroadcastb %edi, %ymm0
444 ; AVX512BW-NEXT: retq
446 ; X86AVX2-LABEL: arg_i8_v32i8_undef:
448 ; X86AVX2-NEXT: vpbroadcastb {{[0-9]+}}(%esp), %ymm0
450 %ins = insertelement <32 x i8> undef, i8 %x, i32 %y
454 define <16 x i16> @arg_i16_v16i16_undef(i16 %x, i32 %y) nounwind {
455 ; SSE-LABEL: arg_i16_v16i16_undef:
457 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
458 ; SSE-NEXT: andl $15, %esi
459 ; SSE-NEXT: movw %di, -40(%rsp,%rsi,2)
460 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
461 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
464 ; AVX1-LABEL: arg_i16_v16i16_undef:
466 ; AVX1-NEXT: vmovd %edi, %xmm0
467 ; AVX1-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
468 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
469 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
472 ; AVX2-LABEL: arg_i16_v16i16_undef:
474 ; AVX2-NEXT: vmovd %edi, %xmm0
475 ; AVX2-NEXT: vpbroadcastw %xmm0, %ymm0
478 ; AVX512F-LABEL: arg_i16_v16i16_undef:
480 ; AVX512F-NEXT: vmovd %edi, %xmm0
481 ; AVX512F-NEXT: vpbroadcastw %xmm0, %ymm0
484 ; AVX512BW-LABEL: arg_i16_v16i16_undef:
486 ; AVX512BW-NEXT: vpbroadcastw %edi, %ymm0
487 ; AVX512BW-NEXT: retq
489 ; X86AVX2-LABEL: arg_i16_v16i16_undef:
491 ; X86AVX2-NEXT: vpbroadcastw {{[0-9]+}}(%esp), %ymm0
493 %ins = insertelement <16 x i16> undef, i16 %x, i32 %y
497 define <8 x i32> @arg_i32_v8i32_undef(i32 %x, i32 %y) nounwind {
498 ; SSE-LABEL: arg_i32_v8i32_undef:
500 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
501 ; SSE-NEXT: andl $7, %esi
502 ; SSE-NEXT: movl %edi, -40(%rsp,%rsi,4)
503 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
504 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
507 ; AVX1-LABEL: arg_i32_v8i32_undef:
509 ; AVX1-NEXT: vmovd %edi, %xmm0
510 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
511 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
514 ; AVX2-LABEL: arg_i32_v8i32_undef:
516 ; AVX2-NEXT: vmovd %edi, %xmm0
517 ; AVX2-NEXT: vpbroadcastd %xmm0, %ymm0
520 ; AVX512-LABEL: arg_i32_v8i32_undef:
522 ; AVX512-NEXT: vpbroadcastd %edi, %ymm0
525 ; X86AVX2-LABEL: arg_i32_v8i32_undef:
527 ; X86AVX2-NEXT: vbroadcastss {{[0-9]+}}(%esp), %ymm0
529 %ins = insertelement <8 x i32> undef, i32 %x, i32 %y
533 define <4 x i64> @arg_i64_v4i64_undef(i64 %x, i32 %y) nounwind {
534 ; SSE-LABEL: arg_i64_v4i64_undef:
536 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
537 ; SSE-NEXT: andl $3, %esi
538 ; SSE-NEXT: movq %rdi, -40(%rsp,%rsi,8)
539 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
540 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
543 ; AVX1-LABEL: arg_i64_v4i64_undef:
545 ; AVX1-NEXT: vmovq %rdi, %xmm0
546 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,1,0,1]
547 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
550 ; AVX2-LABEL: arg_i64_v4i64_undef:
552 ; AVX2-NEXT: vmovq %rdi, %xmm0
553 ; AVX2-NEXT: vpbroadcastq %xmm0, %ymm0
556 ; AVX512-LABEL: arg_i64_v4i64_undef:
558 ; AVX512-NEXT: vpbroadcastq %rdi, %ymm0
561 ; X86AVX2-LABEL: arg_i64_v4i64_undef:
563 ; X86AVX2-NEXT: vbroadcastsd {{[0-9]+}}(%esp), %ymm0
565 %ins = insertelement <4 x i64> undef, i64 %x, i32 %y
569 define <8 x float> @arg_f32_v8f32_undef(float %x, i32 %y) nounwind {
570 ; SSE-LABEL: arg_f32_v8f32_undef:
572 ; SSE-NEXT: # kill: def $edi killed $edi def $rdi
573 ; SSE-NEXT: andl $7, %edi
574 ; SSE-NEXT: movss %xmm0, -40(%rsp,%rdi,4)
575 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
576 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
579 ; AVX1-LABEL: arg_f32_v8f32_undef:
581 ; AVX1-NEXT: vshufps {{.*#+}} xmm0 = xmm0[0,0,0,0]
582 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
585 ; AVX2-LABEL: arg_f32_v8f32_undef:
587 ; AVX2-NEXT: vbroadcastss %xmm0, %ymm0
590 ; AVX512-LABEL: arg_f32_v8f32_undef:
592 ; AVX512-NEXT: vbroadcastss %xmm0, %ymm0
595 ; X86AVX2-LABEL: arg_f32_v8f32_undef:
597 ; X86AVX2-NEXT: vbroadcastss {{[0-9]+}}(%esp), %ymm0
599 %ins = insertelement <8 x float> undef, float %x, i32 %y
603 define <4 x double> @arg_f64_v4f64_undef(double %x, i32 %y) nounwind {
604 ; SSE-LABEL: arg_f64_v4f64_undef:
606 ; SSE-NEXT: # kill: def $edi killed $edi def $rdi
607 ; SSE-NEXT: andl $3, %edi
608 ; SSE-NEXT: movsd %xmm0, -40(%rsp,%rdi,8)
609 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
610 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
613 ; AVX1-LABEL: arg_f64_v4f64_undef:
615 ; AVX1-NEXT: vmovddup {{.*#+}} xmm0 = xmm0[0,0]
616 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
619 ; AVX2-LABEL: arg_f64_v4f64_undef:
621 ; AVX2-NEXT: vbroadcastsd %xmm0, %ymm0
624 ; AVX512-LABEL: arg_f64_v4f64_undef:
626 ; AVX512-NEXT: vbroadcastsd %xmm0, %ymm0
629 ; X86AVX2-LABEL: arg_f64_v4f64_undef:
631 ; X86AVX2-NEXT: vbroadcastsd {{[0-9]+}}(%esp), %ymm0
633 %ins = insertelement <4 x double> undef, double %x, i32 %y
634 ret <4 x double> %ins
637 define <32 x i8> @load_i8_v32i8_undef(ptr %p, i32 %y) nounwind {
638 ; SSE-LABEL: load_i8_v32i8_undef:
640 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
641 ; SSE-NEXT: movzbl (%rdi), %eax
642 ; SSE-NEXT: andl $31, %esi
643 ; SSE-NEXT: movb %al, -40(%rsp,%rsi)
644 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
645 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
648 ; AVX1-LABEL: load_i8_v32i8_undef:
650 ; AVX1-NEXT: movzbl (%rdi), %eax
651 ; AVX1-NEXT: vmovd %eax, %xmm0
652 ; AVX1-NEXT: vpxor %xmm1, %xmm1, %xmm1
653 ; AVX1-NEXT: vpshufb %xmm1, %xmm0, %xmm0
654 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
657 ; AVX2-LABEL: load_i8_v32i8_undef:
659 ; AVX2-NEXT: vpbroadcastb (%rdi), %ymm0
662 ; AVX512-LABEL: load_i8_v32i8_undef:
664 ; AVX512-NEXT: vpbroadcastb (%rdi), %ymm0
667 ; X86AVX2-LABEL: load_i8_v32i8_undef:
669 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
670 ; X86AVX2-NEXT: vpbroadcastb (%eax), %ymm0
673 %ins = insertelement <32 x i8> undef, i8 %x, i32 %y
677 define <16 x i16> @load_i16_v16i16_undef(ptr %p, i32 %y) nounwind {
678 ; SSE-LABEL: load_i16_v16i16_undef:
680 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
681 ; SSE-NEXT: movzwl (%rdi), %eax
682 ; SSE-NEXT: andl $15, %esi
683 ; SSE-NEXT: movw %ax, -40(%rsp,%rsi,2)
684 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
685 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
688 ; AVX1-LABEL: load_i16_v16i16_undef:
690 ; AVX1-NEXT: movzwl (%rdi), %eax
691 ; AVX1-NEXT: vmovd %eax, %xmm0
692 ; AVX1-NEXT: vpshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
693 ; AVX1-NEXT: vpshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
694 ; AVX1-NEXT: vinsertf128 $1, %xmm0, %ymm0, %ymm0
697 ; AVX2-LABEL: load_i16_v16i16_undef:
699 ; AVX2-NEXT: vpbroadcastw (%rdi), %ymm0
702 ; AVX512-LABEL: load_i16_v16i16_undef:
704 ; AVX512-NEXT: vpbroadcastw (%rdi), %ymm0
707 ; X86AVX2-LABEL: load_i16_v16i16_undef:
709 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
710 ; X86AVX2-NEXT: vpbroadcastw (%eax), %ymm0
712 %x = load i16, ptr %p
713 %ins = insertelement <16 x i16> undef, i16 %x, i32 %y
717 define <8 x i32> @load_i32_v8i32_undef(ptr %p, i32 %y) nounwind {
718 ; SSE-LABEL: load_i32_v8i32_undef:
720 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
721 ; SSE-NEXT: movl (%rdi), %eax
722 ; SSE-NEXT: andl $7, %esi
723 ; SSE-NEXT: movl %eax, -40(%rsp,%rsi,4)
724 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
725 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
728 ; AVX-LABEL: load_i32_v8i32_undef:
730 ; AVX-NEXT: vbroadcastss (%rdi), %ymm0
733 ; X86AVX2-LABEL: load_i32_v8i32_undef:
735 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
736 ; X86AVX2-NEXT: vbroadcastss (%eax), %ymm0
738 %x = load i32, ptr %p
739 %ins = insertelement <8 x i32> undef, i32 %x, i32 %y
743 define <4 x i64> @load_i64_v4i64_undef(ptr %p, i32 %y) nounwind {
744 ; SSE-LABEL: load_i64_v4i64_undef:
746 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
747 ; SSE-NEXT: movq (%rdi), %rax
748 ; SSE-NEXT: andl $3, %esi
749 ; SSE-NEXT: movq %rax, -40(%rsp,%rsi,8)
750 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
751 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
754 ; AVX-LABEL: load_i64_v4i64_undef:
756 ; AVX-NEXT: vbroadcastsd (%rdi), %ymm0
759 ; X86AVX2-LABEL: load_i64_v4i64_undef:
761 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
762 ; X86AVX2-NEXT: vbroadcastsd (%eax), %ymm0
764 %x = load i64, ptr %p
765 %ins = insertelement <4 x i64> undef, i64 %x, i32 %y
769 define <8 x float> @load_f32_v8f32_undef(ptr %p, i32 %y) nounwind {
770 ; SSE-LABEL: load_f32_v8f32_undef:
772 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
773 ; SSE-NEXT: movss {{.*#+}} xmm0 = mem[0],zero,zero,zero
774 ; SSE-NEXT: andl $7, %esi
775 ; SSE-NEXT: movss %xmm0, -40(%rsp,%rsi,4)
776 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
777 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
780 ; AVX-LABEL: load_f32_v8f32_undef:
782 ; AVX-NEXT: vbroadcastss (%rdi), %ymm0
785 ; X86AVX2-LABEL: load_f32_v8f32_undef:
787 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
788 ; X86AVX2-NEXT: vbroadcastss (%eax), %ymm0
790 %x = load float, ptr %p
791 %ins = insertelement <8 x float> undef, float %x, i32 %y
795 define <4 x double> @load_f64_v4f64_undef(ptr %p, i32 %y) nounwind {
796 ; SSE-LABEL: load_f64_v4f64_undef:
798 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
799 ; SSE-NEXT: movsd {{.*#+}} xmm0 = mem[0],zero
800 ; SSE-NEXT: andl $3, %esi
801 ; SSE-NEXT: movsd %xmm0, -40(%rsp,%rsi,8)
802 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
803 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
806 ; AVX-LABEL: load_f64_v4f64_undef:
808 ; AVX-NEXT: vbroadcastsd (%rdi), %ymm0
811 ; X86AVX2-LABEL: load_f64_v4f64_undef:
813 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
814 ; X86AVX2-NEXT: vbroadcastsd (%eax), %ymm0
816 %x = load double, ptr %p
817 %ins = insertelement <4 x double> undef, double %x, i32 %y
818 ret <4 x double> %ins
822 ; Insertion into arg vectors
825 define <16 x i8> @arg_i8_v16i8(<16 x i8> %v, i8 %x, i32 %y) nounwind {
826 ; SSE-LABEL: arg_i8_v16i8:
828 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
829 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
830 ; SSE-NEXT: andl $15, %esi
831 ; SSE-NEXT: movb %dil, -24(%rsp,%rsi)
832 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
835 ; AVX1OR2-LABEL: arg_i8_v16i8:
837 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
838 ; AVX1OR2-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
839 ; AVX1OR2-NEXT: andl $15, %esi
840 ; AVX1OR2-NEXT: movb %dil, -24(%rsp,%rsi)
841 ; AVX1OR2-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
844 ; AVX512F-LABEL: arg_i8_v16i8:
846 ; AVX512F-NEXT: # kill: def $esi killed $esi def $rsi
847 ; AVX512F-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
848 ; AVX512F-NEXT: andl $15, %esi
849 ; AVX512F-NEXT: movb %dil, -24(%rsp,%rsi)
850 ; AVX512F-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
853 ; AVX512BW-LABEL: arg_i8_v16i8:
855 ; AVX512BW-NEXT: vpbroadcastb %esi, %xmm1
856 ; AVX512BW-NEXT: vpcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
857 ; AVX512BW-NEXT: vpbroadcastb %edi, %xmm0 {%k1}
858 ; AVX512BW-NEXT: retq
860 ; X86AVX2-LABEL: arg_i8_v16i8:
862 ; X86AVX2-NEXT: pushl %ebp
863 ; X86AVX2-NEXT: movl %esp, %ebp
864 ; X86AVX2-NEXT: andl $-16, %esp
865 ; X86AVX2-NEXT: subl $32, %esp
866 ; X86AVX2-NEXT: movl 12(%ebp), %eax
867 ; X86AVX2-NEXT: andl $15, %eax
868 ; X86AVX2-NEXT: movzbl 8(%ebp), %ecx
869 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
870 ; X86AVX2-NEXT: movb %cl, (%esp,%eax)
871 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
872 ; X86AVX2-NEXT: movl %ebp, %esp
873 ; X86AVX2-NEXT: popl %ebp
875 %ins = insertelement <16 x i8> %v, i8 %x, i32 %y
879 define <8 x i16> @arg_i16_v8i16(<8 x i16> %v, i16 %x, i32 %y) nounwind {
880 ; SSE-LABEL: arg_i16_v8i16:
882 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
883 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
884 ; SSE-NEXT: andl $7, %esi
885 ; SSE-NEXT: movw %di, -24(%rsp,%rsi,2)
886 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
889 ; AVX1OR2-LABEL: arg_i16_v8i16:
891 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
892 ; AVX1OR2-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
893 ; AVX1OR2-NEXT: andl $7, %esi
894 ; AVX1OR2-NEXT: movw %di, -24(%rsp,%rsi,2)
895 ; AVX1OR2-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
898 ; AVX512F-LABEL: arg_i16_v8i16:
900 ; AVX512F-NEXT: # kill: def $esi killed $esi def $rsi
901 ; AVX512F-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
902 ; AVX512F-NEXT: andl $7, %esi
903 ; AVX512F-NEXT: movw %di, -24(%rsp,%rsi,2)
904 ; AVX512F-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
907 ; AVX512BW-LABEL: arg_i16_v8i16:
909 ; AVX512BW-NEXT: vpbroadcastw %esi, %xmm1
910 ; AVX512BW-NEXT: vpcmpeqw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
911 ; AVX512BW-NEXT: vpbroadcastw %edi, %xmm0 {%k1}
912 ; AVX512BW-NEXT: retq
914 ; X86AVX2-LABEL: arg_i16_v8i16:
916 ; X86AVX2-NEXT: pushl %ebp
917 ; X86AVX2-NEXT: movl %esp, %ebp
918 ; X86AVX2-NEXT: andl $-16, %esp
919 ; X86AVX2-NEXT: subl $32, %esp
920 ; X86AVX2-NEXT: movl 12(%ebp), %eax
921 ; X86AVX2-NEXT: andl $7, %eax
922 ; X86AVX2-NEXT: movzwl 8(%ebp), %ecx
923 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
924 ; X86AVX2-NEXT: movw %cx, (%esp,%eax,2)
925 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
926 ; X86AVX2-NEXT: movl %ebp, %esp
927 ; X86AVX2-NEXT: popl %ebp
929 %ins = insertelement <8 x i16> %v, i16 %x, i32 %y
933 define <4 x i32> @arg_i32_v4i32(<4 x i32> %v, i32 %x, i32 %y) nounwind {
934 ; SSE-LABEL: arg_i32_v4i32:
936 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
937 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
938 ; SSE-NEXT: andl $3, %esi
939 ; SSE-NEXT: movl %edi, -24(%rsp,%rsi,4)
940 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
943 ; AVX1OR2-LABEL: arg_i32_v4i32:
945 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
946 ; AVX1OR2-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
947 ; AVX1OR2-NEXT: andl $3, %esi
948 ; AVX1OR2-NEXT: movl %edi, -24(%rsp,%rsi,4)
949 ; AVX1OR2-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
952 ; AVX512-LABEL: arg_i32_v4i32:
954 ; AVX512-NEXT: vpbroadcastd %esi, %xmm1
955 ; AVX512-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
956 ; AVX512-NEXT: vpbroadcastd %edi, %xmm0 {%k1}
959 ; X86AVX2-LABEL: arg_i32_v4i32:
961 ; X86AVX2-NEXT: pushl %ebp
962 ; X86AVX2-NEXT: movl %esp, %ebp
963 ; X86AVX2-NEXT: andl $-16, %esp
964 ; X86AVX2-NEXT: subl $32, %esp
965 ; X86AVX2-NEXT: movl 12(%ebp), %eax
966 ; X86AVX2-NEXT: andl $3, %eax
967 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
968 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
969 ; X86AVX2-NEXT: movl %ecx, (%esp,%eax,4)
970 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
971 ; X86AVX2-NEXT: movl %ebp, %esp
972 ; X86AVX2-NEXT: popl %ebp
974 %ins = insertelement <4 x i32> %v, i32 %x, i32 %y
978 define <2 x i64> @arg_i64_v2i64(<2 x i64> %v, i64 %x, i32 %y) nounwind {
979 ; SSE-LABEL: arg_i64_v2i64:
981 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
982 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
983 ; SSE-NEXT: andl $1, %esi
984 ; SSE-NEXT: movq %rdi, -24(%rsp,%rsi,8)
985 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
988 ; AVX1OR2-LABEL: arg_i64_v2i64:
990 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
991 ; AVX1OR2-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
992 ; AVX1OR2-NEXT: andl $1, %esi
993 ; AVX1OR2-NEXT: movq %rdi, -24(%rsp,%rsi,8)
994 ; AVX1OR2-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
997 ; AVX512-LABEL: arg_i64_v2i64:
999 ; AVX512-NEXT: movl %esi, %eax
1000 ; AVX512-NEXT: vpbroadcastq %rax, %xmm1
1001 ; AVX512-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
1002 ; AVX512-NEXT: vpbroadcastq %rdi, %xmm0 {%k1}
1005 ; X86AVX2-LABEL: arg_i64_v2i64:
1007 ; X86AVX2-NEXT: pushl %ebp
1008 ; X86AVX2-NEXT: movl %esp, %ebp
1009 ; X86AVX2-NEXT: pushl %esi
1010 ; X86AVX2-NEXT: andl $-16, %esp
1011 ; X86AVX2-NEXT: subl $48, %esp
1012 ; X86AVX2-NEXT: movl 8(%ebp), %eax
1013 ; X86AVX2-NEXT: movl 12(%ebp), %ecx
1014 ; X86AVX2-NEXT: movl 16(%ebp), %edx
1015 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
1016 ; X86AVX2-NEXT: leal (%edx,%edx), %esi
1017 ; X86AVX2-NEXT: andl $3, %esi
1018 ; X86AVX2-NEXT: movl %eax, (%esp,%esi,4)
1019 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
1020 ; X86AVX2-NEXT: vmovaps %xmm0, {{[0-9]+}}(%esp)
1021 ; X86AVX2-NEXT: leal 1(%edx,%edx), %eax
1022 ; X86AVX2-NEXT: andl $3, %eax
1023 ; X86AVX2-NEXT: movl %ecx, 16(%esp,%eax,4)
1024 ; X86AVX2-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0
1025 ; X86AVX2-NEXT: leal -4(%ebp), %esp
1026 ; X86AVX2-NEXT: popl %esi
1027 ; X86AVX2-NEXT: popl %ebp
1028 ; X86AVX2-NEXT: retl
1029 %ins = insertelement <2 x i64> %v, i64 %x, i32 %y
1033 define <4 x float> @arg_f32_v4f32(<4 x float> %v, float %x, i32 %y) nounwind {
1034 ; SSE2-LABEL: arg_f32_v4f32:
1036 ; SSE2-NEXT: # kill: def $edi killed $edi def $rdi
1037 ; SSE2-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1038 ; SSE2-NEXT: andl $3, %edi
1039 ; SSE2-NEXT: movss %xmm1, -24(%rsp,%rdi,4)
1040 ; SSE2-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1043 ; SSE41-LABEL: arg_f32_v4f32:
1045 ; SSE41-NEXT: movaps %xmm0, %xmm2
1046 ; SSE41-NEXT: shufps {{.*#+}} xmm1 = xmm1[0,0,0,0]
1047 ; SSE41-NEXT: movd %edi, %xmm0
1048 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
1049 ; SSE41-NEXT: pcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1050 ; SSE41-NEXT: blendvps %xmm0, %xmm1, %xmm2
1051 ; SSE41-NEXT: movaps %xmm2, %xmm0
1054 ; AVX1-LABEL: arg_f32_v4f32:
1056 ; AVX1-NEXT: vshufps {{.*#+}} xmm1 = xmm1[0,0,0,0]
1057 ; AVX1-NEXT: vmovd %edi, %xmm2
1058 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,0,0,0]
1059 ; AVX1-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1060 ; AVX1-NEXT: vblendvps %xmm2, %xmm1, %xmm0, %xmm0
1063 ; AVX2-LABEL: arg_f32_v4f32:
1065 ; AVX2-NEXT: vbroadcastss %xmm1, %xmm1
1066 ; AVX2-NEXT: vmovd %edi, %xmm2
1067 ; AVX2-NEXT: vpbroadcastd %xmm2, %xmm2
1068 ; AVX2-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1069 ; AVX2-NEXT: vblendvps %xmm2, %xmm1, %xmm0, %xmm0
1072 ; AVX512-LABEL: arg_f32_v4f32:
1074 ; AVX512-NEXT: vpbroadcastd %edi, %xmm2
1075 ; AVX512-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %k1
1076 ; AVX512-NEXT: vbroadcastss %xmm1, %xmm0 {%k1}
1079 ; X86AVX2-LABEL: arg_f32_v4f32:
1081 ; X86AVX2-NEXT: vpbroadcastd {{[0-9]+}}(%esp), %xmm1
1082 ; X86AVX2-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1, %xmm1
1083 ; X86AVX2-NEXT: vbroadcastss {{[0-9]+}}(%esp), %xmm2
1084 ; X86AVX2-NEXT: vblendvps %xmm1, %xmm2, %xmm0, %xmm0
1085 ; X86AVX2-NEXT: retl
1086 %ins = insertelement <4 x float> %v, float %x, i32 %y
1087 ret <4 x float> %ins
1090 define <2 x double> @arg_f64_v2f64(<2 x double> %v, double %x, i32 %y) nounwind {
1091 ; SSE2-LABEL: arg_f64_v2f64:
1093 ; SSE2-NEXT: # kill: def $edi killed $edi def $rdi
1094 ; SSE2-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1095 ; SSE2-NEXT: andl $1, %edi
1096 ; SSE2-NEXT: movsd %xmm1, -24(%rsp,%rdi,8)
1097 ; SSE2-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1100 ; SSE41-LABEL: arg_f64_v2f64:
1102 ; SSE41-NEXT: movapd %xmm0, %xmm2
1103 ; SSE41-NEXT: movddup {{.*#+}} xmm1 = xmm1[0,0]
1104 ; SSE41-NEXT: movd %edi, %xmm0
1105 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,1,0,1]
1106 ; SSE41-NEXT: pcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1107 ; SSE41-NEXT: blendvpd %xmm0, %xmm1, %xmm2
1108 ; SSE41-NEXT: movapd %xmm2, %xmm0
1111 ; AVX1-LABEL: arg_f64_v2f64:
1113 ; AVX1-NEXT: vmovddup {{.*#+}} xmm1 = xmm1[0,0]
1114 ; AVX1-NEXT: vmovd %edi, %xmm2
1115 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,1,0,1]
1116 ; AVX1-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1117 ; AVX1-NEXT: vblendvpd %xmm2, %xmm1, %xmm0, %xmm0
1120 ; AVX2-LABEL: arg_f64_v2f64:
1122 ; AVX2-NEXT: vmovddup {{.*#+}} xmm1 = xmm1[0,0]
1123 ; AVX2-NEXT: movl %edi, %eax
1124 ; AVX2-NEXT: vmovq %rax, %xmm2
1125 ; AVX2-NEXT: vpbroadcastq %xmm2, %xmm2
1126 ; AVX2-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1127 ; AVX2-NEXT: vblendvpd %xmm2, %xmm1, %xmm0, %xmm0
1130 ; AVX512-LABEL: arg_f64_v2f64:
1132 ; AVX512-NEXT: movl %edi, %eax
1133 ; AVX512-NEXT: vpbroadcastq %rax, %xmm2
1134 ; AVX512-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %k1
1135 ; AVX512-NEXT: vmovddup {{.*#+}} xmm0 {%k1} = xmm1[0,0]
1138 ; X86AVX2-LABEL: arg_f64_v2f64:
1140 ; X86AVX2-NEXT: pushl %ebp
1141 ; X86AVX2-NEXT: movl %esp, %ebp
1142 ; X86AVX2-NEXT: andl $-16, %esp
1143 ; X86AVX2-NEXT: subl $32, %esp
1144 ; X86AVX2-NEXT: movl 16(%ebp), %eax
1145 ; X86AVX2-NEXT: andl $1, %eax
1146 ; X86AVX2-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero
1147 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
1148 ; X86AVX2-NEXT: vmovsd %xmm1, (%esp,%eax,8)
1149 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
1150 ; X86AVX2-NEXT: movl %ebp, %esp
1151 ; X86AVX2-NEXT: popl %ebp
1152 ; X86AVX2-NEXT: retl
1153 %ins = insertelement <2 x double> %v, double %x, i32 %y
1154 ret <2 x double> %ins
1157 define <16 x i8> @load_i8_v16i8(<16 x i8> %v, ptr %p, i32 %y) nounwind {
1158 ; SSE-LABEL: load_i8_v16i8:
1160 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1161 ; SSE-NEXT: movzbl (%rdi), %eax
1162 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1163 ; SSE-NEXT: andl $15, %esi
1164 ; SSE-NEXT: movb %al, -24(%rsp,%rsi)
1165 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1168 ; AVX1OR2-LABEL: load_i8_v16i8:
1170 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1171 ; AVX1OR2-NEXT: movzbl (%rdi), %eax
1172 ; AVX1OR2-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
1173 ; AVX1OR2-NEXT: andl $15, %esi
1174 ; AVX1OR2-NEXT: movb %al, -24(%rsp,%rsi)
1175 ; AVX1OR2-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
1176 ; AVX1OR2-NEXT: retq
1178 ; AVX512F-LABEL: load_i8_v16i8:
1180 ; AVX512F-NEXT: # kill: def $esi killed $esi def $rsi
1181 ; AVX512F-NEXT: movzbl (%rdi), %eax
1182 ; AVX512F-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
1183 ; AVX512F-NEXT: andl $15, %esi
1184 ; AVX512F-NEXT: movb %al, -24(%rsp,%rsi)
1185 ; AVX512F-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
1186 ; AVX512F-NEXT: retq
1188 ; AVX512BW-LABEL: load_i8_v16i8:
1189 ; AVX512BW: # %bb.0:
1190 ; AVX512BW-NEXT: vpbroadcastb %esi, %xmm1
1191 ; AVX512BW-NEXT: vpcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
1192 ; AVX512BW-NEXT: vpbroadcastb (%rdi), %xmm0 {%k1}
1193 ; AVX512BW-NEXT: retq
1195 ; X86AVX2-LABEL: load_i8_v16i8:
1197 ; X86AVX2-NEXT: pushl %ebp
1198 ; X86AVX2-NEXT: movl %esp, %ebp
1199 ; X86AVX2-NEXT: andl $-16, %esp
1200 ; X86AVX2-NEXT: subl $32, %esp
1201 ; X86AVX2-NEXT: movl 12(%ebp), %eax
1202 ; X86AVX2-NEXT: andl $15, %eax
1203 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
1204 ; X86AVX2-NEXT: movzbl (%ecx), %ecx
1205 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
1206 ; X86AVX2-NEXT: movb %cl, (%esp,%eax)
1207 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
1208 ; X86AVX2-NEXT: movl %ebp, %esp
1209 ; X86AVX2-NEXT: popl %ebp
1210 ; X86AVX2-NEXT: retl
1211 %x = load i8, ptr %p
1212 %ins = insertelement <16 x i8> %v, i8 %x, i32 %y
1216 define <8 x i16> @load_i16_v8i16(<8 x i16> %v, ptr %p, i32 %y) nounwind {
1217 ; SSE-LABEL: load_i16_v8i16:
1219 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1220 ; SSE-NEXT: movzwl (%rdi), %eax
1221 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1222 ; SSE-NEXT: andl $7, %esi
1223 ; SSE-NEXT: movw %ax, -24(%rsp,%rsi,2)
1224 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1227 ; AVX1OR2-LABEL: load_i16_v8i16:
1229 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1230 ; AVX1OR2-NEXT: movzwl (%rdi), %eax
1231 ; AVX1OR2-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
1232 ; AVX1OR2-NEXT: andl $7, %esi
1233 ; AVX1OR2-NEXT: movw %ax, -24(%rsp,%rsi,2)
1234 ; AVX1OR2-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
1235 ; AVX1OR2-NEXT: retq
1237 ; AVX512F-LABEL: load_i16_v8i16:
1239 ; AVX512F-NEXT: # kill: def $esi killed $esi def $rsi
1240 ; AVX512F-NEXT: movzwl (%rdi), %eax
1241 ; AVX512F-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
1242 ; AVX512F-NEXT: andl $7, %esi
1243 ; AVX512F-NEXT: movw %ax, -24(%rsp,%rsi,2)
1244 ; AVX512F-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
1245 ; AVX512F-NEXT: retq
1247 ; AVX512BW-LABEL: load_i16_v8i16:
1248 ; AVX512BW: # %bb.0:
1249 ; AVX512BW-NEXT: vpbroadcastw %esi, %xmm1
1250 ; AVX512BW-NEXT: vpcmpeqw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
1251 ; AVX512BW-NEXT: vpbroadcastw (%rdi), %xmm0 {%k1}
1252 ; AVX512BW-NEXT: retq
1254 ; X86AVX2-LABEL: load_i16_v8i16:
1256 ; X86AVX2-NEXT: pushl %ebp
1257 ; X86AVX2-NEXT: movl %esp, %ebp
1258 ; X86AVX2-NEXT: andl $-16, %esp
1259 ; X86AVX2-NEXT: subl $32, %esp
1260 ; X86AVX2-NEXT: movl 12(%ebp), %eax
1261 ; X86AVX2-NEXT: andl $7, %eax
1262 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
1263 ; X86AVX2-NEXT: movzwl (%ecx), %ecx
1264 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
1265 ; X86AVX2-NEXT: movw %cx, (%esp,%eax,2)
1266 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
1267 ; X86AVX2-NEXT: movl %ebp, %esp
1268 ; X86AVX2-NEXT: popl %ebp
1269 ; X86AVX2-NEXT: retl
1270 %x = load i16, ptr %p
1271 %ins = insertelement <8 x i16> %v, i16 %x, i32 %y
1275 define <4 x i32> @load_i32_v4i32(<4 x i32> %v, ptr %p, i32 %y) nounwind {
1276 ; SSE-LABEL: load_i32_v4i32:
1278 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1279 ; SSE-NEXT: movl (%rdi), %eax
1280 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1281 ; SSE-NEXT: andl $3, %esi
1282 ; SSE-NEXT: movl %eax, -24(%rsp,%rsi,4)
1283 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1286 ; AVX1OR2-LABEL: load_i32_v4i32:
1288 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1289 ; AVX1OR2-NEXT: movl (%rdi), %eax
1290 ; AVX1OR2-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
1291 ; AVX1OR2-NEXT: andl $3, %esi
1292 ; AVX1OR2-NEXT: movl %eax, -24(%rsp,%rsi,4)
1293 ; AVX1OR2-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
1294 ; AVX1OR2-NEXT: retq
1296 ; AVX512-LABEL: load_i32_v4i32:
1298 ; AVX512-NEXT: vpbroadcastd %esi, %xmm1
1299 ; AVX512-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
1300 ; AVX512-NEXT: vpbroadcastd (%rdi), %xmm0 {%k1}
1303 ; X86AVX2-LABEL: load_i32_v4i32:
1305 ; X86AVX2-NEXT: pushl %ebp
1306 ; X86AVX2-NEXT: movl %esp, %ebp
1307 ; X86AVX2-NEXT: andl $-16, %esp
1308 ; X86AVX2-NEXT: subl $32, %esp
1309 ; X86AVX2-NEXT: movl 12(%ebp), %eax
1310 ; X86AVX2-NEXT: andl $3, %eax
1311 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
1312 ; X86AVX2-NEXT: movl (%ecx), %ecx
1313 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
1314 ; X86AVX2-NEXT: movl %ecx, (%esp,%eax,4)
1315 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
1316 ; X86AVX2-NEXT: movl %ebp, %esp
1317 ; X86AVX2-NEXT: popl %ebp
1318 ; X86AVX2-NEXT: retl
1319 %x = load i32, ptr %p
1320 %ins = insertelement <4 x i32> %v, i32 %x, i32 %y
1324 define <2 x i64> @load_i64_v2i64(<2 x i64> %v, ptr %p, i32 %y) nounwind {
1325 ; SSE-LABEL: load_i64_v2i64:
1327 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1328 ; SSE-NEXT: movq (%rdi), %rax
1329 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1330 ; SSE-NEXT: andl $1, %esi
1331 ; SSE-NEXT: movq %rax, -24(%rsp,%rsi,8)
1332 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1335 ; AVX1OR2-LABEL: load_i64_v2i64:
1337 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1338 ; AVX1OR2-NEXT: movq (%rdi), %rax
1339 ; AVX1OR2-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
1340 ; AVX1OR2-NEXT: andl $1, %esi
1341 ; AVX1OR2-NEXT: movq %rax, -24(%rsp,%rsi,8)
1342 ; AVX1OR2-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
1343 ; AVX1OR2-NEXT: retq
1345 ; AVX512-LABEL: load_i64_v2i64:
1347 ; AVX512-NEXT: movl %esi, %eax
1348 ; AVX512-NEXT: vpbroadcastq %rax, %xmm1
1349 ; AVX512-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
1350 ; AVX512-NEXT: vpbroadcastq (%rdi), %xmm0 {%k1}
1353 ; X86AVX2-LABEL: load_i64_v2i64:
1355 ; X86AVX2-NEXT: pushl %ebp
1356 ; X86AVX2-NEXT: movl %esp, %ebp
1357 ; X86AVX2-NEXT: pushl %esi
1358 ; X86AVX2-NEXT: andl $-16, %esp
1359 ; X86AVX2-NEXT: subl $48, %esp
1360 ; X86AVX2-NEXT: movl 12(%ebp), %eax
1361 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
1362 ; X86AVX2-NEXT: movl (%ecx), %edx
1363 ; X86AVX2-NEXT: movl 4(%ecx), %ecx
1364 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
1365 ; X86AVX2-NEXT: leal (%eax,%eax), %esi
1366 ; X86AVX2-NEXT: andl $3, %esi
1367 ; X86AVX2-NEXT: movl %edx, (%esp,%esi,4)
1368 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
1369 ; X86AVX2-NEXT: vmovaps %xmm0, {{[0-9]+}}(%esp)
1370 ; X86AVX2-NEXT: leal 1(%eax,%eax), %eax
1371 ; X86AVX2-NEXT: andl $3, %eax
1372 ; X86AVX2-NEXT: movl %ecx, 16(%esp,%eax,4)
1373 ; X86AVX2-NEXT: vmovaps {{[0-9]+}}(%esp), %xmm0
1374 ; X86AVX2-NEXT: leal -4(%ebp), %esp
1375 ; X86AVX2-NEXT: popl %esi
1376 ; X86AVX2-NEXT: popl %ebp
1377 ; X86AVX2-NEXT: retl
1378 %x = load i64, ptr %p
1379 %ins = insertelement <2 x i64> %v, i64 %x, i32 %y
1383 define <4 x float> @load_f32_v4f32(<4 x float> %v, ptr %p, i32 %y) nounwind {
1384 ; SSE2-LABEL: load_f32_v4f32:
1386 ; SSE2-NEXT: # kill: def $esi killed $esi def $rsi
1387 ; SSE2-NEXT: movss {{.*#+}} xmm1 = mem[0],zero,zero,zero
1388 ; SSE2-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1389 ; SSE2-NEXT: andl $3, %esi
1390 ; SSE2-NEXT: movss %xmm1, -24(%rsp,%rsi,4)
1391 ; SSE2-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1394 ; SSE41-LABEL: load_f32_v4f32:
1396 ; SSE41-NEXT: movaps %xmm0, %xmm1
1397 ; SSE41-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero
1398 ; SSE41-NEXT: shufps {{.*#+}} xmm2 = xmm2[0,0,0,0]
1399 ; SSE41-NEXT: movd %esi, %xmm0
1400 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,0,0,0]
1401 ; SSE41-NEXT: pcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1402 ; SSE41-NEXT: blendvps %xmm0, %xmm2, %xmm1
1403 ; SSE41-NEXT: movaps %xmm1, %xmm0
1406 ; AVX1-LABEL: load_f32_v4f32:
1408 ; AVX1-NEXT: vbroadcastss (%rdi), %xmm1
1409 ; AVX1-NEXT: vmovd %esi, %xmm2
1410 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,0,0,0]
1411 ; AVX1-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1412 ; AVX1-NEXT: vblendvps %xmm2, %xmm1, %xmm0, %xmm0
1415 ; AVX2-LABEL: load_f32_v4f32:
1417 ; AVX2-NEXT: vbroadcastss (%rdi), %xmm1
1418 ; AVX2-NEXT: vmovd %esi, %xmm2
1419 ; AVX2-NEXT: vpbroadcastd %xmm2, %xmm2
1420 ; AVX2-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1421 ; AVX2-NEXT: vblendvps %xmm2, %xmm1, %xmm0, %xmm0
1424 ; AVX512-LABEL: load_f32_v4f32:
1426 ; AVX512-NEXT: vpbroadcastd %esi, %xmm1
1427 ; AVX512-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
1428 ; AVX512-NEXT: vbroadcastss (%rdi), %xmm0 {%k1}
1431 ; X86AVX2-LABEL: load_f32_v4f32:
1433 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
1434 ; X86AVX2-NEXT: vpbroadcastd {{[0-9]+}}(%esp), %xmm1
1435 ; X86AVX2-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}, %xmm1, %xmm1
1436 ; X86AVX2-NEXT: vbroadcastss (%eax), %xmm2
1437 ; X86AVX2-NEXT: vblendvps %xmm1, %xmm2, %xmm0, %xmm0
1438 ; X86AVX2-NEXT: retl
1439 %x = load float, ptr %p
1440 %ins = insertelement <4 x float> %v, float %x, i32 %y
1441 ret <4 x float> %ins
1444 define <2 x double> @load_f64_v2f64(<2 x double> %v, ptr %p, i32 %y) nounwind {
1445 ; SSE2-LABEL: load_f64_v2f64:
1447 ; SSE2-NEXT: # kill: def $esi killed $esi def $rsi
1448 ; SSE2-NEXT: movsd {{.*#+}} xmm1 = mem[0],zero
1449 ; SSE2-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1450 ; SSE2-NEXT: andl $1, %esi
1451 ; SSE2-NEXT: movsd %xmm1, -24(%rsp,%rsi,8)
1452 ; SSE2-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1455 ; SSE41-LABEL: load_f64_v2f64:
1457 ; SSE41-NEXT: movapd %xmm0, %xmm1
1458 ; SSE41-NEXT: movddup {{.*#+}} xmm2 = mem[0,0]
1459 ; SSE41-NEXT: movd %esi, %xmm0
1460 ; SSE41-NEXT: pshufd {{.*#+}} xmm0 = xmm0[0,1,0,1]
1461 ; SSE41-NEXT: pcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm0
1462 ; SSE41-NEXT: blendvpd %xmm0, %xmm2, %xmm1
1463 ; SSE41-NEXT: movapd %xmm1, %xmm0
1466 ; AVX1-LABEL: load_f64_v2f64:
1468 ; AVX1-NEXT: vmovddup {{.*#+}} xmm1 = mem[0,0]
1469 ; AVX1-NEXT: vmovd %esi, %xmm2
1470 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,1,0,1]
1471 ; AVX1-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1472 ; AVX1-NEXT: vblendvpd %xmm2, %xmm1, %xmm0, %xmm0
1475 ; AVX2-LABEL: load_f64_v2f64:
1477 ; AVX2-NEXT: vmovddup {{.*#+}} xmm1 = mem[0,0]
1478 ; AVX2-NEXT: movl %esi, %eax
1479 ; AVX2-NEXT: vmovq %rax, %xmm2
1480 ; AVX2-NEXT: vpbroadcastq %xmm2, %xmm2
1481 ; AVX2-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm2
1482 ; AVX2-NEXT: vblendvpd %xmm2, %xmm1, %xmm0, %xmm0
1485 ; AVX512-LABEL: load_f64_v2f64:
1487 ; AVX512-NEXT: movl %esi, %eax
1488 ; AVX512-NEXT: vpbroadcastq %rax, %xmm1
1489 ; AVX512-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %k1
1490 ; AVX512-NEXT: vmovddup {{.*#+}} xmm0 {%k1} = mem[0,0]
1493 ; X86AVX2-LABEL: load_f64_v2f64:
1495 ; X86AVX2-NEXT: pushl %ebp
1496 ; X86AVX2-NEXT: movl %esp, %ebp
1497 ; X86AVX2-NEXT: andl $-16, %esp
1498 ; X86AVX2-NEXT: subl $32, %esp
1499 ; X86AVX2-NEXT: movl 12(%ebp), %eax
1500 ; X86AVX2-NEXT: andl $1, %eax
1501 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
1502 ; X86AVX2-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero
1503 ; X86AVX2-NEXT: vmovaps %xmm0, (%esp)
1504 ; X86AVX2-NEXT: vmovsd %xmm1, (%esp,%eax,8)
1505 ; X86AVX2-NEXT: vmovaps (%esp), %xmm0
1506 ; X86AVX2-NEXT: movl %ebp, %esp
1507 ; X86AVX2-NEXT: popl %ebp
1508 ; X86AVX2-NEXT: retl
1509 %x = load double, ptr %p
1510 %ins = insertelement <2 x double> %v, double %x, i32 %y
1511 ret <2 x double> %ins
1514 define <32 x i8> @arg_i8_v32i8(<32 x i8> %v, i8 %x, i32 %y) nounwind {
1515 ; SSE-LABEL: arg_i8_v32i8:
1517 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1518 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
1519 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1520 ; SSE-NEXT: andl $31, %esi
1521 ; SSE-NEXT: movb %dil, -40(%rsp,%rsi)
1522 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1523 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
1526 ; AVX1OR2-LABEL: arg_i8_v32i8:
1528 ; AVX1OR2-NEXT: pushq %rbp
1529 ; AVX1OR2-NEXT: movq %rsp, %rbp
1530 ; AVX1OR2-NEXT: andq $-32, %rsp
1531 ; AVX1OR2-NEXT: subq $64, %rsp
1532 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1533 ; AVX1OR2-NEXT: vmovaps %ymm0, (%rsp)
1534 ; AVX1OR2-NEXT: andl $31, %esi
1535 ; AVX1OR2-NEXT: movb %dil, (%rsp,%rsi)
1536 ; AVX1OR2-NEXT: vmovaps (%rsp), %ymm0
1537 ; AVX1OR2-NEXT: movq %rbp, %rsp
1538 ; AVX1OR2-NEXT: popq %rbp
1539 ; AVX1OR2-NEXT: retq
1541 ; AVX512F-LABEL: arg_i8_v32i8:
1543 ; AVX512F-NEXT: pushq %rbp
1544 ; AVX512F-NEXT: movq %rsp, %rbp
1545 ; AVX512F-NEXT: andq $-32, %rsp
1546 ; AVX512F-NEXT: subq $64, %rsp
1547 ; AVX512F-NEXT: # kill: def $esi killed $esi def $rsi
1548 ; AVX512F-NEXT: vmovaps %ymm0, (%rsp)
1549 ; AVX512F-NEXT: andl $31, %esi
1550 ; AVX512F-NEXT: movb %dil, (%rsp,%rsi)
1551 ; AVX512F-NEXT: vmovaps (%rsp), %ymm0
1552 ; AVX512F-NEXT: movq %rbp, %rsp
1553 ; AVX512F-NEXT: popq %rbp
1554 ; AVX512F-NEXT: retq
1556 ; AVX512BW-LABEL: arg_i8_v32i8:
1557 ; AVX512BW: # %bb.0:
1558 ; AVX512BW-NEXT: vpbroadcastb %esi, %ymm1
1559 ; AVX512BW-NEXT: vpcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
1560 ; AVX512BW-NEXT: vpbroadcastb %edi, %ymm0 {%k1}
1561 ; AVX512BW-NEXT: retq
1563 ; X86AVX2-LABEL: arg_i8_v32i8:
1565 ; X86AVX2-NEXT: pushl %ebp
1566 ; X86AVX2-NEXT: movl %esp, %ebp
1567 ; X86AVX2-NEXT: andl $-32, %esp
1568 ; X86AVX2-NEXT: subl $64, %esp
1569 ; X86AVX2-NEXT: movl 12(%ebp), %eax
1570 ; X86AVX2-NEXT: andl $31, %eax
1571 ; X86AVX2-NEXT: movzbl 8(%ebp), %ecx
1572 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
1573 ; X86AVX2-NEXT: movb %cl, (%esp,%eax)
1574 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
1575 ; X86AVX2-NEXT: movl %ebp, %esp
1576 ; X86AVX2-NEXT: popl %ebp
1577 ; X86AVX2-NEXT: retl
1578 %ins = insertelement <32 x i8> %v, i8 %x, i32 %y
1582 define <16 x i16> @arg_i16_v16i16(<16 x i16> %v, i16 %x, i32 %y) nounwind {
1583 ; SSE-LABEL: arg_i16_v16i16:
1585 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1586 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
1587 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1588 ; SSE-NEXT: andl $15, %esi
1589 ; SSE-NEXT: movw %di, -40(%rsp,%rsi,2)
1590 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1591 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
1594 ; AVX1OR2-LABEL: arg_i16_v16i16:
1596 ; AVX1OR2-NEXT: pushq %rbp
1597 ; AVX1OR2-NEXT: movq %rsp, %rbp
1598 ; AVX1OR2-NEXT: andq $-32, %rsp
1599 ; AVX1OR2-NEXT: subq $64, %rsp
1600 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1601 ; AVX1OR2-NEXT: vmovaps %ymm0, (%rsp)
1602 ; AVX1OR2-NEXT: andl $15, %esi
1603 ; AVX1OR2-NEXT: movw %di, (%rsp,%rsi,2)
1604 ; AVX1OR2-NEXT: vmovaps (%rsp), %ymm0
1605 ; AVX1OR2-NEXT: movq %rbp, %rsp
1606 ; AVX1OR2-NEXT: popq %rbp
1607 ; AVX1OR2-NEXT: retq
1609 ; AVX512F-LABEL: arg_i16_v16i16:
1611 ; AVX512F-NEXT: pushq %rbp
1612 ; AVX512F-NEXT: movq %rsp, %rbp
1613 ; AVX512F-NEXT: andq $-32, %rsp
1614 ; AVX512F-NEXT: subq $64, %rsp
1615 ; AVX512F-NEXT: # kill: def $esi killed $esi def $rsi
1616 ; AVX512F-NEXT: vmovaps %ymm0, (%rsp)
1617 ; AVX512F-NEXT: andl $15, %esi
1618 ; AVX512F-NEXT: movw %di, (%rsp,%rsi,2)
1619 ; AVX512F-NEXT: vmovaps (%rsp), %ymm0
1620 ; AVX512F-NEXT: movq %rbp, %rsp
1621 ; AVX512F-NEXT: popq %rbp
1622 ; AVX512F-NEXT: retq
1624 ; AVX512BW-LABEL: arg_i16_v16i16:
1625 ; AVX512BW: # %bb.0:
1626 ; AVX512BW-NEXT: vpbroadcastw %esi, %ymm1
1627 ; AVX512BW-NEXT: vpcmpeqw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
1628 ; AVX512BW-NEXT: vpbroadcastw %edi, %ymm0 {%k1}
1629 ; AVX512BW-NEXT: retq
1631 ; X86AVX2-LABEL: arg_i16_v16i16:
1633 ; X86AVX2-NEXT: pushl %ebp
1634 ; X86AVX2-NEXT: movl %esp, %ebp
1635 ; X86AVX2-NEXT: andl $-32, %esp
1636 ; X86AVX2-NEXT: subl $64, %esp
1637 ; X86AVX2-NEXT: movl 12(%ebp), %eax
1638 ; X86AVX2-NEXT: andl $15, %eax
1639 ; X86AVX2-NEXT: movzwl 8(%ebp), %ecx
1640 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
1641 ; X86AVX2-NEXT: movw %cx, (%esp,%eax,2)
1642 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
1643 ; X86AVX2-NEXT: movl %ebp, %esp
1644 ; X86AVX2-NEXT: popl %ebp
1645 ; X86AVX2-NEXT: retl
1646 %ins = insertelement <16 x i16> %v, i16 %x, i32 %y
1650 define <8 x i32> @arg_i32_v8i32(<8 x i32> %v, i32 %x, i32 %y) nounwind {
1651 ; SSE-LABEL: arg_i32_v8i32:
1653 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1654 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
1655 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1656 ; SSE-NEXT: andl $7, %esi
1657 ; SSE-NEXT: movl %edi, -40(%rsp,%rsi,4)
1658 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1659 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
1662 ; AVX1OR2-LABEL: arg_i32_v8i32:
1664 ; AVX1OR2-NEXT: pushq %rbp
1665 ; AVX1OR2-NEXT: movq %rsp, %rbp
1666 ; AVX1OR2-NEXT: andq $-32, %rsp
1667 ; AVX1OR2-NEXT: subq $64, %rsp
1668 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1669 ; AVX1OR2-NEXT: vmovaps %ymm0, (%rsp)
1670 ; AVX1OR2-NEXT: andl $7, %esi
1671 ; AVX1OR2-NEXT: movl %edi, (%rsp,%rsi,4)
1672 ; AVX1OR2-NEXT: vmovaps (%rsp), %ymm0
1673 ; AVX1OR2-NEXT: movq %rbp, %rsp
1674 ; AVX1OR2-NEXT: popq %rbp
1675 ; AVX1OR2-NEXT: retq
1677 ; AVX512-LABEL: arg_i32_v8i32:
1679 ; AVX512-NEXT: vpbroadcastd %esi, %ymm1
1680 ; AVX512-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
1681 ; AVX512-NEXT: vpbroadcastd %edi, %ymm0 {%k1}
1684 ; X86AVX2-LABEL: arg_i32_v8i32:
1686 ; X86AVX2-NEXT: pushl %ebp
1687 ; X86AVX2-NEXT: movl %esp, %ebp
1688 ; X86AVX2-NEXT: andl $-32, %esp
1689 ; X86AVX2-NEXT: subl $64, %esp
1690 ; X86AVX2-NEXT: movl 12(%ebp), %eax
1691 ; X86AVX2-NEXT: andl $7, %eax
1692 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
1693 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
1694 ; X86AVX2-NEXT: movl %ecx, (%esp,%eax,4)
1695 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
1696 ; X86AVX2-NEXT: movl %ebp, %esp
1697 ; X86AVX2-NEXT: popl %ebp
1698 ; X86AVX2-NEXT: retl
1699 %ins = insertelement <8 x i32> %v, i32 %x, i32 %y
1703 define <4 x i64> @arg_i64_v4i64(<4 x i64> %v, i64 %x, i32 %y) nounwind {
1704 ; SSE-LABEL: arg_i64_v4i64:
1706 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1707 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
1708 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1709 ; SSE-NEXT: andl $3, %esi
1710 ; SSE-NEXT: movq %rdi, -40(%rsp,%rsi,8)
1711 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1712 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
1715 ; AVX1OR2-LABEL: arg_i64_v4i64:
1717 ; AVX1OR2-NEXT: pushq %rbp
1718 ; AVX1OR2-NEXT: movq %rsp, %rbp
1719 ; AVX1OR2-NEXT: andq $-32, %rsp
1720 ; AVX1OR2-NEXT: subq $64, %rsp
1721 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1722 ; AVX1OR2-NEXT: vmovaps %ymm0, (%rsp)
1723 ; AVX1OR2-NEXT: andl $3, %esi
1724 ; AVX1OR2-NEXT: movq %rdi, (%rsp,%rsi,8)
1725 ; AVX1OR2-NEXT: vmovaps (%rsp), %ymm0
1726 ; AVX1OR2-NEXT: movq %rbp, %rsp
1727 ; AVX1OR2-NEXT: popq %rbp
1728 ; AVX1OR2-NEXT: retq
1730 ; AVX512-LABEL: arg_i64_v4i64:
1732 ; AVX512-NEXT: movl %esi, %eax
1733 ; AVX512-NEXT: vpbroadcastq %rax, %ymm1
1734 ; AVX512-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
1735 ; AVX512-NEXT: vpbroadcastq %rdi, %ymm0 {%k1}
1738 ; X86AVX2-LABEL: arg_i64_v4i64:
1740 ; X86AVX2-NEXT: pushl %ebp
1741 ; X86AVX2-NEXT: movl %esp, %ebp
1742 ; X86AVX2-NEXT: pushl %esi
1743 ; X86AVX2-NEXT: andl $-32, %esp
1744 ; X86AVX2-NEXT: subl $96, %esp
1745 ; X86AVX2-NEXT: movl 8(%ebp), %eax
1746 ; X86AVX2-NEXT: movl 12(%ebp), %ecx
1747 ; X86AVX2-NEXT: movl 16(%ebp), %edx
1748 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
1749 ; X86AVX2-NEXT: leal (%edx,%edx), %esi
1750 ; X86AVX2-NEXT: andl $7, %esi
1751 ; X86AVX2-NEXT: movl %eax, (%esp,%esi,4)
1752 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
1753 ; X86AVX2-NEXT: vmovaps %ymm0, {{[0-9]+}}(%esp)
1754 ; X86AVX2-NEXT: leal 1(%edx,%edx), %eax
1755 ; X86AVX2-NEXT: andl $7, %eax
1756 ; X86AVX2-NEXT: movl %ecx, 32(%esp,%eax,4)
1757 ; X86AVX2-NEXT: vmovaps {{[0-9]+}}(%esp), %ymm0
1758 ; X86AVX2-NEXT: leal -4(%ebp), %esp
1759 ; X86AVX2-NEXT: popl %esi
1760 ; X86AVX2-NEXT: popl %ebp
1761 ; X86AVX2-NEXT: retl
1762 %ins = insertelement <4 x i64> %v, i64 %x, i32 %y
1766 define <8 x float> @arg_f32_v8f32(<8 x float> %v, float %x, i32 %y) nounwind {
1767 ; SSE-LABEL: arg_f32_v8f32:
1769 ; SSE-NEXT: # kill: def $edi killed $edi def $rdi
1770 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
1771 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1772 ; SSE-NEXT: andl $7, %edi
1773 ; SSE-NEXT: movss %xmm2, -40(%rsp,%rdi,4)
1774 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1775 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
1778 ; AVX1-LABEL: arg_f32_v8f32:
1780 ; AVX1-NEXT: vshufps {{.*#+}} xmm1 = xmm1[0,0,0,0]
1781 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm1, %ymm1
1782 ; AVX1-NEXT: vmovd %edi, %xmm2
1783 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,0,0,0]
1784 ; AVX1-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm3
1785 ; AVX1-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}+16(%rip), %xmm2, %xmm2
1786 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1787 ; AVX1-NEXT: vblendvps %ymm2, %ymm1, %ymm0, %ymm0
1790 ; AVX2-LABEL: arg_f32_v8f32:
1792 ; AVX2-NEXT: vbroadcastss %xmm1, %ymm1
1793 ; AVX2-NEXT: vmovd %edi, %xmm2
1794 ; AVX2-NEXT: vpbroadcastd %xmm2, %ymm2
1795 ; AVX2-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm2, %ymm2
1796 ; AVX2-NEXT: vblendvps %ymm2, %ymm1, %ymm0, %ymm0
1799 ; AVX512-LABEL: arg_f32_v8f32:
1801 ; AVX512-NEXT: vpbroadcastd %edi, %ymm2
1802 ; AVX512-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm2, %k1
1803 ; AVX512-NEXT: vbroadcastss %xmm1, %ymm0 {%k1}
1806 ; X86AVX2-LABEL: arg_f32_v8f32:
1808 ; X86AVX2-NEXT: vpbroadcastd {{[0-9]+}}(%esp), %ymm1
1809 ; X86AVX2-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1, %ymm1
1810 ; X86AVX2-NEXT: vbroadcastss {{[0-9]+}}(%esp), %ymm2
1811 ; X86AVX2-NEXT: vblendvps %ymm1, %ymm2, %ymm0, %ymm0
1812 ; X86AVX2-NEXT: retl
1813 %ins = insertelement <8 x float> %v, float %x, i32 %y
1814 ret <8 x float> %ins
1817 define <4 x double> @arg_f64_v4f64(<4 x double> %v, double %x, i32 %y) nounwind {
1818 ; SSE-LABEL: arg_f64_v4f64:
1820 ; SSE-NEXT: # kill: def $edi killed $edi def $rdi
1821 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
1822 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1823 ; SSE-NEXT: andl $3, %edi
1824 ; SSE-NEXT: movsd %xmm2, -40(%rsp,%rdi,8)
1825 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1826 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
1829 ; AVX1-LABEL: arg_f64_v4f64:
1831 ; AVX1-NEXT: vmovddup {{.*#+}} xmm1 = xmm1[0,0]
1832 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm1, %ymm1
1833 ; AVX1-NEXT: movl %edi, %eax
1834 ; AVX1-NEXT: vmovq %rax, %xmm2
1835 ; AVX1-NEXT: vpshufd {{.*#+}} xmm2 = xmm2[0,1,0,1]
1836 ; AVX1-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm2, %xmm3
1837 ; AVX1-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}+16(%rip), %xmm2, %xmm2
1838 ; AVX1-NEXT: vinsertf128 $1, %xmm2, %ymm3, %ymm2
1839 ; AVX1-NEXT: vblendvpd %ymm2, %ymm1, %ymm0, %ymm0
1842 ; AVX2-LABEL: arg_f64_v4f64:
1844 ; AVX2-NEXT: vbroadcastsd %xmm1, %ymm1
1845 ; AVX2-NEXT: movl %edi, %eax
1846 ; AVX2-NEXT: vmovq %rax, %xmm2
1847 ; AVX2-NEXT: vpbroadcastq %xmm2, %ymm2
1848 ; AVX2-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm2, %ymm2
1849 ; AVX2-NEXT: vblendvpd %ymm2, %ymm1, %ymm0, %ymm0
1852 ; AVX512-LABEL: arg_f64_v4f64:
1854 ; AVX512-NEXT: movl %edi, %eax
1855 ; AVX512-NEXT: vpbroadcastq %rax, %ymm2
1856 ; AVX512-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm2, %k1
1857 ; AVX512-NEXT: vbroadcastsd %xmm1, %ymm0 {%k1}
1860 ; X86AVX2-LABEL: arg_f64_v4f64:
1862 ; X86AVX2-NEXT: pushl %ebp
1863 ; X86AVX2-NEXT: movl %esp, %ebp
1864 ; X86AVX2-NEXT: andl $-32, %esp
1865 ; X86AVX2-NEXT: subl $64, %esp
1866 ; X86AVX2-NEXT: movl 16(%ebp), %eax
1867 ; X86AVX2-NEXT: andl $3, %eax
1868 ; X86AVX2-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero
1869 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
1870 ; X86AVX2-NEXT: vmovsd %xmm1, (%esp,%eax,8)
1871 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
1872 ; X86AVX2-NEXT: movl %ebp, %esp
1873 ; X86AVX2-NEXT: popl %ebp
1874 ; X86AVX2-NEXT: retl
1875 %ins = insertelement <4 x double> %v, double %x, i32 %y
1876 ret <4 x double> %ins
1879 define <32 x i8> @load_i8_v32i8(<32 x i8> %v, ptr %p, i32 %y) nounwind {
1880 ; SSE-LABEL: load_i8_v32i8:
1882 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1883 ; SSE-NEXT: movzbl (%rdi), %eax
1884 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
1885 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1886 ; SSE-NEXT: andl $31, %esi
1887 ; SSE-NEXT: movb %al, -40(%rsp,%rsi)
1888 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1889 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
1892 ; AVX1OR2-LABEL: load_i8_v32i8:
1894 ; AVX1OR2-NEXT: pushq %rbp
1895 ; AVX1OR2-NEXT: movq %rsp, %rbp
1896 ; AVX1OR2-NEXT: andq $-32, %rsp
1897 ; AVX1OR2-NEXT: subq $64, %rsp
1898 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1899 ; AVX1OR2-NEXT: movzbl (%rdi), %eax
1900 ; AVX1OR2-NEXT: vmovaps %ymm0, (%rsp)
1901 ; AVX1OR2-NEXT: andl $31, %esi
1902 ; AVX1OR2-NEXT: movb %al, (%rsp,%rsi)
1903 ; AVX1OR2-NEXT: vmovaps (%rsp), %ymm0
1904 ; AVX1OR2-NEXT: movq %rbp, %rsp
1905 ; AVX1OR2-NEXT: popq %rbp
1906 ; AVX1OR2-NEXT: retq
1908 ; AVX512F-LABEL: load_i8_v32i8:
1910 ; AVX512F-NEXT: pushq %rbp
1911 ; AVX512F-NEXT: movq %rsp, %rbp
1912 ; AVX512F-NEXT: andq $-32, %rsp
1913 ; AVX512F-NEXT: subq $64, %rsp
1914 ; AVX512F-NEXT: # kill: def $esi killed $esi def $rsi
1915 ; AVX512F-NEXT: movzbl (%rdi), %eax
1916 ; AVX512F-NEXT: vmovaps %ymm0, (%rsp)
1917 ; AVX512F-NEXT: andl $31, %esi
1918 ; AVX512F-NEXT: movb %al, (%rsp,%rsi)
1919 ; AVX512F-NEXT: vmovaps (%rsp), %ymm0
1920 ; AVX512F-NEXT: movq %rbp, %rsp
1921 ; AVX512F-NEXT: popq %rbp
1922 ; AVX512F-NEXT: retq
1924 ; AVX512BW-LABEL: load_i8_v32i8:
1925 ; AVX512BW: # %bb.0:
1926 ; AVX512BW-NEXT: vpbroadcastb %esi, %ymm1
1927 ; AVX512BW-NEXT: vpcmpeqb {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
1928 ; AVX512BW-NEXT: vpbroadcastb (%rdi), %ymm0 {%k1}
1929 ; AVX512BW-NEXT: retq
1931 ; X86AVX2-LABEL: load_i8_v32i8:
1933 ; X86AVX2-NEXT: pushl %ebp
1934 ; X86AVX2-NEXT: movl %esp, %ebp
1935 ; X86AVX2-NEXT: andl $-32, %esp
1936 ; X86AVX2-NEXT: subl $64, %esp
1937 ; X86AVX2-NEXT: movl 12(%ebp), %eax
1938 ; X86AVX2-NEXT: andl $31, %eax
1939 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
1940 ; X86AVX2-NEXT: movzbl (%ecx), %ecx
1941 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
1942 ; X86AVX2-NEXT: movb %cl, (%esp,%eax)
1943 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
1944 ; X86AVX2-NEXT: movl %ebp, %esp
1945 ; X86AVX2-NEXT: popl %ebp
1946 ; X86AVX2-NEXT: retl
1947 %x = load i8, ptr %p
1948 %ins = insertelement <32 x i8> %v, i8 %x, i32 %y
1952 define <16 x i16> @load_i16_v16i16(<16 x i16> %v, ptr %p, i32 %y) nounwind {
1953 ; SSE-LABEL: load_i16_v16i16:
1955 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
1956 ; SSE-NEXT: movzwl (%rdi), %eax
1957 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
1958 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
1959 ; SSE-NEXT: andl $15, %esi
1960 ; SSE-NEXT: movw %ax, -40(%rsp,%rsi,2)
1961 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
1962 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
1965 ; AVX1OR2-LABEL: load_i16_v16i16:
1967 ; AVX1OR2-NEXT: pushq %rbp
1968 ; AVX1OR2-NEXT: movq %rsp, %rbp
1969 ; AVX1OR2-NEXT: andq $-32, %rsp
1970 ; AVX1OR2-NEXT: subq $64, %rsp
1971 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
1972 ; AVX1OR2-NEXT: movzwl (%rdi), %eax
1973 ; AVX1OR2-NEXT: vmovaps %ymm0, (%rsp)
1974 ; AVX1OR2-NEXT: andl $15, %esi
1975 ; AVX1OR2-NEXT: movw %ax, (%rsp,%rsi,2)
1976 ; AVX1OR2-NEXT: vmovaps (%rsp), %ymm0
1977 ; AVX1OR2-NEXT: movq %rbp, %rsp
1978 ; AVX1OR2-NEXT: popq %rbp
1979 ; AVX1OR2-NEXT: retq
1981 ; AVX512F-LABEL: load_i16_v16i16:
1983 ; AVX512F-NEXT: pushq %rbp
1984 ; AVX512F-NEXT: movq %rsp, %rbp
1985 ; AVX512F-NEXT: andq $-32, %rsp
1986 ; AVX512F-NEXT: subq $64, %rsp
1987 ; AVX512F-NEXT: # kill: def $esi killed $esi def $rsi
1988 ; AVX512F-NEXT: movzwl (%rdi), %eax
1989 ; AVX512F-NEXT: vmovaps %ymm0, (%rsp)
1990 ; AVX512F-NEXT: andl $15, %esi
1991 ; AVX512F-NEXT: movw %ax, (%rsp,%rsi,2)
1992 ; AVX512F-NEXT: vmovaps (%rsp), %ymm0
1993 ; AVX512F-NEXT: movq %rbp, %rsp
1994 ; AVX512F-NEXT: popq %rbp
1995 ; AVX512F-NEXT: retq
1997 ; AVX512BW-LABEL: load_i16_v16i16:
1998 ; AVX512BW: # %bb.0:
1999 ; AVX512BW-NEXT: vpbroadcastw %esi, %ymm1
2000 ; AVX512BW-NEXT: vpcmpeqw {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
2001 ; AVX512BW-NEXT: vpbroadcastw (%rdi), %ymm0 {%k1}
2002 ; AVX512BW-NEXT: retq
2004 ; X86AVX2-LABEL: load_i16_v16i16:
2006 ; X86AVX2-NEXT: pushl %ebp
2007 ; X86AVX2-NEXT: movl %esp, %ebp
2008 ; X86AVX2-NEXT: andl $-32, %esp
2009 ; X86AVX2-NEXT: subl $64, %esp
2010 ; X86AVX2-NEXT: movl 12(%ebp), %eax
2011 ; X86AVX2-NEXT: andl $15, %eax
2012 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
2013 ; X86AVX2-NEXT: movzwl (%ecx), %ecx
2014 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
2015 ; X86AVX2-NEXT: movw %cx, (%esp,%eax,2)
2016 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
2017 ; X86AVX2-NEXT: movl %ebp, %esp
2018 ; X86AVX2-NEXT: popl %ebp
2019 ; X86AVX2-NEXT: retl
2020 %x = load i16, ptr %p
2021 %ins = insertelement <16 x i16> %v, i16 %x, i32 %y
2025 define <8 x i32> @load_i32_v8i32(<8 x i32> %v, ptr %p, i32 %y) nounwind {
2026 ; SSE-LABEL: load_i32_v8i32:
2028 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
2029 ; SSE-NEXT: movl (%rdi), %eax
2030 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
2031 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
2032 ; SSE-NEXT: andl $7, %esi
2033 ; SSE-NEXT: movl %eax, -40(%rsp,%rsi,4)
2034 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
2035 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
2038 ; AVX1OR2-LABEL: load_i32_v8i32:
2040 ; AVX1OR2-NEXT: pushq %rbp
2041 ; AVX1OR2-NEXT: movq %rsp, %rbp
2042 ; AVX1OR2-NEXT: andq $-32, %rsp
2043 ; AVX1OR2-NEXT: subq $64, %rsp
2044 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
2045 ; AVX1OR2-NEXT: movl (%rdi), %eax
2046 ; AVX1OR2-NEXT: vmovaps %ymm0, (%rsp)
2047 ; AVX1OR2-NEXT: andl $7, %esi
2048 ; AVX1OR2-NEXT: movl %eax, (%rsp,%rsi,4)
2049 ; AVX1OR2-NEXT: vmovaps (%rsp), %ymm0
2050 ; AVX1OR2-NEXT: movq %rbp, %rsp
2051 ; AVX1OR2-NEXT: popq %rbp
2052 ; AVX1OR2-NEXT: retq
2054 ; AVX512-LABEL: load_i32_v8i32:
2056 ; AVX512-NEXT: vpbroadcastd %esi, %ymm1
2057 ; AVX512-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
2058 ; AVX512-NEXT: vpbroadcastd (%rdi), %ymm0 {%k1}
2061 ; X86AVX2-LABEL: load_i32_v8i32:
2063 ; X86AVX2-NEXT: pushl %ebp
2064 ; X86AVX2-NEXT: movl %esp, %ebp
2065 ; X86AVX2-NEXT: andl $-32, %esp
2066 ; X86AVX2-NEXT: subl $64, %esp
2067 ; X86AVX2-NEXT: movl 12(%ebp), %eax
2068 ; X86AVX2-NEXT: andl $7, %eax
2069 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
2070 ; X86AVX2-NEXT: movl (%ecx), %ecx
2071 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
2072 ; X86AVX2-NEXT: movl %ecx, (%esp,%eax,4)
2073 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
2074 ; X86AVX2-NEXT: movl %ebp, %esp
2075 ; X86AVX2-NEXT: popl %ebp
2076 ; X86AVX2-NEXT: retl
2077 %x = load i32, ptr %p
2078 %ins = insertelement <8 x i32> %v, i32 %x, i32 %y
2082 define <4 x i64> @load_i64_v4i64(<4 x i64> %v, ptr %p, i32 %y) nounwind {
2083 ; SSE-LABEL: load_i64_v4i64:
2085 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
2086 ; SSE-NEXT: movq (%rdi), %rax
2087 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
2088 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
2089 ; SSE-NEXT: andl $3, %esi
2090 ; SSE-NEXT: movq %rax, -40(%rsp,%rsi,8)
2091 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
2092 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
2095 ; AVX1OR2-LABEL: load_i64_v4i64:
2097 ; AVX1OR2-NEXT: pushq %rbp
2098 ; AVX1OR2-NEXT: movq %rsp, %rbp
2099 ; AVX1OR2-NEXT: andq $-32, %rsp
2100 ; AVX1OR2-NEXT: subq $64, %rsp
2101 ; AVX1OR2-NEXT: # kill: def $esi killed $esi def $rsi
2102 ; AVX1OR2-NEXT: movq (%rdi), %rax
2103 ; AVX1OR2-NEXT: vmovaps %ymm0, (%rsp)
2104 ; AVX1OR2-NEXT: andl $3, %esi
2105 ; AVX1OR2-NEXT: movq %rax, (%rsp,%rsi,8)
2106 ; AVX1OR2-NEXT: vmovaps (%rsp), %ymm0
2107 ; AVX1OR2-NEXT: movq %rbp, %rsp
2108 ; AVX1OR2-NEXT: popq %rbp
2109 ; AVX1OR2-NEXT: retq
2111 ; AVX512-LABEL: load_i64_v4i64:
2113 ; AVX512-NEXT: movl %esi, %eax
2114 ; AVX512-NEXT: vpbroadcastq %rax, %ymm1
2115 ; AVX512-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
2116 ; AVX512-NEXT: vpbroadcastq (%rdi), %ymm0 {%k1}
2119 ; X86AVX2-LABEL: load_i64_v4i64:
2121 ; X86AVX2-NEXT: pushl %ebp
2122 ; X86AVX2-NEXT: movl %esp, %ebp
2123 ; X86AVX2-NEXT: pushl %esi
2124 ; X86AVX2-NEXT: andl $-32, %esp
2125 ; X86AVX2-NEXT: subl $96, %esp
2126 ; X86AVX2-NEXT: movl 12(%ebp), %eax
2127 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
2128 ; X86AVX2-NEXT: movl (%ecx), %edx
2129 ; X86AVX2-NEXT: movl 4(%ecx), %ecx
2130 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
2131 ; X86AVX2-NEXT: leal (%eax,%eax), %esi
2132 ; X86AVX2-NEXT: andl $7, %esi
2133 ; X86AVX2-NEXT: movl %edx, (%esp,%esi,4)
2134 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
2135 ; X86AVX2-NEXT: vmovaps %ymm0, {{[0-9]+}}(%esp)
2136 ; X86AVX2-NEXT: leal 1(%eax,%eax), %eax
2137 ; X86AVX2-NEXT: andl $7, %eax
2138 ; X86AVX2-NEXT: movl %ecx, 32(%esp,%eax,4)
2139 ; X86AVX2-NEXT: vmovaps {{[0-9]+}}(%esp), %ymm0
2140 ; X86AVX2-NEXT: leal -4(%ebp), %esp
2141 ; X86AVX2-NEXT: popl %esi
2142 ; X86AVX2-NEXT: popl %ebp
2143 ; X86AVX2-NEXT: retl
2144 %x = load i64, ptr %p
2145 %ins = insertelement <4 x i64> %v, i64 %x, i32 %y
2149 define <8 x float> @load_f32_v8f32(<8 x float> %v, ptr %p, i32 %y) nounwind {
2150 ; SSE-LABEL: load_f32_v8f32:
2152 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
2153 ; SSE-NEXT: movss {{.*#+}} xmm2 = mem[0],zero,zero,zero
2154 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
2155 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
2156 ; SSE-NEXT: andl $7, %esi
2157 ; SSE-NEXT: movss %xmm2, -40(%rsp,%rsi,4)
2158 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
2159 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
2162 ; AVX1-LABEL: load_f32_v8f32:
2164 ; AVX1-NEXT: vmovd %esi, %xmm1
2165 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,0,0,0]
2166 ; AVX1-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm2
2167 ; AVX1-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}+16(%rip), %xmm1, %xmm1
2168 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
2169 ; AVX1-NEXT: vbroadcastss (%rdi), %ymm2
2170 ; AVX1-NEXT: vblendvps %ymm1, %ymm2, %ymm0, %ymm0
2173 ; AVX2-LABEL: load_f32_v8f32:
2175 ; AVX2-NEXT: vbroadcastss (%rdi), %ymm1
2176 ; AVX2-NEXT: vmovd %esi, %xmm2
2177 ; AVX2-NEXT: vpbroadcastd %xmm2, %ymm2
2178 ; AVX2-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm2, %ymm2
2179 ; AVX2-NEXT: vblendvps %ymm2, %ymm1, %ymm0, %ymm0
2182 ; AVX512-LABEL: load_f32_v8f32:
2184 ; AVX512-NEXT: vpbroadcastd %esi, %ymm1
2185 ; AVX512-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
2186 ; AVX512-NEXT: vbroadcastss (%rdi), %ymm0 {%k1}
2189 ; X86AVX2-LABEL: load_f32_v8f32:
2191 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %eax
2192 ; X86AVX2-NEXT: vpbroadcastd {{[0-9]+}}(%esp), %ymm1
2193 ; X86AVX2-NEXT: vpcmpeqd {{\.?LCPI[0-9]+_[0-9]+}}, %ymm1, %ymm1
2194 ; X86AVX2-NEXT: vbroadcastss (%eax), %ymm2
2195 ; X86AVX2-NEXT: vblendvps %ymm1, %ymm2, %ymm0, %ymm0
2196 ; X86AVX2-NEXT: retl
2197 %x = load float, ptr %p
2198 %ins = insertelement <8 x float> %v, float %x, i32 %y
2199 ret <8 x float> %ins
2202 define <4 x double> @load_f64_v4f64(<4 x double> %v, ptr %p, i32 %y) nounwind {
2203 ; SSE-LABEL: load_f64_v4f64:
2205 ; SSE-NEXT: # kill: def $esi killed $esi def $rsi
2206 ; SSE-NEXT: movsd {{.*#+}} xmm2 = mem[0],zero
2207 ; SSE-NEXT: movaps %xmm1, -{{[0-9]+}}(%rsp)
2208 ; SSE-NEXT: movaps %xmm0, -{{[0-9]+}}(%rsp)
2209 ; SSE-NEXT: andl $3, %esi
2210 ; SSE-NEXT: movsd %xmm2, -40(%rsp,%rsi,8)
2211 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm0
2212 ; SSE-NEXT: movaps -{{[0-9]+}}(%rsp), %xmm1
2215 ; AVX1-LABEL: load_f64_v4f64:
2217 ; AVX1-NEXT: movl %esi, %eax
2218 ; AVX1-NEXT: vmovq %rax, %xmm1
2219 ; AVX1-NEXT: vpshufd {{.*#+}} xmm1 = xmm1[0,1,0,1]
2220 ; AVX1-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %xmm1, %xmm2
2221 ; AVX1-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}+16(%rip), %xmm1, %xmm1
2222 ; AVX1-NEXT: vinsertf128 $1, %xmm1, %ymm2, %ymm1
2223 ; AVX1-NEXT: vbroadcastsd (%rdi), %ymm2
2224 ; AVX1-NEXT: vblendvpd %ymm1, %ymm2, %ymm0, %ymm0
2227 ; AVX2-LABEL: load_f64_v4f64:
2229 ; AVX2-NEXT: vbroadcastsd (%rdi), %ymm1
2230 ; AVX2-NEXT: movl %esi, %eax
2231 ; AVX2-NEXT: vmovq %rax, %xmm2
2232 ; AVX2-NEXT: vpbroadcastq %xmm2, %ymm2
2233 ; AVX2-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm2, %ymm2
2234 ; AVX2-NEXT: vblendvpd %ymm2, %ymm1, %ymm0, %ymm0
2237 ; AVX512-LABEL: load_f64_v4f64:
2239 ; AVX512-NEXT: movl %esi, %eax
2240 ; AVX512-NEXT: vpbroadcastq %rax, %ymm1
2241 ; AVX512-NEXT: vpcmpeqq {{\.?LCPI[0-9]+_[0-9]+}}(%rip), %ymm1, %k1
2242 ; AVX512-NEXT: vbroadcastsd (%rdi), %ymm0 {%k1}
2245 ; X86AVX2-LABEL: load_f64_v4f64:
2247 ; X86AVX2-NEXT: pushl %ebp
2248 ; X86AVX2-NEXT: movl %esp, %ebp
2249 ; X86AVX2-NEXT: andl $-32, %esp
2250 ; X86AVX2-NEXT: subl $64, %esp
2251 ; X86AVX2-NEXT: movl 12(%ebp), %eax
2252 ; X86AVX2-NEXT: andl $3, %eax
2253 ; X86AVX2-NEXT: movl 8(%ebp), %ecx
2254 ; X86AVX2-NEXT: vmovsd {{.*#+}} xmm1 = mem[0],zero
2255 ; X86AVX2-NEXT: vmovaps %ymm0, (%esp)
2256 ; X86AVX2-NEXT: vmovsd %xmm1, (%esp,%eax,8)
2257 ; X86AVX2-NEXT: vmovaps (%esp), %ymm0
2258 ; X86AVX2-NEXT: movl %ebp, %esp
2259 ; X86AVX2-NEXT: popl %ebp
2260 ; X86AVX2-NEXT: retl
2261 %x = load double, ptr %p
2262 %ins = insertelement <4 x double> %v, double %x, i32 %y
2263 ret <4 x double> %ins
2266 ; Don't die trying to insert to an invalid index.
2268 define i32 @PR44139(ptr %p) {
2269 ; SSE-LABEL: PR44139:
2271 ; SSE-NEXT: movl (%rdi), %eax
2272 ; SSE-NEXT: pshufd {{.*#+}} xmm0 = mem[0,1,0,1]
2273 ; SSE-NEXT: movdqa %xmm0, 96(%rdi)
2274 ; SSE-NEXT: movdqa %xmm0, 112(%rdi)
2275 ; SSE-NEXT: movdqa %xmm0, 64(%rdi)
2276 ; SSE-NEXT: movdqa %xmm0, 80(%rdi)
2277 ; SSE-NEXT: movdqa %xmm0, 32(%rdi)
2278 ; SSE-NEXT: movdqa %xmm0, 48(%rdi)
2279 ; SSE-NEXT: movdqa %xmm0, (%rdi)
2280 ; SSE-NEXT: movdqa %xmm0, 16(%rdi)
2281 ; SSE-NEXT: leal 2147483647(%rax), %ecx
2282 ; SSE-NEXT: testl %eax, %eax
2283 ; SSE-NEXT: cmovnsl %eax, %ecx
2284 ; SSE-NEXT: andl $-2147483648, %ecx # imm = 0x80000000
2285 ; SSE-NEXT: addl %eax, %ecx
2286 ; SSE-NEXT: # kill: def $eax killed $eax killed $rax
2287 ; SSE-NEXT: xorl %edx, %edx
2288 ; SSE-NEXT: divl %ecx
2291 ; AVX1-LABEL: PR44139:
2293 ; AVX1-NEXT: vbroadcastsd (%rdi), %ymm0
2294 ; AVX1-NEXT: vpinsrq $1, (%rdi), %xmm0, %xmm1
2295 ; AVX1-NEXT: vblendps {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2296 ; AVX1-NEXT: vmovaps %ymm0, 64(%rdi)
2297 ; AVX1-NEXT: vmovaps %ymm0, 96(%rdi)
2298 ; AVX1-NEXT: vmovaps %ymm0, 32(%rdi)
2299 ; AVX1-NEXT: movl (%rdi), %eax
2300 ; AVX1-NEXT: vmovaps %ymm1, (%rdi)
2301 ; AVX1-NEXT: leal 2147483647(%rax), %ecx
2302 ; AVX1-NEXT: testl %eax, %eax
2303 ; AVX1-NEXT: cmovnsl %eax, %ecx
2304 ; AVX1-NEXT: andl $-2147483648, %ecx # imm = 0x80000000
2305 ; AVX1-NEXT: addl %eax, %ecx
2306 ; AVX1-NEXT: # kill: def $eax killed $eax killed $rax
2307 ; AVX1-NEXT: xorl %edx, %edx
2308 ; AVX1-NEXT: divl %ecx
2309 ; AVX1-NEXT: vzeroupper
2312 ; AVX2-LABEL: PR44139:
2314 ; AVX2-NEXT: vpbroadcastq (%rdi), %ymm0
2315 ; AVX2-NEXT: vpinsrq $1, (%rdi), %xmm0, %xmm1
2316 ; AVX2-NEXT: vpblendd {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2317 ; AVX2-NEXT: vmovdqa %ymm0, 64(%rdi)
2318 ; AVX2-NEXT: vmovdqa %ymm0, 96(%rdi)
2319 ; AVX2-NEXT: vmovdqa %ymm0, 32(%rdi)
2320 ; AVX2-NEXT: movl (%rdi), %eax
2321 ; AVX2-NEXT: vmovdqa %ymm1, (%rdi)
2322 ; AVX2-NEXT: leal 2147483647(%rax), %ecx
2323 ; AVX2-NEXT: testl %eax, %eax
2324 ; AVX2-NEXT: cmovnsl %eax, %ecx
2325 ; AVX2-NEXT: andl $-2147483648, %ecx # imm = 0x80000000
2326 ; AVX2-NEXT: addl %eax, %ecx
2327 ; AVX2-NEXT: # kill: def $eax killed $eax killed $rax
2328 ; AVX2-NEXT: xorl %edx, %edx
2329 ; AVX2-NEXT: divl %ecx
2330 ; AVX2-NEXT: vzeroupper
2333 ; AVX512-LABEL: PR44139:
2335 ; AVX512-NEXT: vmovdqa64 (%rdi), %zmm0
2336 ; AVX512-NEXT: vpbroadcastq (%rdi), %zmm1
2337 ; AVX512-NEXT: vpmovqd %zmm0, %ymm0
2338 ; AVX512-NEXT: vpinsrq $1, (%rdi), %xmm1, %xmm2
2339 ; AVX512-NEXT: vinserti32x4 $0, %xmm2, %zmm1, %zmm2
2340 ; AVX512-NEXT: vmovdqa64 %zmm1, 64(%rdi)
2341 ; AVX512-NEXT: vmovdqa64 %zmm2, (%rdi)
2342 ; AVX512-NEXT: vmovd %xmm0, %eax
2343 ; AVX512-NEXT: leal 2147483647(%rax), %ecx
2344 ; AVX512-NEXT: testl %eax, %eax
2345 ; AVX512-NEXT: cmovnsl %eax, %ecx
2346 ; AVX512-NEXT: andl $-2147483648, %ecx # imm = 0x80000000
2347 ; AVX512-NEXT: addl %eax, %ecx
2348 ; AVX512-NEXT: # kill: def $eax killed $eax killed $rax
2349 ; AVX512-NEXT: xorl %edx, %edx
2350 ; AVX512-NEXT: divl %ecx
2351 ; AVX512-NEXT: vzeroupper
2354 ; X86AVX2-LABEL: PR44139:
2356 ; X86AVX2-NEXT: movl {{[0-9]+}}(%esp), %ecx
2357 ; X86AVX2-NEXT: vbroadcastsd (%ecx), %ymm0
2358 ; X86AVX2-NEXT: vunpcklpd {{.*#+}} xmm1 = xmm0[0],mem[0]
2359 ; X86AVX2-NEXT: vblendps {{.*#+}} ymm1 = ymm1[0,1,2,3],ymm0[4,5,6,7]
2360 ; X86AVX2-NEXT: vmovaps %ymm0, 64(%ecx)
2361 ; X86AVX2-NEXT: vmovaps %ymm0, 96(%ecx)
2362 ; X86AVX2-NEXT: vmovaps %ymm0, 32(%ecx)
2363 ; X86AVX2-NEXT: movl (%ecx), %eax
2364 ; X86AVX2-NEXT: vmovaps %ymm1, (%ecx)
2365 ; X86AVX2-NEXT: leal 2147483647(%eax), %ecx
2366 ; X86AVX2-NEXT: testl %eax, %eax
2367 ; X86AVX2-NEXT: cmovnsl %eax, %ecx
2368 ; X86AVX2-NEXT: andl $-2147483648, %ecx # imm = 0x80000000
2369 ; X86AVX2-NEXT: addl %eax, %ecx
2370 ; X86AVX2-NEXT: xorl %edx, %edx
2371 ; X86AVX2-NEXT: divl %ecx
2372 ; X86AVX2-NEXT: vzeroupper
2373 ; X86AVX2-NEXT: retl
2374 %L = load <16 x i64>, ptr %p
2375 %E1 = extractelement <16 x i64> %L, i64 0
2376 %tempvector = insertelement <16 x i64> undef, i64 %E1, i32 0
2377 %vector = shufflevector <16 x i64> %tempvector, <16 x i64> undef, <16 x i32> zeroinitializer
2378 %C3 = icmp sgt i64 9223372036854775807, -9223372036854775808
2379 %t0 = trunc <16 x i64> %vector to <16 x i32>
2380 %I4 = insertelement <16 x i64> %vector, i64 %E1, i1 %C3
2381 store <16 x i64> %I4, ptr %p
2382 %elt = extractelement <16 x i32> %t0, i32 0
2383 %B = srem i32 %elt, -2147483648
2384 %B9 = udiv i32 %elt, %B