Rounding mode set

This commit is contained in:
Nekotekina 2014-07-16 16:09:20 +04:00
parent e1a9f08a91
commit d94ce7094e
2 changed files with 16 additions and 0 deletions

View file

@ -10,6 +10,8 @@
#include "Emu/Cell/SPUDisAsm.h"
#include "Emu/Cell/SPURecompiler.h"
#include <cfenv>
SPUThread& GetCurrentSPUThread()
{
PPCThread* thread = GetCurrentPPCThread();
@ -35,6 +37,19 @@ SPUThread::~SPUThread()
{
}
void SPUThread::Task()
{
const int round = std::fegetround();
std::fesetround(FE_TOWARDZERO);
CPUThread::Task();
if (std::fegetround() != FE_TOWARDZERO)
{
LOG_ERROR(Log::SPU, "Rounding mode has changed(%d)", std::fegetround());
}
std::fesetround(round);
}
void SPUThread::DoReset()
{
PPCThread::DoReset();

View file

@ -1444,6 +1444,7 @@ public:
public:
virtual void InitRegs();
virtual u64 GetFreeStackSize() const;
virtual void Task();
protected:
virtual void DoReset();