diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2021-03-17 17:07:04 +0100 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2021-03-17 17:07:04 +0100 |
| commit | 5a07587437722c1e72d12022774613c9c8e52b45 (patch) | |
| tree | 9d81b481c68bb63e20532be5f54af94938118c8e /src | |
| parent | 6a14d26c1db433706a4c9ebb8728b4fc5954c76d (diff) | |
| download | box64-5a07587437722c1e72d12022774613c9c8e52b45.tar.gz box64-5a07587437722c1e72d12022774613c9c8e52b45.zip | |
[DYNAREC] Added C2 RETN and C3 RET opcodes
Diffstat (limited to 'src')
| -rwxr-xr-x | src/dynarec/dynarec_arm64_00.c | 21 | ||||
| -rwxr-xr-x | src/dynarec/dynarec_arm64_helper.c | 2 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/dynarec/dynarec_arm64_00.c b/src/dynarec/dynarec_arm64_00.c index 58207531..5c7cff03 100755 --- a/src/dynarec/dynarec_arm64_00.c +++ b/src/dynarec/dynarec_arm64_00.c @@ -326,6 +326,27 @@ uintptr_t dynarec64_00(dynarec_arm_t* dyn, uintptr_t addr, uintptr_t ip, int nin } break; + case 0xC2: + INST_NAME("RETN"); + //SETFLAGS(X_ALL, SF_SET); // Hack, set all flags (to an unknown state...) + READFLAGS(X_PEND); // lets play safe here too + BARRIER(2); + i32 = F16; + retn_to_epilog(dyn, ninst, i32); + *need_epilog = 0; + *ok = 0; + break; + case 0xC3: + INST_NAME("RET"); + // SETFLAGS(X_ALL, SF_SET); // Hack, set all flags (to an unknown state...) + // ^^^ that hack break PlantsVsZombies and GOG Setup under wine.... + READFLAGS(X_PEND); // so instead, force the defered flags, so it's not too slow, and flags are not lost + BARRIER(2); + ret_to_epilog(dyn, ninst); + *need_epilog = 0; + *ok = 0; + break; + case 0xE8: INST_NAME("CALL Id"); i32 = F32S; diff --git a/src/dynarec/dynarec_arm64_helper.c b/src/dynarec/dynarec_arm64_helper.c index a48bd313..07c744e8 100755 --- a/src/dynarec/dynarec_arm64_helper.c +++ b/src/dynarec/dynarec_arm64_helper.c @@ -278,6 +278,7 @@ void ret_to_epilog(dynarec_arm_t* dyn, int ninst) LDRx_REG_LSL3(x2, x2, x3); UBFXx(x3, xRIP, 0, JMPTABL_SHIFT); LDRx_REG_LSL3(x2, x2, x3); + MOVx_REG(x1, xRIP); BR(x2); } @@ -301,6 +302,7 @@ void retn_to_epilog(dynarec_arm_t* dyn, int ninst, int n) LDRx_REG_LSL3(x2, x2, x3); UBFXx(x3, xRIP, 0, JMPTABL_SHIFT); LDRx_REG_LSL3(x2, x2, x3); + MOVx_REG(x1, xRIP); BR(x2); } |