1 | /* $Id: IEMAllN8veHlpA-arm64.S 103377 2024-02-15 03:14:37Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * IEM - Native Recompiler Assembly Helpers, ARM64 variant.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2024 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 |
|
---|
29 | /*********************************************************************************************************************************
|
---|
30 | * Header Files *
|
---|
31 | *********************************************************************************************************************************/
|
---|
32 | #include <iprt/asmdefs-arm.h>
|
---|
33 | #include <iprt/x86.h>
|
---|
34 |
|
---|
35 |
|
---|
36 | BEGINCODE
|
---|
37 | /**
|
---|
38 | * This does the epilogue of a TB, given the RBP for the frame and eax value to return.
|
---|
39 | *
|
---|
40 | * @param pFrame (x0) The frame pointer.
|
---|
41 | * @param rc (w1) The return value.
|
---|
42 | *
|
---|
43 | * @note This doesn't really work for MSC since xmm6 thru xmm15 are non-volatile
|
---|
44 | * and since we don't save them in the TB prolog we'll potentially return
|
---|
45 | * with different values if any functions on the calling stack uses them
|
---|
46 | * as they're unlikely to restore them till they return.
|
---|
47 | *
|
---|
48 | * For the GCC calling convention all xmm registers are volatile and the
|
---|
49 | * only worry would be someone fiddling the control bits of MXCSR or FCW
|
---|
50 | * without restoring them. This is highly unlikely, unless we're doing
|
---|
51 | * it ourselves, I think.
|
---|
52 | */
|
---|
53 | .p2align 2
|
---|
54 | .private_extern NAME(iemNativeTbLongJmp)
|
---|
55 | .globl NAME(iemNativeTbLongJmp)
|
---|
56 | NAME(iemNativeTbLongJmp):
|
---|
57 |
|
---|
58 | ;
|
---|
59 | ; This must exactly match what iemNativeEmitEpilog does.
|
---|
60 | ;
|
---|
61 | sub sp, x0, #0x50
|
---|
62 | ldp x19, x20, [sp, #0x00]
|
---|
63 | ldp x21, x22, [sp, #0x10]
|
---|
64 | ldp x23, x24, [sp, #0x20]
|
---|
65 | ldp x25, x26, [sp, #0x30]
|
---|
66 | ldp x27, x28, [sp, #0x40]
|
---|
67 | ldp x29, x30, [sp, #0x50] /* the pFrame address points to this entry */
|
---|
68 | add sp, sp, #0x60
|
---|
69 | mov w0, w1 /* The return value */
|
---|
70 | #ifdef RT_OS_DARWIN
|
---|
71 | retab
|
---|
72 | #else
|
---|
73 | ret
|
---|
74 | #endif
|
---|
75 | brk #1
|
---|
76 |
|
---|