-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathcallconv.s.arm64-darwin
349 lines (348 loc) · 8.32 KB
/
callconv.s.arm64-darwin
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
.section __TEXT,__text,regular,pure_instructions
.build_version ios, 12, 1
.globl _int_args ; -- Begin function int_args
.p2align 2
_int_args: ; @int_args
.cfi_startproc
; %bb.0:
sub sp, sp, #48 ; =48
.cfi_def_cfa_offset 48
ldr w8, [sp, #60]
ldr w9, [sp, #56]
ldr w10, [sp, #52]
ldr w11, [sp, #48]
str w0, [sp, #44]
str w1, [sp, #40]
str w2, [sp, #36]
str w3, [sp, #32]
str w4, [sp, #28]
str w5, [sp, #24]
str w6, [sp, #20]
str w7, [sp, #16]
ldr w0, [sp, #44]
str w11, [sp, #12] ; 4-byte Folded Spill
str w10, [sp, #8] ; 4-byte Folded Spill
str w8, [sp, #4] ; 4-byte Folded Spill
str w9, [sp] ; 4-byte Folded Spill
add sp, sp, #48 ; =48
ret
.cfi_endproc
; -- End function
.globl _float_args ; -- Begin function float_args
.p2align 2
_float_args: ; @float_args
.cfi_startproc
; %bb.0:
sub sp, sp, #64 ; =64
.cfi_def_cfa_offset 64
ldr d16, [sp, #72]
ldr d17, [sp, #64]
str w0, [sp, #60]
str w1, [sp, #56]
str s0, [sp, #52]
str s1, [sp, #48]
str s2, [sp, #44]
str s3, [sp, #40]
str s4, [sp, #36]
str s5, [sp, #32]
str d6, [sp, #24]
str d7, [sp, #16]
ldr s0, [sp, #52]
ldr s1, [sp, #48]
fmul s0, s0, s1
str d17, [sp, #8] ; 8-byte Folded Spill
str d16, [sp] ; 8-byte Folded Spill
add sp, sp, #64 ; =64
ret
.cfi_endproc
; -- End function
.globl _var_args_int ; -- Begin function var_args_int
.p2align 2
_var_args_int: ; @var_args_int
.cfi_startproc
; %bb.0:
sub sp, sp, #48 ; =48
.cfi_def_cfa_offset 48
str w0, [sp, #44]
str w1, [sp, #40]
add x8, sp, #48 ; =48
str x8, [sp, #32]
ldr x8, [sp, #32]
add x9, x8, #8 ; =8
str x9, [sp, #32]
ldr w0, [x8]
str w0, [sp, #24]
ldr w0, [sp, #24]
str w0, [sp, #28]
ldr x8, [sp, #32]
add x9, x8, #8 ; =8
str x9, [sp, #32]
ldr w0, [x8]
str w0, [sp, #16]
ldr w0, [sp, #16]
str w0, [sp, #20]
ldr x8, [sp, #32]
add x9, x8, #8 ; =8
str x9, [sp, #32]
ldr w0, [x8]
str w0, [sp, #8]
ldr w0, [sp, #8]
str w0, [sp, #12]
ldr x8, [sp, #32]
add x9, x8, #8 ; =8
str x9, [sp, #32]
ldr w0, [x8]
str w0, [sp]
ldr w0, [sp]
str w0, [sp, #4]
ldr w0, [sp, #28]
ldr w1, [sp, #20]
add w0, w0, w1
ldr w1, [sp, #12]
ldr w10, [sp, #4]
mul w10, w1, w10
add w0, w0, w10
add sp, sp, #48 ; =48
ret
.cfi_endproc
; -- End function
.globl _var_args ; -- Begin function var_args
.p2align 2
_var_args: ; @var_args
.cfi_startproc
; %bb.0:
sub sp, sp, #64 ; =64
.cfi_def_cfa_offset 64
str s0, [sp, #60]
str w0, [sp, #56]
str w1, [sp, #52]
add x8, sp, #64 ; =64
str x8, [sp, #40]
ldr x8, [sp, #40]
add x9, x8, #8 ; =8
str x9, [sp, #40]
ldr w0, [x8]
str w0, [sp, #32]
ldr w0, [sp, #32]
str w0, [sp, #36]
ldr x8, [sp, #40]
add x9, x8, #8 ; =8
str x9, [sp, #40]
ldr w0, [x8]
str w0, [sp, #24]
ldr w0, [sp, #24]
str w0, [sp, #28]
ldr x8, [sp, #40]
add x9, x8, #8 ; =8
str x9, [sp, #40]
ldr w0, [x8]
str w0, [sp, #16]
ldr w0, [sp, #16]
str w0, [sp, #20]
ldr x8, [sp, #40]
add x9, x8, #8 ; =8
str x9, [sp, #40]
ldr w0, [x8]
str w0, [sp, #8]
ldr w0, [sp, #8]
str w0, [sp, #12]
ldr w0, [sp, #36]
ldr w1, [sp, #28]
add w0, w0, w1
ldr w1, [sp, #20]
ldr w10, [sp, #12]
mul w10, w1, w10
add w0, w0, w10
add sp, sp, #64 ; =64
ret
.cfi_endproc
; -- End function
.globl _test_int_args ; -- Begin function test_int_args
.p2align 2
_test_int_args: ; @test_int_args
.cfi_startproc
; %bb.0:
sub sp, sp, #48 ; =48
stp x29, x30, [sp, #32] ; 8-byte Folded Spill
add x29, sp, #32 ; =32
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
mov w0, #97
mov w1, #98
mov w2, #99
mov w3, #100
mov w4, #101
mov w5, #102
mov w6, #103
mov w7, #104
mov w8, #105
mov w9, #106
mov w10, #107
mov w11, #108
str w8, [sp]
str w9, [sp, #4]
str w10, [sp, #8]
str w11, [sp, #12]
bl _int_args
stur w0, [x29, #-4] ; 4-byte Folded Spill
ldp x29, x30, [sp, #32] ; 8-byte Folded Reload
add sp, sp, #48 ; =48
ret
.cfi_endproc
; -- End function
.globl _test_float_args ; -- Begin function test_float_args
.p2align 2
_test_float_args: ; @test_float_args
.cfi_startproc
; %bb.0:
sub sp, sp, #48 ; =48
stp x29, x30, [sp, #32] ; 8-byte Folded Spill
add x29, sp, #32 ; =32
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
mov w0, #97
mov w1, #98
fmov s0, #3.00000000
fmov s1, #4.00000000
fmov s2, #5.00000000
fmov s3, #6.00000000
fmov s4, #7.00000000
fmov s5, #8.00000000
fmov d6, #9.00000000
fmov d7, #10.00000000
fmov d16, #11.00000000
fmov d17, #12.00000000
str d16, [sp]
str d17, [sp, #8]
bl _float_args
stur s0, [x29, #-4] ; 4-byte Folded Spill
ldp x29, x30, [sp, #32] ; 8-byte Folded Reload
add sp, sp, #48 ; =48
ret
.cfi_endproc
; -- End function
.section __TEXT,__literal4,4byte_literals
.p2align 2 ; -- Begin function test_var_args_int
lCPI6_0:
.long 1120010240 ; float 97
.section __TEXT,__text,regular,pure_instructions
.globl _test_var_args_int
.p2align 2
_test_var_args_int: ; @test_var_args_int
.cfi_startproc
; %bb.0:
sub sp, sp, #96 ; =96
stp x29, x30, [sp, #80] ; 8-byte Folded Spill
add x29, sp, #80 ; =80
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
mov x8, sp
mov w9, #108
mov x10, x9
str x10, [x8, #64]
mov w9, #107
mov x10, x9
str x10, [x8, #56]
mov w9, #106
mov x10, x9
str x10, [x8, #48]
mov w9, #105
mov x10, x9
str x10, [x8, #40]
mov w9, #104
mov x10, x9
str x10, [x8, #32]
mov w9, #103
mov x10, x9
str x10, [x8, #24]
mov w9, #102
mov x10, x9
str x10, [x8, #16]
mov w9, #101
mov x10, x9
str x10, [x8, #8]
mov w9, #100
mov x10, x9
str x10, [x8]
adrp x8, lCPI6_0@PAGE
ldr s0, [x8, lCPI6_0@PAGEOFF]
mov w0, #98
mov w1, #99
bl _var_args
stur w0, [x29, #-4] ; 4-byte Folded Spill
ldp x29, x30, [sp, #80] ; 8-byte Folded Reload
add sp, sp, #96 ; =96
ret
.cfi_endproc
; -- End function
.globl _test_var_args_float ; -- Begin function test_var_args_float
.p2align 2
_test_var_args_float: ; @test_var_args_float
.cfi_startproc
; %bb.0:
sub sp, sp, #112 ; =112
stp x29, x30, [sp, #96] ; 8-byte Folded Spill
add x29, sp, #96 ; =96
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
mov x8, sp
mov x9, #4622945017495814144
str x9, [x8, #80]
mov x9, #4622382067542392832
str x9, [x8, #72]
mov x9, #4621819117588971520
str x9, [x8, #64]
mov x9, #4621256167635550208
str x9, [x8, #56]
mov x9, #4620693217682128896
str x9, [x8, #48]
mov x9, #4619567317775286272
str x9, [x8, #40]
mov x9, #4618441417868443648
str x9, [x8, #32]
mov w10, #5
mov x9, x10
str x9, [x8, #24]
mov x9, #4616189618054758400
str x9, [x8, #16]
orr w10, wzr, #0x3
mov x9, x10
str x9, [x8, #8]
orr x9, xzr, #0x4000000000000000
str x9, [x8]
fmov s0, #1.00000000
mov w0, #97
mov w1, #98
bl _var_args
stur w0, [x29, #-4] ; 4-byte Folded Spill
ldp x29, x30, [sp, #96] ; 8-byte Folded Reload
add sp, sp, #112 ; =112
ret
.cfi_endproc
; -- End function
.globl _test_unknown_function ; -- Begin function test_unknown_function
.p2align 2
_test_unknown_function: ; @test_unknown_function
.cfi_startproc
; %bb.0:
stp x29, x30, [sp, #-16]! ; 8-byte Folded Spill
mov x29, sp
.cfi_def_cfa w29, 16
.cfi_offset w30, -8
.cfi_offset w29, -16
orr w0, wzr, #0x1
fmov d0, #2.00000000
orr w1, wzr, #0x3
fmov d1, #4.00000000
mov w2, #5
fmov d2, #6.00000000
bl _unknown_function
ldp x29, x30, [sp], #16 ; 8-byte Folded Reload
ret
.cfi_endproc
; -- End function
.subsections_via_symbols