diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-04-10 10:20:35 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-04-10 10:20:35 +0200 |
| commit | 889bbf3e3f87dc255494552da6d5d9e7a57bedaf (patch) | |
| tree | f4fef3bba846f371e4b389d09f9655f6300d3a9e /src | |
| parent | abb8d29cd4a635afe013457bde5c74ebf3545697 (diff) | |
| download | box64-889bbf3e3f87dc255494552da6d5d9e7a57bedaf.tar.gz box64-889bbf3e3f87dc255494552da6d5d9e7a57bedaf.zip | |
[DYNAREC] Fixed some issue with RIP optimisations (Fixed Doom)
Diffstat (limited to 'src')
| -rwxr-xr-x | src/dynarec/arm64/dynarec_arm64_helper.c | 6 | ||||
| -rwxr-xr-x | src/dynarec/arm64/dynarec_arm64_helper.h | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/dynarec/arm64/dynarec_arm64_helper.c b/src/dynarec/arm64/dynarec_arm64_helper.c index 5fb55a6a..f4067684 100755 --- a/src/dynarec/arm64/dynarec_arm64_helper.c +++ b/src/dynarec/arm64/dynarec_arm64_helper.c @@ -401,6 +401,7 @@ void jump_to_next(dynarec_arm_t* dyn, uintptr_t ip, int reg, int ninst) if(reg!=x1) { MOVx_REG(x1, xRIP); } + CLEARIP(); #ifdef HAVE_TRACE //MOVx(x2, 15); no access to PC reg #endif @@ -424,6 +425,7 @@ void ret_to_epilog(dynarec_arm_t* dyn, int ninst) LDRx_REG_LSL3(x2, x2, x3); MOVx_REG(x1, xRIP); BLR(x2); // save LR + CLEARIP(); } void retn_to_epilog(dynarec_arm_t* dyn, int ninst, int n) @@ -449,11 +451,12 @@ void retn_to_epilog(dynarec_arm_t* dyn, int ninst, int n) LDRx_REG_LSL3(x2, x2, x3); MOVx_REG(x1, xRIP); BLR(x2); // save LR + CLEARIP(); } void iret_to_epilog(dynarec_arm_t* dyn, int ninst, int is64bits) { - #warning TODO: is64bits + //#warning TODO: is64bits MAYUSE(ninst); MESSAGE(LOG_DUMP, "IRet to epilog\n"); // POP IP @@ -480,6 +483,7 @@ void iret_to_epilog(dynarec_arm_t* dyn, int ninst, int is64bits) // Ret.... MOV64x(x2, (uintptr_t)arm64_epilog); // epilog on purpose, CS might have changed! BR(x2); + CLEARIP(); } void call_c(dynarec_arm_t* dyn, int ninst, void* fnc, int reg, int ret, int saveflags, int savereg) diff --git a/src/dynarec/arm64/dynarec_arm64_helper.h b/src/dynarec/arm64/dynarec_arm64_helper.h index c2355f3a..f730fdea 100755 --- a/src/dynarec/arm64/dynarec_arm64_helper.h +++ b/src/dynarec/arm64/dynarec_arm64_helper.h @@ -667,6 +667,7 @@ TABLE64(xRIP, (A)); \ } #endif +#define CLEARIP() dyn->last_ip=0 #if STEP < 2 #define PASS2IF(A, B) if(A) |