1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=arm64ec-pc-windows-msvc < %s | FileCheck %s
3 ; RUN: llc -mtriple=arm64ec-pc-windows-msvc < %s -global-isel=1 -global-isel-abort=0 | FileCheck %s
5 define void @varargs_callee(double %x, ...) nounwind {
6 ; CHECK-LABEL: varargs_callee:
8 ; CHECK-NEXT: sub sp, sp, #48
9 ; CHECK-NEXT: stp x1, x2, [x4, #-24]!
10 ; CHECK-NEXT: str x3, [x4, #16]
11 ; CHECK-NEXT: str x4, [sp, #8]
12 ; CHECK-NEXT: add sp, sp, #48
14 %list = alloca ptr, align 8
15 call void @llvm.va_start(ptr nonnull %list)
19 define void @varargs_callee_manyargs(i64, i64, i64, i64, i64, ...) nounwind {
20 ; CHECK-LABEL: varargs_callee_manyargs:
22 ; CHECK-NEXT: sub sp, sp, #16
23 ; CHECK-NEXT: add x8, x4, #8
24 ; CHECK-NEXT: str x8, [sp, #8]
25 ; CHECK-NEXT: add sp, sp, #16
27 %list = alloca ptr, align 8
28 call void @llvm.va_start(ptr nonnull %list)
32 define void @varargs_caller() nounwind {
33 ; CHECK-LABEL: varargs_caller:
35 ; CHECK-NEXT: sub sp, sp, #48
36 ; CHECK-NEXT: mov x4, sp
37 ; CHECK-NEXT: add x8, sp, #16
38 ; CHECK-NEXT: mov x9, #4617315517961601024
39 ; CHECK-NEXT: mov x0, #4607182418800017408
40 ; CHECK-NEXT: mov w1, #2
41 ; CHECK-NEXT: mov x2, #4613937818241073152
42 ; CHECK-NEXT: mov w3, #4
43 ; CHECK-NEXT: mov w5, #16
44 ; CHECK-NEXT: stp xzr, x30, [sp, #24] // 8-byte Folded Spill
45 ; CHECK-NEXT: stp x8, xzr, [sp, #8]
46 ; CHECK-NEXT: str x9, [sp]
47 ; CHECK-NEXT: bl varargs_callee
48 ; CHECK-NEXT: ldr x30, [sp, #32] // 8-byte Folded Reload
49 ; CHECK-NEXT: add sp, sp, #48
51 call void (double, ...) @varargs_callee(double 1.0, i32 2, double 3.0, i32 4, double 5.0, <2 x double> <double 0.0, double 0.0>)
55 define <2 x double> @varargs_many_argscallee(double %a, double %b, double %c,
56 ; CHECK-LABEL: varargs_many_argscallee:
58 ; CHECK-NEXT: ldr x8, [x4]
59 ; CHECK-NEXT: ldr q0, [x3]
60 ; CHECK-NEXT: ldr q1, [x8]
61 ; CHECK-NEXT: fadd v0.2d, v0.2d, v1.2d
63 <2 x double> %d, <2 x double> %e, ...) nounwind {
64 %rval = fadd <2 x double> %d, %e
65 ret <2 x double> %rval
68 define void @varargs_many_argscalleer() nounwind {
69 ; CHECK-LABEL: varargs_many_argscalleer:
71 ; CHECK-NEXT: sub sp, sp, #64
72 ; CHECK-NEXT: movi v0.2d, #0000000000000000
73 ; CHECK-NEXT: mov x4, sp
74 ; CHECK-NEXT: mov x8, #4618441417868443648
75 ; CHECK-NEXT: add x9, sp, #16
76 ; CHECK-NEXT: add x3, sp, #32
77 ; CHECK-NEXT: mov x0, #4607182418800017408
78 ; CHECK-NEXT: mov x1, #4611686018427387904
79 ; CHECK-NEXT: mov x2, #4613937818241073152
80 ; CHECK-NEXT: mov w5, #16
81 ; CHECK-NEXT: str x30, [sp, #48] // 8-byte Folded Spill
82 ; CHECK-NEXT: stp q0, q0, [sp, #16]
83 ; CHECK-NEXT: stp x9, x8, [sp]
84 ; CHECK-NEXT: bl varargs_many_argscallee
85 ; CHECK-NEXT: ldr x30, [sp, #48] // 8-byte Folded Reload
86 ; CHECK-NEXT: add sp, sp, #64
88 call <2 x double> (double, double, double, <2 x double>, <2 x double>, ...)
89 @varargs_many_argscallee(double 1., double 2., double 3.,
90 <2 x double> zeroinitializer,
91 <2 x double> zeroinitializer, double 6.)
96 declare void @llvm.va_start(ptr)