Core: in CX86RecompilerOps::CompileCheckFPUResult64 protect RegPointer before Map_TempReg(asmjit::x86::eax)

This commit is contained in:
zilmar 2024-05-23 11:41:15 +09:30
parent 3baaa829de
commit ec714cd90d
1 changed files with 5 additions and 5 deletions

View File

@ -8427,6 +8427,11 @@ void CX86RecompilerOps::CompileCheckFPUResult32(int32_t DestReg)
void CX86RecompilerOps::CompileCheckFPUResult64(asmjit::x86::Gp RegPointer) void CX86RecompilerOps::CompileCheckFPUResult64(asmjit::x86::Gp RegPointer)
{ {
m_RegWorkingSet.UnMap_FPStatusReg(); m_RegWorkingSet.UnMap_FPStatusReg();
bool RegPointerProtect = m_RegWorkingSet.GetX86Protected(GetIndexFromX86Reg(RegPointer));
if (!RegPointerProtect)
{
m_RegWorkingSet.SetX86Protected(GetIndexFromX86Reg(RegPointer), true);
}
asmjit::x86::Gp TempReg = m_RegWorkingSet.Map_TempReg(asmjit::x86::eax, -1, false, false); asmjit::x86::Gp TempReg = m_RegWorkingSet.Map_TempReg(asmjit::x86::eax, -1, false, false);
if (RegPointer == TempReg) if (RegPointer == TempReg)
{ {
@ -8434,11 +8439,6 @@ void CX86RecompilerOps::CompileCheckFPUResult64(asmjit::x86::Gp RegPointer)
m_Assembler.mov(RegPointerValue, RegPointer); m_Assembler.mov(RegPointerValue, RegPointer);
RegPointer = RegPointerValue; RegPointer = RegPointerValue;
} }
bool RegPointerProtect = m_RegWorkingSet.GetX86Protected(GetIndexFromX86Reg(RegPointer));
if (!RegPointerProtect)
{
m_RegWorkingSet.SetX86Protected(GetIndexFromX86Reg(RegPointer), true);
}
asmjit::x86::Gp TempReg2 = m_RegWorkingSet.Map_TempReg(x86Reg_Unknown, -1, false, false); asmjit::x86::Gp TempReg2 = m_RegWorkingSet.Map_TempReg(x86Reg_Unknown, -1, false, false);
m_Assembler.fnstsw(asmjit::x86::ax); m_Assembler.fnstsw(asmjit::x86::ax);