RSP: JALR update rd after updating the PC

This commit is contained in:
zilmar 2024-06-27 16:57:31 +09:30
parent 06eea03d7d
commit 0e0f0f7618
2 changed files with 1 additions and 3 deletions

View File

@ -819,7 +819,6 @@ void CompilerRSPBlock(void)
uint32_t EndPC = 0x1000; uint32_t EndPC = 0x1000;
do do
{ {
// Reordering is setup to allow us to have loop labels // Reordering is setup to allow us to have loop labels
// so here we see if this is one and put it in the jump table // so here we see if this is one and put it in the jump table
@ -857,7 +856,6 @@ void CompilerRSPBlock(void)
CPU_Message("X86 Address: %08X", RecompPos); CPU_Message("X86 Address: %08X", RecompPos);
} }
#endif #endif
RSP_LW_IMEM(CompilePC, &RSPOpC.Value); RSP_LW_IMEM(CompilePC, &RSPOpC.Value);
if (LogRDP && NextInstruction != RSPPIPELINE_DELAY_SLOT_DONE) if (LogRDP && NextInstruction != RSPPIPELINE_DELAY_SLOT_DONE)

View File

@ -1549,10 +1549,10 @@ void Compile_Special_JALR(void)
if (NextInstruction == RSPPIPELINE_NORMAL) if (NextInstruction == RSPPIPELINE_NORMAL)
{ {
CPU_Message(" %X %s", CompilePC, RSPInstruction(CompilePC, RSPOpC.Value).NameAndParam().c_str()); CPU_Message(" %X %s", CompilePC, RSPInstruction(CompilePC, RSPOpC.Value).NameAndParam().c_str());
MoveConstToVariable(Const, &RSP_GPR[RSPOpC.rd].W, GPR_Name(RSPOpC.rd));
MoveVariableToX86reg(&RSP_GPR[RSPOpC.rs].W, GPR_Name(RSPOpC.rs), x86_EAX); MoveVariableToX86reg(&RSP_GPR[RSPOpC.rs].W, GPR_Name(RSPOpC.rs), x86_EAX);
AndConstToX86Reg(x86_EAX, 0xFFC); AndConstToX86Reg(x86_EAX, 0xFFC);
MoveX86regToVariable(x86_EAX, PrgCount, "RSP PC"); MoveX86regToVariable(x86_EAX, PrgCount, "RSP PC");
MoveConstToVariable(Const, &RSP_GPR[RSPOpC.rd].W, GPR_Name(RSPOpC.rd));
NextInstruction = RSPPIPELINE_DO_DELAY_SLOT; NextInstruction = RSPPIPELINE_DO_DELAY_SLOT;
} }
else if (NextInstruction == RSPPIPELINE_DELAY_SLOT_DONE) else if (NextInstruction == RSPPIPELINE_DELAY_SLOT_DONE)