1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -verify-machineinstrs \
3 ; RUN: | FileCheck -check-prefix=ILP32-ILP32F-FPELIM %s
4 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -verify-machineinstrs -frame-pointer=all \
5 ; RUN: | FileCheck -check-prefix=ILP32-ILP32F-WITHFP %s
6 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+d -verify-machineinstrs \
7 ; RUN: | FileCheck -check-prefix=RV32D-ILP32-ILP32F-ILP32D-FPELIM %s
8 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+d -target-abi ilp32f \
9 ; RUN: -verify-machineinstrs \
10 ; RUN: | FileCheck -check-prefix=RV32D-ILP32-ILP32F-ILP32D-FPELIM %s
11 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -mattr=+d -target-abi ilp32d \
12 ; RUN: -verify-machineinstrs \
13 ; RUN: | FileCheck -check-prefix=RV32D-ILP32-ILP32F-ILP32D-FPELIM %s
14 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -target-abi ilp32e \
15 ; RUN: -verify-machineinstrs \
16 ; RUN: | FileCheck -check-prefix=ILP32E-FPELIM %s
17 ; RUN: sed 's/iXLen/i32/g' %s | llc -mtriple=riscv32 -target-abi ilp32e -frame-pointer=all \
18 ; RUN: -verify-machineinstrs \
19 ; RUN: | FileCheck -check-prefix=ILP32E-WITHFP %s
20 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -verify-machineinstrs \
21 ; RUN: | FileCheck -check-prefix=LP64-LP64F-LP64D-FPELIM %s
22 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+d -target-abi lp64f \
23 ; RUN: -verify-machineinstrs \
24 ; RUN: | FileCheck -check-prefix=LP64-LP64F-LP64D-FPELIM %s
25 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -mattr=+d -target-abi lp64d \
26 ; RUN: -verify-machineinstrs \
27 ; RUN: | FileCheck -check-prefix=LP64-LP64F-LP64D-FPELIM %s
28 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -verify-machineinstrs -frame-pointer=all \
29 ; RUN: | FileCheck -check-prefix=LP64-LP64F-LP64D-WITHFP %s
30 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -target-abi lp64e \
31 ; RUN: -verify-machineinstrs \
32 ; RUN: | FileCheck -check-prefix=LP64E-FPELIM %s
33 ; RUN: sed 's/iXLen/i64/g' %s | llc -mtriple=riscv64 -target-abi lp64e -frame-pointer=all \
34 ; RUN: -verify-machineinstrs \
35 ; RUN: | FileCheck -check-prefix=LP64E-WITHFP %s
37 ; The same vararg calling convention is used for ilp32/ilp32f/ilp32d and for
38 ; lp64/lp64f/lp64d. Different CHECK lines are required for RV32D due to slight
39 ; codegen differences due to the way the f64 load operations are lowered.
40 ; The nounwind attribute is omitted for some of the tests, to check that CFI
41 ; directives are correctly generated.
43 declare void @llvm.va_start(ptr)
44 declare void @llvm.va_end(ptr)
46 declare void @notdead(ptr)
48 ; Although frontends are recommended to not generate va_arg due to the lack of
49 ; support for aggregate types, we test simple cases here to ensure they are
52 define i32 @va1(ptr %fmt, ...) {
53 ; ILP32-ILP32F-FPELIM-LABEL: va1:
54 ; ILP32-ILP32F-FPELIM: # %bb.0:
55 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
56 ; ILP32-ILP32F-FPELIM-NEXT: .cfi_def_cfa_offset 48
57 ; ILP32-ILP32F-FPELIM-NEXT: mv a0, a1
58 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
59 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
60 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
61 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
62 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
63 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
64 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
65 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, sp, 24
66 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 12(sp)
67 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
68 ; ILP32-ILP32F-FPELIM-NEXT: ret
70 ; ILP32-ILP32F-WITHFP-LABEL: va1:
71 ; ILP32-ILP32F-WITHFP: # %bb.0:
72 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
73 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa_offset 48
74 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
75 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
76 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_offset ra, -36
77 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_offset s0, -40
78 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
79 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa s0, 32
80 ; ILP32-ILP32F-WITHFP-NEXT: mv a0, a1
81 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
82 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
83 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
84 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
85 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
86 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
87 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
88 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 8
89 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -12(s0)
90 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
91 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
92 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
93 ; ILP32-ILP32F-WITHFP-NEXT: ret
95 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va1:
96 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
97 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
98 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: .cfi_def_cfa_offset 48
99 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv a0, a1
100 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
101 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
102 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
103 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
104 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
105 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
106 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
107 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, sp, 24
108 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
109 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
110 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
112 ; ILP32E-FPELIM-LABEL: va1:
113 ; ILP32E-FPELIM: # %bb.0:
114 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
115 ; ILP32E-FPELIM-NEXT: .cfi_def_cfa_offset 28
116 ; ILP32E-FPELIM-NEXT: mv a0, a1
117 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
118 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
119 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
120 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
121 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
122 ; ILP32E-FPELIM-NEXT: addi a1, sp, 12
123 ; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
124 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
125 ; ILP32E-FPELIM-NEXT: ret
127 ; ILP32E-WITHFP-LABEL: va1:
128 ; ILP32E-WITHFP: # %bb.0:
129 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
130 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 36
131 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
132 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
133 ; ILP32E-WITHFP-NEXT: .cfi_offset ra, -28
134 ; ILP32E-WITHFP-NEXT: .cfi_offset s0, -32
135 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
136 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 24
137 ; ILP32E-WITHFP-NEXT: mv a0, a1
138 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
139 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
140 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
141 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
142 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
143 ; ILP32E-WITHFP-NEXT: addi a1, s0, 8
144 ; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
145 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
146 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
147 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
148 ; ILP32E-WITHFP-NEXT: ret
150 ; LP64-LP64F-LP64D-FPELIM-LABEL: va1:
151 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
152 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
153 ; LP64-LP64F-LP64D-FPELIM-NEXT: .cfi_def_cfa_offset 80
154 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
155 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
156 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
157 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, sp, 28
158 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 8(sp)
159 ; LP64-LP64F-LP64D-FPELIM-NEXT: lw a0, 24(sp)
160 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
161 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
162 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
163 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
164 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
165 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
167 ; LP64-LP64F-LP64D-WITHFP-LABEL: va1:
168 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
169 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
170 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa_offset 96
171 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
172 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
173 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_offset ra, -72
174 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_offset s0, -80
175 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
176 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa s0, 64
177 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
178 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
179 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
180 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, s0, 12
181 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -24(s0)
182 ; LP64-LP64F-LP64D-WITHFP-NEXT: lw a0, 8(s0)
183 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
184 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
185 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
186 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
187 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
188 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
189 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
190 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
192 ; LP64E-FPELIM-LABEL: va1:
193 ; LP64E-FPELIM: # %bb.0:
194 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
195 ; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 56
196 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
197 ; LP64E-FPELIM-NEXT: addi a0, sp, 20
198 ; LP64E-FPELIM-NEXT: sd a0, 0(sp)
199 ; LP64E-FPELIM-NEXT: lw a0, 16(sp)
200 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
201 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
202 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
203 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
204 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
205 ; LP64E-FPELIM-NEXT: ret
207 ; LP64E-WITHFP-LABEL: va1:
208 ; LP64E-WITHFP: # %bb.0:
209 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
210 ; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 72
211 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
212 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
213 ; LP64E-WITHFP-NEXT: .cfi_offset ra, -56
214 ; LP64E-WITHFP-NEXT: .cfi_offset s0, -64
215 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
216 ; LP64E-WITHFP-NEXT: .cfi_def_cfa s0, 48
217 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
218 ; LP64E-WITHFP-NEXT: addi a0, s0, 12
219 ; LP64E-WITHFP-NEXT: sd a0, -24(s0)
220 ; LP64E-WITHFP-NEXT: lw a0, 8(s0)
221 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
222 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
223 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
224 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
225 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
226 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
227 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
228 ; LP64E-WITHFP-NEXT: ret
230 call void @llvm.va_start(ptr %va)
231 %argp.cur = load ptr, ptr %va, align 4
232 %argp.next = getelementptr inbounds i8, ptr %argp.cur, i32 4
233 store ptr %argp.next, ptr %va, align 4
234 %1 = load i32, ptr %argp.cur, align 4
235 call void @llvm.va_end(ptr %va)
239 define i32 @va1_va_arg(ptr %fmt, ...) nounwind {
240 ; ILP32-ILP32F-FPELIM-LABEL: va1_va_arg:
241 ; ILP32-ILP32F-FPELIM: # %bb.0:
242 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
243 ; ILP32-ILP32F-FPELIM-NEXT: mv a0, a1
244 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
245 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
246 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
247 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
248 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
249 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
250 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
251 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, sp, 24
252 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 12(sp)
253 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
254 ; ILP32-ILP32F-FPELIM-NEXT: ret
256 ; ILP32-ILP32F-WITHFP-LABEL: va1_va_arg:
257 ; ILP32-ILP32F-WITHFP: # %bb.0:
258 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
259 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
260 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
261 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
262 ; ILP32-ILP32F-WITHFP-NEXT: mv a0, a1
263 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
264 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
265 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
266 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
267 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
268 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
269 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
270 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 8
271 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -12(s0)
272 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
273 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
274 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
275 ; ILP32-ILP32F-WITHFP-NEXT: ret
277 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va1_va_arg:
278 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
279 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
280 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv a0, a1
281 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
282 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
283 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
284 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
285 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
286 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
287 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
288 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, sp, 24
289 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
290 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
291 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
293 ; ILP32E-FPELIM-LABEL: va1_va_arg:
294 ; ILP32E-FPELIM: # %bb.0:
295 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
296 ; ILP32E-FPELIM-NEXT: mv a0, a1
297 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
298 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
299 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
300 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
301 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
302 ; ILP32E-FPELIM-NEXT: addi a1, sp, 12
303 ; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
304 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
305 ; ILP32E-FPELIM-NEXT: ret
307 ; ILP32E-WITHFP-LABEL: va1_va_arg:
308 ; ILP32E-WITHFP: # %bb.0:
309 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
310 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
311 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
312 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
313 ; ILP32E-WITHFP-NEXT: mv a0, a1
314 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
315 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
316 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
317 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
318 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
319 ; ILP32E-WITHFP-NEXT: addi a1, s0, 8
320 ; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
321 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
322 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
323 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
324 ; ILP32E-WITHFP-NEXT: ret
326 ; LP64-LP64F-LP64D-FPELIM-LABEL: va1_va_arg:
327 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
328 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
329 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv a0, a1
330 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
331 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
332 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
333 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
334 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
335 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
336 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
337 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, sp, 32
338 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
339 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
340 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
342 ; LP64-LP64F-LP64D-WITHFP-LABEL: va1_va_arg:
343 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
344 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
345 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
346 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
347 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
348 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv a0, a1
349 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
350 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
351 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
352 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
353 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
354 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
355 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
356 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, s0, 16
357 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -24(s0)
358 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
359 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
360 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
361 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
363 ; LP64E-FPELIM-LABEL: va1_va_arg:
364 ; LP64E-FPELIM: # %bb.0:
365 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
366 ; LP64E-FPELIM-NEXT: mv a0, a1
367 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
368 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
369 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
370 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
371 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
372 ; LP64E-FPELIM-NEXT: addi a1, sp, 24
373 ; LP64E-FPELIM-NEXT: sd a1, 0(sp)
374 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
375 ; LP64E-FPELIM-NEXT: ret
377 ; LP64E-WITHFP-LABEL: va1_va_arg:
378 ; LP64E-WITHFP: # %bb.0:
379 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
380 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
381 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
382 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
383 ; LP64E-WITHFP-NEXT: mv a0, a1
384 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
385 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
386 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
387 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
388 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
389 ; LP64E-WITHFP-NEXT: addi a1, s0, 16
390 ; LP64E-WITHFP-NEXT: sd a1, -24(s0)
391 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
392 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
393 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
394 ; LP64E-WITHFP-NEXT: ret
396 call void @llvm.va_start(ptr %va)
397 %1 = va_arg ptr %va, i32
398 call void @llvm.va_end(ptr %va)
402 ; Ensure the adjustment when restoring the stack pointer using the frame
404 define i32 @va1_va_arg_alloca(ptr %fmt, ...) nounwind {
405 ; ILP32-ILP32F-FPELIM-LABEL: va1_va_arg_alloca:
406 ; ILP32-ILP32F-FPELIM: # %bb.0:
407 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
408 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
409 ; ILP32-ILP32F-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
410 ; ILP32-ILP32F-FPELIM-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
411 ; ILP32-ILP32F-FPELIM-NEXT: addi s0, sp, 16
412 ; ILP32-ILP32F-FPELIM-NEXT: mv s1, a1
413 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 28(s0)
414 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 24(s0)
415 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 20(s0)
416 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 16(s0)
417 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 12(s0)
418 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 8(s0)
419 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 4(s0)
420 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, s0, 8
421 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, -16(s0)
422 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a1, 15
423 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -16
424 ; ILP32-ILP32F-FPELIM-NEXT: sub a0, sp, a0
425 ; ILP32-ILP32F-FPELIM-NEXT: mv sp, a0
426 ; ILP32-ILP32F-FPELIM-NEXT: call notdead
427 ; ILP32-ILP32F-FPELIM-NEXT: mv a0, s1
428 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, s0, -16
429 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
430 ; ILP32-ILP32F-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
431 ; ILP32-ILP32F-FPELIM-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
432 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
433 ; ILP32-ILP32F-FPELIM-NEXT: ret
435 ; ILP32-ILP32F-WITHFP-LABEL: va1_va_arg_alloca:
436 ; ILP32-ILP32F-WITHFP: # %bb.0:
437 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
438 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
439 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
440 ; ILP32-ILP32F-WITHFP-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
441 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
442 ; ILP32-ILP32F-WITHFP-NEXT: mv s1, a1
443 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
444 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
445 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
446 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
447 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
448 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
449 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
450 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 8
451 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -16(s0)
452 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a1, 15
453 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -16
454 ; ILP32-ILP32F-WITHFP-NEXT: sub a0, sp, a0
455 ; ILP32-ILP32F-WITHFP-NEXT: mv sp, a0
456 ; ILP32-ILP32F-WITHFP-NEXT: call notdead
457 ; ILP32-ILP32F-WITHFP-NEXT: mv a0, s1
458 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, s0, -16
459 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
460 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
461 ; ILP32-ILP32F-WITHFP-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
462 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
463 ; ILP32-ILP32F-WITHFP-NEXT: ret
465 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va1_va_arg_alloca:
466 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
467 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
468 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
469 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
470 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
471 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi s0, sp, 16
472 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv s1, a1
473 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 28(s0)
474 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 24(s0)
475 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 20(s0)
476 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 16(s0)
477 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 12(s0)
478 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 8(s0)
479 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 4(s0)
480 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, s0, 8
481 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, -16(s0)
482 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a1, 15
483 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -16
484 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sub a0, sp, a0
485 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv sp, a0
486 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call notdead
487 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv a0, s1
488 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, s0, -16
489 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
490 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
491 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
492 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
493 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
495 ; ILP32E-FPELIM-LABEL: va1_va_arg_alloca:
496 ; ILP32E-FPELIM: # %bb.0:
497 ; ILP32E-FPELIM-NEXT: addi sp, sp, -40
498 ; ILP32E-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
499 ; ILP32E-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
500 ; ILP32E-FPELIM-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
501 ; ILP32E-FPELIM-NEXT: addi s0, sp, 16
502 ; ILP32E-FPELIM-NEXT: mv s1, a1
503 ; ILP32E-FPELIM-NEXT: sw a5, 20(s0)
504 ; ILP32E-FPELIM-NEXT: sw a4, 16(s0)
505 ; ILP32E-FPELIM-NEXT: sw a3, 12(s0)
506 ; ILP32E-FPELIM-NEXT: sw a2, 8(s0)
507 ; ILP32E-FPELIM-NEXT: sw a1, 4(s0)
508 ; ILP32E-FPELIM-NEXT: addi a0, s0, 8
509 ; ILP32E-FPELIM-NEXT: sw a0, -16(s0)
510 ; ILP32E-FPELIM-NEXT: addi a0, a1, 3
511 ; ILP32E-FPELIM-NEXT: andi a0, a0, -4
512 ; ILP32E-FPELIM-NEXT: sub a0, sp, a0
513 ; ILP32E-FPELIM-NEXT: mv sp, a0
514 ; ILP32E-FPELIM-NEXT: call notdead
515 ; ILP32E-FPELIM-NEXT: mv a0, s1
516 ; ILP32E-FPELIM-NEXT: addi sp, s0, -16
517 ; ILP32E-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
518 ; ILP32E-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
519 ; ILP32E-FPELIM-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
520 ; ILP32E-FPELIM-NEXT: addi sp, sp, 40
521 ; ILP32E-FPELIM-NEXT: ret
523 ; ILP32E-WITHFP-LABEL: va1_va_arg_alloca:
524 ; ILP32E-WITHFP: # %bb.0:
525 ; ILP32E-WITHFP-NEXT: addi sp, sp, -40
526 ; ILP32E-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
527 ; ILP32E-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
528 ; ILP32E-WITHFP-NEXT: sw s1, 4(sp) # 4-byte Folded Spill
529 ; ILP32E-WITHFP-NEXT: addi s0, sp, 16
530 ; ILP32E-WITHFP-NEXT: mv s1, a1
531 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
532 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
533 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
534 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
535 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
536 ; ILP32E-WITHFP-NEXT: addi a0, s0, 8
537 ; ILP32E-WITHFP-NEXT: sw a0, -16(s0)
538 ; ILP32E-WITHFP-NEXT: addi a0, a1, 3
539 ; ILP32E-WITHFP-NEXT: andi a0, a0, -4
540 ; ILP32E-WITHFP-NEXT: sub a0, sp, a0
541 ; ILP32E-WITHFP-NEXT: mv sp, a0
542 ; ILP32E-WITHFP-NEXT: call notdead
543 ; ILP32E-WITHFP-NEXT: mv a0, s1
544 ; ILP32E-WITHFP-NEXT: addi sp, s0, -16
545 ; ILP32E-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
546 ; ILP32E-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
547 ; ILP32E-WITHFP-NEXT: lw s1, 4(sp) # 4-byte Folded Reload
548 ; ILP32E-WITHFP-NEXT: addi sp, sp, 40
549 ; ILP32E-WITHFP-NEXT: ret
551 ; LP64-LP64F-LP64D-FPELIM-LABEL: va1_va_arg_alloca:
552 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
553 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -96
554 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
555 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
556 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
557 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi s0, sp, 32
558 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv s1, a1
559 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 56(s0)
560 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 48(s0)
561 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 40(s0)
562 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 32(s0)
563 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 24(s0)
564 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 16(s0)
565 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(s0)
566 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, s0, 16
567 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, -32(s0)
568 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a0, a1, 32
569 ; LP64-LP64F-LP64D-FPELIM-NEXT: srli a0, a0, 32
570 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, a0, 15
571 ; LP64-LP64F-LP64D-FPELIM-NEXT: andi a0, a0, -16
572 ; LP64-LP64F-LP64D-FPELIM-NEXT: sub a0, sp, a0
573 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv sp, a0
574 ; LP64-LP64F-LP64D-FPELIM-NEXT: call notdead
575 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv a0, s1
576 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, s0, -32
577 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
578 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
579 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
580 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 96
581 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
583 ; LP64-LP64F-LP64D-WITHFP-LABEL: va1_va_arg_alloca:
584 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
585 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
586 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
587 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
588 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
589 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
590 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv s1, a1
591 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
592 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
593 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
594 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
595 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
596 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
597 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
598 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, s0, 16
599 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -32(s0)
600 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a0, a1, 32
601 ; LP64-LP64F-LP64D-WITHFP-NEXT: srli a0, a0, 32
602 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, a0, 15
603 ; LP64-LP64F-LP64D-WITHFP-NEXT: andi a0, a0, -16
604 ; LP64-LP64F-LP64D-WITHFP-NEXT: sub a0, sp, a0
605 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv sp, a0
606 ; LP64-LP64F-LP64D-WITHFP-NEXT: call notdead
607 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv a0, s1
608 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, s0, -32
609 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
610 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
611 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
612 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
613 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
615 ; LP64E-FPELIM-LABEL: va1_va_arg_alloca:
616 ; LP64E-FPELIM: # %bb.0:
617 ; LP64E-FPELIM-NEXT: addi sp, sp, -80
618 ; LP64E-FPELIM-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
619 ; LP64E-FPELIM-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
620 ; LP64E-FPELIM-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
621 ; LP64E-FPELIM-NEXT: addi s0, sp, 32
622 ; LP64E-FPELIM-NEXT: mv s1, a1
623 ; LP64E-FPELIM-NEXT: sd a5, 40(s0)
624 ; LP64E-FPELIM-NEXT: sd a4, 32(s0)
625 ; LP64E-FPELIM-NEXT: sd a3, 24(s0)
626 ; LP64E-FPELIM-NEXT: sd a2, 16(s0)
627 ; LP64E-FPELIM-NEXT: sd a1, 8(s0)
628 ; LP64E-FPELIM-NEXT: addi a0, s0, 16
629 ; LP64E-FPELIM-NEXT: sd a0, -32(s0)
630 ; LP64E-FPELIM-NEXT: slli a0, a1, 32
631 ; LP64E-FPELIM-NEXT: srli a0, a0, 32
632 ; LP64E-FPELIM-NEXT: addi a0, a0, 7
633 ; LP64E-FPELIM-NEXT: andi a0, a0, -8
634 ; LP64E-FPELIM-NEXT: sub a0, sp, a0
635 ; LP64E-FPELIM-NEXT: mv sp, a0
636 ; LP64E-FPELIM-NEXT: call notdead
637 ; LP64E-FPELIM-NEXT: mv a0, s1
638 ; LP64E-FPELIM-NEXT: addi sp, s0, -32
639 ; LP64E-FPELIM-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
640 ; LP64E-FPELIM-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
641 ; LP64E-FPELIM-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
642 ; LP64E-FPELIM-NEXT: addi sp, sp, 80
643 ; LP64E-FPELIM-NEXT: ret
645 ; LP64E-WITHFP-LABEL: va1_va_arg_alloca:
646 ; LP64E-WITHFP: # %bb.0:
647 ; LP64E-WITHFP-NEXT: addi sp, sp, -80
648 ; LP64E-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
649 ; LP64E-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
650 ; LP64E-WITHFP-NEXT: sd s1, 8(sp) # 8-byte Folded Spill
651 ; LP64E-WITHFP-NEXT: addi s0, sp, 32
652 ; LP64E-WITHFP-NEXT: mv s1, a1
653 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
654 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
655 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
656 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
657 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
658 ; LP64E-WITHFP-NEXT: addi a0, s0, 16
659 ; LP64E-WITHFP-NEXT: sd a0, -32(s0)
660 ; LP64E-WITHFP-NEXT: slli a0, a1, 32
661 ; LP64E-WITHFP-NEXT: srli a0, a0, 32
662 ; LP64E-WITHFP-NEXT: addi a0, a0, 7
663 ; LP64E-WITHFP-NEXT: andi a0, a0, -8
664 ; LP64E-WITHFP-NEXT: sub a0, sp, a0
665 ; LP64E-WITHFP-NEXT: mv sp, a0
666 ; LP64E-WITHFP-NEXT: call notdead
667 ; LP64E-WITHFP-NEXT: mv a0, s1
668 ; LP64E-WITHFP-NEXT: addi sp, s0, -32
669 ; LP64E-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
670 ; LP64E-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
671 ; LP64E-WITHFP-NEXT: ld s1, 8(sp) # 8-byte Folded Reload
672 ; LP64E-WITHFP-NEXT: addi sp, sp, 80
673 ; LP64E-WITHFP-NEXT: ret
675 call void @llvm.va_start(ptr %va)
676 %1 = va_arg ptr %va, i32
677 %2 = alloca i8, i32 %1
678 call void @notdead(ptr %2)
679 call void @llvm.va_end(ptr %va)
683 define void @va1_caller() nounwind {
684 ; Pass a double, as a float would be promoted by a C/C++ frontend
685 ; ILP32-ILP32F-FPELIM-LABEL: va1_caller:
686 ; ILP32-ILP32F-FPELIM: # %bb.0:
687 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -16
688 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
689 ; ILP32-ILP32F-FPELIM-NEXT: lui a3, 261888
690 ; ILP32-ILP32F-FPELIM-NEXT: li a4, 2
691 ; ILP32-ILP32F-FPELIM-NEXT: li a2, 0
692 ; ILP32-ILP32F-FPELIM-NEXT: call va1
693 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
694 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 16
695 ; ILP32-ILP32F-FPELIM-NEXT: ret
697 ; ILP32-ILP32F-WITHFP-LABEL: va1_caller:
698 ; ILP32-ILP32F-WITHFP: # %bb.0:
699 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -16
700 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
701 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
702 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
703 ; ILP32-ILP32F-WITHFP-NEXT: lui a3, 261888
704 ; ILP32-ILP32F-WITHFP-NEXT: li a4, 2
705 ; ILP32-ILP32F-WITHFP-NEXT: li a2, 0
706 ; ILP32-ILP32F-WITHFP-NEXT: call va1
707 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
708 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
709 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 16
710 ; ILP32-ILP32F-WITHFP-NEXT: ret
712 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va1_caller:
713 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
714 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -16
715 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
716 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a3, 261888
717 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a4, 2
718 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a2, 0
719 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call va1
720 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
721 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 16
722 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
724 ; ILP32E-FPELIM-LABEL: va1_caller:
725 ; ILP32E-FPELIM: # %bb.0:
726 ; ILP32E-FPELIM-NEXT: addi sp, sp, -4
727 ; ILP32E-FPELIM-NEXT: sw ra, 0(sp) # 4-byte Folded Spill
728 ; ILP32E-FPELIM-NEXT: lui a2, 261888
729 ; ILP32E-FPELIM-NEXT: li a3, 2
730 ; ILP32E-FPELIM-NEXT: li a1, 0
731 ; ILP32E-FPELIM-NEXT: call va1
732 ; ILP32E-FPELIM-NEXT: lw ra, 0(sp) # 4-byte Folded Reload
733 ; ILP32E-FPELIM-NEXT: addi sp, sp, 4
734 ; ILP32E-FPELIM-NEXT: ret
736 ; ILP32E-WITHFP-LABEL: va1_caller:
737 ; ILP32E-WITHFP: # %bb.0:
738 ; ILP32E-WITHFP-NEXT: addi sp, sp, -8
739 ; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
740 ; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
741 ; ILP32E-WITHFP-NEXT: addi s0, sp, 8
742 ; ILP32E-WITHFP-NEXT: lui a2, 261888
743 ; ILP32E-WITHFP-NEXT: li a3, 2
744 ; ILP32E-WITHFP-NEXT: li a1, 0
745 ; ILP32E-WITHFP-NEXT: call va1
746 ; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
747 ; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
748 ; ILP32E-WITHFP-NEXT: addi sp, sp, 8
749 ; ILP32E-WITHFP-NEXT: ret
751 ; LP64-LP64F-LP64D-FPELIM-LABEL: va1_caller:
752 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
753 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -16
754 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
755 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a1, 1023
756 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a1, a1, 52
757 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a2, 2
758 ; LP64-LP64F-LP64D-FPELIM-NEXT: call va1
759 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
760 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 16
761 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
763 ; LP64-LP64F-LP64D-WITHFP-LABEL: va1_caller:
764 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
765 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -16
766 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
767 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
768 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 16
769 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a1, 1023
770 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a1, a1, 52
771 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a2, 2
772 ; LP64-LP64F-LP64D-WITHFP-NEXT: call va1
773 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
774 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
775 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 16
776 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
778 ; LP64E-FPELIM-LABEL: va1_caller:
779 ; LP64E-FPELIM: # %bb.0:
780 ; LP64E-FPELIM-NEXT: addi sp, sp, -8
781 ; LP64E-FPELIM-NEXT: sd ra, 0(sp) # 8-byte Folded Spill
782 ; LP64E-FPELIM-NEXT: li a1, 1023
783 ; LP64E-FPELIM-NEXT: slli a1, a1, 52
784 ; LP64E-FPELIM-NEXT: li a2, 2
785 ; LP64E-FPELIM-NEXT: call va1
786 ; LP64E-FPELIM-NEXT: ld ra, 0(sp) # 8-byte Folded Reload
787 ; LP64E-FPELIM-NEXT: addi sp, sp, 8
788 ; LP64E-FPELIM-NEXT: ret
790 ; LP64E-WITHFP-LABEL: va1_caller:
791 ; LP64E-WITHFP: # %bb.0:
792 ; LP64E-WITHFP-NEXT: addi sp, sp, -16
793 ; LP64E-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
794 ; LP64E-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
795 ; LP64E-WITHFP-NEXT: addi s0, sp, 16
796 ; LP64E-WITHFP-NEXT: li a1, 1023
797 ; LP64E-WITHFP-NEXT: slli a1, a1, 52
798 ; LP64E-WITHFP-NEXT: li a2, 2
799 ; LP64E-WITHFP-NEXT: call va1
800 ; LP64E-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
801 ; LP64E-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
802 ; LP64E-WITHFP-NEXT: addi sp, sp, 16
803 ; LP64E-WITHFP-NEXT: ret
804 %1 = call i32 (ptr, ...) @va1(ptr undef, double 1.0, i32 2)
808 ; Ensure that 2x xlen size+alignment varargs are accessed via an "aligned"
809 ; register pair (where the first register is even-numbered).
811 define i64 @va2(ptr %fmt, ...) nounwind {
812 ; ILP32-ILP32F-FPELIM-LABEL: va2:
813 ; ILP32-ILP32F-FPELIM: # %bb.0:
814 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
815 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
816 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
817 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
818 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
819 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
820 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
821 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
822 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 20
823 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 12(sp)
824 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 27
825 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -8
826 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, sp, 35
827 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 12(sp)
828 ; ILP32-ILP32F-FPELIM-NEXT: lw a1, 4(a0)
829 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 0(a0)
830 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
831 ; ILP32-ILP32F-FPELIM-NEXT: ret
833 ; ILP32-ILP32F-WITHFP-LABEL: va2:
834 ; ILP32-ILP32F-WITHFP: # %bb.0:
835 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
836 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
837 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
838 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
839 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
840 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
841 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
842 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
843 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
844 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
845 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
846 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 4
847 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -12(s0)
848 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 11
849 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -8
850 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 19
851 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -12(s0)
852 ; ILP32-ILP32F-WITHFP-NEXT: lw a1, 4(a0)
853 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, 0(a0)
854 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
855 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
856 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
857 ; ILP32-ILP32F-WITHFP-NEXT: ret
859 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va2:
860 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
861 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
862 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
863 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
864 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
865 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
866 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
867 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
868 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
869 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 20
870 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 12(sp)
871 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 27
872 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -8
873 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, sp, 35
874 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
875 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a1, 4(a0)
876 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 0(a0)
877 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
878 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
880 ; ILP32E-FPELIM-LABEL: va2:
881 ; ILP32E-FPELIM: # %bb.0:
882 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
883 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
884 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
885 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
886 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
887 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
888 ; ILP32E-FPELIM-NEXT: addi a0, sp, 8
889 ; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
890 ; ILP32E-FPELIM-NEXT: addi a0, sp, 15
891 ; ILP32E-FPELIM-NEXT: andi a0, a0, -8
892 ; ILP32E-FPELIM-NEXT: addi a1, sp, 23
893 ; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
894 ; ILP32E-FPELIM-NEXT: lw a1, 4(a0)
895 ; ILP32E-FPELIM-NEXT: lw a0, 0(a0)
896 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
897 ; ILP32E-FPELIM-NEXT: ret
899 ; ILP32E-WITHFP-LABEL: va2:
900 ; ILP32E-WITHFP: # %bb.0:
901 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
902 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
903 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
904 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
905 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
906 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
907 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
908 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
909 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
910 ; ILP32E-WITHFP-NEXT: addi a0, s0, 4
911 ; ILP32E-WITHFP-NEXT: sw a0, -12(s0)
912 ; ILP32E-WITHFP-NEXT: addi a0, s0, 11
913 ; ILP32E-WITHFP-NEXT: andi a0, a0, -8
914 ; ILP32E-WITHFP-NEXT: addi a1, s0, 19
915 ; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
916 ; ILP32E-WITHFP-NEXT: lw a1, 4(a0)
917 ; ILP32E-WITHFP-NEXT: lw a0, 0(a0)
918 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
919 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
920 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
921 ; ILP32E-WITHFP-NEXT: ret
923 ; LP64-LP64F-LP64D-FPELIM-LABEL: va2:
924 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
925 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
926 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv a0, a1
927 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
928 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
929 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
930 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
931 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
932 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
933 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
934 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, sp, 39
935 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
936 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
937 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
939 ; LP64-LP64F-LP64D-WITHFP-LABEL: va2:
940 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
941 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
942 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
943 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
944 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
945 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv a0, a1
946 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
947 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
948 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
949 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
950 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
951 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
952 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
953 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, s0, 23
954 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -24(s0)
955 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
956 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
957 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
958 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
960 ; LP64E-FPELIM-LABEL: va2:
961 ; LP64E-FPELIM: # %bb.0:
962 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
963 ; LP64E-FPELIM-NEXT: mv a0, a1
964 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
965 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
966 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
967 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
968 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
969 ; LP64E-FPELIM-NEXT: addi a1, sp, 31
970 ; LP64E-FPELIM-NEXT: sd a1, 0(sp)
971 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
972 ; LP64E-FPELIM-NEXT: ret
974 ; LP64E-WITHFP-LABEL: va2:
975 ; LP64E-WITHFP: # %bb.0:
976 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
977 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
978 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
979 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
980 ; LP64E-WITHFP-NEXT: mv a0, a1
981 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
982 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
983 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
984 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
985 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
986 ; LP64E-WITHFP-NEXT: addi a1, s0, 23
987 ; LP64E-WITHFP-NEXT: sd a1, -24(s0)
988 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
989 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
990 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
991 ; LP64E-WITHFP-NEXT: ret
993 call void @llvm.va_start(ptr %va)
994 %argp.cur = load ptr, ptr %va
995 %ptrint = ptrtoint ptr %argp.cur to iXLen
996 %1 = add iXLen %ptrint, 7
997 %2 = and iXLen %1, -8
998 %argp.cur.aligned = inttoptr iXLen %1 to ptr
999 %argp.next = getelementptr inbounds i8, ptr %argp.cur.aligned, i32 8
1000 store ptr %argp.next, ptr %va
1001 %3 = inttoptr iXLen %2 to ptr
1002 %4 = load double, ptr %3, align 8
1003 %5 = bitcast double %4 to i64
1004 call void @llvm.va_end(ptr %va)
1008 define i64 @va2_va_arg(ptr %fmt, ...) nounwind {
1009 ; ILP32-ILP32F-FPELIM-LABEL: va2_va_arg:
1010 ; ILP32-ILP32F-FPELIM: # %bb.0:
1011 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
1012 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
1013 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
1014 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
1015 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
1016 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
1017 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
1018 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
1019 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 27
1020 ; ILP32-ILP32F-FPELIM-NEXT: andi a1, a0, -8
1021 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a1, 4
1022 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 12(sp)
1023 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 0(a1)
1024 ; ILP32-ILP32F-FPELIM-NEXT: addi a2, a1, 8
1025 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 12(sp)
1026 ; ILP32-ILP32F-FPELIM-NEXT: lw a1, 4(a1)
1027 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
1028 ; ILP32-ILP32F-FPELIM-NEXT: ret
1030 ; ILP32-ILP32F-WITHFP-LABEL: va2_va_arg:
1031 ; ILP32-ILP32F-WITHFP: # %bb.0:
1032 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
1033 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1034 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1035 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
1036 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
1037 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
1038 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
1039 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
1040 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
1041 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
1042 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
1043 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 11
1044 ; ILP32-ILP32F-WITHFP-NEXT: andi a1, a0, -8
1045 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a1, 4
1046 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -12(s0)
1047 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, 0(a1)
1048 ; ILP32-ILP32F-WITHFP-NEXT: addi a2, a1, 8
1049 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, -12(s0)
1050 ; ILP32-ILP32F-WITHFP-NEXT: lw a1, 4(a1)
1051 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1052 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
1053 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
1054 ; ILP32-ILP32F-WITHFP-NEXT: ret
1056 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va2_va_arg:
1057 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1058 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
1059 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
1060 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
1061 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
1062 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
1063 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
1064 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
1065 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
1066 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 27
1067 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -8
1068 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, a0, 8
1069 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
1070 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: fld fa5, 0(a0)
1071 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: fsd fa5, 0(sp)
1072 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 0(sp)
1073 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a1, 4(sp)
1074 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
1075 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1077 ; ILP32E-FPELIM-LABEL: va2_va_arg:
1078 ; ILP32E-FPELIM: # %bb.0:
1079 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
1080 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
1081 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
1082 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
1083 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
1084 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
1085 ; ILP32E-FPELIM-NEXT: addi a0, sp, 15
1086 ; ILP32E-FPELIM-NEXT: andi a1, a0, -8
1087 ; ILP32E-FPELIM-NEXT: addi a0, a1, 4
1088 ; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
1089 ; ILP32E-FPELIM-NEXT: lw a0, 0(a1)
1090 ; ILP32E-FPELIM-NEXT: addi a2, a1, 8
1091 ; ILP32E-FPELIM-NEXT: sw a2, 0(sp)
1092 ; ILP32E-FPELIM-NEXT: lw a1, 4(a1)
1093 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
1094 ; ILP32E-FPELIM-NEXT: ret
1096 ; ILP32E-WITHFP-LABEL: va2_va_arg:
1097 ; ILP32E-WITHFP: # %bb.0:
1098 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
1099 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
1100 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
1101 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
1102 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
1103 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
1104 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
1105 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
1106 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
1107 ; ILP32E-WITHFP-NEXT: addi a0, s0, 11
1108 ; ILP32E-WITHFP-NEXT: andi a1, a0, -8
1109 ; ILP32E-WITHFP-NEXT: addi a0, a1, 4
1110 ; ILP32E-WITHFP-NEXT: sw a0, -12(s0)
1111 ; ILP32E-WITHFP-NEXT: lw a0, 0(a1)
1112 ; ILP32E-WITHFP-NEXT: addi a2, a1, 8
1113 ; ILP32E-WITHFP-NEXT: sw a2, -12(s0)
1114 ; ILP32E-WITHFP-NEXT: lw a1, 4(a1)
1115 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
1116 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
1117 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
1118 ; ILP32E-WITHFP-NEXT: ret
1120 ; LP64-LP64F-LP64D-FPELIM-LABEL: va2_va_arg:
1121 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1122 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
1123 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv a0, a1
1124 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
1125 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
1126 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
1127 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
1128 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
1129 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
1130 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
1131 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, sp, 32
1132 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
1133 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
1134 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1136 ; LP64-LP64F-LP64D-WITHFP-LABEL: va2_va_arg:
1137 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1138 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
1139 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
1140 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
1141 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
1142 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv a0, a1
1143 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
1144 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
1145 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
1146 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
1147 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
1148 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
1149 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
1150 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, s0, 16
1151 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -24(s0)
1152 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
1153 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
1154 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
1155 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1157 ; LP64E-FPELIM-LABEL: va2_va_arg:
1158 ; LP64E-FPELIM: # %bb.0:
1159 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
1160 ; LP64E-FPELIM-NEXT: mv a0, a1
1161 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
1162 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
1163 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
1164 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
1165 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
1166 ; LP64E-FPELIM-NEXT: addi a1, sp, 24
1167 ; LP64E-FPELIM-NEXT: sd a1, 0(sp)
1168 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
1169 ; LP64E-FPELIM-NEXT: ret
1171 ; LP64E-WITHFP-LABEL: va2_va_arg:
1172 ; LP64E-WITHFP: # %bb.0:
1173 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
1174 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
1175 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
1176 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
1177 ; LP64E-WITHFP-NEXT: mv a0, a1
1178 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
1179 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
1180 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
1181 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
1182 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
1183 ; LP64E-WITHFP-NEXT: addi a1, s0, 16
1184 ; LP64E-WITHFP-NEXT: sd a1, -24(s0)
1185 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
1186 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
1187 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
1188 ; LP64E-WITHFP-NEXT: ret
1190 call void @llvm.va_start(ptr %va)
1191 %1 = va_arg ptr %va, double
1192 call void @llvm.va_end(ptr %va)
1193 %2 = bitcast double %1 to i64
1197 define void @va2_caller() nounwind {
1198 ; ILP32-ILP32F-FPELIM-LABEL: va2_caller:
1199 ; ILP32-ILP32F-FPELIM: # %bb.0:
1200 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -16
1201 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1202 ; ILP32-ILP32F-FPELIM-NEXT: lui a3, 261888
1203 ; ILP32-ILP32F-FPELIM-NEXT: li a2, 0
1204 ; ILP32-ILP32F-FPELIM-NEXT: call va2
1205 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1206 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 16
1207 ; ILP32-ILP32F-FPELIM-NEXT: ret
1209 ; ILP32-ILP32F-WITHFP-LABEL: va2_caller:
1210 ; ILP32-ILP32F-WITHFP: # %bb.0:
1211 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -16
1212 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1213 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1214 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
1215 ; ILP32-ILP32F-WITHFP-NEXT: lui a3, 261888
1216 ; ILP32-ILP32F-WITHFP-NEXT: li a2, 0
1217 ; ILP32-ILP32F-WITHFP-NEXT: call va2
1218 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1219 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
1220 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 16
1221 ; ILP32-ILP32F-WITHFP-NEXT: ret
1223 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va2_caller:
1224 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1225 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -16
1226 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1227 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a3, 261888
1228 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a2, 0
1229 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call va2
1230 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1231 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 16
1232 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1234 ; ILP32E-FPELIM-LABEL: va2_caller:
1235 ; ILP32E-FPELIM: # %bb.0:
1236 ; ILP32E-FPELIM-NEXT: addi sp, sp, -4
1237 ; ILP32E-FPELIM-NEXT: sw ra, 0(sp) # 4-byte Folded Spill
1238 ; ILP32E-FPELIM-NEXT: lui a2, 261888
1239 ; ILP32E-FPELIM-NEXT: li a1, 0
1240 ; ILP32E-FPELIM-NEXT: call va2
1241 ; ILP32E-FPELIM-NEXT: lw ra, 0(sp) # 4-byte Folded Reload
1242 ; ILP32E-FPELIM-NEXT: addi sp, sp, 4
1243 ; ILP32E-FPELIM-NEXT: ret
1245 ; ILP32E-WITHFP-LABEL: va2_caller:
1246 ; ILP32E-WITHFP: # %bb.0:
1247 ; ILP32E-WITHFP-NEXT: addi sp, sp, -8
1248 ; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
1249 ; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
1250 ; ILP32E-WITHFP-NEXT: addi s0, sp, 8
1251 ; ILP32E-WITHFP-NEXT: lui a2, 261888
1252 ; ILP32E-WITHFP-NEXT: li a1, 0
1253 ; ILP32E-WITHFP-NEXT: call va2
1254 ; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
1255 ; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
1256 ; ILP32E-WITHFP-NEXT: addi sp, sp, 8
1257 ; ILP32E-WITHFP-NEXT: ret
1259 ; LP64-LP64F-LP64D-FPELIM-LABEL: va2_caller:
1260 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1261 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -16
1262 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1263 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a1, 1023
1264 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a1, a1, 52
1265 ; LP64-LP64F-LP64D-FPELIM-NEXT: call va2
1266 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1267 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 16
1268 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1270 ; LP64-LP64F-LP64D-WITHFP-LABEL: va2_caller:
1271 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1272 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -16
1273 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1274 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
1275 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 16
1276 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a1, 1023
1277 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a1, a1, 52
1278 ; LP64-LP64F-LP64D-WITHFP-NEXT: call va2
1279 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1280 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
1281 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 16
1282 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1284 ; LP64E-FPELIM-LABEL: va2_caller:
1285 ; LP64E-FPELIM: # %bb.0:
1286 ; LP64E-FPELIM-NEXT: addi sp, sp, -8
1287 ; LP64E-FPELIM-NEXT: sd ra, 0(sp) # 8-byte Folded Spill
1288 ; LP64E-FPELIM-NEXT: li a1, 1023
1289 ; LP64E-FPELIM-NEXT: slli a1, a1, 52
1290 ; LP64E-FPELIM-NEXT: call va2
1291 ; LP64E-FPELIM-NEXT: ld ra, 0(sp) # 8-byte Folded Reload
1292 ; LP64E-FPELIM-NEXT: addi sp, sp, 8
1293 ; LP64E-FPELIM-NEXT: ret
1295 ; LP64E-WITHFP-LABEL: va2_caller:
1296 ; LP64E-WITHFP: # %bb.0:
1297 ; LP64E-WITHFP-NEXT: addi sp, sp, -16
1298 ; LP64E-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1299 ; LP64E-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
1300 ; LP64E-WITHFP-NEXT: addi s0, sp, 16
1301 ; LP64E-WITHFP-NEXT: li a1, 1023
1302 ; LP64E-WITHFP-NEXT: slli a1, a1, 52
1303 ; LP64E-WITHFP-NEXT: call va2
1304 ; LP64E-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1305 ; LP64E-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
1306 ; LP64E-WITHFP-NEXT: addi sp, sp, 16
1307 ; LP64E-WITHFP-NEXT: ret
1308 %1 = call i64 (ptr, ...) @va2(ptr undef, double 1.000000e+00)
1312 ; On RV32, Ensure a named 2*xlen argument is passed in a1 and a2, while the
1313 ; vararg double is passed in a4 and a5 (rather than a3 and a4)
1315 define i64 @va3(i32 %a, i64 %b, ...) nounwind {
1316 ; ILP32-ILP32F-FPELIM-LABEL: va3:
1317 ; ILP32-ILP32F-FPELIM: # %bb.0:
1318 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -32
1319 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 28(sp)
1320 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 24(sp)
1321 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 20(sp)
1322 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 16(sp)
1323 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 12(sp)
1324 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 12
1325 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 4(sp)
1326 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 19
1327 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -8
1328 ; ILP32-ILP32F-FPELIM-NEXT: addi a3, sp, 27
1329 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 4(sp)
1330 ; ILP32-ILP32F-FPELIM-NEXT: lw a3, 4(a0)
1331 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 0(a0)
1332 ; ILP32-ILP32F-FPELIM-NEXT: add a2, a2, a3
1333 ; ILP32-ILP32F-FPELIM-NEXT: add a0, a1, a0
1334 ; ILP32-ILP32F-FPELIM-NEXT: sltu a1, a0, a1
1335 ; ILP32-ILP32F-FPELIM-NEXT: add a1, a2, a1
1336 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 32
1337 ; ILP32-ILP32F-FPELIM-NEXT: ret
1339 ; ILP32-ILP32F-WITHFP-LABEL: va3:
1340 ; ILP32-ILP32F-WITHFP: # %bb.0:
1341 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
1342 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
1343 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 16(sp) # 4-byte Folded Spill
1344 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 24
1345 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 20(s0)
1346 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 16(s0)
1347 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 12(s0)
1348 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 8(s0)
1349 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 4(s0)
1350 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 4
1351 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -12(s0)
1352 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 11
1353 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -8
1354 ; ILP32-ILP32F-WITHFP-NEXT: addi a3, s0, 19
1355 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, -12(s0)
1356 ; ILP32-ILP32F-WITHFP-NEXT: lw a3, 4(a0)
1357 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, 0(a0)
1358 ; ILP32-ILP32F-WITHFP-NEXT: add a2, a2, a3
1359 ; ILP32-ILP32F-WITHFP-NEXT: add a0, a1, a0
1360 ; ILP32-ILP32F-WITHFP-NEXT: sltu a1, a0, a1
1361 ; ILP32-ILP32F-WITHFP-NEXT: add a1, a2, a1
1362 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
1363 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 16(sp) # 4-byte Folded Reload
1364 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
1365 ; ILP32-ILP32F-WITHFP-NEXT: ret
1367 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va3:
1368 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1369 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -32
1370 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 28(sp)
1371 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 24(sp)
1372 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 20(sp)
1373 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 16(sp)
1374 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 12(sp)
1375 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 12
1376 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 4(sp)
1377 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 19
1378 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -8
1379 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a3, sp, 27
1380 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 4(sp)
1381 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a3, 4(a0)
1382 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 0(a0)
1383 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a2, a2, a3
1384 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a0, a1, a0
1385 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sltu a1, a0, a1
1386 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, a2, a1
1387 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 32
1388 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1390 ; ILP32E-FPELIM-LABEL: va3:
1391 ; ILP32E-FPELIM: # %bb.0:
1392 ; ILP32E-FPELIM-NEXT: addi sp, sp, -20
1393 ; ILP32E-FPELIM-NEXT: sw a5, 16(sp)
1394 ; ILP32E-FPELIM-NEXT: sw a4, 12(sp)
1395 ; ILP32E-FPELIM-NEXT: sw a3, 8(sp)
1396 ; ILP32E-FPELIM-NEXT: addi a0, sp, 8
1397 ; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
1398 ; ILP32E-FPELIM-NEXT: addi a0, sp, 15
1399 ; ILP32E-FPELIM-NEXT: andi a0, a0, -8
1400 ; ILP32E-FPELIM-NEXT: addi a3, sp, 23
1401 ; ILP32E-FPELIM-NEXT: sw a3, 0(sp)
1402 ; ILP32E-FPELIM-NEXT: lw a3, 4(a0)
1403 ; ILP32E-FPELIM-NEXT: lw a0, 0(a0)
1404 ; ILP32E-FPELIM-NEXT: add a2, a2, a3
1405 ; ILP32E-FPELIM-NEXT: add a0, a1, a0
1406 ; ILP32E-FPELIM-NEXT: sltu a1, a0, a1
1407 ; ILP32E-FPELIM-NEXT: add a1, a2, a1
1408 ; ILP32E-FPELIM-NEXT: addi sp, sp, 20
1409 ; ILP32E-FPELIM-NEXT: ret
1411 ; ILP32E-WITHFP-LABEL: va3:
1412 ; ILP32E-WITHFP: # %bb.0:
1413 ; ILP32E-WITHFP-NEXT: addi sp, sp, -28
1414 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
1415 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
1416 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
1417 ; ILP32E-WITHFP-NEXT: sw a5, 12(s0)
1418 ; ILP32E-WITHFP-NEXT: sw a4, 8(s0)
1419 ; ILP32E-WITHFP-NEXT: sw a3, 4(s0)
1420 ; ILP32E-WITHFP-NEXT: addi a0, s0, 4
1421 ; ILP32E-WITHFP-NEXT: sw a0, -12(s0)
1422 ; ILP32E-WITHFP-NEXT: addi a0, s0, 11
1423 ; ILP32E-WITHFP-NEXT: andi a0, a0, -8
1424 ; ILP32E-WITHFP-NEXT: addi a3, s0, 19
1425 ; ILP32E-WITHFP-NEXT: sw a3, -12(s0)
1426 ; ILP32E-WITHFP-NEXT: lw a3, 4(a0)
1427 ; ILP32E-WITHFP-NEXT: lw a0, 0(a0)
1428 ; ILP32E-WITHFP-NEXT: add a2, a2, a3
1429 ; ILP32E-WITHFP-NEXT: add a0, a1, a0
1430 ; ILP32E-WITHFP-NEXT: sltu a1, a0, a1
1431 ; ILP32E-WITHFP-NEXT: add a1, a2, a1
1432 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
1433 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
1434 ; ILP32E-WITHFP-NEXT: addi sp, sp, 28
1435 ; ILP32E-WITHFP-NEXT: ret
1437 ; LP64-LP64F-LP64D-FPELIM-LABEL: va3:
1438 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1439 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -64
1440 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 56(sp)
1441 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 48(sp)
1442 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 40(sp)
1443 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 32(sp)
1444 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 24(sp)
1445 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 16(sp)
1446 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a3, sp, 31
1447 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, a1, a2
1448 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 8(sp)
1449 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 64
1450 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1452 ; LP64-LP64F-LP64D-WITHFP-LABEL: va3:
1453 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1454 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -80
1455 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
1456 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
1457 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
1458 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 40(s0)
1459 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 32(s0)
1460 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 24(s0)
1461 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 16(s0)
1462 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 8(s0)
1463 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 0(s0)
1464 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a3, s0, 15
1465 ; LP64-LP64F-LP64D-WITHFP-NEXT: add a0, a1, a2
1466 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, -24(s0)
1467 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
1468 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
1469 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 80
1470 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1472 ; LP64E-FPELIM-LABEL: va3:
1473 ; LP64E-FPELIM: # %bb.0:
1474 ; LP64E-FPELIM-NEXT: addi sp, sp, -40
1475 ; LP64E-FPELIM-NEXT: sd a5, 32(sp)
1476 ; LP64E-FPELIM-NEXT: sd a4, 24(sp)
1477 ; LP64E-FPELIM-NEXT: sd a3, 16(sp)
1478 ; LP64E-FPELIM-NEXT: sd a2, 8(sp)
1479 ; LP64E-FPELIM-NEXT: addi a3, sp, 23
1480 ; LP64E-FPELIM-NEXT: add a0, a1, a2
1481 ; LP64E-FPELIM-NEXT: sd a3, 0(sp)
1482 ; LP64E-FPELIM-NEXT: addi sp, sp, 40
1483 ; LP64E-FPELIM-NEXT: ret
1485 ; LP64E-WITHFP-LABEL: va3:
1486 ; LP64E-WITHFP: # %bb.0:
1487 ; LP64E-WITHFP-NEXT: addi sp, sp, -56
1488 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
1489 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
1490 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
1491 ; LP64E-WITHFP-NEXT: sd a5, 24(s0)
1492 ; LP64E-WITHFP-NEXT: sd a4, 16(s0)
1493 ; LP64E-WITHFP-NEXT: sd a3, 8(s0)
1494 ; LP64E-WITHFP-NEXT: sd a2, 0(s0)
1495 ; LP64E-WITHFP-NEXT: addi a3, s0, 15
1496 ; LP64E-WITHFP-NEXT: add a0, a1, a2
1497 ; LP64E-WITHFP-NEXT: sd a3, -24(s0)
1498 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
1499 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
1500 ; LP64E-WITHFP-NEXT: addi sp, sp, 56
1501 ; LP64E-WITHFP-NEXT: ret
1503 call void @llvm.va_start(ptr %va)
1504 %argp.cur = load ptr, ptr %va
1505 %ptrint = ptrtoint ptr %argp.cur to iXLen
1506 %1 = add iXLen %ptrint, 7
1507 %2 = and iXLen %1, -8
1508 %argp.cur.aligned = inttoptr iXLen %1 to ptr
1509 %argp.next = getelementptr inbounds i8, ptr %argp.cur.aligned, i32 8
1510 store ptr %argp.next, ptr %va
1511 %3 = inttoptr iXLen %2 to ptr
1512 %4 = load double, ptr %3, align 8
1513 call void @llvm.va_end(ptr %va)
1514 %5 = bitcast double %4 to i64
1519 define i64 @va3_va_arg(i32 %a, i64 %b, ...) nounwind {
1520 ; ILP32-ILP32F-FPELIM-LABEL: va3_va_arg:
1521 ; ILP32-ILP32F-FPELIM: # %bb.0:
1522 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -32
1523 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 28(sp)
1524 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 24(sp)
1525 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 20(sp)
1526 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 16(sp)
1527 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 12(sp)
1528 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 19
1529 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -8
1530 ; ILP32-ILP32F-FPELIM-NEXT: addi a3, a0, 4
1531 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 4(sp)
1532 ; ILP32-ILP32F-FPELIM-NEXT: lw a3, 0(a0)
1533 ; ILP32-ILP32F-FPELIM-NEXT: addi a4, a0, 8
1534 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 4(sp)
1535 ; ILP32-ILP32F-FPELIM-NEXT: lw a4, 4(a0)
1536 ; ILP32-ILP32F-FPELIM-NEXT: add a0, a1, a3
1537 ; ILP32-ILP32F-FPELIM-NEXT: sltu a1, a0, a1
1538 ; ILP32-ILP32F-FPELIM-NEXT: add a2, a2, a4
1539 ; ILP32-ILP32F-FPELIM-NEXT: add a1, a2, a1
1540 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 32
1541 ; ILP32-ILP32F-FPELIM-NEXT: ret
1543 ; ILP32-ILP32F-WITHFP-LABEL: va3_va_arg:
1544 ; ILP32-ILP32F-WITHFP: # %bb.0:
1545 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
1546 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 20(sp) # 4-byte Folded Spill
1547 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 16(sp) # 4-byte Folded Spill
1548 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 24
1549 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 20(s0)
1550 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 16(s0)
1551 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 12(s0)
1552 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 8(s0)
1553 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 4(s0)
1554 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 11
1555 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -8
1556 ; ILP32-ILP32F-WITHFP-NEXT: addi a3, a0, 4
1557 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, -12(s0)
1558 ; ILP32-ILP32F-WITHFP-NEXT: lw a3, 0(a0)
1559 ; ILP32-ILP32F-WITHFP-NEXT: addi a4, a0, 8
1560 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, -12(s0)
1561 ; ILP32-ILP32F-WITHFP-NEXT: lw a4, 4(a0)
1562 ; ILP32-ILP32F-WITHFP-NEXT: add a0, a1, a3
1563 ; ILP32-ILP32F-WITHFP-NEXT: sltu a1, a0, a1
1564 ; ILP32-ILP32F-WITHFP-NEXT: add a2, a2, a4
1565 ; ILP32-ILP32F-WITHFP-NEXT: add a1, a2, a1
1566 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 20(sp) # 4-byte Folded Reload
1567 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 16(sp) # 4-byte Folded Reload
1568 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
1569 ; ILP32-ILP32F-WITHFP-NEXT: ret
1571 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va3_va_arg:
1572 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1573 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
1574 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
1575 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
1576 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
1577 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
1578 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
1579 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 35
1580 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -8
1581 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a3, a0, 8
1582 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 20(sp)
1583 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: fld fa5, 0(a0)
1584 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: fsd fa5, 8(sp)
1585 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 12(sp)
1586 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a3, 8(sp)
1587 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a2, a2, a0
1588 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a0, a1, a3
1589 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sltu a1, a0, a1
1590 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, a2, a1
1591 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
1592 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1594 ; ILP32E-FPELIM-LABEL: va3_va_arg:
1595 ; ILP32E-FPELIM: # %bb.0:
1596 ; ILP32E-FPELIM-NEXT: addi sp, sp, -20
1597 ; ILP32E-FPELIM-NEXT: sw a5, 16(sp)
1598 ; ILP32E-FPELIM-NEXT: sw a4, 12(sp)
1599 ; ILP32E-FPELIM-NEXT: sw a3, 8(sp)
1600 ; ILP32E-FPELIM-NEXT: addi a0, sp, 15
1601 ; ILP32E-FPELIM-NEXT: andi a0, a0, -8
1602 ; ILP32E-FPELIM-NEXT: addi a3, a0, 4
1603 ; ILP32E-FPELIM-NEXT: sw a3, 0(sp)
1604 ; ILP32E-FPELIM-NEXT: lw a3, 0(a0)
1605 ; ILP32E-FPELIM-NEXT: addi a4, a0, 8
1606 ; ILP32E-FPELIM-NEXT: sw a4, 0(sp)
1607 ; ILP32E-FPELIM-NEXT: lw a4, 4(a0)
1608 ; ILP32E-FPELIM-NEXT: add a0, a1, a3
1609 ; ILP32E-FPELIM-NEXT: sltu a1, a0, a1
1610 ; ILP32E-FPELIM-NEXT: add a2, a2, a4
1611 ; ILP32E-FPELIM-NEXT: add a1, a2, a1
1612 ; ILP32E-FPELIM-NEXT: addi sp, sp, 20
1613 ; ILP32E-FPELIM-NEXT: ret
1615 ; ILP32E-WITHFP-LABEL: va3_va_arg:
1616 ; ILP32E-WITHFP: # %bb.0:
1617 ; ILP32E-WITHFP-NEXT: addi sp, sp, -28
1618 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
1619 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
1620 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
1621 ; ILP32E-WITHFP-NEXT: sw a5, 12(s0)
1622 ; ILP32E-WITHFP-NEXT: sw a4, 8(s0)
1623 ; ILP32E-WITHFP-NEXT: sw a3, 4(s0)
1624 ; ILP32E-WITHFP-NEXT: addi a0, s0, 11
1625 ; ILP32E-WITHFP-NEXT: andi a0, a0, -8
1626 ; ILP32E-WITHFP-NEXT: addi a3, a0, 4
1627 ; ILP32E-WITHFP-NEXT: sw a3, -12(s0)
1628 ; ILP32E-WITHFP-NEXT: lw a3, 0(a0)
1629 ; ILP32E-WITHFP-NEXT: addi a4, a0, 8
1630 ; ILP32E-WITHFP-NEXT: sw a4, -12(s0)
1631 ; ILP32E-WITHFP-NEXT: lw a4, 4(a0)
1632 ; ILP32E-WITHFP-NEXT: add a0, a1, a3
1633 ; ILP32E-WITHFP-NEXT: sltu a1, a0, a1
1634 ; ILP32E-WITHFP-NEXT: add a2, a2, a4
1635 ; ILP32E-WITHFP-NEXT: add a1, a2, a1
1636 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
1637 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
1638 ; ILP32E-WITHFP-NEXT: addi sp, sp, 28
1639 ; ILP32E-WITHFP-NEXT: ret
1641 ; LP64-LP64F-LP64D-FPELIM-LABEL: va3_va_arg:
1642 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1643 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -64
1644 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 56(sp)
1645 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 48(sp)
1646 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 40(sp)
1647 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 32(sp)
1648 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 24(sp)
1649 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 16(sp)
1650 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a3, sp, 24
1651 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, a1, a2
1652 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 8(sp)
1653 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 64
1654 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1656 ; LP64-LP64F-LP64D-WITHFP-LABEL: va3_va_arg:
1657 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1658 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -80
1659 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
1660 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
1661 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
1662 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 40(s0)
1663 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 32(s0)
1664 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 24(s0)
1665 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 16(s0)
1666 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 8(s0)
1667 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 0(s0)
1668 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a3, s0, 8
1669 ; LP64-LP64F-LP64D-WITHFP-NEXT: add a0, a1, a2
1670 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, -24(s0)
1671 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
1672 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
1673 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 80
1674 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1676 ; LP64E-FPELIM-LABEL: va3_va_arg:
1677 ; LP64E-FPELIM: # %bb.0:
1678 ; LP64E-FPELIM-NEXT: addi sp, sp, -40
1679 ; LP64E-FPELIM-NEXT: sd a5, 32(sp)
1680 ; LP64E-FPELIM-NEXT: sd a4, 24(sp)
1681 ; LP64E-FPELIM-NEXT: sd a3, 16(sp)
1682 ; LP64E-FPELIM-NEXT: sd a2, 8(sp)
1683 ; LP64E-FPELIM-NEXT: addi a3, sp, 16
1684 ; LP64E-FPELIM-NEXT: add a0, a1, a2
1685 ; LP64E-FPELIM-NEXT: sd a3, 0(sp)
1686 ; LP64E-FPELIM-NEXT: addi sp, sp, 40
1687 ; LP64E-FPELIM-NEXT: ret
1689 ; LP64E-WITHFP-LABEL: va3_va_arg:
1690 ; LP64E-WITHFP: # %bb.0:
1691 ; LP64E-WITHFP-NEXT: addi sp, sp, -56
1692 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
1693 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
1694 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
1695 ; LP64E-WITHFP-NEXT: sd a5, 24(s0)
1696 ; LP64E-WITHFP-NEXT: sd a4, 16(s0)
1697 ; LP64E-WITHFP-NEXT: sd a3, 8(s0)
1698 ; LP64E-WITHFP-NEXT: sd a2, 0(s0)
1699 ; LP64E-WITHFP-NEXT: addi a3, s0, 8
1700 ; LP64E-WITHFP-NEXT: add a0, a1, a2
1701 ; LP64E-WITHFP-NEXT: sd a3, -24(s0)
1702 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
1703 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
1704 ; LP64E-WITHFP-NEXT: addi sp, sp, 56
1705 ; LP64E-WITHFP-NEXT: ret
1707 call void @llvm.va_start(ptr %va)
1708 %1 = va_arg ptr %va, double
1709 call void @llvm.va_end(ptr %va)
1710 %2 = bitcast double %1 to i64
1715 define void @va3_caller() nounwind {
1716 ; ILP32-ILP32F-FPELIM-LABEL: va3_caller:
1717 ; ILP32-ILP32F-FPELIM: # %bb.0:
1718 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -16
1719 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1720 ; ILP32-ILP32F-FPELIM-NEXT: li a0, 2
1721 ; ILP32-ILP32F-FPELIM-NEXT: li a1, 1111
1722 ; ILP32-ILP32F-FPELIM-NEXT: lui a5, 262144
1723 ; ILP32-ILP32F-FPELIM-NEXT: li a2, 0
1724 ; ILP32-ILP32F-FPELIM-NEXT: li a4, 0
1725 ; ILP32-ILP32F-FPELIM-NEXT: call va3
1726 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1727 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 16
1728 ; ILP32-ILP32F-FPELIM-NEXT: ret
1730 ; ILP32-ILP32F-WITHFP-LABEL: va3_caller:
1731 ; ILP32-ILP32F-WITHFP: # %bb.0:
1732 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -16
1733 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1734 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1735 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
1736 ; ILP32-ILP32F-WITHFP-NEXT: li a0, 2
1737 ; ILP32-ILP32F-WITHFP-NEXT: li a1, 1111
1738 ; ILP32-ILP32F-WITHFP-NEXT: lui a5, 262144
1739 ; ILP32-ILP32F-WITHFP-NEXT: li a2, 0
1740 ; ILP32-ILP32F-WITHFP-NEXT: li a4, 0
1741 ; ILP32-ILP32F-WITHFP-NEXT: call va3
1742 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1743 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
1744 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 16
1745 ; ILP32-ILP32F-WITHFP-NEXT: ret
1747 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va3_caller:
1748 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1749 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -16
1750 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1751 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a0, 2
1752 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a1, 1111
1753 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a5, 262144
1754 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a2, 0
1755 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a4, 0
1756 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call va3
1757 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1758 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 16
1759 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1761 ; ILP32E-FPELIM-LABEL: va3_caller:
1762 ; ILP32E-FPELIM: # %bb.0:
1763 ; ILP32E-FPELIM-NEXT: addi sp, sp, -4
1764 ; ILP32E-FPELIM-NEXT: sw ra, 0(sp) # 4-byte Folded Spill
1765 ; ILP32E-FPELIM-NEXT: li a0, 2
1766 ; ILP32E-FPELIM-NEXT: li a1, 1111
1767 ; ILP32E-FPELIM-NEXT: lui a4, 262144
1768 ; ILP32E-FPELIM-NEXT: li a2, 0
1769 ; ILP32E-FPELIM-NEXT: li a3, 0
1770 ; ILP32E-FPELIM-NEXT: call va3
1771 ; ILP32E-FPELIM-NEXT: lw ra, 0(sp) # 4-byte Folded Reload
1772 ; ILP32E-FPELIM-NEXT: addi sp, sp, 4
1773 ; ILP32E-FPELIM-NEXT: ret
1775 ; ILP32E-WITHFP-LABEL: va3_caller:
1776 ; ILP32E-WITHFP: # %bb.0:
1777 ; ILP32E-WITHFP-NEXT: addi sp, sp, -8
1778 ; ILP32E-WITHFP-NEXT: sw ra, 4(sp) # 4-byte Folded Spill
1779 ; ILP32E-WITHFP-NEXT: sw s0, 0(sp) # 4-byte Folded Spill
1780 ; ILP32E-WITHFP-NEXT: addi s0, sp, 8
1781 ; ILP32E-WITHFP-NEXT: li a0, 2
1782 ; ILP32E-WITHFP-NEXT: li a1, 1111
1783 ; ILP32E-WITHFP-NEXT: lui a4, 262144
1784 ; ILP32E-WITHFP-NEXT: li a2, 0
1785 ; ILP32E-WITHFP-NEXT: li a3, 0
1786 ; ILP32E-WITHFP-NEXT: call va3
1787 ; ILP32E-WITHFP-NEXT: lw ra, 4(sp) # 4-byte Folded Reload
1788 ; ILP32E-WITHFP-NEXT: lw s0, 0(sp) # 4-byte Folded Reload
1789 ; ILP32E-WITHFP-NEXT: addi sp, sp, 8
1790 ; ILP32E-WITHFP-NEXT: ret
1792 ; LP64-LP64F-LP64D-FPELIM-LABEL: va3_caller:
1793 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
1794 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -16
1795 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1796 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a2, 1
1797 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a2, a2, 62
1798 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a0, 2
1799 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a1, 1111
1800 ; LP64-LP64F-LP64D-FPELIM-NEXT: call va3
1801 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1802 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 16
1803 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
1805 ; LP64-LP64F-LP64D-WITHFP-LABEL: va3_caller:
1806 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
1807 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -16
1808 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1809 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
1810 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 16
1811 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a2, 1
1812 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a2, a2, 62
1813 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a0, 2
1814 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a1, 1111
1815 ; LP64-LP64F-LP64D-WITHFP-NEXT: call va3
1816 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1817 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
1818 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 16
1819 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
1821 ; LP64E-FPELIM-LABEL: va3_caller:
1822 ; LP64E-FPELIM: # %bb.0:
1823 ; LP64E-FPELIM-NEXT: addi sp, sp, -8
1824 ; LP64E-FPELIM-NEXT: sd ra, 0(sp) # 8-byte Folded Spill
1825 ; LP64E-FPELIM-NEXT: li a2, 1
1826 ; LP64E-FPELIM-NEXT: slli a2, a2, 62
1827 ; LP64E-FPELIM-NEXT: li a0, 2
1828 ; LP64E-FPELIM-NEXT: li a1, 1111
1829 ; LP64E-FPELIM-NEXT: call va3
1830 ; LP64E-FPELIM-NEXT: ld ra, 0(sp) # 8-byte Folded Reload
1831 ; LP64E-FPELIM-NEXT: addi sp, sp, 8
1832 ; LP64E-FPELIM-NEXT: ret
1834 ; LP64E-WITHFP-LABEL: va3_caller:
1835 ; LP64E-WITHFP: # %bb.0:
1836 ; LP64E-WITHFP-NEXT: addi sp, sp, -16
1837 ; LP64E-WITHFP-NEXT: sd ra, 8(sp) # 8-byte Folded Spill
1838 ; LP64E-WITHFP-NEXT: sd s0, 0(sp) # 8-byte Folded Spill
1839 ; LP64E-WITHFP-NEXT: addi s0, sp, 16
1840 ; LP64E-WITHFP-NEXT: li a2, 1
1841 ; LP64E-WITHFP-NEXT: slli a2, a2, 62
1842 ; LP64E-WITHFP-NEXT: li a0, 2
1843 ; LP64E-WITHFP-NEXT: li a1, 1111
1844 ; LP64E-WITHFP-NEXT: call va3
1845 ; LP64E-WITHFP-NEXT: ld ra, 8(sp) # 8-byte Folded Reload
1846 ; LP64E-WITHFP-NEXT: ld s0, 0(sp) # 8-byte Folded Reload
1847 ; LP64E-WITHFP-NEXT: addi sp, sp, 16
1848 ; LP64E-WITHFP-NEXT: ret
1849 %1 = call i64 (i32, i64, ...) @va3(i32 2, i64 1111, double 2.000000e+00)
1853 declare void @llvm.va_copy(ptr, ptr)
1855 define i32 @va4_va_copy(i32 %argno, ...) nounwind {
1856 ; ILP32-ILP32F-FPELIM-LABEL: va4_va_copy:
1857 ; ILP32-ILP32F-FPELIM: # %bb.0:
1858 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
1859 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1860 ; ILP32-ILP32F-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1861 ; ILP32-ILP32F-FPELIM-NEXT: mv s0, a1
1862 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
1863 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
1864 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
1865 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
1866 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
1867 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
1868 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
1869 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, sp, 24
1870 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 4(sp)
1871 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 0(sp)
1872 ; ILP32-ILP32F-FPELIM-NEXT: call notdead
1873 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 4(sp)
1874 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, 3
1875 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -4
1876 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, a0, 4
1877 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 4(sp)
1878 ; ILP32-ILP32F-FPELIM-NEXT: lw a1, 0(a0)
1879 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, 7
1880 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -4
1881 ; ILP32-ILP32F-FPELIM-NEXT: addi a2, a0, 4
1882 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 4(sp)
1883 ; ILP32-ILP32F-FPELIM-NEXT: lw a2, 0(a0)
1884 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, 7
1885 ; ILP32-ILP32F-FPELIM-NEXT: andi a0, a0, -4
1886 ; ILP32-ILP32F-FPELIM-NEXT: addi a3, a0, 4
1887 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 4(sp)
1888 ; ILP32-ILP32F-FPELIM-NEXT: lw a0, 0(a0)
1889 ; ILP32-ILP32F-FPELIM-NEXT: add a1, a1, s0
1890 ; ILP32-ILP32F-FPELIM-NEXT: add a1, a1, a2
1891 ; ILP32-ILP32F-FPELIM-NEXT: add a0, a1, a0
1892 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1893 ; ILP32-ILP32F-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
1894 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
1895 ; ILP32-ILP32F-FPELIM-NEXT: ret
1897 ; ILP32-ILP32F-WITHFP-LABEL: va4_va_copy:
1898 ; ILP32-ILP32F-WITHFP: # %bb.0:
1899 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -64
1900 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 28(sp) # 4-byte Folded Spill
1901 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 24(sp) # 4-byte Folded Spill
1902 ; ILP32-ILP32F-WITHFP-NEXT: sw s1, 20(sp) # 4-byte Folded Spill
1903 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 32
1904 ; ILP32-ILP32F-WITHFP-NEXT: mv s1, a1
1905 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
1906 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
1907 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
1908 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
1909 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
1910 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
1911 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
1912 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, s0, 8
1913 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -16(s0)
1914 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -20(s0)
1915 ; ILP32-ILP32F-WITHFP-NEXT: call notdead
1916 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, -16(s0)
1917 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, 3
1918 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -4
1919 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, a0, 4
1920 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -16(s0)
1921 ; ILP32-ILP32F-WITHFP-NEXT: lw a1, 0(a0)
1922 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, 7
1923 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -4
1924 ; ILP32-ILP32F-WITHFP-NEXT: addi a2, a0, 4
1925 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, -16(s0)
1926 ; ILP32-ILP32F-WITHFP-NEXT: lw a2, 0(a0)
1927 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, 7
1928 ; ILP32-ILP32F-WITHFP-NEXT: andi a0, a0, -4
1929 ; ILP32-ILP32F-WITHFP-NEXT: addi a3, a0, 4
1930 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, -16(s0)
1931 ; ILP32-ILP32F-WITHFP-NEXT: lw a0, 0(a0)
1932 ; ILP32-ILP32F-WITHFP-NEXT: add a1, a1, s1
1933 ; ILP32-ILP32F-WITHFP-NEXT: add a1, a1, a2
1934 ; ILP32-ILP32F-WITHFP-NEXT: add a0, a1, a0
1935 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 28(sp) # 4-byte Folded Reload
1936 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 24(sp) # 4-byte Folded Reload
1937 ; ILP32-ILP32F-WITHFP-NEXT: lw s1, 20(sp) # 4-byte Folded Reload
1938 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 64
1939 ; ILP32-ILP32F-WITHFP-NEXT: ret
1941 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va4_va_copy:
1942 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
1943 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
1944 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1945 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1946 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv s0, a1
1947 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
1948 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
1949 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
1950 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
1951 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
1952 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
1953 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
1954 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, sp, 24
1955 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 4(sp)
1956 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 0(sp)
1957 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call notdead
1958 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 4(sp)
1959 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, 3
1960 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -4
1961 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, a0, 4
1962 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 4(sp)
1963 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a1, 0(a0)
1964 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, 7
1965 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -4
1966 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a2, a0, 4
1967 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 4(sp)
1968 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a2, 0(a0)
1969 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, 7
1970 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: andi a0, a0, -4
1971 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a3, a0, 4
1972 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 4(sp)
1973 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw a0, 0(a0)
1974 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, a1, s0
1975 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, a1, a2
1976 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a0, a1, a0
1977 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
1978 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
1979 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
1980 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
1982 ; ILP32E-FPELIM-LABEL: va4_va_copy:
1983 ; ILP32E-FPELIM: # %bb.0:
1984 ; ILP32E-FPELIM-NEXT: addi sp, sp, -40
1985 ; ILP32E-FPELIM-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
1986 ; ILP32E-FPELIM-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
1987 ; ILP32E-FPELIM-NEXT: mv s0, a1
1988 ; ILP32E-FPELIM-NEXT: sw a5, 36(sp)
1989 ; ILP32E-FPELIM-NEXT: sw a4, 32(sp)
1990 ; ILP32E-FPELIM-NEXT: sw a3, 28(sp)
1991 ; ILP32E-FPELIM-NEXT: sw a2, 24(sp)
1992 ; ILP32E-FPELIM-NEXT: sw a1, 20(sp)
1993 ; ILP32E-FPELIM-NEXT: addi a0, sp, 24
1994 ; ILP32E-FPELIM-NEXT: sw a0, 4(sp)
1995 ; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
1996 ; ILP32E-FPELIM-NEXT: call notdead
1997 ; ILP32E-FPELIM-NEXT: lw a0, 4(sp)
1998 ; ILP32E-FPELIM-NEXT: addi a0, a0, 3
1999 ; ILP32E-FPELIM-NEXT: andi a0, a0, -4
2000 ; ILP32E-FPELIM-NEXT: addi a1, a0, 4
2001 ; ILP32E-FPELIM-NEXT: sw a1, 4(sp)
2002 ; ILP32E-FPELIM-NEXT: lw a1, 0(a0)
2003 ; ILP32E-FPELIM-NEXT: addi a0, a0, 7
2004 ; ILP32E-FPELIM-NEXT: andi a0, a0, -4
2005 ; ILP32E-FPELIM-NEXT: addi a2, a0, 4
2006 ; ILP32E-FPELIM-NEXT: sw a2, 4(sp)
2007 ; ILP32E-FPELIM-NEXT: lw a2, 0(a0)
2008 ; ILP32E-FPELIM-NEXT: addi a0, a0, 7
2009 ; ILP32E-FPELIM-NEXT: andi a0, a0, -4
2010 ; ILP32E-FPELIM-NEXT: addi a3, a0, 4
2011 ; ILP32E-FPELIM-NEXT: sw a3, 4(sp)
2012 ; ILP32E-FPELIM-NEXT: lw a0, 0(a0)
2013 ; ILP32E-FPELIM-NEXT: add a1, a1, s0
2014 ; ILP32E-FPELIM-NEXT: add a1, a1, a2
2015 ; ILP32E-FPELIM-NEXT: add a0, a1, a0
2016 ; ILP32E-FPELIM-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
2017 ; ILP32E-FPELIM-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
2018 ; ILP32E-FPELIM-NEXT: addi sp, sp, 40
2019 ; ILP32E-FPELIM-NEXT: ret
2021 ; ILP32E-WITHFP-LABEL: va4_va_copy:
2022 ; ILP32E-WITHFP: # %bb.0:
2023 ; ILP32E-WITHFP-NEXT: addi sp, sp, -44
2024 ; ILP32E-WITHFP-NEXT: sw ra, 16(sp) # 4-byte Folded Spill
2025 ; ILP32E-WITHFP-NEXT: sw s0, 12(sp) # 4-byte Folded Spill
2026 ; ILP32E-WITHFP-NEXT: sw s1, 8(sp) # 4-byte Folded Spill
2027 ; ILP32E-WITHFP-NEXT: addi s0, sp, 20
2028 ; ILP32E-WITHFP-NEXT: mv s1, a1
2029 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
2030 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
2031 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
2032 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
2033 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
2034 ; ILP32E-WITHFP-NEXT: addi a0, s0, 8
2035 ; ILP32E-WITHFP-NEXT: sw a0, -16(s0)
2036 ; ILP32E-WITHFP-NEXT: sw a0, -20(s0)
2037 ; ILP32E-WITHFP-NEXT: call notdead
2038 ; ILP32E-WITHFP-NEXT: lw a0, -16(s0)
2039 ; ILP32E-WITHFP-NEXT: addi a0, a0, 3
2040 ; ILP32E-WITHFP-NEXT: andi a0, a0, -4
2041 ; ILP32E-WITHFP-NEXT: addi a1, a0, 4
2042 ; ILP32E-WITHFP-NEXT: sw a1, -16(s0)
2043 ; ILP32E-WITHFP-NEXT: lw a1, 0(a0)
2044 ; ILP32E-WITHFP-NEXT: addi a0, a0, 7
2045 ; ILP32E-WITHFP-NEXT: andi a0, a0, -4
2046 ; ILP32E-WITHFP-NEXT: addi a2, a0, 4
2047 ; ILP32E-WITHFP-NEXT: sw a2, -16(s0)
2048 ; ILP32E-WITHFP-NEXT: lw a2, 0(a0)
2049 ; ILP32E-WITHFP-NEXT: addi a0, a0, 7
2050 ; ILP32E-WITHFP-NEXT: andi a0, a0, -4
2051 ; ILP32E-WITHFP-NEXT: addi a3, a0, 4
2052 ; ILP32E-WITHFP-NEXT: sw a3, -16(s0)
2053 ; ILP32E-WITHFP-NEXT: lw a0, 0(a0)
2054 ; ILP32E-WITHFP-NEXT: add a1, a1, s1
2055 ; ILP32E-WITHFP-NEXT: add a1, a1, a2
2056 ; ILP32E-WITHFP-NEXT: add a0, a1, a0
2057 ; ILP32E-WITHFP-NEXT: lw ra, 16(sp) # 4-byte Folded Reload
2058 ; ILP32E-WITHFP-NEXT: lw s0, 12(sp) # 4-byte Folded Reload
2059 ; ILP32E-WITHFP-NEXT: lw s1, 8(sp) # 4-byte Folded Reload
2060 ; ILP32E-WITHFP-NEXT: addi sp, sp, 44
2061 ; ILP32E-WITHFP-NEXT: ret
2063 ; LP64-LP64F-LP64D-FPELIM-LABEL: va4_va_copy:
2064 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
2065 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -96
2066 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
2067 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
2068 ; LP64-LP64F-LP64D-FPELIM-NEXT: mv s0, a1
2069 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 88(sp)
2070 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 80(sp)
2071 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 72(sp)
2072 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 64(sp)
2073 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 56(sp)
2074 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 48(sp)
2075 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 40(sp)
2076 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, sp, 48
2077 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 8(sp)
2078 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 0(sp)
2079 ; LP64-LP64F-LP64D-FPELIM-NEXT: call notdead
2080 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a0, 8(sp)
2081 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, a0, 3
2082 ; LP64-LP64F-LP64D-FPELIM-NEXT: andi a0, a0, -4
2083 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, a0, 8
2084 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
2085 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a1, 0(a0)
2086 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, a0, 11
2087 ; LP64-LP64F-LP64D-FPELIM-NEXT: andi a0, a0, -4
2088 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a2, a0, 8
2089 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 8(sp)
2090 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a2, 0(a0)
2091 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a0, a0, 11
2092 ; LP64-LP64F-LP64D-FPELIM-NEXT: andi a0, a0, -4
2093 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a3, a0, 8
2094 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 8(sp)
2095 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a0, 0(a0)
2096 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, a1, s0
2097 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, a1, a2
2098 ; LP64-LP64F-LP64D-FPELIM-NEXT: addw a0, a1, a0
2099 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
2100 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
2101 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 96
2102 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
2104 ; LP64-LP64F-LP64D-WITHFP-LABEL: va4_va_copy:
2105 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
2106 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -112
2107 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 40(sp) # 8-byte Folded Spill
2108 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 32(sp) # 8-byte Folded Spill
2109 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s1, 24(sp) # 8-byte Folded Spill
2110 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 48
2111 ; LP64-LP64F-LP64D-WITHFP-NEXT: mv s1, a1
2112 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
2113 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
2114 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
2115 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
2116 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
2117 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
2118 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
2119 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, s0, 16
2120 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -32(s0)
2121 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -40(s0)
2122 ; LP64-LP64F-LP64D-WITHFP-NEXT: call notdead
2123 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a0, -32(s0)
2124 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, a0, 3
2125 ; LP64-LP64F-LP64D-WITHFP-NEXT: andi a0, a0, -4
2126 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, a0, 8
2127 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -32(s0)
2128 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a1, 0(a0)
2129 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, a0, 11
2130 ; LP64-LP64F-LP64D-WITHFP-NEXT: andi a0, a0, -4
2131 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a2, a0, 8
2132 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, -32(s0)
2133 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a2, 0(a0)
2134 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, a0, 11
2135 ; LP64-LP64F-LP64D-WITHFP-NEXT: andi a0, a0, -4
2136 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a3, a0, 8
2137 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, -32(s0)
2138 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a0, 0(a0)
2139 ; LP64-LP64F-LP64D-WITHFP-NEXT: add a1, a1, s1
2140 ; LP64-LP64F-LP64D-WITHFP-NEXT: add a1, a1, a2
2141 ; LP64-LP64F-LP64D-WITHFP-NEXT: addw a0, a1, a0
2142 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 40(sp) # 8-byte Folded Reload
2143 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 32(sp) # 8-byte Folded Reload
2144 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s1, 24(sp) # 8-byte Folded Reload
2145 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 112
2146 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
2148 ; LP64E-FPELIM-LABEL: va4_va_copy:
2149 ; LP64E-FPELIM: # %bb.0:
2150 ; LP64E-FPELIM-NEXT: addi sp, sp, -80
2151 ; LP64E-FPELIM-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
2152 ; LP64E-FPELIM-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
2153 ; LP64E-FPELIM-NEXT: mv s0, a1
2154 ; LP64E-FPELIM-NEXT: sd a5, 72(sp)
2155 ; LP64E-FPELIM-NEXT: sd a4, 64(sp)
2156 ; LP64E-FPELIM-NEXT: sd a3, 56(sp)
2157 ; LP64E-FPELIM-NEXT: sd a2, 48(sp)
2158 ; LP64E-FPELIM-NEXT: sd a1, 40(sp)
2159 ; LP64E-FPELIM-NEXT: addi a0, sp, 48
2160 ; LP64E-FPELIM-NEXT: sd a0, 8(sp)
2161 ; LP64E-FPELIM-NEXT: sd a0, 0(sp)
2162 ; LP64E-FPELIM-NEXT: call notdead
2163 ; LP64E-FPELIM-NEXT: ld a0, 8(sp)
2164 ; LP64E-FPELIM-NEXT: addi a0, a0, 3
2165 ; LP64E-FPELIM-NEXT: andi a0, a0, -4
2166 ; LP64E-FPELIM-NEXT: addi a1, a0, 8
2167 ; LP64E-FPELIM-NEXT: sd a1, 8(sp)
2168 ; LP64E-FPELIM-NEXT: ld a1, 0(a0)
2169 ; LP64E-FPELIM-NEXT: addi a0, a0, 11
2170 ; LP64E-FPELIM-NEXT: andi a0, a0, -4
2171 ; LP64E-FPELIM-NEXT: addi a2, a0, 8
2172 ; LP64E-FPELIM-NEXT: sd a2, 8(sp)
2173 ; LP64E-FPELIM-NEXT: ld a2, 0(a0)
2174 ; LP64E-FPELIM-NEXT: addi a0, a0, 11
2175 ; LP64E-FPELIM-NEXT: andi a0, a0, -4
2176 ; LP64E-FPELIM-NEXT: addi a3, a0, 8
2177 ; LP64E-FPELIM-NEXT: sd a3, 8(sp)
2178 ; LP64E-FPELIM-NEXT: ld a0, 0(a0)
2179 ; LP64E-FPELIM-NEXT: add a1, a1, s0
2180 ; LP64E-FPELIM-NEXT: add a1, a1, a2
2181 ; LP64E-FPELIM-NEXT: addw a0, a1, a0
2182 ; LP64E-FPELIM-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
2183 ; LP64E-FPELIM-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
2184 ; LP64E-FPELIM-NEXT: addi sp, sp, 80
2185 ; LP64E-FPELIM-NEXT: ret
2187 ; LP64E-WITHFP-LABEL: va4_va_copy:
2188 ; LP64E-WITHFP: # %bb.0:
2189 ; LP64E-WITHFP-NEXT: addi sp, sp, -88
2190 ; LP64E-WITHFP-NEXT: sd ra, 32(sp) # 8-byte Folded Spill
2191 ; LP64E-WITHFP-NEXT: sd s0, 24(sp) # 8-byte Folded Spill
2192 ; LP64E-WITHFP-NEXT: sd s1, 16(sp) # 8-byte Folded Spill
2193 ; LP64E-WITHFP-NEXT: addi s0, sp, 40
2194 ; LP64E-WITHFP-NEXT: mv s1, a1
2195 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
2196 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
2197 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
2198 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
2199 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
2200 ; LP64E-WITHFP-NEXT: addi a0, s0, 16
2201 ; LP64E-WITHFP-NEXT: sd a0, -32(s0)
2202 ; LP64E-WITHFP-NEXT: sd a0, -40(s0)
2203 ; LP64E-WITHFP-NEXT: call notdead
2204 ; LP64E-WITHFP-NEXT: ld a0, -32(s0)
2205 ; LP64E-WITHFP-NEXT: addi a0, a0, 3
2206 ; LP64E-WITHFP-NEXT: andi a0, a0, -4
2207 ; LP64E-WITHFP-NEXT: addi a1, a0, 8
2208 ; LP64E-WITHFP-NEXT: sd a1, -32(s0)
2209 ; LP64E-WITHFP-NEXT: ld a1, 0(a0)
2210 ; LP64E-WITHFP-NEXT: addi a0, a0, 11
2211 ; LP64E-WITHFP-NEXT: andi a0, a0, -4
2212 ; LP64E-WITHFP-NEXT: addi a2, a0, 8
2213 ; LP64E-WITHFP-NEXT: sd a2, -32(s0)
2214 ; LP64E-WITHFP-NEXT: ld a2, 0(a0)
2215 ; LP64E-WITHFP-NEXT: addi a0, a0, 11
2216 ; LP64E-WITHFP-NEXT: andi a0, a0, -4
2217 ; LP64E-WITHFP-NEXT: addi a3, a0, 8
2218 ; LP64E-WITHFP-NEXT: sd a3, -32(s0)
2219 ; LP64E-WITHFP-NEXT: ld a0, 0(a0)
2220 ; LP64E-WITHFP-NEXT: add a1, a1, s1
2221 ; LP64E-WITHFP-NEXT: add a1, a1, a2
2222 ; LP64E-WITHFP-NEXT: addw a0, a1, a0
2223 ; LP64E-WITHFP-NEXT: ld ra, 32(sp) # 8-byte Folded Reload
2224 ; LP64E-WITHFP-NEXT: ld s0, 24(sp) # 8-byte Folded Reload
2225 ; LP64E-WITHFP-NEXT: ld s1, 16(sp) # 8-byte Folded Reload
2226 ; LP64E-WITHFP-NEXT: addi sp, sp, 88
2227 ; LP64E-WITHFP-NEXT: ret
2230 call void @llvm.va_start(ptr %vargs)
2231 %1 = va_arg ptr %vargs, i32
2232 call void @llvm.va_copy(ptr %wargs, ptr %vargs)
2233 %2 = load ptr, ptr %wargs, align 4
2234 call void @notdead(ptr %2)
2235 %3 = va_arg ptr %vargs, i32
2236 %4 = va_arg ptr %vargs, i32
2237 %5 = va_arg ptr %vargs, i32
2238 call void @llvm.va_end(ptr %vargs)
2239 call void @llvm.va_end(ptr %wargs)
2240 %add1 = add i32 %3, %1
2241 %add2 = add i32 %add1, %4
2242 %add3 = add i32 %add2, %5
2246 ; Check 2x*xlen values are aligned appropriately when passed on the stack in a vararg call
2248 declare i32 @va5_aligned_stack_callee(i32, ...)
2250 define void @va5_aligned_stack_caller() nounwind {
2251 ; The double should be 8-byte aligned on the stack, but the two-element array
2252 ; should only be 4-byte aligned
2253 ; ILP32-ILP32F-FPELIM-LABEL: va5_aligned_stack_caller:
2254 ; ILP32-ILP32F-FPELIM: # %bb.0:
2255 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -64
2256 ; ILP32-ILP32F-FPELIM-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2257 ; ILP32-ILP32F-FPELIM-NEXT: li a0, 17
2258 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 24(sp)
2259 ; ILP32-ILP32F-FPELIM-NEXT: li a0, 16
2260 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 20(sp)
2261 ; ILP32-ILP32F-FPELIM-NEXT: li a0, 15
2262 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 16(sp)
2263 ; ILP32-ILP32F-FPELIM-NEXT: lui a0, 262236
2264 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, 655
2265 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 12(sp)
2266 ; ILP32-ILP32F-FPELIM-NEXT: lui a0, 377487
2267 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, 1475
2268 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 8(sp)
2269 ; ILP32-ILP32F-FPELIM-NEXT: li a0, 14
2270 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 0(sp)
2271 ; ILP32-ILP32F-FPELIM-NEXT: lui a0, 262153
2272 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, 491
2273 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 44(sp)
2274 ; ILP32-ILP32F-FPELIM-NEXT: lui a0, 545260
2275 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, -1967
2276 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 40(sp)
2277 ; ILP32-ILP32F-FPELIM-NEXT: lui a0, 964690
2278 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, -328
2279 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 36(sp)
2280 ; ILP32-ILP32F-FPELIM-NEXT: lui a0, 335544
2281 ; ILP32-ILP32F-FPELIM-NEXT: addi a5, a0, 1311
2282 ; ILP32-ILP32F-FPELIM-NEXT: lui a0, 688509
2283 ; ILP32-ILP32F-FPELIM-NEXT: addi a6, a0, -2048
2284 ; ILP32-ILP32F-FPELIM-NEXT: li a0, 1
2285 ; ILP32-ILP32F-FPELIM-NEXT: li a1, 11
2286 ; ILP32-ILP32F-FPELIM-NEXT: addi a2, sp, 32
2287 ; ILP32-ILP32F-FPELIM-NEXT: li a3, 12
2288 ; ILP32-ILP32F-FPELIM-NEXT: li a4, 13
2289 ; ILP32-ILP32F-FPELIM-NEXT: li a7, 4
2290 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 32(sp)
2291 ; ILP32-ILP32F-FPELIM-NEXT: call va5_aligned_stack_callee
2292 ; ILP32-ILP32F-FPELIM-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2293 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 64
2294 ; ILP32-ILP32F-FPELIM-NEXT: ret
2296 ; ILP32-ILP32F-WITHFP-LABEL: va5_aligned_stack_caller:
2297 ; ILP32-ILP32F-WITHFP: # %bb.0:
2298 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -64
2299 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2300 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
2301 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 64
2302 ; ILP32-ILP32F-WITHFP-NEXT: li a0, 17
2303 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, 24(sp)
2304 ; ILP32-ILP32F-WITHFP-NEXT: li a0, 16
2305 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, 20(sp)
2306 ; ILP32-ILP32F-WITHFP-NEXT: li a0, 15
2307 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, 16(sp)
2308 ; ILP32-ILP32F-WITHFP-NEXT: lui a0, 262236
2309 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, 655
2310 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, 12(sp)
2311 ; ILP32-ILP32F-WITHFP-NEXT: lui a0, 377487
2312 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, 1475
2313 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, 8(sp)
2314 ; ILP32-ILP32F-WITHFP-NEXT: li a0, 14
2315 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, 0(sp)
2316 ; ILP32-ILP32F-WITHFP-NEXT: lui a0, 262153
2317 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, 491
2318 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -20(s0)
2319 ; ILP32-ILP32F-WITHFP-NEXT: lui a0, 545260
2320 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, -1967
2321 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -24(s0)
2322 ; ILP32-ILP32F-WITHFP-NEXT: lui a0, 964690
2323 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, -328
2324 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, -28(s0)
2325 ; ILP32-ILP32F-WITHFP-NEXT: lui a0, 335544
2326 ; ILP32-ILP32F-WITHFP-NEXT: addi a5, a0, 1311
2327 ; ILP32-ILP32F-WITHFP-NEXT: lui a0, 688509
2328 ; ILP32-ILP32F-WITHFP-NEXT: addi a6, a0, -2048
2329 ; ILP32-ILP32F-WITHFP-NEXT: li a0, 1
2330 ; ILP32-ILP32F-WITHFP-NEXT: li a1, 11
2331 ; ILP32-ILP32F-WITHFP-NEXT: addi a2, s0, -32
2332 ; ILP32-ILP32F-WITHFP-NEXT: li a3, 12
2333 ; ILP32-ILP32F-WITHFP-NEXT: li a4, 13
2334 ; ILP32-ILP32F-WITHFP-NEXT: li a7, 4
2335 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, -32(s0)
2336 ; ILP32-ILP32F-WITHFP-NEXT: call va5_aligned_stack_callee
2337 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2338 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
2339 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 64
2340 ; ILP32-ILP32F-WITHFP-NEXT: ret
2342 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va5_aligned_stack_caller:
2343 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
2344 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -64
2345 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2346 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a0, 262236
2347 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, 655
2348 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 12(sp)
2349 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a0, 377487
2350 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, 1475
2351 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 8(sp)
2352 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a0, 17
2353 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 24(sp)
2354 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a0, 16
2355 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 20(sp)
2356 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a0, 15
2357 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 16(sp)
2358 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a0, 14
2359 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 0(sp)
2360 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a0, 262153
2361 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, 491
2362 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 44(sp)
2363 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a0, 545260
2364 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, -1967
2365 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 40(sp)
2366 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a0, 964690
2367 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, -328
2368 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 36(sp)
2369 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a0, 335544
2370 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a5, a0, 1311
2371 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a0, 688509
2372 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a6, a0, -2048
2373 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a0, 1
2374 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a1, 11
2375 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a2, sp, 32
2376 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a3, 12
2377 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a4, 13
2378 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: li a7, 4
2379 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 32(sp)
2380 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: call va5_aligned_stack_callee
2381 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2382 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 64
2383 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
2385 ; ILP32E-FPELIM-LABEL: va5_aligned_stack_caller:
2386 ; ILP32E-FPELIM: # %bb.0:
2387 ; ILP32E-FPELIM-NEXT: addi sp, sp, -64
2388 ; ILP32E-FPELIM-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2389 ; ILP32E-FPELIM-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
2390 ; ILP32E-FPELIM-NEXT: addi s0, sp, 64
2391 ; ILP32E-FPELIM-NEXT: andi sp, sp, -16
2392 ; ILP32E-FPELIM-NEXT: li a0, 17
2393 ; ILP32E-FPELIM-NEXT: sw a0, 24(sp)
2394 ; ILP32E-FPELIM-NEXT: li a0, 16
2395 ; ILP32E-FPELIM-NEXT: sw a0, 20(sp)
2396 ; ILP32E-FPELIM-NEXT: li a0, 15
2397 ; ILP32E-FPELIM-NEXT: sw a0, 16(sp)
2398 ; ILP32E-FPELIM-NEXT: lui a0, 262236
2399 ; ILP32E-FPELIM-NEXT: addi a0, a0, 655
2400 ; ILP32E-FPELIM-NEXT: sw a0, 12(sp)
2401 ; ILP32E-FPELIM-NEXT: lui a0, 377487
2402 ; ILP32E-FPELIM-NEXT: addi a0, a0, 1475
2403 ; ILP32E-FPELIM-NEXT: sw a0, 8(sp)
2404 ; ILP32E-FPELIM-NEXT: li a0, 14
2405 ; ILP32E-FPELIM-NEXT: sw a0, 4(sp)
2406 ; ILP32E-FPELIM-NEXT: li a0, 4
2407 ; ILP32E-FPELIM-NEXT: sw a0, 0(sp)
2408 ; ILP32E-FPELIM-NEXT: lui a0, 262153
2409 ; ILP32E-FPELIM-NEXT: addi a0, a0, 491
2410 ; ILP32E-FPELIM-NEXT: sw a0, 44(sp)
2411 ; ILP32E-FPELIM-NEXT: lui a0, 545260
2412 ; ILP32E-FPELIM-NEXT: addi a0, a0, -1967
2413 ; ILP32E-FPELIM-NEXT: sw a0, 40(sp)
2414 ; ILP32E-FPELIM-NEXT: lui a0, 964690
2415 ; ILP32E-FPELIM-NEXT: addi a0, a0, -328
2416 ; ILP32E-FPELIM-NEXT: sw a0, 36(sp)
2417 ; ILP32E-FPELIM-NEXT: lui a0, 335544
2418 ; ILP32E-FPELIM-NEXT: addi a6, a0, 1311
2419 ; ILP32E-FPELIM-NEXT: lui a0, 688509
2420 ; ILP32E-FPELIM-NEXT: addi a5, a0, -2048
2421 ; ILP32E-FPELIM-NEXT: li a0, 1
2422 ; ILP32E-FPELIM-NEXT: li a1, 11
2423 ; ILP32E-FPELIM-NEXT: addi a2, sp, 32
2424 ; ILP32E-FPELIM-NEXT: li a3, 12
2425 ; ILP32E-FPELIM-NEXT: li a4, 13
2426 ; ILP32E-FPELIM-NEXT: sw a6, 32(sp)
2427 ; ILP32E-FPELIM-NEXT: call va5_aligned_stack_callee
2428 ; ILP32E-FPELIM-NEXT: addi sp, s0, -64
2429 ; ILP32E-FPELIM-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2430 ; ILP32E-FPELIM-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
2431 ; ILP32E-FPELIM-NEXT: addi sp, sp, 64
2432 ; ILP32E-FPELIM-NEXT: ret
2434 ; ILP32E-WITHFP-LABEL: va5_aligned_stack_caller:
2435 ; ILP32E-WITHFP: # %bb.0:
2436 ; ILP32E-WITHFP-NEXT: addi sp, sp, -64
2437 ; ILP32E-WITHFP-NEXT: sw ra, 60(sp) # 4-byte Folded Spill
2438 ; ILP32E-WITHFP-NEXT: sw s0, 56(sp) # 4-byte Folded Spill
2439 ; ILP32E-WITHFP-NEXT: addi s0, sp, 64
2440 ; ILP32E-WITHFP-NEXT: andi sp, sp, -16
2441 ; ILP32E-WITHFP-NEXT: li a0, 17
2442 ; ILP32E-WITHFP-NEXT: sw a0, 24(sp)
2443 ; ILP32E-WITHFP-NEXT: li a0, 16
2444 ; ILP32E-WITHFP-NEXT: sw a0, 20(sp)
2445 ; ILP32E-WITHFP-NEXT: li a0, 15
2446 ; ILP32E-WITHFP-NEXT: sw a0, 16(sp)
2447 ; ILP32E-WITHFP-NEXT: lui a0, 262236
2448 ; ILP32E-WITHFP-NEXT: addi a0, a0, 655
2449 ; ILP32E-WITHFP-NEXT: sw a0, 12(sp)
2450 ; ILP32E-WITHFP-NEXT: lui a0, 377487
2451 ; ILP32E-WITHFP-NEXT: addi a0, a0, 1475
2452 ; ILP32E-WITHFP-NEXT: sw a0, 8(sp)
2453 ; ILP32E-WITHFP-NEXT: li a0, 14
2454 ; ILP32E-WITHFP-NEXT: sw a0, 4(sp)
2455 ; ILP32E-WITHFP-NEXT: li a0, 4
2456 ; ILP32E-WITHFP-NEXT: sw a0, 0(sp)
2457 ; ILP32E-WITHFP-NEXT: lui a0, 262153
2458 ; ILP32E-WITHFP-NEXT: addi a0, a0, 491
2459 ; ILP32E-WITHFP-NEXT: sw a0, 44(sp)
2460 ; ILP32E-WITHFP-NEXT: lui a0, 545260
2461 ; ILP32E-WITHFP-NEXT: addi a0, a0, -1967
2462 ; ILP32E-WITHFP-NEXT: sw a0, 40(sp)
2463 ; ILP32E-WITHFP-NEXT: lui a0, 964690
2464 ; ILP32E-WITHFP-NEXT: addi a0, a0, -328
2465 ; ILP32E-WITHFP-NEXT: sw a0, 36(sp)
2466 ; ILP32E-WITHFP-NEXT: lui a0, 335544
2467 ; ILP32E-WITHFP-NEXT: addi a6, a0, 1311
2468 ; ILP32E-WITHFP-NEXT: lui a0, 688509
2469 ; ILP32E-WITHFP-NEXT: addi a5, a0, -2048
2470 ; ILP32E-WITHFP-NEXT: li a0, 1
2471 ; ILP32E-WITHFP-NEXT: li a1, 11
2472 ; ILP32E-WITHFP-NEXT: addi a2, sp, 32
2473 ; ILP32E-WITHFP-NEXT: li a3, 12
2474 ; ILP32E-WITHFP-NEXT: li a4, 13
2475 ; ILP32E-WITHFP-NEXT: sw a6, 32(sp)
2476 ; ILP32E-WITHFP-NEXT: call va5_aligned_stack_callee
2477 ; ILP32E-WITHFP-NEXT: addi sp, s0, -64
2478 ; ILP32E-WITHFP-NEXT: lw ra, 60(sp) # 4-byte Folded Reload
2479 ; ILP32E-WITHFP-NEXT: lw s0, 56(sp) # 4-byte Folded Reload
2480 ; ILP32E-WITHFP-NEXT: addi sp, sp, 64
2481 ; ILP32E-WITHFP-NEXT: ret
2483 ; LP64-LP64F-LP64D-FPELIM-LABEL: va5_aligned_stack_caller:
2484 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
2485 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -48
2486 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd ra, 40(sp) # 8-byte Folded Spill
2487 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a0, 17
2488 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 24(sp)
2489 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a0, 16
2490 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 16(sp)
2491 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a0, 15
2492 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 8(sp)
2493 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, %hi(.LCPI11_0)
2494 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld t0, %lo(.LCPI11_0)(a0)
2495 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, %hi(.LCPI11_1)
2496 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a2, %lo(.LCPI11_1)(a0)
2497 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, %hi(.LCPI11_2)
2498 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld a3, %lo(.LCPI11_2)(a0)
2499 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 2384
2500 ; LP64-LP64F-LP64D-FPELIM-NEXT: addiw a6, a0, 761
2501 ; LP64-LP64F-LP64D-FPELIM-NEXT: slli a6, a6, 11
2502 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a0, 1
2503 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a1, 11
2504 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a4, 12
2505 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a5, 13
2506 ; LP64-LP64F-LP64D-FPELIM-NEXT: li a7, 14
2507 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd t0, 0(sp)
2508 ; LP64-LP64F-LP64D-FPELIM-NEXT: call va5_aligned_stack_callee
2509 ; LP64-LP64F-LP64D-FPELIM-NEXT: ld ra, 40(sp) # 8-byte Folded Reload
2510 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 48
2511 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
2513 ; LP64-LP64F-LP64D-WITHFP-LABEL: va5_aligned_stack_caller:
2514 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
2515 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -48
2516 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 40(sp) # 8-byte Folded Spill
2517 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 32(sp) # 8-byte Folded Spill
2518 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 48
2519 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a0, 17
2520 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, 24(sp)
2521 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a0, 16
2522 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, 16(sp)
2523 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a0, 15
2524 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, 8(sp)
2525 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a0, %hi(.LCPI11_0)
2526 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld t0, %lo(.LCPI11_0)(a0)
2527 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a0, %hi(.LCPI11_1)
2528 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a2, %lo(.LCPI11_1)(a0)
2529 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a0, %hi(.LCPI11_2)
2530 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld a3, %lo(.LCPI11_2)(a0)
2531 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a0, 2384
2532 ; LP64-LP64F-LP64D-WITHFP-NEXT: addiw a6, a0, 761
2533 ; LP64-LP64F-LP64D-WITHFP-NEXT: slli a6, a6, 11
2534 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a0, 1
2535 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a1, 11
2536 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a4, 12
2537 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a5, 13
2538 ; LP64-LP64F-LP64D-WITHFP-NEXT: li a7, 14
2539 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd t0, 0(sp)
2540 ; LP64-LP64F-LP64D-WITHFP-NEXT: call va5_aligned_stack_callee
2541 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 40(sp) # 8-byte Folded Reload
2542 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 32(sp) # 8-byte Folded Reload
2543 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 48
2544 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
2546 ; LP64E-FPELIM-LABEL: va5_aligned_stack_caller:
2547 ; LP64E-FPELIM: # %bb.0:
2548 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
2549 ; LP64E-FPELIM-NEXT: sd ra, 48(sp) # 8-byte Folded Spill
2550 ; LP64E-FPELIM-NEXT: li a0, 17
2551 ; LP64E-FPELIM-NEXT: sd a0, 40(sp)
2552 ; LP64E-FPELIM-NEXT: li a0, 16
2553 ; LP64E-FPELIM-NEXT: lui a1, %hi(.LCPI11_0)
2554 ; LP64E-FPELIM-NEXT: ld a1, %lo(.LCPI11_0)(a1)
2555 ; LP64E-FPELIM-NEXT: sd a0, 32(sp)
2556 ; LP64E-FPELIM-NEXT: li a0, 15
2557 ; LP64E-FPELIM-NEXT: sd a0, 24(sp)
2558 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
2559 ; LP64E-FPELIM-NEXT: li a0, 14
2560 ; LP64E-FPELIM-NEXT: sd a0, 8(sp)
2561 ; LP64E-FPELIM-NEXT: lui a0, 2384
2562 ; LP64E-FPELIM-NEXT: addiw a0, a0, 761
2563 ; LP64E-FPELIM-NEXT: slli a6, a0, 11
2564 ; LP64E-FPELIM-NEXT: lui a0, %hi(.LCPI11_1)
2565 ; LP64E-FPELIM-NEXT: ld a2, %lo(.LCPI11_1)(a0)
2566 ; LP64E-FPELIM-NEXT: lui a0, %hi(.LCPI11_2)
2567 ; LP64E-FPELIM-NEXT: ld a3, %lo(.LCPI11_2)(a0)
2568 ; LP64E-FPELIM-NEXT: li a0, 1
2569 ; LP64E-FPELIM-NEXT: li a1, 11
2570 ; LP64E-FPELIM-NEXT: li a4, 12
2571 ; LP64E-FPELIM-NEXT: li a5, 13
2572 ; LP64E-FPELIM-NEXT: sd a6, 0(sp)
2573 ; LP64E-FPELIM-NEXT: call va5_aligned_stack_callee
2574 ; LP64E-FPELIM-NEXT: ld ra, 48(sp) # 8-byte Folded Reload
2575 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
2576 ; LP64E-FPELIM-NEXT: ret
2578 ; LP64E-WITHFP-LABEL: va5_aligned_stack_caller:
2579 ; LP64E-WITHFP: # %bb.0:
2580 ; LP64E-WITHFP-NEXT: addi sp, sp, -64
2581 ; LP64E-WITHFP-NEXT: sd ra, 56(sp) # 8-byte Folded Spill
2582 ; LP64E-WITHFP-NEXT: sd s0, 48(sp) # 8-byte Folded Spill
2583 ; LP64E-WITHFP-NEXT: addi s0, sp, 64
2584 ; LP64E-WITHFP-NEXT: li a0, 17
2585 ; LP64E-WITHFP-NEXT: sd a0, 40(sp)
2586 ; LP64E-WITHFP-NEXT: li a0, 16
2587 ; LP64E-WITHFP-NEXT: lui a1, %hi(.LCPI11_0)
2588 ; LP64E-WITHFP-NEXT: ld a1, %lo(.LCPI11_0)(a1)
2589 ; LP64E-WITHFP-NEXT: sd a0, 32(sp)
2590 ; LP64E-WITHFP-NEXT: li a0, 15
2591 ; LP64E-WITHFP-NEXT: sd a0, 24(sp)
2592 ; LP64E-WITHFP-NEXT: sd a1, 16(sp)
2593 ; LP64E-WITHFP-NEXT: li a0, 14
2594 ; LP64E-WITHFP-NEXT: sd a0, 8(sp)
2595 ; LP64E-WITHFP-NEXT: lui a0, 2384
2596 ; LP64E-WITHFP-NEXT: addiw a0, a0, 761
2597 ; LP64E-WITHFP-NEXT: slli a6, a0, 11
2598 ; LP64E-WITHFP-NEXT: lui a0, %hi(.LCPI11_1)
2599 ; LP64E-WITHFP-NEXT: ld a2, %lo(.LCPI11_1)(a0)
2600 ; LP64E-WITHFP-NEXT: lui a0, %hi(.LCPI11_2)
2601 ; LP64E-WITHFP-NEXT: ld a3, %lo(.LCPI11_2)(a0)
2602 ; LP64E-WITHFP-NEXT: li a0, 1
2603 ; LP64E-WITHFP-NEXT: li a1, 11
2604 ; LP64E-WITHFP-NEXT: li a4, 12
2605 ; LP64E-WITHFP-NEXT: li a5, 13
2606 ; LP64E-WITHFP-NEXT: sd a6, 0(sp)
2607 ; LP64E-WITHFP-NEXT: call va5_aligned_stack_callee
2608 ; LP64E-WITHFP-NEXT: ld ra, 56(sp) # 8-byte Folded Reload
2609 ; LP64E-WITHFP-NEXT: ld s0, 48(sp) # 8-byte Folded Reload
2610 ; LP64E-WITHFP-NEXT: addi sp, sp, 64
2611 ; LP64E-WITHFP-NEXT: ret
2612 %1 = call i32 (i32, ...) @va5_aligned_stack_callee(i32 1, i32 11,
2613 fp128 0xLEB851EB851EB851F400091EB851EB851, i32 12, i32 13, i64 20000000000,
2614 i32 14, double 2.720000e+00, i32 15, [2 x i32] [i32 16, i32 17])
2618 ; A function with no fixed arguments is not valid C, but can be
2619 ; specified in LLVM IR. We must ensure the vararg save area is
2620 ; still set up correctly.
2622 define i32 @va6_no_fixed_args(...) nounwind {
2623 ; ILP32-ILP32F-FPELIM-LABEL: va6_no_fixed_args:
2624 ; ILP32-ILP32F-FPELIM: # %bb.0:
2625 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, -48
2626 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 44(sp)
2627 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 40(sp)
2628 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 36(sp)
2629 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 32(sp)
2630 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 28(sp)
2631 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 24(sp)
2632 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 20(sp)
2633 ; ILP32-ILP32F-FPELIM-NEXT: sw a0, 16(sp)
2634 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, sp, 20
2635 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 12(sp)
2636 ; ILP32-ILP32F-FPELIM-NEXT: addi sp, sp, 48
2637 ; ILP32-ILP32F-FPELIM-NEXT: ret
2639 ; ILP32-ILP32F-WITHFP-LABEL: va6_no_fixed_args:
2640 ; ILP32-ILP32F-WITHFP: # %bb.0:
2641 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -48
2642 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 12(sp) # 4-byte Folded Spill
2643 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 8(sp) # 4-byte Folded Spill
2644 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 16
2645 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
2646 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
2647 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
2648 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
2649 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
2650 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
2651 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
2652 ; ILP32-ILP32F-WITHFP-NEXT: sw a0, 0(s0)
2653 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 4
2654 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -12(s0)
2655 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 12(sp) # 4-byte Folded Reload
2656 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 8(sp) # 4-byte Folded Reload
2657 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 48
2658 ; ILP32-ILP32F-WITHFP-NEXT: ret
2660 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va6_no_fixed_args:
2661 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
2662 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, -48
2663 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 44(sp)
2664 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 40(sp)
2665 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 36(sp)
2666 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 32(sp)
2667 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 28(sp)
2668 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 24(sp)
2669 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 20(sp)
2670 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a0, 16(sp)
2671 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, sp, 20
2672 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
2673 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi sp, sp, 48
2674 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
2676 ; ILP32E-FPELIM-LABEL: va6_no_fixed_args:
2677 ; ILP32E-FPELIM: # %bb.0:
2678 ; ILP32E-FPELIM-NEXT: addi sp, sp, -28
2679 ; ILP32E-FPELIM-NEXT: sw a5, 24(sp)
2680 ; ILP32E-FPELIM-NEXT: sw a4, 20(sp)
2681 ; ILP32E-FPELIM-NEXT: sw a3, 16(sp)
2682 ; ILP32E-FPELIM-NEXT: sw a2, 12(sp)
2683 ; ILP32E-FPELIM-NEXT: sw a1, 8(sp)
2684 ; ILP32E-FPELIM-NEXT: sw a0, 4(sp)
2685 ; ILP32E-FPELIM-NEXT: addi a1, sp, 8
2686 ; ILP32E-FPELIM-NEXT: sw a1, 0(sp)
2687 ; ILP32E-FPELIM-NEXT: addi sp, sp, 28
2688 ; ILP32E-FPELIM-NEXT: ret
2690 ; ILP32E-WITHFP-LABEL: va6_no_fixed_args:
2691 ; ILP32E-WITHFP: # %bb.0:
2692 ; ILP32E-WITHFP-NEXT: addi sp, sp, -36
2693 ; ILP32E-WITHFP-NEXT: sw ra, 8(sp) # 4-byte Folded Spill
2694 ; ILP32E-WITHFP-NEXT: sw s0, 4(sp) # 4-byte Folded Spill
2695 ; ILP32E-WITHFP-NEXT: addi s0, sp, 12
2696 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
2697 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
2698 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
2699 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
2700 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
2701 ; ILP32E-WITHFP-NEXT: sw a0, 0(s0)
2702 ; ILP32E-WITHFP-NEXT: addi a1, s0, 4
2703 ; ILP32E-WITHFP-NEXT: sw a1, -12(s0)
2704 ; ILP32E-WITHFP-NEXT: lw ra, 8(sp) # 4-byte Folded Reload
2705 ; ILP32E-WITHFP-NEXT: lw s0, 4(sp) # 4-byte Folded Reload
2706 ; ILP32E-WITHFP-NEXT: addi sp, sp, 36
2707 ; ILP32E-WITHFP-NEXT: ret
2709 ; LP64-LP64F-LP64D-FPELIM-LABEL: va6_no_fixed_args:
2710 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
2711 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, -80
2712 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 72(sp)
2713 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 64(sp)
2714 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 56(sp)
2715 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 48(sp)
2716 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 40(sp)
2717 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 32(sp)
2718 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 24(sp)
2719 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 16(sp)
2720 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi a1, sp, 24
2721 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 8(sp)
2722 ; LP64-LP64F-LP64D-FPELIM-NEXT: addi sp, sp, 80
2723 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
2725 ; LP64-LP64F-LP64D-WITHFP-LABEL: va6_no_fixed_args:
2726 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
2727 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -96
2728 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 24(sp) # 8-byte Folded Spill
2729 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 16(sp) # 8-byte Folded Spill
2730 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 32
2731 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
2732 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
2733 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
2734 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
2735 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
2736 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
2737 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
2738 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, 0(s0)
2739 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a1, s0, 8
2740 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, -24(s0)
2741 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 24(sp) # 8-byte Folded Reload
2742 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 16(sp) # 8-byte Folded Reload
2743 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 96
2744 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
2746 ; LP64E-FPELIM-LABEL: va6_no_fixed_args:
2747 ; LP64E-FPELIM: # %bb.0:
2748 ; LP64E-FPELIM-NEXT: addi sp, sp, -56
2749 ; LP64E-FPELIM-NEXT: sd a5, 48(sp)
2750 ; LP64E-FPELIM-NEXT: sd a4, 40(sp)
2751 ; LP64E-FPELIM-NEXT: sd a3, 32(sp)
2752 ; LP64E-FPELIM-NEXT: sd a2, 24(sp)
2753 ; LP64E-FPELIM-NEXT: sd a1, 16(sp)
2754 ; LP64E-FPELIM-NEXT: sd a0, 8(sp)
2755 ; LP64E-FPELIM-NEXT: addi a1, sp, 16
2756 ; LP64E-FPELIM-NEXT: sd a1, 0(sp)
2757 ; LP64E-FPELIM-NEXT: addi sp, sp, 56
2758 ; LP64E-FPELIM-NEXT: ret
2760 ; LP64E-WITHFP-LABEL: va6_no_fixed_args:
2761 ; LP64E-WITHFP: # %bb.0:
2762 ; LP64E-WITHFP-NEXT: addi sp, sp, -72
2763 ; LP64E-WITHFP-NEXT: sd ra, 16(sp) # 8-byte Folded Spill
2764 ; LP64E-WITHFP-NEXT: sd s0, 8(sp) # 8-byte Folded Spill
2765 ; LP64E-WITHFP-NEXT: addi s0, sp, 24
2766 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
2767 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
2768 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
2769 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
2770 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
2771 ; LP64E-WITHFP-NEXT: sd a0, 0(s0)
2772 ; LP64E-WITHFP-NEXT: addi a1, s0, 8
2773 ; LP64E-WITHFP-NEXT: sd a1, -24(s0)
2774 ; LP64E-WITHFP-NEXT: ld ra, 16(sp) # 8-byte Folded Reload
2775 ; LP64E-WITHFP-NEXT: ld s0, 8(sp) # 8-byte Folded Reload
2776 ; LP64E-WITHFP-NEXT: addi sp, sp, 72
2777 ; LP64E-WITHFP-NEXT: ret
2779 call void @llvm.va_start(ptr %va)
2780 %1 = va_arg ptr %va, i32
2781 call void @llvm.va_end(ptr %va)
2785 ; TODO: improve constant materialization of stack addresses
2787 define i32 @va_large_stack(ptr %fmt, ...) {
2788 ; ILP32-ILP32F-FPELIM-LABEL: va_large_stack:
2789 ; ILP32-ILP32F-FPELIM: # %bb.0:
2790 ; ILP32-ILP32F-FPELIM-NEXT: lui a0, 24414
2791 ; ILP32-ILP32F-FPELIM-NEXT: addi a0, a0, 304
2792 ; ILP32-ILP32F-FPELIM-NEXT: sub sp, sp, a0
2793 ; ILP32-ILP32F-FPELIM-NEXT: .cfi_def_cfa_offset 100000048
2794 ; ILP32-ILP32F-FPELIM-NEXT: mv a0, a1
2795 ; ILP32-ILP32F-FPELIM-NEXT: lui t0, 24414
2796 ; ILP32-ILP32F-FPELIM-NEXT: add t0, sp, t0
2797 ; ILP32-ILP32F-FPELIM-NEXT: sw a7, 300(t0)
2798 ; ILP32-ILP32F-FPELIM-NEXT: lui a7, 24414
2799 ; ILP32-ILP32F-FPELIM-NEXT: add a7, sp, a7
2800 ; ILP32-ILP32F-FPELIM-NEXT: sw a6, 296(a7)
2801 ; ILP32-ILP32F-FPELIM-NEXT: lui a6, 24414
2802 ; ILP32-ILP32F-FPELIM-NEXT: add a6, sp, a6
2803 ; ILP32-ILP32F-FPELIM-NEXT: sw a5, 292(a6)
2804 ; ILP32-ILP32F-FPELIM-NEXT: lui a5, 24414
2805 ; ILP32-ILP32F-FPELIM-NEXT: add a5, sp, a5
2806 ; ILP32-ILP32F-FPELIM-NEXT: sw a4, 288(a5)
2807 ; ILP32-ILP32F-FPELIM-NEXT: lui a4, 24414
2808 ; ILP32-ILP32F-FPELIM-NEXT: add a4, sp, a4
2809 ; ILP32-ILP32F-FPELIM-NEXT: sw a3, 284(a4)
2810 ; ILP32-ILP32F-FPELIM-NEXT: lui a3, 24414
2811 ; ILP32-ILP32F-FPELIM-NEXT: add a3, sp, a3
2812 ; ILP32-ILP32F-FPELIM-NEXT: sw a2, 280(a3)
2813 ; ILP32-ILP32F-FPELIM-NEXT: lui a2, 24414
2814 ; ILP32-ILP32F-FPELIM-NEXT: add a2, sp, a2
2815 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 276(a2)
2816 ; ILP32-ILP32F-FPELIM-NEXT: lui a1, 24414
2817 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, a1, 280
2818 ; ILP32-ILP32F-FPELIM-NEXT: add a1, sp, a1
2819 ; ILP32-ILP32F-FPELIM-NEXT: sw a1, 12(sp)
2820 ; ILP32-ILP32F-FPELIM-NEXT: lui a1, 24414
2821 ; ILP32-ILP32F-FPELIM-NEXT: addi a1, a1, 304
2822 ; ILP32-ILP32F-FPELIM-NEXT: add sp, sp, a1
2823 ; ILP32-ILP32F-FPELIM-NEXT: ret
2825 ; ILP32-ILP32F-WITHFP-LABEL: va_large_stack:
2826 ; ILP32-ILP32F-WITHFP: # %bb.0:
2827 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, -2032
2828 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa_offset 2032
2829 ; ILP32-ILP32F-WITHFP-NEXT: sw ra, 1996(sp) # 4-byte Folded Spill
2830 ; ILP32-ILP32F-WITHFP-NEXT: sw s0, 1992(sp) # 4-byte Folded Spill
2831 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_offset ra, -36
2832 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_offset s0, -40
2833 ; ILP32-ILP32F-WITHFP-NEXT: addi s0, sp, 2000
2834 ; ILP32-ILP32F-WITHFP-NEXT: .cfi_def_cfa s0, 32
2835 ; ILP32-ILP32F-WITHFP-NEXT: lui a0, 24414
2836 ; ILP32-ILP32F-WITHFP-NEXT: addi a0, a0, -1728
2837 ; ILP32-ILP32F-WITHFP-NEXT: sub sp, sp, a0
2838 ; ILP32-ILP32F-WITHFP-NEXT: mv a0, a1
2839 ; ILP32-ILP32F-WITHFP-NEXT: sw a7, 28(s0)
2840 ; ILP32-ILP32F-WITHFP-NEXT: sw a6, 24(s0)
2841 ; ILP32-ILP32F-WITHFP-NEXT: sw a5, 20(s0)
2842 ; ILP32-ILP32F-WITHFP-NEXT: sw a4, 16(s0)
2843 ; ILP32-ILP32F-WITHFP-NEXT: sw a3, 12(s0)
2844 ; ILP32-ILP32F-WITHFP-NEXT: sw a2, 8(s0)
2845 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, 4(s0)
2846 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, s0, 8
2847 ; ILP32-ILP32F-WITHFP-NEXT: lui a2, 24414
2848 ; ILP32-ILP32F-WITHFP-NEXT: sub a2, s0, a2
2849 ; ILP32-ILP32F-WITHFP-NEXT: sw a1, -272(a2)
2850 ; ILP32-ILP32F-WITHFP-NEXT: lui a1, 24414
2851 ; ILP32-ILP32F-WITHFP-NEXT: addi a1, a1, -1728
2852 ; ILP32-ILP32F-WITHFP-NEXT: add sp, sp, a1
2853 ; ILP32-ILP32F-WITHFP-NEXT: lw ra, 1996(sp) # 4-byte Folded Reload
2854 ; ILP32-ILP32F-WITHFP-NEXT: lw s0, 1992(sp) # 4-byte Folded Reload
2855 ; ILP32-ILP32F-WITHFP-NEXT: addi sp, sp, 2032
2856 ; ILP32-ILP32F-WITHFP-NEXT: ret
2858 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-LABEL: va_large_stack:
2859 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM: # %bb.0:
2860 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a0, 24414
2861 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a0, a0, 304
2862 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sub sp, sp, a0
2863 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: .cfi_def_cfa_offset 100000048
2864 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: mv a0, a1
2865 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui t0, 24414
2866 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add t0, sp, t0
2867 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a7, 300(t0)
2868 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a7, 24414
2869 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a7, sp, a7
2870 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a6, 296(a7)
2871 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a6, 24414
2872 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a6, sp, a6
2873 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a5, 292(a6)
2874 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a5, 24414
2875 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a5, sp, a5
2876 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a4, 288(a5)
2877 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a4, 24414
2878 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a4, sp, a4
2879 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a3, 284(a4)
2880 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a3, 24414
2881 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a3, sp, a3
2882 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a2, 280(a3)
2883 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a2, 24414
2884 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a2, sp, a2
2885 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 276(a2)
2886 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a1, 24414
2887 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, a1, 280
2888 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add a1, sp, a1
2889 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: sw a1, 12(sp)
2890 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: lui a1, 24414
2891 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: addi a1, a1, 304
2892 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: add sp, sp, a1
2893 ; RV32D-ILP32-ILP32F-ILP32D-FPELIM-NEXT: ret
2895 ; ILP32E-FPELIM-LABEL: va_large_stack:
2896 ; ILP32E-FPELIM: # %bb.0:
2897 ; ILP32E-FPELIM-NEXT: lui a0, 24414
2898 ; ILP32E-FPELIM-NEXT: addi a0, a0, 288
2899 ; ILP32E-FPELIM-NEXT: sub sp, sp, a0
2900 ; ILP32E-FPELIM-NEXT: .cfi_def_cfa_offset 100000032
2901 ; ILP32E-FPELIM-NEXT: mv a0, a1
2902 ; ILP32E-FPELIM-NEXT: lui a6, 24414
2903 ; ILP32E-FPELIM-NEXT: add a6, sp, a6
2904 ; ILP32E-FPELIM-NEXT: sw a5, 284(a6)
2905 ; ILP32E-FPELIM-NEXT: lui a5, 24414
2906 ; ILP32E-FPELIM-NEXT: add a5, sp, a5
2907 ; ILP32E-FPELIM-NEXT: sw a4, 280(a5)
2908 ; ILP32E-FPELIM-NEXT: lui a4, 24414
2909 ; ILP32E-FPELIM-NEXT: add a4, sp, a4
2910 ; ILP32E-FPELIM-NEXT: sw a3, 276(a4)
2911 ; ILP32E-FPELIM-NEXT: lui a3, 24414
2912 ; ILP32E-FPELIM-NEXT: add a3, sp, a3
2913 ; ILP32E-FPELIM-NEXT: sw a2, 272(a3)
2914 ; ILP32E-FPELIM-NEXT: lui a2, 24414
2915 ; ILP32E-FPELIM-NEXT: add a2, sp, a2
2916 ; ILP32E-FPELIM-NEXT: sw a1, 268(a2)
2917 ; ILP32E-FPELIM-NEXT: lui a1, 24414
2918 ; ILP32E-FPELIM-NEXT: addi a1, a1, 272
2919 ; ILP32E-FPELIM-NEXT: add a1, sp, a1
2920 ; ILP32E-FPELIM-NEXT: sw a1, 4(sp)
2921 ; ILP32E-FPELIM-NEXT: lui a1, 24414
2922 ; ILP32E-FPELIM-NEXT: addi a1, a1, 288
2923 ; ILP32E-FPELIM-NEXT: add sp, sp, a1
2924 ; ILP32E-FPELIM-NEXT: ret
2926 ; ILP32E-WITHFP-LABEL: va_large_stack:
2927 ; ILP32E-WITHFP: # %bb.0:
2928 ; ILP32E-WITHFP-NEXT: addi sp, sp, -2044
2929 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa_offset 2044
2930 ; ILP32E-WITHFP-NEXT: sw ra, 2016(sp) # 4-byte Folded Spill
2931 ; ILP32E-WITHFP-NEXT: sw s0, 2012(sp) # 4-byte Folded Spill
2932 ; ILP32E-WITHFP-NEXT: .cfi_offset ra, -28
2933 ; ILP32E-WITHFP-NEXT: .cfi_offset s0, -32
2934 ; ILP32E-WITHFP-NEXT: addi s0, sp, 2020
2935 ; ILP32E-WITHFP-NEXT: .cfi_def_cfa s0, 24
2936 ; ILP32E-WITHFP-NEXT: lui a0, 24414
2937 ; ILP32E-WITHFP-NEXT: addi a0, a0, -1748
2938 ; ILP32E-WITHFP-NEXT: sub sp, sp, a0
2939 ; ILP32E-WITHFP-NEXT: mv a0, a1
2940 ; ILP32E-WITHFP-NEXT: sw a5, 20(s0)
2941 ; ILP32E-WITHFP-NEXT: sw a4, 16(s0)
2942 ; ILP32E-WITHFP-NEXT: sw a3, 12(s0)
2943 ; ILP32E-WITHFP-NEXT: sw a2, 8(s0)
2944 ; ILP32E-WITHFP-NEXT: sw a1, 4(s0)
2945 ; ILP32E-WITHFP-NEXT: addi a1, s0, 8
2946 ; ILP32E-WITHFP-NEXT: lui a2, 24414
2947 ; ILP32E-WITHFP-NEXT: sub a2, s0, a2
2948 ; ILP32E-WITHFP-NEXT: sw a1, -272(a2)
2949 ; ILP32E-WITHFP-NEXT: lui a1, 24414
2950 ; ILP32E-WITHFP-NEXT: addi a1, a1, -1748
2951 ; ILP32E-WITHFP-NEXT: add sp, sp, a1
2952 ; ILP32E-WITHFP-NEXT: lw ra, 2016(sp) # 4-byte Folded Reload
2953 ; ILP32E-WITHFP-NEXT: lw s0, 2012(sp) # 4-byte Folded Reload
2954 ; ILP32E-WITHFP-NEXT: addi sp, sp, 2044
2955 ; ILP32E-WITHFP-NEXT: ret
2957 ; LP64-LP64F-LP64D-FPELIM-LABEL: va_large_stack:
2958 ; LP64-LP64F-LP64D-FPELIM: # %bb.0:
2959 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
2960 ; LP64-LP64F-LP64D-FPELIM-NEXT: addiw a0, a0, 336
2961 ; LP64-LP64F-LP64D-FPELIM-NEXT: sub sp, sp, a0
2962 ; LP64-LP64F-LP64D-FPELIM-NEXT: .cfi_def_cfa_offset 100000080
2963 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
2964 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, sp, a0
2965 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a1, 280(a0)
2966 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
2967 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, sp, a0
2968 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a7, 328(a0)
2969 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
2970 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, sp, a0
2971 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a6, 320(a0)
2972 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
2973 ; LP64-LP64F-LP64D-FPELIM-NEXT: addiw a0, a0, 284
2974 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, sp, a0
2975 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a0, 8(sp)
2976 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a0, 24414
2977 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a0, sp, a0
2978 ; LP64-LP64F-LP64D-FPELIM-NEXT: lw a0, 280(a0)
2979 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
2980 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
2981 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a5, 312(a1)
2982 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
2983 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
2984 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a4, 304(a1)
2985 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
2986 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
2987 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a3, 296(a1)
2988 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
2989 ; LP64-LP64F-LP64D-FPELIM-NEXT: add a1, sp, a1
2990 ; LP64-LP64F-LP64D-FPELIM-NEXT: sd a2, 288(a1)
2991 ; LP64-LP64F-LP64D-FPELIM-NEXT: lui a1, 24414
2992 ; LP64-LP64F-LP64D-FPELIM-NEXT: addiw a1, a1, 336
2993 ; LP64-LP64F-LP64D-FPELIM-NEXT: add sp, sp, a1
2994 ; LP64-LP64F-LP64D-FPELIM-NEXT: ret
2996 ; LP64-LP64F-LP64D-WITHFP-LABEL: va_large_stack:
2997 ; LP64-LP64F-LP64D-WITHFP: # %bb.0:
2998 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, -2032
2999 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa_offset 2032
3000 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd ra, 1960(sp) # 8-byte Folded Spill
3001 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd s0, 1952(sp) # 8-byte Folded Spill
3002 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_offset ra, -72
3003 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_offset s0, -80
3004 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi s0, sp, 1968
3005 ; LP64-LP64F-LP64D-WITHFP-NEXT: .cfi_def_cfa s0, 64
3006 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a0, 24414
3007 ; LP64-LP64F-LP64D-WITHFP-NEXT: addiw a0, a0, -1680
3008 ; LP64-LP64F-LP64D-WITHFP-NEXT: sub sp, sp, a0
3009 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a1, 8(s0)
3010 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a7, 56(s0)
3011 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a6, 48(s0)
3012 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi a0, s0, 12
3013 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a1, 24414
3014 ; LP64-LP64F-LP64D-WITHFP-NEXT: sub a1, s0, a1
3015 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a0, -288(a1)
3016 ; LP64-LP64F-LP64D-WITHFP-NEXT: lw a0, 8(s0)
3017 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a5, 40(s0)
3018 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a4, 32(s0)
3019 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a3, 24(s0)
3020 ; LP64-LP64F-LP64D-WITHFP-NEXT: sd a2, 16(s0)
3021 ; LP64-LP64F-LP64D-WITHFP-NEXT: lui a1, 24414
3022 ; LP64-LP64F-LP64D-WITHFP-NEXT: addiw a1, a1, -1680
3023 ; LP64-LP64F-LP64D-WITHFP-NEXT: add sp, sp, a1
3024 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld ra, 1960(sp) # 8-byte Folded Reload
3025 ; LP64-LP64F-LP64D-WITHFP-NEXT: ld s0, 1952(sp) # 8-byte Folded Reload
3026 ; LP64-LP64F-LP64D-WITHFP-NEXT: addi sp, sp, 2032
3027 ; LP64-LP64F-LP64D-WITHFP-NEXT: ret
3029 ; LP64E-FPELIM-LABEL: va_large_stack:
3030 ; LP64E-FPELIM: # %bb.0:
3031 ; LP64E-FPELIM-NEXT: lui a0, 24414
3032 ; LP64E-FPELIM-NEXT: addiw a0, a0, 320
3033 ; LP64E-FPELIM-NEXT: sub sp, sp, a0
3034 ; LP64E-FPELIM-NEXT: .cfi_def_cfa_offset 100000064
3035 ; LP64E-FPELIM-NEXT: lui a0, 24414
3036 ; LP64E-FPELIM-NEXT: add a0, sp, a0
3037 ; LP64E-FPELIM-NEXT: sd a1, 280(a0)
3038 ; LP64E-FPELIM-NEXT: lui a0, 24414
3039 ; LP64E-FPELIM-NEXT: addiw a0, a0, 284
3040 ; LP64E-FPELIM-NEXT: add a0, sp, a0
3041 ; LP64E-FPELIM-NEXT: sd a0, 8(sp)
3042 ; LP64E-FPELIM-NEXT: lui a0, 24414
3043 ; LP64E-FPELIM-NEXT: add a0, sp, a0
3044 ; LP64E-FPELIM-NEXT: lw a0, 280(a0)
3045 ; LP64E-FPELIM-NEXT: lui a1, 24414
3046 ; LP64E-FPELIM-NEXT: add a1, sp, a1
3047 ; LP64E-FPELIM-NEXT: sd a5, 312(a1)
3048 ; LP64E-FPELIM-NEXT: lui a1, 24414
3049 ; LP64E-FPELIM-NEXT: add a1, sp, a1
3050 ; LP64E-FPELIM-NEXT: sd a4, 304(a1)
3051 ; LP64E-FPELIM-NEXT: lui a1, 24414
3052 ; LP64E-FPELIM-NEXT: add a1, sp, a1
3053 ; LP64E-FPELIM-NEXT: sd a3, 296(a1)
3054 ; LP64E-FPELIM-NEXT: lui a1, 24414
3055 ; LP64E-FPELIM-NEXT: add a1, sp, a1
3056 ; LP64E-FPELIM-NEXT: sd a2, 288(a1)
3057 ; LP64E-FPELIM-NEXT: lui a1, 24414
3058 ; LP64E-FPELIM-NEXT: addiw a1, a1, 320
3059 ; LP64E-FPELIM-NEXT: add sp, sp, a1
3060 ; LP64E-FPELIM-NEXT: ret
3062 ; LP64E-WITHFP-LABEL: va_large_stack:
3063 ; LP64E-WITHFP: # %bb.0:
3064 ; LP64E-WITHFP-NEXT: addi sp, sp, -2040
3065 ; LP64E-WITHFP-NEXT: .cfi_def_cfa_offset 2040
3066 ; LP64E-WITHFP-NEXT: sd ra, 1984(sp) # 8-byte Folded Spill
3067 ; LP64E-WITHFP-NEXT: sd s0, 1976(sp) # 8-byte Folded Spill
3068 ; LP64E-WITHFP-NEXT: .cfi_offset ra, -56
3069 ; LP64E-WITHFP-NEXT: .cfi_offset s0, -64
3070 ; LP64E-WITHFP-NEXT: addi s0, sp, 1992
3071 ; LP64E-WITHFP-NEXT: .cfi_def_cfa s0, 48
3072 ; LP64E-WITHFP-NEXT: lui a0, 24414
3073 ; LP64E-WITHFP-NEXT: addiw a0, a0, -1704
3074 ; LP64E-WITHFP-NEXT: sub sp, sp, a0
3075 ; LP64E-WITHFP-NEXT: sd a1, 8(s0)
3076 ; LP64E-WITHFP-NEXT: addi a0, s0, 12
3077 ; LP64E-WITHFP-NEXT: lui a1, 24414
3078 ; LP64E-WITHFP-NEXT: sub a1, s0, a1
3079 ; LP64E-WITHFP-NEXT: sd a0, -288(a1)
3080 ; LP64E-WITHFP-NEXT: lw a0, 8(s0)
3081 ; LP64E-WITHFP-NEXT: sd a5, 40(s0)
3082 ; LP64E-WITHFP-NEXT: sd a4, 32(s0)
3083 ; LP64E-WITHFP-NEXT: sd a3, 24(s0)
3084 ; LP64E-WITHFP-NEXT: sd a2, 16(s0)
3085 ; LP64E-WITHFP-NEXT: lui a1, 24414
3086 ; LP64E-WITHFP-NEXT: addiw a1, a1, -1704
3087 ; LP64E-WITHFP-NEXT: add sp, sp, a1
3088 ; LP64E-WITHFP-NEXT: ld ra, 1984(sp) # 8-byte Folded Reload
3089 ; LP64E-WITHFP-NEXT: ld s0, 1976(sp) # 8-byte Folded Reload
3090 ; LP64E-WITHFP-NEXT: addi sp, sp, 2040
3091 ; LP64E-WITHFP-NEXT: ret
3092 %large = alloca [ 100000000 x i8 ]
3094 call void @llvm.va_start(ptr %va)
3095 %argp.cur = load ptr, ptr %va, align 4
3096 %argp.next = getelementptr inbounds i8, ptr %argp.cur, i32 4
3097 store ptr %argp.next, ptr %va, align 4
3098 %1 = load i32, ptr %argp.cur, align 4
3099 call void @llvm.va_end(ptr %va)