[Project64] Sync InterpreterCPU.cpp and InterpreterOps.cpp

This commit is contained in:
zilmar 2016-01-13 20:33:17 +11:00
parent 5c329f72be
commit 6164b45b6e
2 changed files with 252 additions and 252 deletions

View File

@ -281,7 +281,7 @@ void CInterpreterCPU::ExecuteCPU()
uint32_t CountPerOp = g_System->CountPerOp(); uint32_t CountPerOp = g_System->CountPerOp();
int32_t & NextTimer = *g_NextTimer; int32_t & NextTimer = *g_NextTimer;
__try __except_try()
{ {
while (!Done) while (!Done)
{ {
@ -346,7 +346,7 @@ void CInterpreterCPU::ExecuteCPU()
} }
} }
} }
__except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) __except_catch()
{ {
g_Notify->FatalError(GS(MSG_UNKNOWN_MEM_ACTION)); g_Notify->FatalError(GS(MSG_UNKNOWN_MEM_ACTION));
} }
@ -362,7 +362,7 @@ void CInterpreterCPU::ExecuteOps(int32_t Cycles)
const int32_t & DoSomething = g_SystemEvents->DoSomething(); const int32_t & DoSomething = g_SystemEvents->DoSomething();
uint32_t CountPerOp = g_System->CountPerOp(); uint32_t CountPerOp = g_System->CountPerOp();
__try __except_try()
{ {
while (!Done) while (!Done)
{ {
@ -455,7 +455,7 @@ void CInterpreterCPU::ExecuteOps(int32_t Cycles)
} }
} }
} }
__except (g_MMU->MemoryFilter(GetExceptionCode(), GetExceptionInformation())) __except_catch()
{ {
g_Notify->FatalError(GS(MSG_UNKNOWN_MEM_ACTION)); g_Notify->FatalError(GS(MSG_UNKNOWN_MEM_ACTION));
} }

View File

