mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 12:05:23 +00:00
Rounding mode set
This commit is contained in:
parent
e1a9f08a91
commit
d94ce7094e
2 changed files with 16 additions and 0 deletions
|
@ -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();
|
||||
|
|
|
@ -1444,6 +1444,7 @@ public:
|
|||
public:
|
||||
virtual void InitRegs();
|
||||
virtual u64 GetFreeStackSize() const;
|
||||
virtual void Task();
|
||||
|
||||
protected:
|
||||
virtual void DoReset();
|
||||
|
|
Loading…
Add table
Reference in a new issue