Core: Get recompiler to handle RESERVED31

This commit is contained in:
zilmar 2022-10-24 16:50:12 +10:30
parent d06d1526d9
commit 6c9237f603
11 changed files with 38 additions and 1 deletions

View File

@ -144,6 +144,11 @@ void CAarch64RecompilerOps::LDR()
g_Notify->BreakPoint(__FILE__, __LINE__);
}
void CAarch64RecompilerOps::RESERVED31()
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
void CAarch64RecompilerOps::LB()
{
g_Notify->BreakPoint(__FILE__, __LINE__);

View File

@ -50,6 +50,7 @@ public:
void DADDIU();
void LDL();
void LDR();
void RESERVED31();
void LB();
void LH();
void LWL();

View File

@ -145,6 +145,11 @@ void CArmRecompilerOps::LDR()
g_Notify->BreakPoint(__FILE__, __LINE__);
}
void CArmRecompilerOps::RESERVED31()
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
void CArmRecompilerOps::LB()
{
g_Notify->BreakPoint(__FILE__, __LINE__);

View File

@ -49,6 +49,7 @@ public:
void DADDIU();
void LDL();
void LDR();
void RESERVED31();
void LB();
void LH();
void LWL();

View File

@ -772,6 +772,10 @@ bool CCodeBlock::AnalyzeInstruction(uint32_t PC, uint32_t & TargetPC, uint32_t &
case R4300i_DADDIU:
case R4300i_LDL:
case R4300i_LDR:
break;
case R4300i_RESERVED31:
EndBlock = true;
break;
case R4300i_LB:
case R4300i_LH:
case R4300i_LWL:

View File

@ -646,6 +646,7 @@ bool CCodeSection::GenerateNativeCode(uint32_t Test)
case R4300i_DADDIU: m_RecompilerOps->DADDIU(); break;
case R4300i_LDL: m_RecompilerOps->LDL(); break;
case R4300i_LDR: m_RecompilerOps->LDR(); break;
case R4300i_RESERVED31: m_RecompilerOps->RESERVED31(); break;
case R4300i_LB: m_RecompilerOps->LB(); break;
case R4300i_LH: m_RecompilerOps->LH(); break;
case R4300i_LWL: m_RecompilerOps->LWL(); break;

View File

@ -19,6 +19,7 @@ enum ExitReason
ExitReason_ExceptionOverflow,
ExitReason_AddressErrorExceptionRead32,
ExitReason_AddressErrorExceptionRead64,
ExitReason_IllegalInstruction,
};
struct CExitInfo

View File

@ -143,6 +143,11 @@ void CX64RecompilerOps::LDR()
g_Notify->BreakPoint(__FILE__, __LINE__);
}
void CX64RecompilerOps::RESERVED31()
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
void CX64RecompilerOps::LB()
{
g_Notify->BreakPoint(__FILE__, __LINE__);

View File

@ -50,6 +50,7 @@ public:
void DADDIU();
void LDL();
void LDR();
void RESERVED31();
void LB();
void LH();
void LWL();

View File

@ -3036,6 +3036,13 @@ void CX86RecompilerOps::LH_KnownAddress(CX86Ops::x86Reg Reg, uint32_t VAddr, boo
}
}
void CX86RecompilerOps::RESERVED31()
{
m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + g_System->CountPerOp());
CompileExit(m_CompilePC, m_CompilePC, m_RegWorkingSet, ExitReason_IllegalInstruction, true, nullptr);
m_PipelineStage = PIPELINE_STAGE_END_BLOCK;
}
void CX86RecompilerOps::LB()
{
if (m_Opcode.rt == 0)
@ -4499,7 +4506,7 @@ void CX86RecompilerOps::SPECIAL_JALR()
void CX86RecompilerOps::SPECIAL_SYSCALL()
{
m_RegWorkingSet.SetBlockCycleCount(m_RegWorkingSet.GetBlockCycleCount() + g_System->CountPerOp());
CompileExit(m_CompilePC, (uint32_t)-1, m_RegWorkingSet, ExitReason_DoSysCall, true, nullptr);
CompileExit(m_CompilePC, m_CompilePC, m_RegWorkingSet, ExitReason_DoSysCall, true, nullptr);
m_PipelineStage = PIPELINE_STAGE_END_BLOCK;
}
@ -9636,6 +9643,11 @@ void CX86RecompilerOps::CompileExit(uint32_t JumpPC, uint32_t TargetPC, CRegInfo
m_Assembler.CallThis((uint32_t)g_Reg, AddressOf(&CRegisters::DoAddressError), "CRegisters::DoAddressError", 12);
ExitCodeBlock();
break;
case ExitReason_IllegalInstruction:
m_Assembler.PushImm32(InDelaySlot ? "true" : "false", InDelaySlot);
m_Assembler.CallThis((uint32_t)g_Reg, AddressOf(&CRegisters::DoIllegalInstructionException), "CRegisters::DoIllegalInstructionException", 8);
ExitCodeBlock();
break;
default:
WriteTrace(TraceRecompiler, TraceError, "How did you want to exit on reason (%d) ???", reason);
g_Notify->BreakPoint(__FILE__, __LINE__);

View File

@ -57,6 +57,7 @@ public:
void DADDIU();
void LDL();
void LDR();
void RESERVED31();
void LB();
void LH();
void LWL();