Fixed delay slot at edge condition

This commit is contained in:
zilmar 2012-10-20 06:06:30 +11:00
parent 5f09adbc49
commit 5f41558e49
1 changed files with 9 additions and 3 deletions

View File

@ -1246,8 +1246,14 @@ bool CCodeSection::GenerateX86Code ( DWORD Test )
{ {
_Notify->BreakPoint(__FILE__,__LINE__); _Notify->BreakPoint(__FILE__,__LINE__);
} }
if (m_NextInstruction == NORMAL) { if (m_NextInstruction == NORMAL)
CompileExit (m_CompilePC, m_CompilePC + 4,m_RegWorkingSet,CExitInfo::Normal,true,NULL); {
if (m_DelaySlot)
{
CompileExit (m_CompilePC, m_Jump.TargetPC,m_RegWorkingSet,CExitInfo::Normal,true,NULL);
} else {
CompileExit (m_CompilePC, m_CompilePC + 4,m_RegWorkingSet,CExitInfo::Normal,true,NULL);
}
m_NextInstruction = END_BLOCK; m_NextInstruction = END_BLOCK;
} }
} }
@ -1267,7 +1273,7 @@ bool CCodeSection::GenerateX86Code ( DWORD Test )
break; break;
} }
if (m_DelaySlot) if (m_DelaySlot && (CompilePC() & 0xFFC) != 0xFFC)
{ {
m_Jump.RegSet = m_RegWorkingSet; m_Jump.RegSet = m_RegWorkingSet;
m_Jump.FallThrough = true; m_Jump.FallThrough = true;