1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; FIXME: Fix machine verifier issues and remove -verify-machineinstrs=0. PR39437.
3 ; RUN: llc < %s -mtriple=i386-pc-win32 -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq -verify-machineinstrs=0 | FileCheck %s --check-prefix=X32
4 ; RUN: llc < %s -mtriple=x86_64-win32 -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq -verify-machineinstrs=0 | FileCheck %s --check-prefix=WIN64
5 ; RUN: llc < %s -mtriple=x86_64-linux-gnu -mattr=+avx512f -mattr=+avx512vl -mattr=+avx512bw -mattr=+avx512dq -verify-machineinstrs=0 | FileCheck %s --check-prefix=LINUXOSX64
7 ; Test regcall when receiving/returning i1
8 define x86_regcallcc i1 @test_argReti1(i1 %a) {
9 ; X32-LABEL: test_argReti1:
12 ; X32-NEXT: # kill: def $al killed $al killed $eax
15 ; WIN64-LABEL: test_argReti1:
17 ; WIN64-NEXT: incb %al
18 ; WIN64-NEXT: # kill: def $al killed $al killed $eax
21 ; LINUXOSX64-LABEL: test_argReti1:
22 ; LINUXOSX64: # %bb.0:
23 ; LINUXOSX64-NEXT: incb %al
24 ; LINUXOSX64-NEXT: # kill: def $al killed $al killed $eax
25 ; LINUXOSX64-NEXT: retq
30 ; Test regcall when passing/retrieving i1
31 define x86_regcallcc i1 @test_CallargReti1(i1 %a) {
32 ; X32-LABEL: test_CallargReti1:
34 ; X32-NEXT: pushl %esp
36 ; X32-NEXT: movzbl %al, %eax
37 ; X32-NEXT: calll _test_argReti1
42 ; WIN64-LABEL: test_CallargReti1:
44 ; WIN64-NEXT: pushq %rsp
45 ; WIN64-NEXT: .seh_pushreg %rsp
46 ; WIN64-NEXT: .seh_endprologue
47 ; WIN64-NEXT: incb %al
48 ; WIN64-NEXT: movzbl %al, %eax
49 ; WIN64-NEXT: callq test_argReti1
50 ; WIN64-NEXT: incb %al
51 ; WIN64-NEXT: popq %rsp
53 ; WIN64-NEXT: .seh_handlerdata
55 ; WIN64-NEXT: .seh_endproc
57 ; LINUXOSX64-LABEL: test_CallargReti1:
58 ; LINUXOSX64: # %bb.0:
59 ; LINUXOSX64-NEXT: pushq %rsp
60 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
61 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
62 ; LINUXOSX64-NEXT: incb %al
63 ; LINUXOSX64-NEXT: movzbl %al, %eax
64 ; LINUXOSX64-NEXT: callq test_argReti1
65 ; LINUXOSX64-NEXT: incb %al
66 ; LINUXOSX64-NEXT: popq %rsp
67 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
68 ; LINUXOSX64-NEXT: retq
70 %c = call x86_regcallcc i1 @test_argReti1(i1 %b)
75 ; Test regcall when receiving/returning i8
76 define x86_regcallcc i8 @test_argReti8(i8 %a) {
77 ; X32-LABEL: test_argReti8:
80 ; X32-NEXT: # kill: def $al killed $al killed $eax
83 ; WIN64-LABEL: test_argReti8:
85 ; WIN64-NEXT: incb %al
86 ; WIN64-NEXT: # kill: def $al killed $al killed $eax
89 ; LINUXOSX64-LABEL: test_argReti8:
90 ; LINUXOSX64: # %bb.0:
91 ; LINUXOSX64-NEXT: incb %al
92 ; LINUXOSX64-NEXT: # kill: def $al killed $al killed $eax
93 ; LINUXOSX64-NEXT: retq
98 ; Test regcall when passing/retrieving i8
99 define x86_regcallcc i8 @test_CallargReti8(i8 %a) {
100 ; X32-LABEL: test_CallargReti8:
102 ; X32-NEXT: pushl %esp
104 ; X32-NEXT: movzbl %al, %eax
105 ; X32-NEXT: calll _test_argReti8
107 ; X32-NEXT: popl %esp
110 ; WIN64-LABEL: test_CallargReti8:
112 ; WIN64-NEXT: pushq %rsp
113 ; WIN64-NEXT: .seh_pushreg %rsp
114 ; WIN64-NEXT: .seh_endprologue
115 ; WIN64-NEXT: incb %al
116 ; WIN64-NEXT: movzbl %al, %eax
117 ; WIN64-NEXT: callq test_argReti8
118 ; WIN64-NEXT: incb %al
119 ; WIN64-NEXT: popq %rsp
121 ; WIN64-NEXT: .seh_handlerdata
123 ; WIN64-NEXT: .seh_endproc
125 ; LINUXOSX64-LABEL: test_CallargReti8:
126 ; LINUXOSX64: # %bb.0:
127 ; LINUXOSX64-NEXT: pushq %rsp
128 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
129 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
130 ; LINUXOSX64-NEXT: incb %al
131 ; LINUXOSX64-NEXT: movzbl %al, %eax
132 ; LINUXOSX64-NEXT: callq test_argReti8
133 ; LINUXOSX64-NEXT: incb %al
134 ; LINUXOSX64-NEXT: popq %rsp
135 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
136 ; LINUXOSX64-NEXT: retq
138 %c = call x86_regcallcc i8 @test_argReti8(i8 %b)
143 ; Test regcall when receiving/returning i16
144 define x86_regcallcc i16 @test_argReti16(i16 %a) {
145 ; X32-LABEL: test_argReti16:
147 ; X32-NEXT: incl %eax
148 ; X32-NEXT: # kill: def $ax killed $ax killed $eax
151 ; WIN64-LABEL: test_argReti16:
153 ; WIN64-NEXT: incl %eax
154 ; WIN64-NEXT: # kill: def $ax killed $ax killed $eax
157 ; LINUXOSX64-LABEL: test_argReti16:
158 ; LINUXOSX64: # %bb.0:
159 ; LINUXOSX64-NEXT: incl %eax
160 ; LINUXOSX64-NEXT: # kill: def $ax killed $ax killed $eax
161 ; LINUXOSX64-NEXT: retq
166 ; Test regcall when passing/retrieving i16
167 define x86_regcallcc i16 @test_CallargReti16(i16 %a) {
168 ; X32-LABEL: test_CallargReti16:
170 ; X32-NEXT: pushl %esp
171 ; X32-NEXT: incl %eax
172 ; X32-NEXT: calll _test_argReti16
173 ; X32-NEXT: # kill: def $ax killed $ax def $eax
174 ; X32-NEXT: incl %eax
175 ; X32-NEXT: # kill: def $ax killed $ax killed $eax
176 ; X32-NEXT: popl %esp
179 ; WIN64-LABEL: test_CallargReti16:
181 ; WIN64-NEXT: pushq %rsp
182 ; WIN64-NEXT: .seh_pushreg %rsp
183 ; WIN64-NEXT: .seh_endprologue
184 ; WIN64-NEXT: incl %eax
185 ; WIN64-NEXT: callq test_argReti16
186 ; WIN64-NEXT: # kill: def $ax killed $ax def $eax
187 ; WIN64-NEXT: incl %eax
188 ; WIN64-NEXT: # kill: def $ax killed $ax killed $eax
189 ; WIN64-NEXT: popq %rsp
191 ; WIN64-NEXT: .seh_handlerdata
193 ; WIN64-NEXT: .seh_endproc
195 ; LINUXOSX64-LABEL: test_CallargReti16:
196 ; LINUXOSX64: # %bb.0:
197 ; LINUXOSX64-NEXT: pushq %rsp
198 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
199 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
200 ; LINUXOSX64-NEXT: incl %eax
201 ; LINUXOSX64-NEXT: callq test_argReti16
202 ; LINUXOSX64-NEXT: # kill: def $ax killed $ax def $eax
203 ; LINUXOSX64-NEXT: incl %eax
204 ; LINUXOSX64-NEXT: # kill: def $ax killed $ax killed $eax
205 ; LINUXOSX64-NEXT: popq %rsp
206 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
207 ; LINUXOSX64-NEXT: retq
209 %c = call x86_regcallcc i16 @test_argReti16(i16 %b)
214 ; Test regcall when receiving/returning i32
215 define x86_regcallcc i32 @test_argReti32(i32 %a) {
216 ; X32-LABEL: test_argReti32:
218 ; X32-NEXT: incl %eax
221 ; WIN64-LABEL: test_argReti32:
223 ; WIN64-NEXT: incl %eax
226 ; LINUXOSX64-LABEL: test_argReti32:
227 ; LINUXOSX64: # %bb.0:
228 ; LINUXOSX64-NEXT: incl %eax
229 ; LINUXOSX64-NEXT: retq
234 ; Test regcall when passing/retrieving i32
235 define x86_regcallcc i32 @test_CallargReti32(i32 %a) {
236 ; X32-LABEL: test_CallargReti32:
238 ; X32-NEXT: pushl %esp
239 ; X32-NEXT: incl %eax
240 ; X32-NEXT: calll _test_argReti32
241 ; X32-NEXT: incl %eax
242 ; X32-NEXT: popl %esp
245 ; WIN64-LABEL: test_CallargReti32:
247 ; WIN64-NEXT: pushq %rsp
248 ; WIN64-NEXT: .seh_pushreg %rsp
249 ; WIN64-NEXT: .seh_endprologue
250 ; WIN64-NEXT: incl %eax
251 ; WIN64-NEXT: callq test_argReti32
252 ; WIN64-NEXT: incl %eax
253 ; WIN64-NEXT: popq %rsp
255 ; WIN64-NEXT: .seh_handlerdata
257 ; WIN64-NEXT: .seh_endproc
259 ; LINUXOSX64-LABEL: test_CallargReti32:
260 ; LINUXOSX64: # %bb.0:
261 ; LINUXOSX64-NEXT: pushq %rsp
262 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
263 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
264 ; LINUXOSX64-NEXT: incl %eax
265 ; LINUXOSX64-NEXT: callq test_argReti32
266 ; LINUXOSX64-NEXT: incl %eax
267 ; LINUXOSX64-NEXT: popq %rsp
268 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
269 ; LINUXOSX64-NEXT: retq
271 %c = call x86_regcallcc i32 @test_argReti32(i32 %b)
276 ; Test regcall when receiving/returning i64
277 define x86_regcallcc i64 @test_argReti64(i64 %a) {
278 ; X32-LABEL: test_argReti64:
280 ; X32-NEXT: addl $3, %eax
281 ; X32-NEXT: adcl $1, %ecx
284 ; WIN64-LABEL: test_argReti64:
286 ; WIN64-NEXT: movabsq $4294967299, %rcx # imm = 0x100000003
287 ; WIN64-NEXT: addq %rcx, %rax
290 ; LINUXOSX64-LABEL: test_argReti64:
291 ; LINUXOSX64: # %bb.0:
292 ; LINUXOSX64-NEXT: movabsq $4294967299, %rcx # imm = 0x100000003
293 ; LINUXOSX64-NEXT: addq %rcx, %rax
294 ; LINUXOSX64-NEXT: retq
295 %add = add i64 %a, 4294967299
299 ; Test regcall when passing/retrieving i64
300 define x86_regcallcc i64 @test_CallargReti64(i64 %a) {
301 ; X32-LABEL: test_CallargReti64:
303 ; X32-NEXT: pushl %esp
304 ; X32-NEXT: addl $1, %eax
305 ; X32-NEXT: adcl $0, %ecx
306 ; X32-NEXT: calll _test_argReti64
307 ; X32-NEXT: addl $1, %eax
308 ; X32-NEXT: adcl $0, %ecx
309 ; X32-NEXT: popl %esp
312 ; WIN64-LABEL: test_CallargReti64:
314 ; WIN64-NEXT: pushq %rsp
315 ; WIN64-NEXT: .seh_pushreg %rsp
316 ; WIN64-NEXT: .seh_endprologue
317 ; WIN64-NEXT: incq %rax
318 ; WIN64-NEXT: callq test_argReti64
319 ; WIN64-NEXT: incq %rax
320 ; WIN64-NEXT: popq %rsp
322 ; WIN64-NEXT: .seh_handlerdata
324 ; WIN64-NEXT: .seh_endproc
326 ; LINUXOSX64-LABEL: test_CallargReti64:
327 ; LINUXOSX64: # %bb.0:
328 ; LINUXOSX64-NEXT: pushq %rsp
329 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
330 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
331 ; LINUXOSX64-NEXT: incq %rax
332 ; LINUXOSX64-NEXT: callq test_argReti64
333 ; LINUXOSX64-NEXT: incq %rax
334 ; LINUXOSX64-NEXT: popq %rsp
335 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
336 ; LINUXOSX64-NEXT: retq
338 %c = call x86_regcallcc i64 @test_argReti64(i64 %b)
343 ; Test regcall when receiving/returning float
344 define x86_regcallcc float @test_argRetFloat(float %a) {
345 ; X32-LABEL: test_argRetFloat:
347 ; X32-NEXT: vaddss __real@3f800000, %xmm0, %xmm0
350 ; WIN64-LABEL: test_argRetFloat:
352 ; WIN64-NEXT: vaddss __real@{{.*}}(%rip), %xmm0, %xmm0
355 ; LINUXOSX64-LABEL: test_argRetFloat:
356 ; LINUXOSX64: # %bb.0:
357 ; LINUXOSX64-NEXT: vaddss {{.*}}(%rip), %xmm0, %xmm0
358 ; LINUXOSX64-NEXT: retq
359 %add = fadd float 1.0, %a
363 ; Test regcall when passing/retrieving float
364 define x86_regcallcc float @test_CallargRetFloat(float %a) {
365 ; X32-LABEL: test_CallargRetFloat:
367 ; X32-NEXT: pushl %esp
368 ; X32-NEXT: subl $24, %esp
369 ; X32-NEXT: vmovups %xmm4, (%esp) # 16-byte Spill
370 ; X32-NEXT: vmovss {{.*#+}} xmm4 = mem[0],zero,zero,zero
371 ; X32-NEXT: vaddss %xmm4, %xmm0, %xmm0
372 ; X32-NEXT: calll _test_argRetFloat
373 ; X32-NEXT: vaddss %xmm4, %xmm0, %xmm0
374 ; X32-NEXT: vmovups (%esp), %xmm4 # 16-byte Reload
375 ; X32-NEXT: addl $24, %esp
376 ; X32-NEXT: popl %esp
379 ; WIN64-LABEL: test_CallargRetFloat:
381 ; WIN64-NEXT: pushq %rsp
382 ; WIN64-NEXT: .seh_pushreg %rsp
383 ; WIN64-NEXT: subq $16, %rsp
384 ; WIN64-NEXT: .seh_stackalloc 16
385 ; WIN64-NEXT: vmovaps %xmm8, (%rsp) # 16-byte Spill
386 ; WIN64-NEXT: .seh_savexmm %xmm8, 0
387 ; WIN64-NEXT: .seh_endprologue
388 ; WIN64-NEXT: vmovss {{.*#+}} xmm8 = mem[0],zero,zero,zero
389 ; WIN64-NEXT: vaddss %xmm8, %xmm0, %xmm0
390 ; WIN64-NEXT: callq test_argRetFloat
391 ; WIN64-NEXT: vaddss %xmm8, %xmm0, %xmm0
392 ; WIN64-NEXT: vmovaps (%rsp), %xmm8 # 16-byte Reload
393 ; WIN64-NEXT: addq $16, %rsp
394 ; WIN64-NEXT: popq %rsp
396 ; WIN64-NEXT: .seh_handlerdata
398 ; WIN64-NEXT: .seh_endproc
400 ; LINUXOSX64-LABEL: test_CallargRetFloat:
401 ; LINUXOSX64: # %bb.0:
402 ; LINUXOSX64-NEXT: pushq %rsp
403 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
404 ; LINUXOSX64-NEXT: subq $16, %rsp
405 ; LINUXOSX64-NEXT: vmovaps %xmm8, (%rsp) # 16-byte Spill
406 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 32
407 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
408 ; LINUXOSX64-NEXT: .cfi_offset %xmm8, -32
409 ; LINUXOSX64-NEXT: vmovss {{.*#+}} xmm8 = mem[0],zero,zero,zero
410 ; LINUXOSX64-NEXT: vaddss %xmm8, %xmm0, %xmm0
411 ; LINUXOSX64-NEXT: callq test_argRetFloat
412 ; LINUXOSX64-NEXT: vaddss %xmm8, %xmm0, %xmm0
413 ; LINUXOSX64-NEXT: vmovaps (%rsp), %xmm8 # 16-byte Reload
414 ; LINUXOSX64-NEXT: addq $16, %rsp
415 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
416 ; LINUXOSX64-NEXT: popq %rsp
417 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
418 ; LINUXOSX64-NEXT: retq
419 %b = fadd float 1.0, %a
420 %c = call x86_regcallcc float @test_argRetFloat(float %b)
421 %d = fadd float 1.0, %c
425 ; Test regcall when receiving/returning double
426 define x86_regcallcc double @test_argRetDouble(double %a) {
427 ; X32-LABEL: test_argRetDouble:
429 ; X32-NEXT: vaddsd __real@3ff0000000000000, %xmm0, %xmm0
432 ; WIN64-LABEL: test_argRetDouble:
434 ; WIN64-NEXT: vaddsd __real@{{.*}}(%rip), %xmm0, %xmm0
437 ; LINUXOSX64-LABEL: test_argRetDouble:
438 ; LINUXOSX64: # %bb.0:
439 ; LINUXOSX64-NEXT: vaddsd {{.*}}(%rip), %xmm0, %xmm0
440 ; LINUXOSX64-NEXT: retq
441 %add = fadd double %a, 1.0
445 ; Test regcall when passing/retrieving double
446 define x86_regcallcc double @test_CallargRetDouble(double %a) {
447 ; X32-LABEL: test_CallargRetDouble:
449 ; X32-NEXT: pushl %esp
450 ; X32-NEXT: subl $24, %esp
451 ; X32-NEXT: vmovups %xmm4, (%esp) # 16-byte Spill
452 ; X32-NEXT: vmovsd {{.*#+}} xmm4 = mem[0],zero
453 ; X32-NEXT: vaddsd %xmm4, %xmm0, %xmm0
454 ; X32-NEXT: calll _test_argRetDouble
455 ; X32-NEXT: vaddsd %xmm4, %xmm0, %xmm0
456 ; X32-NEXT: vmovups (%esp), %xmm4 # 16-byte Reload
457 ; X32-NEXT: addl $24, %esp
458 ; X32-NEXT: popl %esp
461 ; WIN64-LABEL: test_CallargRetDouble:
463 ; WIN64-NEXT: pushq %rsp
464 ; WIN64-NEXT: .seh_pushreg %rsp
465 ; WIN64-NEXT: subq $16, %rsp
466 ; WIN64-NEXT: .seh_stackalloc 16
467 ; WIN64-NEXT: vmovaps %xmm8, (%rsp) # 16-byte Spill
468 ; WIN64-NEXT: .seh_savexmm %xmm8, 0
469 ; WIN64-NEXT: .seh_endprologue
470 ; WIN64-NEXT: vmovsd {{.*#+}} xmm8 = mem[0],zero
471 ; WIN64-NEXT: vaddsd %xmm8, %xmm0, %xmm0
472 ; WIN64-NEXT: callq test_argRetDouble
473 ; WIN64-NEXT: vaddsd %xmm8, %xmm0, %xmm0
474 ; WIN64-NEXT: vmovaps (%rsp), %xmm8 # 16-byte Reload
475 ; WIN64-NEXT: addq $16, %rsp
476 ; WIN64-NEXT: popq %rsp
478 ; WIN64-NEXT: .seh_handlerdata
480 ; WIN64-NEXT: .seh_endproc
482 ; LINUXOSX64-LABEL: test_CallargRetDouble:
483 ; LINUXOSX64: # %bb.0:
484 ; LINUXOSX64-NEXT: pushq %rsp
485 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
486 ; LINUXOSX64-NEXT: subq $16, %rsp
487 ; LINUXOSX64-NEXT: vmovaps %xmm8, (%rsp) # 16-byte Spill
488 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 32
489 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
490 ; LINUXOSX64-NEXT: .cfi_offset %xmm8, -32
491 ; LINUXOSX64-NEXT: vmovsd {{.*#+}} xmm8 = mem[0],zero
492 ; LINUXOSX64-NEXT: vaddsd %xmm8, %xmm0, %xmm0
493 ; LINUXOSX64-NEXT: callq test_argRetDouble
494 ; LINUXOSX64-NEXT: vaddsd %xmm8, %xmm0, %xmm0
495 ; LINUXOSX64-NEXT: vmovaps (%rsp), %xmm8 # 16-byte Reload
496 ; LINUXOSX64-NEXT: addq $16, %rsp
497 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
498 ; LINUXOSX64-NEXT: popq %rsp
499 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
500 ; LINUXOSX64-NEXT: retq
501 %b = fadd double 1.0, %a
502 %c = call x86_regcallcc double @test_argRetDouble(double %b)
503 %d = fadd double 1.0, %c
507 ; Test regcall when receiving/returning long double
508 define x86_regcallcc x86_fp80 @test_argRetf80(x86_fp80 %a0) nounwind {
509 ; X32-LABEL: test_argRetf80:
511 ; X32-NEXT: fadd %st, %st(0)
514 ; WIN64-LABEL: test_argRetf80:
516 ; WIN64-NEXT: fadd %st, %st(0)
519 ; LINUXOSX64-LABEL: test_argRetf80:
520 ; LINUXOSX64: # %bb.0:
521 ; LINUXOSX64-NEXT: fadd %st, %st(0)
522 ; LINUXOSX64-NEXT: retq
523 %r0 = fadd x86_fp80 %a0, %a0
527 ; Test regcall when passing/retrieving long double
528 define x86_regcallcc x86_fp80 @test_CallargRetf80(x86_fp80 %a) {
529 ; X32-LABEL: test_CallargRetf80:
531 ; X32-NEXT: pushl %esp
532 ; X32-NEXT: fadd %st, %st(0)
533 ; X32-NEXT: calll _test_argRetf80
534 ; X32-NEXT: fadd %st, %st(0)
535 ; X32-NEXT: popl %esp
538 ; WIN64-LABEL: test_CallargRetf80:
540 ; WIN64-NEXT: pushq %rsp
541 ; WIN64-NEXT: .seh_pushreg %rsp
542 ; WIN64-NEXT: .seh_endprologue
543 ; WIN64-NEXT: fadd %st, %st(0)
544 ; WIN64-NEXT: callq test_argRetf80
545 ; WIN64-NEXT: fadd %st, %st(0)
546 ; WIN64-NEXT: popq %rsp
548 ; WIN64-NEXT: .seh_handlerdata
550 ; WIN64-NEXT: .seh_endproc
552 ; LINUXOSX64-LABEL: test_CallargRetf80:
553 ; LINUXOSX64: # %bb.0:
554 ; LINUXOSX64-NEXT: pushq %rsp
555 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
556 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
557 ; LINUXOSX64-NEXT: fadd %st, %st(0)
558 ; LINUXOSX64-NEXT: callq test_argRetf80
559 ; LINUXOSX64-NEXT: fadd %st, %st(0)
560 ; LINUXOSX64-NEXT: popq %rsp
561 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
562 ; LINUXOSX64-NEXT: retq
563 %b = fadd x86_fp80 %a, %a
564 %c = call x86_regcallcc x86_fp80 @test_argRetf80(x86_fp80 %b)
565 %d = fadd x86_fp80 %c, %c
569 ; Test regcall when receiving/returning pointer
570 define x86_regcallcc [4 x i32]* @test_argRetPointer([4 x i32]* %a) {
571 ; X32-LABEL: test_argRetPointer:
573 ; X32-NEXT: incl %eax
576 ; WIN64-LABEL: test_argRetPointer:
578 ; WIN64-NEXT: incl %eax
581 ; LINUXOSX64-LABEL: test_argRetPointer:
582 ; LINUXOSX64: # %bb.0:
583 ; LINUXOSX64-NEXT: incl %eax
584 ; LINUXOSX64-NEXT: retq
585 %b = ptrtoint [4 x i32]* %a to i32
587 %d = inttoptr i32 %c to [4 x i32]*
591 ; Test regcall when passing/retrieving pointer
592 define x86_regcallcc [4 x i32]* @test_CallargRetPointer([4 x i32]* %a) {
593 ; X32-LABEL: test_CallargRetPointer:
595 ; X32-NEXT: pushl %esp
596 ; X32-NEXT: incl %eax
597 ; X32-NEXT: calll _test_argRetPointer
598 ; X32-NEXT: incl %eax
599 ; X32-NEXT: popl %esp
602 ; WIN64-LABEL: test_CallargRetPointer:
604 ; WIN64-NEXT: pushq %rsp
605 ; WIN64-NEXT: .seh_pushreg %rsp
606 ; WIN64-NEXT: .seh_endprologue
607 ; WIN64-NEXT: incl %eax
608 ; WIN64-NEXT: callq test_argRetPointer
609 ; WIN64-NEXT: incl %eax
610 ; WIN64-NEXT: popq %rsp
612 ; WIN64-NEXT: .seh_handlerdata
614 ; WIN64-NEXT: .seh_endproc
616 ; LINUXOSX64-LABEL: test_CallargRetPointer:
617 ; LINUXOSX64: # %bb.0:
618 ; LINUXOSX64-NEXT: pushq %rsp
619 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
620 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
621 ; LINUXOSX64-NEXT: incl %eax
622 ; LINUXOSX64-NEXT: callq test_argRetPointer
623 ; LINUXOSX64-NEXT: incl %eax
624 ; LINUXOSX64-NEXT: popq %rsp
625 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
626 ; LINUXOSX64-NEXT: retq
627 %b = ptrtoint [4 x i32]* %a to i32
629 %d = inttoptr i32 %c to [4 x i32]*
630 %e = call x86_regcallcc [4 x i32]* @test_argRetPointer([4 x i32]* %d)
631 %f = ptrtoint [4 x i32]* %e to i32
633 %h = inttoptr i32 %g to [4 x i32]*
637 ; Test regcall when receiving/returning 128 bit vector
638 define x86_regcallcc <4 x i32> @test_argRet128Vector(<4 x i1> %x, <4 x i32> %a, <4 x i32> %b) {
639 ; X32-LABEL: test_argRet128Vector:
641 ; X32-NEXT: vpslld $31, %xmm0, %xmm0
642 ; X32-NEXT: vpmovd2m %xmm0, %k1
643 ; X32-NEXT: vpblendmd %xmm1, %xmm2, %xmm0 {%k1}
646 ; WIN64-LABEL: test_argRet128Vector:
648 ; WIN64-NEXT: vpslld $31, %xmm0, %xmm0
649 ; WIN64-NEXT: vpmovd2m %xmm0, %k1
650 ; WIN64-NEXT: vpblendmd %xmm1, %xmm2, %xmm0 {%k1}
653 ; LINUXOSX64-LABEL: test_argRet128Vector:
654 ; LINUXOSX64: # %bb.0:
655 ; LINUXOSX64-NEXT: vpslld $31, %xmm0, %xmm0
656 ; LINUXOSX64-NEXT: vpmovd2m %xmm0, %k1
657 ; LINUXOSX64-NEXT: vpblendmd %xmm1, %xmm2, %xmm0 {%k1}
658 ; LINUXOSX64-NEXT: retq
659 %d = select <4 x i1> %x, <4 x i32> %a, <4 x i32> %b
663 ; Test regcall when passing/retrieving 128 bit vector
664 define x86_regcallcc <4 x i32> @test_CallargRet128Vector(<4 x i1> %x, <4 x i32> %a) {
665 ; X32-LABEL: test_CallargRet128Vector:
667 ; X32-NEXT: pushl %esp
668 ; X32-NEXT: subl $40, %esp
669 ; X32-NEXT: vmovups %xmm4, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill
670 ; X32-NEXT: vmovdqa %xmm1, %xmm4
671 ; X32-NEXT: vpslld $31, %xmm0, %xmm1
672 ; X32-NEXT: vpmovd2m %xmm1, %k1
673 ; X32-NEXT: kmovw %k1, {{[-0-9]+}}(%e{{[sb]}}p) # 2-byte Spill
674 ; X32-NEXT: vmovdqa %xmm4, %xmm1
675 ; X32-NEXT: vmovdqa %xmm4, %xmm2
676 ; X32-NEXT: calll _test_argRet128Vector
677 ; X32-NEXT: kmovw {{[-0-9]+}}(%e{{[sb]}}p), %k1 # 2-byte Reload
678 ; X32-NEXT: vmovdqa32 %xmm4, %xmm0 {%k1}
679 ; X32-NEXT: vmovups {{[-0-9]+}}(%e{{[sb]}}p), %xmm4 # 16-byte Reload
680 ; X32-NEXT: addl $40, %esp
681 ; X32-NEXT: popl %esp
684 ; WIN64-LABEL: test_CallargRet128Vector:
686 ; WIN64-NEXT: pushq %rsp
687 ; WIN64-NEXT: .seh_pushreg %rsp
688 ; WIN64-NEXT: subq $32, %rsp
689 ; WIN64-NEXT: .seh_stackalloc 32
690 ; WIN64-NEXT: vmovaps %xmm8, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
691 ; WIN64-NEXT: .seh_savexmm %xmm8, 16
692 ; WIN64-NEXT: .seh_endprologue
693 ; WIN64-NEXT: vmovdqa %xmm1, %xmm8
694 ; WIN64-NEXT: vpslld $31, %xmm0, %xmm1
695 ; WIN64-NEXT: vpmovd2m %xmm1, %k1
696 ; WIN64-NEXT: kmovw %k1, {{[-0-9]+}}(%r{{[sb]}}p) # 2-byte Spill
697 ; WIN64-NEXT: vmovdqa %xmm8, %xmm1
698 ; WIN64-NEXT: vmovdqa %xmm8, %xmm2
699 ; WIN64-NEXT: callq test_argRet128Vector
700 ; WIN64-NEXT: kmovw {{[-0-9]+}}(%r{{[sb]}}p), %k1 # 2-byte Reload
701 ; WIN64-NEXT: vmovdqa32 %xmm8, %xmm0 {%k1}
702 ; WIN64-NEXT: vmovaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm8 # 16-byte Reload
703 ; WIN64-NEXT: addq $32, %rsp
704 ; WIN64-NEXT: popq %rsp
706 ; WIN64-NEXT: .seh_handlerdata
708 ; WIN64-NEXT: .seh_endproc
710 ; LINUXOSX64-LABEL: test_CallargRet128Vector:
711 ; LINUXOSX64: # %bb.0:
712 ; LINUXOSX64-NEXT: pushq %rsp
713 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
714 ; LINUXOSX64-NEXT: subq $32, %rsp
715 ; LINUXOSX64-NEXT: vmovaps %xmm8, {{[-0-9]+}}(%r{{[sb]}}p) # 16-byte Spill
716 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 48
717 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
718 ; LINUXOSX64-NEXT: .cfi_offset %xmm8, -32
719 ; LINUXOSX64-NEXT: vmovdqa %xmm1, %xmm8
720 ; LINUXOSX64-NEXT: vpslld $31, %xmm0, %xmm1
721 ; LINUXOSX64-NEXT: vpmovd2m %xmm1, %k1
722 ; LINUXOSX64-NEXT: kmovw %k1, {{[-0-9]+}}(%r{{[sb]}}p) # 2-byte Spill
723 ; LINUXOSX64-NEXT: vmovdqa %xmm8, %xmm1
724 ; LINUXOSX64-NEXT: vmovdqa %xmm8, %xmm2
725 ; LINUXOSX64-NEXT: callq test_argRet128Vector
726 ; LINUXOSX64-NEXT: kmovw {{[-0-9]+}}(%r{{[sb]}}p), %k1 # 2-byte Reload
727 ; LINUXOSX64-NEXT: vmovdqa32 %xmm8, %xmm0 {%k1}
728 ; LINUXOSX64-NEXT: vmovaps {{[-0-9]+}}(%r{{[sb]}}p), %xmm8 # 16-byte Reload
729 ; LINUXOSX64-NEXT: addq $32, %rsp
730 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
731 ; LINUXOSX64-NEXT: popq %rsp
732 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
733 ; LINUXOSX64-NEXT: retq
734 %b = call x86_regcallcc <4 x i32> @test_argRet128Vector(<4 x i1> %x, <4 x i32> %a, <4 x i32> %a)
735 %c = select <4 x i1> %x, <4 x i32> %a, <4 x i32> %b
739 ; Test regcall when receiving/returning 256 bit vector
740 define x86_regcallcc <8 x i32> @test_argRet256Vector(<8 x i1> %x, <8 x i32> %a, <8 x i32> %b) {
741 ; X32-LABEL: test_argRet256Vector:
743 ; X32-NEXT: kmovd %eax, %k1
744 ; X32-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
747 ; WIN64-LABEL: test_argRet256Vector:
749 ; WIN64-NEXT: kmovd %eax, %k1
750 ; WIN64-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
753 ; LINUXOSX64-LABEL: test_argRet256Vector:
754 ; LINUXOSX64: # %bb.0:
755 ; LINUXOSX64-NEXT: kmovd %eax, %k1
756 ; LINUXOSX64-NEXT: vpblendmd %ymm0, %ymm1, %ymm0 {%k1}
757 ; LINUXOSX64-NEXT: retq
758 %d = select <8 x i1> %x, <8 x i32> %a, <8 x i32> %b
762 ; Test regcall when passing/retrieving 256 bit vector
763 define x86_regcallcc <8 x i32> @test_CallargRet256Vector(<8 x i1> %x, <8 x i32> %a) {
764 ; X32-LABEL: test_CallargRet256Vector:
766 ; X32-NEXT: pushl %esp
767 ; X32-NEXT: subl $88, %esp
768 ; X32-NEXT: vmovdqu %ymm0, {{[-0-9]+}}(%e{{[sb]}}p) # 32-byte Spill
769 ; X32-NEXT: kmovd %eax, %k1
770 ; X32-NEXT: kmovw %k1, {{[-0-9]+}}(%e{{[sb]}}p) # 2-byte Spill
771 ; X32-NEXT: vmovdqa %ymm0, %ymm1
772 ; X32-NEXT: calll _test_argRet256Vector
773 ; X32-NEXT: kmovw {{[-0-9]+}}(%e{{[sb]}}p), %k1 # 2-byte Reload
774 ; X32-NEXT: vmovdqu {{[-0-9]+}}(%e{{[sb]}}p), %ymm1 # 32-byte Reload
775 ; X32-NEXT: vmovdqa32 %ymm1, %ymm0 {%k1}
776 ; X32-NEXT: addl $88, %esp
777 ; X32-NEXT: popl %esp
780 ; WIN64-LABEL: test_CallargRet256Vector:
782 ; WIN64-NEXT: pushq %rsp
783 ; WIN64-NEXT: .seh_pushreg %rsp
784 ; WIN64-NEXT: subq $80, %rsp
785 ; WIN64-NEXT: .seh_stackalloc 80
786 ; WIN64-NEXT: .seh_endprologue
787 ; WIN64-NEXT: vmovdqu %ymm0, {{[-0-9]+}}(%r{{[sb]}}p) # 32-byte Spill
788 ; WIN64-NEXT: kmovd %eax, %k1
789 ; WIN64-NEXT: kmovw %k1, {{[-0-9]+}}(%r{{[sb]}}p) # 2-byte Spill
790 ; WIN64-NEXT: vmovdqa %ymm0, %ymm1
791 ; WIN64-NEXT: callq test_argRet256Vector
792 ; WIN64-NEXT: kmovw {{[-0-9]+}}(%r{{[sb]}}p), %k1 # 2-byte Reload
793 ; WIN64-NEXT: vmovdqu {{[-0-9]+}}(%r{{[sb]}}p), %ymm1 # 32-byte Reload
794 ; WIN64-NEXT: vmovdqa32 %ymm1, %ymm0 {%k1}
795 ; WIN64-NEXT: addq $80, %rsp
796 ; WIN64-NEXT: popq %rsp
798 ; WIN64-NEXT: .seh_handlerdata
800 ; WIN64-NEXT: .seh_endproc
802 ; LINUXOSX64-LABEL: test_CallargRet256Vector:
803 ; LINUXOSX64: # %bb.0:
804 ; LINUXOSX64-NEXT: pushq %rsp
805 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
806 ; LINUXOSX64-NEXT: subq $80, %rsp
807 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 96
808 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
809 ; LINUXOSX64-NEXT: vmovdqu %ymm0, {{[-0-9]+}}(%r{{[sb]}}p) # 32-byte Spill
810 ; LINUXOSX64-NEXT: kmovd %eax, %k1
811 ; LINUXOSX64-NEXT: kmovw %k1, {{[-0-9]+}}(%r{{[sb]}}p) # 2-byte Spill
812 ; LINUXOSX64-NEXT: vmovdqa %ymm0, %ymm1
813 ; LINUXOSX64-NEXT: callq test_argRet256Vector
814 ; LINUXOSX64-NEXT: kmovw {{[-0-9]+}}(%r{{[sb]}}p), %k1 # 2-byte Reload
815 ; LINUXOSX64-NEXT: vmovdqu {{[-0-9]+}}(%r{{[sb]}}p), %ymm1 # 32-byte Reload
816 ; LINUXOSX64-NEXT: vmovdqa32 %ymm1, %ymm0 {%k1}
817 ; LINUXOSX64-NEXT: addq $80, %rsp
818 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
819 ; LINUXOSX64-NEXT: popq %rsp
820 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
821 ; LINUXOSX64-NEXT: retq
822 %b = call x86_regcallcc <8 x i32> @test_argRet256Vector(<8 x i1> %x, <8 x i32> %a, <8 x i32> %a)
823 %c = select <8 x i1> %x, <8 x i32> %a, <8 x i32> %b
827 ; Test regcall when receiving/returning 512 bit vector
828 define x86_regcallcc <16 x i32> @test_argRet512Vector(<16 x i1> %x, <16 x i32> %a, <16 x i32> %b) {
829 ; X32-LABEL: test_argRet512Vector:
831 ; X32-NEXT: kmovd %eax, %k1
832 ; X32-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
835 ; WIN64-LABEL: test_argRet512Vector:
837 ; WIN64-NEXT: kmovd %eax, %k1
838 ; WIN64-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
841 ; LINUXOSX64-LABEL: test_argRet512Vector:
842 ; LINUXOSX64: # %bb.0:
843 ; LINUXOSX64-NEXT: kmovd %eax, %k1
844 ; LINUXOSX64-NEXT: vpblendmd %zmm0, %zmm1, %zmm0 {%k1}
845 ; LINUXOSX64-NEXT: retq
846 %d = select <16 x i1> %x, <16 x i32> %a, <16 x i32> %b
850 ; Test regcall when passing/retrieving 512 bit vector
851 define x86_regcallcc <16 x i32> @test_CallargRet512Vector(<16 x i1> %x, <16 x i32> %a) {
852 ; X32-LABEL: test_CallargRet512Vector:
854 ; X32-NEXT: pushl %esp
855 ; X32-NEXT: subl $184, %esp
856 ; X32-NEXT: vmovdqu64 %zmm0, {{[-0-9]+}}(%e{{[sb]}}p) # 64-byte Spill
857 ; X32-NEXT: kmovd %eax, %k1
858 ; X32-NEXT: kmovw %k1, {{[-0-9]+}}(%e{{[sb]}}p) # 2-byte Spill
859 ; X32-NEXT: vmovdqa64 %zmm0, %zmm1
860 ; X32-NEXT: calll _test_argRet512Vector
861 ; X32-NEXT: kmovw {{[-0-9]+}}(%e{{[sb]}}p), %k1 # 2-byte Reload
862 ; X32-NEXT: vmovdqu64 {{[-0-9]+}}(%e{{[sb]}}p), %zmm1 # 64-byte Reload
863 ; X32-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1}
864 ; X32-NEXT: addl $184, %esp
865 ; X32-NEXT: popl %esp
868 ; WIN64-LABEL: test_CallargRet512Vector:
870 ; WIN64-NEXT: pushq %rsp
871 ; WIN64-NEXT: .seh_pushreg %rsp
872 ; WIN64-NEXT: subq $176, %rsp
873 ; WIN64-NEXT: .seh_stackalloc 176
874 ; WIN64-NEXT: .seh_endprologue
875 ; WIN64-NEXT: vmovdqu64 %zmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 64-byte Spill
876 ; WIN64-NEXT: kmovd %eax, %k1
877 ; WIN64-NEXT: kmovw %k1, {{[-0-9]+}}(%r{{[sb]}}p) # 2-byte Spill
878 ; WIN64-NEXT: vmovdqa64 %zmm0, %zmm1
879 ; WIN64-NEXT: callq test_argRet512Vector
880 ; WIN64-NEXT: kmovw {{[-0-9]+}}(%r{{[sb]}}p), %k1 # 2-byte Reload
881 ; WIN64-NEXT: vmovdqu64 {{[-0-9]+}}(%r{{[sb]}}p), %zmm1 # 64-byte Reload
882 ; WIN64-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1}
883 ; WIN64-NEXT: addq $176, %rsp
884 ; WIN64-NEXT: popq %rsp
886 ; WIN64-NEXT: .seh_handlerdata
888 ; WIN64-NEXT: .seh_endproc
890 ; LINUXOSX64-LABEL: test_CallargRet512Vector:
891 ; LINUXOSX64: # %bb.0:
892 ; LINUXOSX64-NEXT: pushq %rsp
893 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
894 ; LINUXOSX64-NEXT: subq $176, %rsp
895 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 192
896 ; LINUXOSX64-NEXT: .cfi_offset %rsp, -16
897 ; LINUXOSX64-NEXT: vmovdqu64 %zmm0, {{[-0-9]+}}(%r{{[sb]}}p) # 64-byte Spill
898 ; LINUXOSX64-NEXT: kmovd %eax, %k1
899 ; LINUXOSX64-NEXT: kmovw %k1, {{[-0-9]+}}(%r{{[sb]}}p) # 2-byte Spill
900 ; LINUXOSX64-NEXT: vmovdqa64 %zmm0, %zmm1
901 ; LINUXOSX64-NEXT: callq test_argRet512Vector
902 ; LINUXOSX64-NEXT: kmovw {{[-0-9]+}}(%r{{[sb]}}p), %k1 # 2-byte Reload
903 ; LINUXOSX64-NEXT: vmovdqu64 {{[-0-9]+}}(%r{{[sb]}}p), %zmm1 # 64-byte Reload
904 ; LINUXOSX64-NEXT: vmovdqa32 %zmm1, %zmm0 {%k1}
905 ; LINUXOSX64-NEXT: addq $176, %rsp
906 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 16
907 ; LINUXOSX64-NEXT: popq %rsp
908 ; LINUXOSX64-NEXT: .cfi_def_cfa_offset 8
909 ; LINUXOSX64-NEXT: retq
910 %b = call x86_regcallcc <16 x i32> @test_argRet512Vector(<16 x i1> %x, <16 x i32> %a, <16 x i32> %a)
911 %c = select <16 x i1> %x, <16 x i32> %a, <16 x i32> %b
915 ; Test regcall when running multiple input parameters - callee saved xmms
916 define x86_regcallcc <32 x float> @testf32_inp(<32 x float> %a, <32 x float> %b, <32 x float> %c) nounwind {
917 ; X32-LABEL: testf32_inp:
919 ; X32-NEXT: subl $44, %esp
920 ; X32-NEXT: vmovups %xmm7, {{[-0-9]+}}(%e{{[sb]}}p) # 16-byte Spill
921 ; X32-NEXT: vmovups %xmm6, (%esp) # 16-byte Spill
922 ; X32-NEXT: vaddps %zmm2, %zmm0, %zmm6
923 ; X32-NEXT: vaddps %zmm3, %zmm1, %zmm7
924 ; X32-NEXT: vmulps %zmm2, %zmm0, %zmm0
925 ; X32-NEXT: vsubps %zmm0, %zmm6, %zmm0
926 ; X32-NEXT: vmulps %zmm3, %zmm1, %zmm1
927 ; X32-NEXT: vsubps %zmm1, %zmm7, %zmm1
928 ; X32-NEXT: vaddps %zmm4, %zmm0, %zmm0
929 ; X32-NEXT: vaddps %zmm5, %zmm1, %zmm1
930 ; X32-NEXT: vmovups (%esp), %xmm6 # 16-byte Reload
931 ; X32-NEXT: vmovups {{[-0-9]+}}(%e{{[sb]}}p), %xmm7 # 16-byte Reload
932 ; X32-NEXT: addl $44, %esp
935 ; WIN64-LABEL: testf32_inp:
937 ; WIN64-NEXT: vaddps %zmm2, %zmm0, %zmm6
938 ; WIN64-NEXT: vaddps %zmm3, %zmm1, %zmm7
939 ; WIN64-NEXT: vmulps %zmm2, %zmm0, %zmm0
940 ; WIN64-NEXT: vsubps %zmm0, %zmm6, %zmm0
941 ; WIN64-NEXT: vmulps %zmm3, %zmm1, %zmm1
942 ; WIN64-NEXT: vsubps %zmm1, %zmm7, %zmm1
943 ; WIN64-NEXT: vaddps %zmm4, %zmm0, %zmm0
944 ; WIN64-NEXT: vaddps %zmm5, %zmm1, %zmm1
947 ; LINUXOSX64-LABEL: testf32_inp:
948 ; LINUXOSX64: # %bb.0:
949 ; LINUXOSX64-NEXT: vaddps %zmm2, %zmm0, %zmm6
950 ; LINUXOSX64-NEXT: vaddps %zmm3, %zmm1, %zmm7
951 ; LINUXOSX64-NEXT: vmulps %zmm2, %zmm0, %zmm0
952 ; LINUXOSX64-NEXT: vsubps %zmm0, %zmm6, %zmm0
953 ; LINUXOSX64-NEXT: vmulps %zmm3, %zmm1, %zmm1
954 ; LINUXOSX64-NEXT: vsubps %zmm1, %zmm7, %zmm1
955 ; LINUXOSX64-NEXT: vaddps %zmm4, %zmm0, %zmm0
956 ; LINUXOSX64-NEXT: vaddps %zmm5, %zmm1, %zmm1
957 ; LINUXOSX64-NEXT: retq
958 %x1 = fadd <32 x float> %a, %b
959 %x2 = fmul <32 x float> %a, %b
960 %x3 = fsub <32 x float> %x1, %x2
961 %x4 = fadd <32 x float> %x3, %c
965 ; Test regcall when running multiple input parameters - callee saved GPRs
966 define x86_regcallcc i32 @testi32_inp(i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6, i32 %b1, i32 %b2, i32 %b3, i32 %b4, i32 %b5, i32 %b6) nounwind {
967 ; X32-LABEL: testi32_inp:
969 ; X32-NEXT: pushl %ebp
970 ; X32-NEXT: pushl %ebx
971 ; X32-NEXT: subl $20, %esp
972 ; X32-NEXT: movl %esi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
973 ; X32-NEXT: movl %edi, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
974 ; X32-NEXT: movl %edx, (%esp) # 4-byte Spill
975 ; X32-NEXT: movl %ecx, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
976 ; X32-NEXT: movl %eax, %ebx
977 ; X32-NEXT: movl %eax, {{[-0-9]+}}(%e{{[sb]}}p) # 4-byte Spill
978 ; X32-NEXT: subl %ecx, %ebx
979 ; X32-NEXT: movl {{[0-9]+}}(%esp), %esi
980 ; X32-NEXT: movl %esi, %ebp
981 ; X32-NEXT: subl {{[0-9]+}}(%esp), %ebp
982 ; X32-NEXT: imull %ebp, %ebx
983 ; X32-NEXT: movl %edx, %ebp
984 ; X32-NEXT: subl %edi, %ebp
985 ; X32-NEXT: movl {{[0-9]+}}(%esp), %edx
986 ; X32-NEXT: movl %edx, %ecx
987 ; X32-NEXT: subl {{[0-9]+}}(%esp), %ecx
988 ; X32-NEXT: imull %ebp, %ecx
989 ; X32-NEXT: addl %ecx, %ebx
990 ; X32-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %edi # 4-byte Reload
991 ; X32-NEXT: movl %edi, %ebp
992 ; X32-NEXT: subl {{[0-9]+}}(%esp), %ebp
993 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ecx
994 ; X32-NEXT: movl %ecx, %eax
995 ; X32-NEXT: subl {{[0-9]+}}(%esp), %eax
996 ; X32-NEXT: imull %ebp, %eax
997 ; X32-NEXT: addl %eax, %ebx
998 ; X32-NEXT: movl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Reload
999 ; X32-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %eax # 4-byte Folded Reload
1000 ; X32-NEXT: movl (%esp), %ebp # 4-byte Reload
1001 ; X32-NEXT: addl {{[-0-9]+}}(%e{{[sb]}}p), %ebp # 4-byte Folded Reload
1002 ; X32-NEXT: addl {{[0-9]+}}(%esp), %edi
1003 ; X32-NEXT: addl {{[0-9]+}}(%esp), %esi
1004 ; X32-NEXT: imull %eax, %esi
1005 ; X32-NEXT: addl {{[0-9]+}}(%esp), %edx
1006 ; X32-NEXT: imull %ebp, %edx
1007 ; X32-NEXT: addl %esi, %edx
1008 ; X32-NEXT: addl {{[0-9]+}}(%esp), %ecx
1009 ; X32-NEXT: imull %edi, %ecx
1010 ; X32-NEXT: addl %edx, %ecx
1011 ; X32-NEXT: addl %ecx, %ebx
1012 ; X32-NEXT: movl %ebx, %eax
1013 ; X32-NEXT: addl $20, %esp
1014 ; X32-NEXT: popl %ebx
1015 ; X32-NEXT: popl %ebp
1018 ; WIN64-LABEL: testi32_inp:
1020 ; WIN64-NEXT: pushq %r13
1021 ; WIN64-NEXT: pushq %rbp
1022 ; WIN64-NEXT: pushq %rbx
1023 ; WIN64-NEXT: movl %eax, %r13d
1024 ; WIN64-NEXT: subl %ecx, %eax
1025 ; WIN64-NEXT: movl %edx, %ebp
1026 ; WIN64-NEXT: subl %edi, %ebp
1027 ; WIN64-NEXT: movl %r9d, %ebx
1028 ; WIN64-NEXT: subl %r10d, %ebx
1029 ; WIN64-NEXT: imull %ebx, %eax
1030 ; WIN64-NEXT: movl %r11d, %ebx
1031 ; WIN64-NEXT: subl %r12d, %ebx
1032 ; WIN64-NEXT: imull %ebp, %ebx
1033 ; WIN64-NEXT: movl %esi, %ebp
1034 ; WIN64-NEXT: subl %r8d, %ebp
1035 ; WIN64-NEXT: addl %ebx, %eax
1036 ; WIN64-NEXT: movl %r14d, %ebx
1037 ; WIN64-NEXT: subl %r15d, %ebx
1038 ; WIN64-NEXT: imull %ebp, %ebx
1039 ; WIN64-NEXT: addl %ebx, %eax
1040 ; WIN64-NEXT: addl %ecx, %r13d
1041 ; WIN64-NEXT: addl %edi, %edx
1042 ; WIN64-NEXT: addl %r8d, %esi
1043 ; WIN64-NEXT: addl %r10d, %r9d
1044 ; WIN64-NEXT: imull %r13d, %r9d
1045 ; WIN64-NEXT: addl %r12d, %r11d
1046 ; WIN64-NEXT: imull %edx, %r11d
1047 ; WIN64-NEXT: addl %r9d, %r11d
1048 ; WIN64-NEXT: addl %r15d, %r14d
1049 ; WIN64-NEXT: imull %esi, %r14d
1050 ; WIN64-NEXT: addl %r11d, %r14d
1051 ; WIN64-NEXT: addl %r14d, %eax
1052 ; WIN64-NEXT: popq %rbx
1053 ; WIN64-NEXT: popq %rbp
1054 ; WIN64-NEXT: popq %r13
1057 ; LINUXOSX64-LABEL: testi32_inp:
1058 ; LINUXOSX64: # %bb.0:
1059 ; LINUXOSX64-NEXT: pushq %rbp
1060 ; LINUXOSX64-NEXT: pushq %rbx
1061 ; LINUXOSX64-NEXT: movl %eax, %r10d
1062 ; LINUXOSX64-NEXT: movl {{[0-9]+}}(%rsp), %r11d
1063 ; LINUXOSX64-NEXT: subl %ecx, %eax
1064 ; LINUXOSX64-NEXT: movl %edx, %ebx
1065 ; LINUXOSX64-NEXT: subl %edi, %ebx
1066 ; LINUXOSX64-NEXT: movl %r9d, %ebp
1067 ; LINUXOSX64-NEXT: subl %r12d, %ebp
1068 ; LINUXOSX64-NEXT: imull %ebp, %eax
1069 ; LINUXOSX64-NEXT: movl %r13d, %ebp
1070 ; LINUXOSX64-NEXT: subl %r14d, %ebp
1071 ; LINUXOSX64-NEXT: imull %ebx, %ebp
1072 ; LINUXOSX64-NEXT: movl %esi, %ebx
1073 ; LINUXOSX64-NEXT: subl %r8d, %ebx
1074 ; LINUXOSX64-NEXT: addl %ebp, %eax
1075 ; LINUXOSX64-NEXT: movl %r15d, %ebp
1076 ; LINUXOSX64-NEXT: subl %r11d, %ebp
1077 ; LINUXOSX64-NEXT: imull %ebx, %ebp
1078 ; LINUXOSX64-NEXT: addl %ebp, %eax
1079 ; LINUXOSX64-NEXT: addl %ecx, %r10d
1080 ; LINUXOSX64-NEXT: addl %edi, %edx
1081 ; LINUXOSX64-NEXT: addl %r8d, %esi
1082 ; LINUXOSX64-NEXT: addl %r12d, %r9d
1083 ; LINUXOSX64-NEXT: imull %r10d, %r9d
1084 ; LINUXOSX64-NEXT: addl %r14d, %r13d
1085 ; LINUXOSX64-NEXT: imull %edx, %r13d
1086 ; LINUXOSX64-NEXT: addl %r9d, %r13d
1087 ; LINUXOSX64-NEXT: addl %r11d, %r15d
1088 ; LINUXOSX64-NEXT: imull %esi, %r15d
1089 ; LINUXOSX64-NEXT: addl %r13d, %r15d
1090 ; LINUXOSX64-NEXT: addl %r15d, %eax
1091 ; LINUXOSX64-NEXT: popq %rbx
1092 ; LINUXOSX64-NEXT: popq %rbp
1093 ; LINUXOSX64-NEXT: retq
1094 %x1 = sub i32 %a1, %a2
1095 %x2 = sub i32 %a3, %a4
1096 %x3 = sub i32 %a5, %a6
1097 %y1 = sub i32 %b1, %b2
1098 %y2 = sub i32 %b3, %b4
1099 %y3 = sub i32 %b5, %b6
1100 %v1 = add i32 %a1, %a2
1101 %v2 = add i32 %a3, %a4
1102 %v3 = add i32 %a5, %a6
1103 %w1 = add i32 %b1, %b2
1104 %w2 = add i32 %b3, %b4
1105 %w3 = add i32 %b5, %b6
1106 %s1 = mul i32 %x1, %y1
1107 %s2 = mul i32 %x2, %y2
1108 %s3 = mul i32 %x3, %y3
1109 %t1 = mul i32 %v1, %w1
1110 %t2 = mul i32 %v2, %w2
1111 %t3 = mul i32 %v3, %w3
1112 %m1 = add i32 %s1, %s2
1113 %m2 = add i32 %m1, %s3
1114 %n1 = add i32 %t1, %t2
1115 %n2 = add i32 %n1, %t3
1116 %r1 = add i32 %m2, %n2
1120 ; Test that parameters, overflowing register capacity, are passed through the stack
1121 define x86_regcallcc <32 x float> @testf32_stack(<32 x float> %a0, <32 x float> %b0, <32 x float> %c0, <32 x float> %a1, <32 x float> %b1, <32 x float> %c1, <32 x float> %a2, <32 x float> %b2, <32 x float> %c2) nounwind {
1122 ; X32-LABEL: testf32_stack:
1124 ; X32-NEXT: pushl %ebp
1125 ; X32-NEXT: movl %esp, %ebp
1126 ; X32-NEXT: andl $-64, %esp
1127 ; X32-NEXT: subl $64, %esp
1128 ; X32-NEXT: vaddps %zmm3, %zmm1, %zmm1
1129 ; X32-NEXT: vaddps %zmm2, %zmm0, %zmm0
1130 ; X32-NEXT: vaddps %zmm0, %zmm4, %zmm0
1131 ; X32-NEXT: vaddps %zmm1, %zmm5, %zmm1
1132 ; X32-NEXT: vaddps %zmm1, %zmm7, %zmm1
1133 ; X32-NEXT: vaddps %zmm0, %zmm6, %zmm0
1134 ; X32-NEXT: vaddps 8(%ebp), %zmm0, %zmm0
1135 ; X32-NEXT: vaddps 72(%ebp), %zmm1, %zmm1
1136 ; X32-NEXT: vaddps 200(%ebp), %zmm1, %zmm1
1137 ; X32-NEXT: vaddps 136(%ebp), %zmm0, %zmm0
1138 ; X32-NEXT: vaddps 264(%ebp), %zmm0, %zmm0
1139 ; X32-NEXT: vaddps 328(%ebp), %zmm1, %zmm1
1140 ; X32-NEXT: vaddps 456(%ebp), %zmm1, %zmm1
1141 ; X32-NEXT: vaddps 392(%ebp), %zmm0, %zmm0
1142 ; X32-NEXT: vaddps 520(%ebp), %zmm0, %zmm0
1143 ; X32-NEXT: vaddps 584(%ebp), %zmm1, %zmm1
1144 ; X32-NEXT: movl %ebp, %esp
1145 ; X32-NEXT: popl %ebp
1148 ; WIN64-LABEL: testf32_stack:
1150 ; WIN64-NEXT: pushq %rbp
1151 ; WIN64-NEXT: subq $48, %rsp
1152 ; WIN64-NEXT: leaq {{[0-9]+}}(%rsp), %rbp
1153 ; WIN64-NEXT: andq $-64, %rsp
1154 ; WIN64-NEXT: vaddps %zmm3, %zmm1, %zmm1
1155 ; WIN64-NEXT: vaddps %zmm2, %zmm0, %zmm0
1156 ; WIN64-NEXT: vaddps %zmm0, %zmm4, %zmm0
1157 ; WIN64-NEXT: vaddps %zmm1, %zmm5, %zmm1
1158 ; WIN64-NEXT: vaddps %zmm1, %zmm7, %zmm1
1159 ; WIN64-NEXT: vaddps %zmm0, %zmm6, %zmm0
1160 ; WIN64-NEXT: vaddps %zmm0, %zmm8, %zmm0
1161 ; WIN64-NEXT: vaddps %zmm1, %zmm9, %zmm1
1162 ; WIN64-NEXT: vaddps %zmm1, %zmm11, %zmm1
1163 ; WIN64-NEXT: vaddps %zmm0, %zmm10, %zmm0
1164 ; WIN64-NEXT: vaddps %zmm0, %zmm12, %zmm0
1165 ; WIN64-NEXT: vaddps %zmm1, %zmm13, %zmm1
1166 ; WIN64-NEXT: vaddps %zmm1, %zmm15, %zmm1
1167 ; WIN64-NEXT: vaddps %zmm0, %zmm14, %zmm0
1168 ; WIN64-NEXT: vaddps 16(%rbp), %zmm0, %zmm0
1169 ; WIN64-NEXT: vaddps 80(%rbp), %zmm1, %zmm1
1170 ; WIN64-NEXT: movq %rbp, %rsp
1171 ; WIN64-NEXT: popq %rbp
1174 ; LINUXOSX64-LABEL: testf32_stack:
1175 ; LINUXOSX64: # %bb.0:
1176 ; LINUXOSX64-NEXT: pushq %rbp
1177 ; LINUXOSX64-NEXT: movq %rsp, %rbp
1178 ; LINUXOSX64-NEXT: andq $-64, %rsp
1179 ; LINUXOSX64-NEXT: subq $64, %rsp
1180 ; LINUXOSX64-NEXT: vaddps %zmm3, %zmm1, %zmm1
1181 ; LINUXOSX64-NEXT: vaddps %zmm2, %zmm0, %zmm0
1182 ; LINUXOSX64-NEXT: vaddps %zmm0, %zmm4, %zmm0
1183 ; LINUXOSX64-NEXT: vaddps %zmm1, %zmm5, %zmm1
1184 ; LINUXOSX64-NEXT: vaddps %zmm1, %zmm7, %zmm1
1185 ; LINUXOSX64-NEXT: vaddps %zmm0, %zmm6, %zmm0
1186 ; LINUXOSX64-NEXT: vaddps %zmm0, %zmm8, %zmm0
1187 ; LINUXOSX64-NEXT: vaddps %zmm1, %zmm9, %zmm1
1188 ; LINUXOSX64-NEXT: vaddps %zmm1, %zmm11, %zmm1
1189 ; LINUXOSX64-NEXT: vaddps %zmm0, %zmm10, %zmm0
1190 ; LINUXOSX64-NEXT: vaddps %zmm0, %zmm12, %zmm0
1191 ; LINUXOSX64-NEXT: vaddps %zmm1, %zmm13, %zmm1
1192 ; LINUXOSX64-NEXT: vaddps %zmm1, %zmm15, %zmm1
1193 ; LINUXOSX64-NEXT: vaddps %zmm0, %zmm14, %zmm0
1194 ; LINUXOSX64-NEXT: vaddps 16(%rbp), %zmm0, %zmm0
1195 ; LINUXOSX64-NEXT: vaddps 80(%rbp), %zmm1, %zmm1
1196 ; LINUXOSX64-NEXT: movq %rbp, %rsp
1197 ; LINUXOSX64-NEXT: popq %rbp
1198 ; LINUXOSX64-NEXT: retq
1199 %x1 = fadd <32 x float> %a0, %b0
1200 %x2 = fadd <32 x float> %c0, %x1
1201 %x3 = fadd <32 x float> %a1, %x2
1202 %x4 = fadd <32 x float> %b1, %x3
1203 %x5 = fadd <32 x float> %c1, %x4
1204 %x6 = fadd <32 x float> %a2, %x5
1205 %x7 = fadd <32 x float> %b2, %x6
1206 %x8 = fadd <32 x float> %c2, %x7
1207 ret <32 x float> %x8
1210 ; Test regcall when passing/retrieving mixed types
1211 define x86_regcallcc i32 @test_argRetMixTypes(double, float, i8 signext, i32, i64, i16 signext, i32*) #0 {
1212 ; X32-LABEL: test_argRetMixTypes:
1214 ; X32-NEXT: pushl %ebx
1215 ; X32-NEXT: movl {{[0-9]+}}(%esp), %ebx
1216 ; X32-NEXT: vcvtss2sd %xmm1, %xmm1, %xmm1
1217 ; X32-NEXT: vaddsd %xmm0, %xmm1, %xmm0
1218 ; X32-NEXT: vcvtsi2sd %eax, %xmm2, %xmm1
1219 ; X32-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1220 ; X32-NEXT: vcvtsi2sd %ecx, %xmm2, %xmm1
1221 ; X32-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1222 ; X32-NEXT: vmovd %edx, %xmm1
1223 ; X32-NEXT: vpinsrd $1, %edi, %xmm1, %xmm1
1224 ; X32-NEXT: vcvtqq2pd %ymm1, %ymm1
1225 ; X32-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1226 ; X32-NEXT: vcvtsi2sd %esi, %xmm2, %xmm1
1227 ; X32-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1228 ; X32-NEXT: vcvtsi2sdl (%ebx), %xmm2, %xmm1
1229 ; X32-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1230 ; X32-NEXT: vcvttsd2si %xmm0, %eax
1231 ; X32-NEXT: popl %ebx
1232 ; X32-NEXT: vzeroupper
1235 ; WIN64-LABEL: test_argRetMixTypes:
1237 ; WIN64-NEXT: vcvtss2sd %xmm1, %xmm1, %xmm1
1238 ; WIN64-NEXT: vaddsd %xmm0, %xmm1, %xmm0
1239 ; WIN64-NEXT: vcvtsi2sd %eax, %xmm2, %xmm1
1240 ; WIN64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1241 ; WIN64-NEXT: vcvtsi2sd %ecx, %xmm2, %xmm1
1242 ; WIN64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1243 ; WIN64-NEXT: vcvtsi2sd %rdx, %xmm2, %xmm1
1244 ; WIN64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1245 ; WIN64-NEXT: vcvtsi2sd %edi, %xmm2, %xmm1
1246 ; WIN64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1247 ; WIN64-NEXT: vcvtsi2sdl (%rsi), %xmm2, %xmm1
1248 ; WIN64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1249 ; WIN64-NEXT: vcvttsd2si %xmm0, %eax
1252 ; LINUXOSX64-LABEL: test_argRetMixTypes:
1253 ; LINUXOSX64: # %bb.0:
1254 ; LINUXOSX64-NEXT: vcvtss2sd %xmm1, %xmm1, %xmm1
1255 ; LINUXOSX64-NEXT: vaddsd %xmm0, %xmm1, %xmm0
1256 ; LINUXOSX64-NEXT: vcvtsi2sd %eax, %xmm2, %xmm1
1257 ; LINUXOSX64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1258 ; LINUXOSX64-NEXT: vcvtsi2sd %ecx, %xmm2, %xmm1
1259 ; LINUXOSX64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1260 ; LINUXOSX64-NEXT: vcvtsi2sd %rdx, %xmm2, %xmm1
1261 ; LINUXOSX64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1262 ; LINUXOSX64-NEXT: vcvtsi2sd %edi, %xmm2, %xmm1
1263 ; LINUXOSX64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1264 ; LINUXOSX64-NEXT: vcvtsi2sdl (%rsi), %xmm2, %xmm1
1265 ; LINUXOSX64-NEXT: vaddsd %xmm1, %xmm0, %xmm0
1266 ; LINUXOSX64-NEXT: vcvttsd2si %xmm0, %eax
1267 ; LINUXOSX64-NEXT: retq
1268 %8 = fpext float %1 to double
1269 %9 = fadd double %8, %0
1270 %10 = sitofp i8 %2 to double
1271 %11 = fadd double %9, %10
1272 %12 = sitofp i32 %3 to double
1273 %13 = fadd double %11, %12
1274 %14 = sitofp i64 %4 to double
1275 %15 = fadd double %13, %14
1276 %16 = sitofp i16 %5 to double
1277 %17 = fadd double %15, %16
1278 %18 = load i32, i32* %6, align 4
1279 %19 = sitofp i32 %18 to double
1280 %20 = fadd double %17, %19
1281 %21 = fptosi double %20 to i32
1285 %struct.complex = type { float, double, i32, i8, i64}
1287 define x86_regcallcc %struct.complex @test_argMultiRet(float, double, i32, i8, i64) local_unnamed_addr #0 {
1288 ; X32-LABEL: test_argMultiRet:
1290 ; X32-NEXT: vaddsd __real@4014000000000000, %xmm1, %xmm1
1291 ; X32-NEXT: movl $4, %eax
1292 ; X32-NEXT: movb $7, %cl
1293 ; X32-NEXT: movl $999, %edx # imm = 0x3E7
1294 ; X32-NEXT: xorl %edi, %edi
1297 ; WIN64-LABEL: test_argMultiRet:
1299 ; WIN64-NEXT: vaddsd __real@{{.*}}(%rip), %xmm1, %xmm1
1300 ; WIN64-NEXT: movl $999, %edx # imm = 0x3E7
1301 ; WIN64-NEXT: movl $4, %eax
1302 ; WIN64-NEXT: movb $7, %cl
1305 ; LINUXOSX64-LABEL: test_argMultiRet:
1306 ; LINUXOSX64: # %bb.0:
1307 ; LINUXOSX64-NEXT: vaddsd {{.*}}(%rip), %xmm1, %xmm1
1308 ; LINUXOSX64-NEXT: movl $999, %edx # imm = 0x3E7
1309 ; LINUXOSX64-NEXT: movl $4, %eax
1310 ; LINUXOSX64-NEXT: movb $7, %cl
1311 ; LINUXOSX64-NEXT: retq
1312 %6 = fadd double %1, 5.000000e+00
1313 %7 = insertvalue %struct.complex undef, float %0, 0
1314 %8 = insertvalue %struct.complex %7, double %6, 1
1315 %9 = insertvalue %struct.complex %8, i32 4, 2
1316 %10 = insertvalue %struct.complex %9, i8 7, 3
1317 %11 = insertvalue %struct.complex %10, i64 999, 4
1318 ret %struct.complex %11