Core: Change to using fenv.h instead of including the code directly

This commit is contained in:
zilmar 2023-01-30 10:07:51 +10:30
parent fb6bda321c
commit f802b18cdc
5 changed files with 4 additions and 42 deletions

View File

@ -13,31 +13,4 @@ int _vscprintf(const char * format, va_list pargs)
va_end(argcopy); va_end(argcopy);
return retval; return retval;
} }
#endif #endif
#ifdef _MSC_VER
#include <float.h>
int fesetround(int RoundType)
{
static const unsigned int msRound[4] = {_RC_NEAR, _RC_CHOP, _RC_UP, _RC_DOWN};
int32_t res = _controlfp(msRound[RoundType], _MCW_RC);
if (res == _RC_NEAR)
{
return FE_TONEAREST;
}
if (res == _RC_CHOP)
{
return FE_TOWARDZERO;
}
if (res == _RC_UP)
{
return FE_UPWARD;
}
if (res == _RC_DOWN)
{
return FE_DOWNWARD;
}
return FE_TONEAREST;
}
#endif

View File

@ -13,17 +13,3 @@
int _vscprintf(const char * format, va_list pargs); int _vscprintf(const char * format, va_list pargs);
#endif #endif
// FPU rounding code
#ifdef _WIN32
typedef enum
{
FE_TONEAREST = 0,
FE_TOWARDZERO,
FE_UPWARD,
FE_DOWNWARD,
} eRoundType;
int fesetround(int RoundType);
#else
#include <fenv.h>
#endif

View File

@ -10,6 +10,7 @@
#include <Project64-core/N64System/Mips/TLB.h> #include <Project64-core/N64System/Mips/TLB.h>
#include <Project64-core/N64System/N64System.h> #include <Project64-core/N64System/N64System.h>
#include <Project64-core/N64System/SystemGlobals.h> #include <Project64-core/N64System/SystemGlobals.h>
#include <fenv.h>
#include <float.h> #include <float.h>
#include <math.h> #include <math.h>

View File

@ -4,6 +4,7 @@
#include <Project64-core/N64System/Mips/Register.h> #include <Project64-core/N64System/Mips/Register.h>
#include <Project64-core/N64System/N64System.h> #include <Project64-core/N64System/N64System.h>
#include <Project64-core/N64System/SystemGlobals.h> #include <Project64-core/N64System/SystemGlobals.h>
#include <fenv.h>
const char * CRegName::GPR[32] = { const char * CRegName::GPR[32] = {
"R0", "R0",

View File

@ -17,6 +17,7 @@
#include <Project64-core/N64System/Recompiler/SectionInfo.h> #include <Project64-core/N64System/Recompiler/SectionInfo.h>
#include <Project64-core/N64System/Recompiler/x86/x86RecompilerOps.h> #include <Project64-core/N64System/Recompiler/x86/x86RecompilerOps.h>
#include <Project64-core/N64System/SystemGlobals.h> #include <Project64-core/N64System/SystemGlobals.h>
#include <fenv.h>
#include <stdio.h> #include <stdio.h>
uint32_t CX86RecompilerOps::m_TempValue32 = 0; uint32_t CX86RecompilerOps::m_TempValue32 = 0;