2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-01 01:25:38 +03:00

Merge pull request #305 from dreamstalker/fpu_flags_dont_set

Removed FPU flags changing for SSE builds
This commit is contained in:
theAsmodai 2017-01-07 01:54:11 +03:00 committed by GitHub
commit 428b05e8ec

View File

@ -212,15 +212,18 @@ enginefuncs_t g_engfuncsExportedToDlls;
#ifdef _WIN32
void Sys_SetupFPUOptions()
{
#ifndef __SSE__
static uint8 fpuOpts[32];
__asm { fnstenv byte ptr fpuOpts }
fpuOpts[0] |= 0x3Fu;
__asm { fldenv byte ptr fpuOpts }
#endif
}
NOINLINE void Sys_InitFPUControlWords()
void Sys_InitFPUControlWords()
{
#ifndef __SSE__
int fpucw = 0;
__asm { fnstcw fpucw }
@ -228,9 +231,10 @@ NOINLINE void Sys_InitFPUControlWords()
g_FPUCW_Mask_Prec_64Bit_2 = (fpucw & 0xF0FF) | 0x300;
g_FPUCW_Mask_Round_Trunc = (fpucw & 0xF0FF) | 0xC00;
g_FPUCW_Mask_Round_Up = (fpucw & 0xF0FF) | 0x800;
#endif
}
void __cdecl Sys_SetStartTime()
void Sys_SetStartTime()
{
int startTimeArg;
@ -277,15 +281,19 @@ void __cdecl Sys_InitHardwareTimer()
}
int g_SavedFPUCW1 = 0;
NOINLINE void Sys_FPUCW_Push_Prec64() {
void Sys_FPUCW_Push_Prec64() {
#ifndef __SSE__
uint16 tmp = g_FPUCW_Mask_Prec_64Bit;
__asm { fnstcw g_SavedFPUCW1 }
__asm { fldcw tmp }
#endif
}
NOINLINE void Sys_FPUCW_Pop_Prec64() {
void Sys_FPUCW_Pop_Prec64() {
#ifndef __SSE__
uint16 tmp = g_SavedFPUCW1;
__asm { fldcw tmp }
#endif
}
#endif // _WIN32