@ -9,7 +9,7 @@
* * * *
****************************************************************************/ ****************************************************************************/
#include "stdafx.h" #include "stdafx.h"
#include "InterpreterOps.h" #include <Project64-core/N64System/Interpreter/InterpreterOps.h>
#include <Project64-core/N64System/SystemGlobals.h> #include <Project64-core/N64System/SystemGlobals.h>
#include <Project64-core/N64System/N64Class.h> #include <Project64-core/N64System/N64Class.h>
#include <Project64-core/N64System/Mips/MemoryVirtualMem.h> #include <Project64-core/N64System/Mips/MemoryVirtualMem.h>
@ -58,7 +58,7 @@ const int32_t R4300iOp::LWR_SHIFT[4] = { 24, 16, 8, 0 };
return; return;
//#define TEST_COP1_USABLE_EXCEPTION //#define TEST_COP1_USABLE_EXCEPTION
#define TEST_COP1_USABLE_EXCEPTION \ #define TEST_COP1_USABLE_EXCEPTION() \
if ((g_Reg->STATUS_REGISTER & STATUS_CU1) == 0) {\ if ((g_Reg->STATUS_REGISTER & STATUS_CU1) == 0) {\
g_Reg->DoCopUnusableException(m_NextInstruction == JUMP,1);\ g_Reg->DoCopUnusableException(m_NextInstruction == JUMP,1);\
m_NextInstruction = JUMP;\ m_NextInstruction = JUMP;\
@ -1021,7 +1021,7 @@ void R4300iOp::LDL()
g_Notify->BreakPoint(__FILE__, __LINE__); g_Notify->BreakPoint(__FILE__, __LINE__);
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
return; return;
} }
@ -1048,7 +1048,7 @@ void R4300iOp::LDR()
g_Notify->BreakPoint(__FILE__, __LINE__); g_Notify->BreakPoint(__FILE__, __LINE__);
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
return; return;
} }
@ -1064,7 +1064,7 @@ void R4300iOp::LB()
{ {
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} }
@ -1085,7 +1085,7 @@ void R4300iOp::LH()
{ {
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} }
@ -1107,7 +1107,7 @@ void R4300iOp::LWL()
g_Notify->BreakPoint(__FILE__, __LINE__); g_Notify->BreakPoint(__FILE__, __LINE__);
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
return; return;
} }
@ -1133,7 +1133,7 @@ void R4300iOp::LW()
{ {
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} }
@ -1150,7 +1150,7 @@ void R4300iOp::LBU()
{ {
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} }
@ -1171,7 +1171,7 @@ void R4300iOp::LHU()
{ {
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} }
@ -1193,7 +1193,7 @@ void R4300iOp::LWR()
g_Notify->BreakPoint(__FILE__, __LINE__); g_Notify->BreakPoint(__FILE__, __LINE__);
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
return; return;
} }
@ -1214,7 +1214,7 @@ void R4300iOp::LWU()
{ {
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} }
@ -1235,7 +1235,7 @@ void R4300iOp::SB()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1255,7 +1255,7 @@ void R4300iOp::SH()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1275,7 +1275,7 @@ void R4300iOp::SWL()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
return; return;
} }
@ -1291,7 +1291,7 @@ void R4300iOp::SWL()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1315,7 +1315,7 @@ void R4300iOp::SW()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1346,7 +1346,7 @@ void R4300iOp::SDL()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
return; return;
} }
@ -1362,7 +1362,7 @@ void R4300iOp::SDL()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1394,7 +1394,7 @@ void R4300iOp::SDR()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
return; return;
} }
@ -1410,7 +1410,7 @@ void R4300iOp::SDR()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1430,7 +1430,7 @@ void R4300iOp::SWR()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
return; return;
} }
@ -1446,7 +1446,7 @@ void R4300iOp::SWR()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1472,7 +1472,7 @@ void R4300iOp::LL()
{ {
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} }
@ -1486,7 +1486,7 @@ void R4300iOp::LL()
void R4300iOp::LWC1() void R4300iOp::LWC1()
{ {
uint32_t Address = _GPR[m_Opcode.base].UW[0] + (uint32_t)((int16_t)m_Opcode.offset); uint32_t Address = _GPR[m_Opcode.base].UW[0] + (uint32_t)((int16_t)m_Opcode.offset);
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
if ((Address & 3) != 0) if ((Address & 3) != 0)
{ {
ADDRESS_ERROR_EXCEPTION(Address, true); ADDRESS_ERROR_EXCEPTION(Address, true);
@ -1495,7 +1495,7 @@ void R4300iOp::LWC1()
{ {
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
TLB_READ_EXCEPTION(Address); TLB_READ_EXCEPTION(Address);
} }
@ -1516,7 +1516,7 @@ void R4300iOp::SC()
g_Notify->BreakPoint(__FILE__, __LINE__); g_Notify->BreakPoint(__FILE__, __LINE__);
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1538,7 +1538,7 @@ void R4300iOp::LD()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
return; return;
} }
@ -1554,7 +1554,7 @@ void R4300iOp::LDC1()
{ {
uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset;
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
if ((Address & 7) != 0) if ((Address & 7) != 0)
{ {
ADDRESS_ERROR_EXCEPTION(Address, true); ADDRESS_ERROR_EXCEPTION(Address, true);
@ -1567,7 +1567,7 @@ void R4300iOp::LDC1()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1575,7 +1575,7 @@ void R4300iOp::LDC1()
void R4300iOp::SWC1() void R4300iOp::SWC1()
{ {
uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset;
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
if ((Address & 3) != 0) if ((Address & 3) != 0)
{ {
ADDRESS_ERROR_EXCEPTION(Address, false); ADDRESS_ERROR_EXCEPTION(Address, false);
@ -1589,7 +1589,7 @@ void R4300iOp::SWC1()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1598,7 +1598,7 @@ void R4300iOp::SDC1()
{ {
uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset; uint32_t Address = _GPR[m_Opcode.base].UW[0] + (int16_t)m_Opcode.offset;
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
if ((Address & 7) != 0) if ((Address & 7) != 0)
{ {
ADDRESS_ERROR_EXCEPTION(Address, false); ADDRESS_ERROR_EXCEPTION(Address, false);
@ -1611,7 +1611,7 @@ void R4300iOp::SDC1()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -1631,7 +1631,7 @@ void R4300iOp::SD()
} }
if (bShowTLBMisses()) if (bShowTLBMisses())
{ {
g_Notify->DisplayError(stdstr_f(__FUNCTION__ " TLB: %X", Address).c_str()); g_Notify->DisplayError(stdstr_f("%s TLB: %X", __FUNCTION__, Address).c_str());
} }
} }
} }
@ -2242,19 +2242,19 @@ void R4300iOp::COP0_CO_ERET()
/************************** COP1 functions **************************/ /************************** COP1 functions **************************/
void R4300iOp::COP1_MF() void R4300iOp::COP1_MF()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_GPR[m_Opcode.rt].DW = *(int32_t *)_FPR_S[m_Opcode.fs]; _GPR[m_Opcode.rt].DW = *(int32_t *)_FPR_S[m_Opcode.fs];
} }
void R4300iOp::COP1_DMF() void R4300iOp::COP1_DMF()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_GPR[m_Opcode.rt].DW = *(int64_t *)_FPR_D[m_Opcode.fs]; _GPR[m_Opcode.rt].DW = *(int64_t *)_FPR_D[m_Opcode.fs];
} }
void R4300iOp::COP1_CF() void R4300iOp::COP1_CF()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
if (m_Opcode.fs != 31 && m_Opcode.fs != 0) if (m_Opcode.fs != 31 && m_Opcode.fs != 0)
{ {
if (bHaveDebugger()) if (bHaveDebugger())
@ -2268,20 +2268,21 @@ void R4300iOp::COP1_CF()
void R4300iOp::COP1_MT() void R4300iOp::COP1_MT()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
*(int32_t *)_FPR_S[m_Opcode.fs] = _GPR[m_Opcode.rt].W[0]; *(int32_t *)_FPR_S[m_Opcode.fs] = _GPR[m_Opcode.rt].W[0];
} }
void R4300iOp::COP1_DMT() void R4300iOp::COP1_DMT()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
*(int64_t *)_FPR_D[m_Opcode.fs] = _GPR[m_Opcode.rt].DW; *(int64_t *)_FPR_D[m_Opcode.fs] = _GPR[m_Opcode.rt].DW;
} }
void R4300iOp::COP1_CT() void R4300iOp::COP1_CT()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
if (m_Opcode.fs == 31) { if (m_Opcode.fs == 31)
{
_FPCR[m_Opcode.fs] = _GPR[m_Opcode.rt].W[0]; _FPCR[m_Opcode.fs] = _GPR[m_Opcode.rt].W[0];
switch ((_FPCR[m_Opcode.fs] & 3)) switch ((_FPCR[m_Opcode.fs] & 3))
{ {
@ -2301,7 +2302,7 @@ void R4300iOp::COP1_CT()
/************************* COP1: BC1 functions ***********************/ /************************* COP1: BC1 functions ***********************/
void R4300iOp::COP1_BCF() void R4300iOp::COP1_BCF()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if ((_FPCR[31] & FPCSR_C) == 0) if ((_FPCR[31] & FPCSR_C) == 0)
{ {
@ -2315,7 +2316,7 @@ void R4300iOp::COP1_BCF()
void R4300iOp::COP1_BCT() void R4300iOp::COP1_BCT()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
if ((_FPCR[31] & FPCSR_C) != 0) if ((_FPCR[31] & FPCSR_C) != 0)
{ {
@ -2329,7 +2330,7 @@ void R4300iOp::COP1_BCT()
void R4300iOp::COP1_BCFL() void R4300iOp::COP1_BCFL()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
if ((_FPCR[31] & FPCSR_C) == 0) if ((_FPCR[31] & FPCSR_C) == 0)
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
@ -2344,7 +2345,7 @@ void R4300iOp::COP1_BCFL()
void R4300iOp::COP1_BCTL() void R4300iOp::COP1_BCTL()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
if ((_FPCR[31] & FPCSR_C) != 0) if ((_FPCR[31] & FPCSR_C) != 0)
{ {
m_NextInstruction = DELAY_SLOT; m_NextInstruction = DELAY_SLOT;
@ -2395,28 +2396,28 @@ __inline void Float_RoundToInteger64(int64_t * Dest, float * Source)
void R4300iOp::COP1_S_ADD() void R4300iOp::COP1_S_ADD()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] + *(float *)_FPR_S[m_Opcode.ft]); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] + *(float *)_FPR_S[m_Opcode.ft]);
} }
void R4300iOp::COP1_S_SUB() void R4300iOp::COP1_S_SUB()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] - *(float *)_FPR_S[m_Opcode.ft]); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] - *(float *)_FPR_S[m_Opcode.ft]);
} }
void R4300iOp::COP1_S_MUL() void R4300iOp::COP1_S_MUL()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] * *(float *)_FPR_S[m_Opcode.ft]); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] * *(float *)_FPR_S[m_Opcode.ft]);
} }
void R4300iOp::COP1_S_DIV() void R4300iOp::COP1_S_DIV()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] / *(float *)_FPR_S[m_Opcode.ft]); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] / *(float *)_FPR_S[m_Opcode.ft]);
} }
@ -2426,7 +2427,7 @@ void R4300iOp::COP1_S_SQRT()
float * Dest = (float *)(_FPR_S[m_Opcode.fd]); float * Dest = (float *)(_FPR_S[m_Opcode.fd]);
float * Source = (float *)(_FPR_S[m_Opcode.fs]); float * Source = (float *)(_FPR_S[m_Opcode.fs]);
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
#ifdef _M_IX86 #ifdef _M_IX86
_asm _asm
@ -2450,91 +2451,91 @@ void R4300iOp::COP1_S_SQRT()
void R4300iOp::COP1_S_ABS() void R4300iOp::COP1_S_ABS()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = (float)fabs(*(float *)_FPR_S[m_Opcode.fs]); *(float *)_FPR_S[m_Opcode.fd] = (float)fabs(*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_MOV() void R4300iOp::COP1_S_MOV()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = *(float *)_FPR_S[m_Opcode.fs]; *(float *)_FPR_S[m_Opcode.fd] = *(float *)_FPR_S[m_Opcode.fs];
} }
void R4300iOp::COP1_S_NEG() void R4300iOp::COP1_S_NEG()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] * -1.0f); *(float *)_FPR_S[m_Opcode.fd] = (*(float *)_FPR_S[m_Opcode.fs] * -1.0f);
} }
void R4300iOp::COP1_S_TRUNC_L() void R4300iOp::COP1_S_TRUNC_L()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_CHOP, _MCW_RC); _controlfp(_RC_CHOP, _MCW_RC);
Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_CEIL_L() void R4300iOp::COP1_S_CEIL_L()
{ //added by Witten { //added by Witten
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_UP, _MCW_RC); _controlfp(_RC_UP, _MCW_RC);
Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_FLOOR_L() void R4300iOp::COP1_S_FLOOR_L()
{ //added by Witten { //added by Witten
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_DOWN, _MCW_RC); _controlfp(_RC_DOWN, _MCW_RC);
Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_ROUND_W() void R4300iOp::COP1_S_ROUND_W()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_NEAR, _MCW_RC); _controlfp(_RC_NEAR, _MCW_RC);
Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_TRUNC_W() void R4300iOp::COP1_S_TRUNC_W()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_CHOP, _MCW_RC); _controlfp(_RC_CHOP, _MCW_RC);
Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_CEIL_W() void R4300iOp::COP1_S_CEIL_W()
{ //added by Witten { //added by Witten
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_UP, _MCW_RC); _controlfp(_RC_UP, _MCW_RC);
Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_FLOOR_W() void R4300iOp::COP1_S_FLOOR_W()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_DOWN, _MCW_RC); _controlfp(_RC_DOWN, _MCW_RC);
Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_CVT_D() void R4300iOp::COP1_S_CVT_D()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = (double)(*(float *)_FPR_S[m_Opcode.fs]); *(double *)_FPR_D[m_Opcode.fd] = (double)(*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_CVT_W() void R4300iOp::COP1_S_CVT_W()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); Float_RoundToInteger32(&*(int32_t *)_FPR_S[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_S_CVT_L() void R4300iOp::COP1_S_CVT_L()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]); Float_RoundToInteger64(&*(int64_t *)_FPR_D[m_Opcode.fd], &*(float *)_FPR_S[m_Opcode.fs]);
} }
@ -2543,18 +2544,17 @@ void R4300iOp::COP1_S_CMP()
{ {
bool less, equal, unorded; bool less, equal, unorded;
int32_t condition; int32_t condition;
float Temp0, Temp1;
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
Temp0 = *(float *)_FPR_S[m_Opcode.fs]; float Temp0 = *(float *)_FPR_S[m_Opcode.fs];
Temp1 = *(float *)_FPR_S[m_Opcode.ft]; float Temp1 = *(float *)_FPR_S[m_Opcode.ft];
if (_isnan(Temp0) || _isnan(Temp1)) if (_isnan(Temp0) || _isnan(Temp1))
{ {
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError(__FUNCTION__ ": Nan ?"); g_Notify->DisplayError(stdstr_f("%s: Nan ?",__FUNCTION__).c_str());
} }
less = false; less = false;
equal = false; equal = false;
@ -2626,126 +2626,126 @@ __inline void Double_RoundToInteger64(uint64_t * Dest, double * Source)
void R4300iOp::COP1_D_ADD() void R4300iOp::COP1_D_ADD()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] + *(double *)_FPR_D[m_Opcode.ft]; *(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] + *(double *)_FPR_D[m_Opcode.ft];
} }
void R4300iOp::COP1_D_SUB() void R4300iOp::COP1_D_SUB()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] - *(double *)_FPR_D[m_Opcode.ft]; *(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] - *(double *)_FPR_D[m_Opcode.ft];
} }
void R4300iOp::COP1_D_MUL() void R4300iOp::COP1_D_MUL()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] * *(double *)_FPR_D[m_Opcode.ft]; *(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] * *(double *)_FPR_D[m_Opcode.ft];
} }
void R4300iOp::COP1_D_DIV() void R4300iOp::COP1_D_DIV()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] / *(double *)_FPR_D[m_Opcode.ft]; *(double *)_FPR_D[m_Opcode.fd] = *(double *)_FPR_D[m_Opcode.fs] / *(double *)_FPR_D[m_Opcode.ft];
} }
void R4300iOp::COP1_D_SQRT() void R4300iOp::COP1_D_SQRT()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = (double)sqrt(*(double *)_FPR_D[m_Opcode.fs]); *(double *)_FPR_D[m_Opcode.fd] = (double)sqrt(*(double *)_FPR_D[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_ABS() void R4300iOp::COP1_D_ABS()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = fabs(*(double *)_FPR_D[m_Opcode.fs]); *(double *)_FPR_D[m_Opcode.fd] = fabs(*(double *)_FPR_D[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_MOV() void R4300iOp::COP1_D_MOV()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(int64_t *)_FPR_D[m_Opcode.fd] = *(int64_t *)_FPR_D[m_Opcode.fs]; *(int64_t *)_FPR_D[m_Opcode.fd] = *(int64_t *)_FPR_D[m_Opcode.fs];
} }
void R4300iOp::COP1_D_NEG() void R4300iOp::COP1_D_NEG()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = (*(double *)_FPR_D[m_Opcode.fs] * -1.0); *(double *)_FPR_D[m_Opcode.fd] = (*(double *)_FPR_D[m_Opcode.fs] * -1.0);
} }
void R4300iOp::COP1_D_TRUNC_L() void R4300iOp::COP1_D_TRUNC_L()
{ //added by Witten { //added by Witten
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(RC_CHOP, _MCW_RC); _controlfp(RC_CHOP, _MCW_RC);
Double_RoundToInteger64(&*(uint64_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); Double_RoundToInteger64(&*(uint64_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_CEIL_L() void R4300iOp::COP1_D_CEIL_L()
{ //added by Witten { //added by Witten
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(RC_UP, _MCW_RC); _controlfp(RC_UP, _MCW_RC);
Double_RoundToInteger64(&*(uint64_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); Double_RoundToInteger64(&*(uint64_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_FLOOR_L() void R4300iOp::COP1_D_FLOOR_L()
{ //added by Witten { //added by Witten
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_DOWN, _MCW_RC); _controlfp(_RC_DOWN, _MCW_RC);
Double_RoundToInteger64(&*(uint64_t *)_FPR_D[m_Opcode.fd], &*(double *)_FPR_S[m_Opcode.fs]); Double_RoundToInteger64(&*(uint64_t *)_FPR_D[m_Opcode.fd], &*(double *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_ROUND_W() void R4300iOp::COP1_D_ROUND_W()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_NEAR, _MCW_RC); _controlfp(_RC_NEAR, _MCW_RC);
Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_TRUNC_W() void R4300iOp::COP1_D_TRUNC_W()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(RC_CHOP, _MCW_RC); _controlfp(RC_CHOP, _MCW_RC);
Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_CEIL_W() void R4300iOp::COP1_D_CEIL_W()
{ //added by Witten { //added by Witten
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(RC_UP, _MCW_RC); _controlfp(RC_UP, _MCW_RC);
Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_FLOOR_W() void R4300iOp::COP1_D_FLOOR_W()
{ //added by Witten { //added by Witten
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(_RC_DOWN, _MCW_RC); _controlfp(_RC_DOWN, _MCW_RC);
Double_RoundToInteger32(&*(uint32_t *)_FPR_D[m_Opcode.fd], &*(double *)_FPR_S[m_Opcode.fs]); Double_RoundToInteger32(&*(uint32_t *)_FPR_D[m_Opcode.fd], &*(double *)_FPR_S[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_CVT_S() void R4300iOp::COP1_D_CVT_S()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = (float)*(double *)_FPR_D[m_Opcode.fs]; *(float *)_FPR_S[m_Opcode.fd] = (float)*(double *)_FPR_D[m_Opcode.fs];
} }
void R4300iOp::COP1_D_CVT_W() void R4300iOp::COP1_D_CVT_W()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); Double_RoundToInteger32(&*(uint32_t *)_FPR_S[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]);
} }
void R4300iOp::COP1_D_CVT_L() void R4300iOp::COP1_D_CVT_L()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
Double_RoundToInteger64(&*(uint64_t *)_FPR_D[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]); Double_RoundToInteger64(&*(uint64_t *)_FPR_D[m_Opcode.fd], &*(double *)_FPR_D[m_Opcode.fs]);
} }
@ -2756,7 +2756,7 @@ void R4300iOp::COP1_D_CMP()
int32_t condition; int32_t condition;
MIPS_DWORD Temp0, Temp1; MIPS_DWORD Temp0, Temp1;
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
Temp0.DW = *(int64_t *)_FPR_D[m_Opcode.fs]; Temp0.DW = *(int64_t *)_FPR_D[m_Opcode.fs];
Temp1.DW = *(int64_t *)_FPR_D[m_Opcode.ft]; Temp1.DW = *(int64_t *)_FPR_D[m_Opcode.ft];
@ -2765,7 +2765,7 @@ void R4300iOp::COP1_D_CMP()
{ {
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError(__FUNCTION__ ": Nan ?"); g_Notify->DisplayError(stdstr_f("%s: Nan ?",__FUNCTION__).c_str());
} }
less = false; less = false;
equal = false; equal = false;
@ -2774,7 +2774,7 @@ void R4300iOp::COP1_D_CMP()
{ {
if (bHaveDebugger()) if (bHaveDebugger())
{ {
g_Notify->DisplayError("Signal InvalidOperationException\nin " __FUNCTION__); g_Notify->DisplayError(stdstr_f("Signal InvalidOperationException\nin %s", __FUNCTION__).c_str());
} }
} }
} }
@ -2801,14 +2801,14 @@ void R4300iOp::COP1_D_CMP()
/************************** COP1: W functions ************************/ /************************** COP1: W functions ************************/
void R4300iOp::COP1_W_CVT_S() void R4300iOp::COP1_W_CVT_S()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = (float)*(int32_t *)_FPR_S[m_Opcode.fs]; *(float *)_FPR_S[m_Opcode.fd] = (float)*(int32_t *)_FPR_S[m_Opcode.fs];
} }
void R4300iOp::COP1_W_CVT_D() void R4300iOp::COP1_W_CVT_D()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = (double)*(int32_t *)_FPR_S[m_Opcode.fs]; *(double *)_FPR_D[m_Opcode.fd] = (double)*(int32_t *)_FPR_S[m_Opcode.fs];
} }
@ -2816,14 +2816,14 @@ void R4300iOp::COP1_W_CVT_D()
/************************** COP1: L functions ************************/ /************************** COP1: L functions ************************/
void R4300iOp::COP1_L_CVT_S() void R4300iOp::COP1_L_CVT_S()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(float *)_FPR_S[m_Opcode.fd] = (float)*(int64_t *)_FPR_D[m_Opcode.fs]; *(float *)_FPR_S[m_Opcode.fd] = (float)*(int64_t *)_FPR_D[m_Opcode.fs];
} }
void R4300iOp::COP1_L_CVT_D() void R4300iOp::COP1_L_CVT_D()
{ {
TEST_COP1_USABLE_EXCEPTION TEST_COP1_USABLE_EXCEPTION();
_controlfp(*_RoundingModel, _MCW_RC); _controlfp(*_RoundingModel, _MCW_RC);
*(double *)_FPR_D[m_Opcode.fd] = (double)*(int64_t *)_FPR_D[m_Opcode.fs]; *(double *)_FPR_D[m_Opcode.fd] = (double)*(int64_t *)_FPR_D[m_Opcode.fs];
} }