From 163158cf126a7b774ccb8c0c1e9d94b696b343bb Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Fri, 5 Jan 2024 12:15:03 +0100 Subject: [ARM64_DYNAREC] Simplified a bit CALLRET fallback handling on stack unsync --- src/dynarec/arm64/arm64_prolog.S | 5 +---- src/dynarec/arm64/dynarec_arm64_helper.c | 8 ++------ 2 files changed, 3 insertions(+), 10 deletions(-) (limited to 'src') 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); -- cgit 1.4.1