Optimized reset stack pointer when stack pointer was already mapped

This commit is contained in:
zilmar 2012-09-28 08:54:38 +10:00
parent 07286c302a
commit 77d68a5aad
1 changed files with 13 additions and 2 deletions

View File

@ -1266,11 +1266,22 @@ void CMipsMemoryVM::ResetMemoryStack ( void)
{
x86Reg Reg, TempReg;
int MipsReg = 29;
CPU_Message(" ResetMemoryStack");
Reg = Get_MemoryStack();
if (Reg != x86_Unknown) { UnMap_X86reg(Reg); }
if (Reg == x86_Unknown)
{
Reg = Map_TempReg(x86_Any, MipsReg, FALSE);
} else {
if (IsUnknown(MipsReg)) {
MoveVariableToX86reg(&_GPR[MipsReg].UW[0],CRegName::GPR_Lo[MipsReg],Reg);
} else if (IsMapped(MipsReg)) {
MoveX86RegToX86Reg(MipsRegMapLo(MipsReg),Reg);
} else {
MoveConstToX86reg(MipsRegLo(MipsReg),Reg);
}
}
Reg = Map_TempReg(x86_Any, 29, FALSE);
if (bUseTlb())
{
TempReg = Map_TempReg(x86_Any,-1,FALSE);