about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-01-05 12:15:03 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-01-05 12:15:03 +0100
commit163158cf126a7b774ccb8c0c1e9d94b696b343bb (patch)
tree3be0fcb1ce2bb39ecf569bb0de4e3a38ca2a025b /src
parente4821aa9e1a8c94238131d952a6c837952e7af9e (diff)
downloadbox64-163158cf126a7b774ccb8c0c1e9d94b696b343bb.tar.gz
box64-163158cf126a7b774ccb8c0c1e9d94b696b343bb.zip
[ARM64_DYNAREC] Simplified a bit CALLRET fallback handling on stack unsync
Diffstat (limited to 'src')
-rw-r--r--src/dynarec/arm64/arm64_prolog.S5
-rw-r--r--src/dynarec/arm64/dynarec_arm64_helper.c8
2 files changed, 3 insertions, 10 deletions
diff --git a/src/dynarec/arm64/arm64_prolog.S b/src/dynarec/arm64/arm64_prolog.S
index 5635fde2..eaee127f 100644
--- a/src/dynarec/arm64/arm64_prolog.S
+++ b/src/dynarec/arm64/arm64_prolog.S
@@ -6,8 +6,6 @@
 .text
 .align 4
 
-.extern arm64_next
-
 .global arm64_prolog
 arm64_prolog:
     //save all 18 used register
@@ -34,8 +32,7 @@ arm64_prolog:
     ldp     x24, x25, [x0, (8 * 14)]
     ldp     x26, x27, [x0, (8 * 16)]
     // Push a jump next on the stack
-    adr     x28, arm64_next
-    stp     x28, xzr, [sp, -16]!
+    stp     xzr, xzr, [sp, -16]!
     // Save old xSP in x28
     add     x28, sp, 16
     //jump to function
diff --git a/src/dynarec/arm64/dynarec_arm64_helper.c b/src/dynarec/arm64/dynarec_arm64_helper.c
index af0c595e..47685d84 100644
--- a/src/dynarec/arm64/dynarec_arm64_helper.c
+++ b/src/dynarec/arm64/dynarec_arm64_helper.c
@@ -617,9 +617,7 @@ void ret_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex)
     SMEND();
     if(box64_dynarec_callret) {
         // pop the actual return address for ARM stack
-        LDPx_S7_offset(x2, x6, xSP, 0);
-        CBZx(x6, 6*4);
-        ADDx_U12(xSP, xSP, 16);
+        LDPx_S7_postindex(x2, x6, xSP, 16);
         SUBx_REG(x6, x6, xRIP); // is it the right address?
         CBNZx(x6, 2*4);
         BLR(x2);
@@ -660,9 +658,7 @@ void retn_to_epilog(dynarec_arm_t* dyn, int ninst, rex_t rex, int n)
     SMEND();
     if(box64_dynarec_callret) {
         // pop the actual return address for ARM stack
-        LDPx_S7_offset(x2, x6, xSP, 0);
-        CBZx(x6, 6*4);
-        ADDx_U12(xSP, xSP, 16);
+        LDPx_S7_postindex(x2, x6, xSP, 16);
         SUBx_REG(x6, x6, xRIP); // is it the right address?
         CBNZx(x6, 2*4);
         BLR(x2);