[Android] Add CArmRegInfo::FixRoundModel

This commit is contained in:
zilmar 2016-10-01 12:35:00 +10:00
parent 0cc9ae52b2
commit 74727e8e39
2 changed files with 28 additions and 0 deletions

View File

@ -77,6 +77,33 @@ void CArmRegInfo::AfterCallDirect(void)
m_InCallDirect = false;
}
void CArmRegInfo::FixRoundModel(FPU_ROUND RoundMethod)
{
if (m_InCallDirect)
{
CPU_Message("%s: in CallDirect",__FUNCTION__);
g_Notify->BreakPoint(__FILE__, __LINE__);
return;
}
if (GetRoundingModel() == RoundMethod)
{
return;
}
CPU_Message(" FixRoundModel: CurrentRoundingModel: %s targetRoundModel: %s", RoundingModelName(GetRoundingModel()), RoundingModelName(RoundMethod));
if (RoundMethod == RoundDefault)
{
m_RegWorkingSet.BeforeCallDirect();
MoveVariableToArmReg(_RoundingModel, "_RoundingModel", Arm_R0);
CallFunction((void *)fesetround, "fesetround");
m_RegWorkingSet.AfterCallDirect();
}
else
{
g_Notify->BreakPoint(__FILE__, __LINE__);
}
}
CArmOps::ArmReg CArmRegInfo::FreeArmReg()
{
if (m_InCallDirect)

View File

@ -50,6 +50,7 @@ public:
void BeforeCallDirect(void);
void AfterCallDirect(void);
void FixRoundModel(FPU_ROUND RoundMethod);
ArmReg FreeArmReg();
void WriteBackRegisters();