From 3e412891674af3d4eb77675853c1f10715dfabce Mon Sep 17 00:00:00 2001 From: Yang Liu Date: Sat, 6 Apr 2024 14:48:00 +0800 Subject: [DYNAREC] Fixed REP opcodes for correct register state recovery (#1420) --- src/dynarec/la64/dynarec_la64_00.c | 4 ++-- src/dynarec/rv64/dynarec_rv64_00_2.c | 8 ++++---- src/dynarec/rv64/dynarec_rv64_66.c | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/dynarec/la64/dynarec_la64_00.c b/src/dynarec/la64/dynarec_la64_00.c index bdf04154..6940839d 100644 --- a/src/dynarec/la64/dynarec_la64_00.c +++ b/src/dynarec/la64/dynarec_la64_00.c @@ -666,8 +666,8 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni BNEZ_MARK2(x1); MARK; // Part with DF==0 LD_BU(x1, xRSI, 0); - ADDI_D(xRSI, xRSI, 1); LD_BU(x2, xRDI, 0); + ADDI_D(xRSI, xRSI, 1); ADDI_D(xRDI, xRDI, 1); ADDI_D(xRCX, xRCX, -1); if (rep == 1) { @@ -679,8 +679,8 @@ uintptr_t dynarec64_00(dynarec_la64_t* dyn, uintptr_t addr, uintptr_t ip, int ni B_MARK3_nocond; MARK2; // Part with DF==1 LD_BU(x1, xRSI, 0); - ADDI_D(xRSI, xRSI, -1); LD_BU(x2, xRDI, 0); + ADDI_D(xRSI, xRSI, -1); ADDI_D(xRDI, xRDI, -1); ADDI_D(xRCX, xRCX, -1); if (rep == 1) { diff --git a/src/dynarec/rv64/dynarec_rv64_00_2.c b/src/dynarec/rv64/dynarec_rv64_00_2.c index 6dc4f3c5..e62c73e9 100644 --- a/src/dynarec/rv64/dynarec_rv64_00_2.c +++ b/src/dynarec/rv64/dynarec_rv64_00_2.c @@ -625,8 +625,8 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int BNEZ_MARK2(x1); MARK; // Part with DF==0 LBU(x1, xRSI, 0); - ADDI(xRSI, xRSI, 1); LBU(x2, xRDI, 0); + ADDI(xRSI, xRSI, 1); ADDI(xRDI, xRDI, 1); SUBI(xRCX, xRCX, 1); if (rep==1) {BEQ_MARK3(x1, x2);} else {BNE_MARK3(x1, x2);} @@ -634,8 +634,8 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int B_MARK3_nocond; MARK2; // Part with DF==1 LBU(x1, xRSI, 0); - SUBI(xRSI, xRSI, 1); LBU(x2, xRDI, 0); + SUBI(xRSI, xRSI, 1); SUBI(xRDI, xRDI, 1); SUBI(xRCX, xRCX, 1); if (rep==1) {BEQ_MARK3(x1, x2);} else {BNE_MARK3(x1, x2);} @@ -667,8 +667,8 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int BNEZ_MARK2(x1); MARK; // Part with DF==0 LDxw(x1, xRSI, 0); - ADDI(xRSI, xRSI, rex.w ? 8 : 4); LDxw(x2, xRDI, 0); + ADDI(xRSI, xRSI, rex.w ? 8 : 4); ADDI(xRDI, xRDI, rex.w ? 8 : 4); SUBI(xRCX, xRCX, 1); if (rep == 1) { BEQ_MARK3(x1, x2); } else { BNE_MARK3(x1, x2); } @@ -676,8 +676,8 @@ uintptr_t dynarec64_00_2(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int B_MARK3_nocond; MARK2; // Part with DF==1 LDxw(x1, xRSI, 0); - SUBI(xRSI, xRSI, rex.w ? 8 : 4); LDxw(x2, xRDI, 0); + SUBI(xRSI, xRSI, rex.w ? 8 : 4); SUBI(xRDI, xRDI, rex.w ? 8 : 4); SUBI(xRCX, xRCX, 1); if (rep == 1) { BEQ_MARK3(x1, x2); } else { BNE_MARK3(x1, x2); } diff --git a/src/dynarec/rv64/dynarec_rv64_66.c b/src/dynarec/rv64/dynarec_rv64_66.c index 06ac0fe1..a17aae3b 100644 --- a/src/dynarec/rv64/dynarec_rv64_66.c +++ b/src/dynarec/rv64/dynarec_rv64_66.c @@ -760,8 +760,8 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni B_NEXT_nocond; MARK2; // Part with DF==1 LH(x1, xRSI, 0); - SUBI(xRSI, xRSI, 2); SH(x1, xRDI, 0); + SUBI(xRSI, xRSI, 2); SUBI(xRDI, xRDI, 2); SUBI(xRCX, xRCX, 1); BNEZ_MARK2(xRCX); @@ -787,8 +787,8 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni BNEZ_MARK2(x1); MARK; // Part with DF==0 LHU(x1, xRSI, 0); - ADDI(xRSI, xRSI, 2); LHU(x2, xRDI, 0); + ADDI(xRSI, xRSI, 2); ADDI(xRDI, xRDI, 2); SUBI(xRCX, xRCX, 1); if (rep == 1) { BEQ_MARK3(x1, x2); } else { BNE_MARK3(x1, x2); } @@ -796,8 +796,8 @@ uintptr_t dynarec64_66(dynarec_rv64_t* dyn, uintptr_t addr, uintptr_t ip, int ni B_MARK3_nocond; MARK2; // Part with DF==1 LHU(x1, xRSI, 0); - SUBI(xRSI, xRSI, 2); LHU(x2, xRDI, 0); + SUBI(xRSI, xRSI, 2); SUBI(xRDI, xRDI, 2); SUBI(xRCX, xRCX, 1); if (rep == 1) { BEQ_MARK3(x1, x2); } else { BNE_MARK3(x1, x2); } -- cgit 1.4.1