Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
stenzek
GitHub Repository: stenzek/duckstation
Path: blob/master/src/common/fastjmp_arm.asm
4211 views
1
; SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
2
; SPDX-License-Identifier: CC-BY-NC-ND-4.0
3
4
#include "ksarm64.h"
5
6
EXPORT fastjmp_set
7
EXPORT fastjmp_jmp
8
9
TEXTAREA
10
11
; void fastjmp_set(fastjmp_buf*)
12
LEAF_ENTRY fastjmp_set
13
mov x16, sp
14
stp x16, x30, [x0]
15
stp x19, x20, [x0, #16]
16
stp x21, x22, [x0, #32]
17
stp x23, x24, [x0, #48]
18
stp x25, x26, [x0, #64]
19
stp x27, x28, [x0, #80]
20
str x29, [x0, #96]
21
stp d8, d9, [x0, #112]
22
stp d10, d11, [x0, #128]
23
stp d12, d13, [x0, #144]
24
stp d14, d15, [x0, #160]
25
mov w0, wzr
26
br x30
27
LEAF_END
28
29
; void fastjmp_jmp(fastjmp_buf*, int)
30
LEAF_ENTRY fastjmp_jmp
31
ldp x16, x30, [x0]
32
mov sp, x16
33
ldp x19, x20, [x0, #16]
34
ldp x21, x22, [x0, #32]
35
ldp x23, x24, [x0, #48]
36
ldp x25, x26, [x0, #64]
37
ldp x27, x28, [x0, #80]
38
ldr x29, [x0, #96]
39
ldp d8, d9, [x0, #112]
40
ldp d10, d11, [x0, #128]
41
ldp d12, d13, [x0, #144]
42
ldp d14, d15, [x0, #160]
43
mov w0, w1
44
br x30
45
LEAF_END
46
47
END
48
49