diff --git a/neo/TypeInfo/main.cpp b/neo/TypeInfo/main.cpp index aa785a8e..e258fa02 100644 --- a/neo/TypeInfo/main.cpp +++ b/neo/TypeInfo/main.cpp @@ -205,7 +205,6 @@ void idSysLocal::DebugVPrintf( const char *fmt, va_list arg ) {} double idSysLocal::GetClockTicks( void ) { return 0.0; } double idSysLocal::ClockTicksPerSecond( void ) { return 1.0; } int idSysLocal::GetProcessorId( void ) { return 0; } -const char * idSysLocal::FPU_GetState( void ) { return ""; } bool idSysLocal::FPU_StackIsEmpty( void ) { return true; } void idSysLocal::FPU_SetFTZ( bool enable ) {} void idSysLocal::FPU_SetDAZ( bool enable ) {} diff --git a/neo/d3xp/Game_local.cpp b/neo/d3xp/Game_local.cpp index 13c8b8ae..09208e3e 100644 --- a/neo/d3xp/Game_local.cpp +++ b/neo/d3xp/Game_local.cpp @@ -2657,7 +2657,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const { float ratio_y; if ( !sys->FPU_StackIsEmpty() ) { - Printf( sys->FPU_GetState() ); Error( "idGameLocal::CalcFov: FPU stack not empty" ); } @@ -2669,7 +2668,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const { // FIXME: somehow, this is happening occasionally assert( fov_y > 0 ); if ( fov_y <= 0 ) { - Printf( sys->FPU_GetState() ); Error( "idGameLocal::CalcFov: bad result" ); } @@ -2706,7 +2704,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const { // FIXME: somehow, this is happening occasionally assert( ( fov_x > 0 ) && ( fov_y > 0 ) ); if ( ( fov_y <= 0 ) || ( fov_x <= 0 ) ) { - Printf( sys->FPU_GetState() ); Error( "idGameLocal::CalcFov: bad result" ); } } diff --git a/neo/framework/Common.cpp b/neo/framework/Common.cpp index f2224dc0..b0aaa6dd 100644 --- a/neo/framework/Common.cpp +++ b/neo/framework/Common.cpp @@ -2429,7 +2429,6 @@ void idCommonLocal::Frame( void ) { // the FPU stack better be empty at this point or some bad code or compiler bug left values on the stack if ( !Sys_FPU_StackIsEmpty() ) { - Printf( Sys_FPU_GetState() ); FatalError( "idCommon::Frame: the FPU stack is not empty at the end of the frame\n" ); } } diff --git a/neo/game/Game_local.cpp b/neo/game/Game_local.cpp index 1c9d0a12..94280e80 100644 --- a/neo/game/Game_local.cpp +++ b/neo/game/Game_local.cpp @@ -2392,7 +2392,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const { float ratio_y; if ( !sys->FPU_StackIsEmpty() ) { - Printf( sys->FPU_GetState() ); Error( "idGameLocal::CalcFov: FPU stack not empty" ); } @@ -2404,7 +2403,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const { // FIXME: somehow, this is happening occasionally assert( fov_y > 0 ); if ( fov_y <= 0 ) { - Printf( sys->FPU_GetState() ); Error( "idGameLocal::CalcFov: bad result" ); } @@ -2441,7 +2439,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const { // FIXME: somehow, this is happening occasionally assert( ( fov_x > 0 ) && ( fov_y > 0 ) ); if ( ( fov_y <= 0 ) || ( fov_x <= 0 ) ) { - Printf( sys->FPU_GetState() ); Error( "idGameLocal::CalcFov: bad result" ); } } diff --git a/neo/sys/posix/posix_main.cpp b/neo/sys/posix/posix_main.cpp index f36989e6..81260710 100644 --- a/neo/sys/posix/posix_main.cpp +++ b/neo/sys/posix/posix_main.cpp @@ -319,10 +319,6 @@ bool Sys_FPU_StackIsEmpty( void ) { return true; } -const char *Sys_FPU_GetState( void ) { - return ""; -} - /* ================ Sys_LockMemory diff --git a/neo/sys/sys_local.cpp b/neo/sys/sys_local.cpp index e73a6000..967748a9 100644 --- a/neo/sys/sys_local.cpp +++ b/neo/sys/sys_local.cpp @@ -61,10 +61,6 @@ int idSysLocal::GetProcessorId( void ) { return Sys_GetProcessorId(); } -const char *idSysLocal::FPU_GetState( void ) { - return Sys_FPU_GetState(); -} - bool idSysLocal::FPU_StackIsEmpty( void ) { return Sys_FPU_StackIsEmpty(); } diff --git a/neo/sys/sys_local.h b/neo/sys/sys_local.h index 646555d5..b55d0b75 100644 --- a/neo/sys/sys_local.h +++ b/neo/sys/sys_local.h @@ -48,7 +48,6 @@ public: virtual unsigned int GetMilliseconds( void ); virtual int GetProcessorId( void ); - virtual const char * FPU_GetState( void ); virtual bool FPU_StackIsEmpty( void ); virtual void FPU_SetFTZ( bool enable ); virtual void FPU_SetDAZ( bool enable ); diff --git a/neo/sys/sys_public.h b/neo/sys/sys_public.h index 0a63a69f..b28fb7b9 100644 --- a/neo/sys/sys_public.h +++ b/neo/sys/sys_public.h @@ -136,9 +136,6 @@ int Sys_GetProcessorId( void ); // returns true if the FPU stack is empty bool Sys_FPU_StackIsEmpty( void ); -// returns the FPU state as a string -const char * Sys_FPU_GetState( void ); - // sets the FPU precision void Sys_FPU_SetPrecision(); @@ -368,7 +365,6 @@ public: virtual unsigned int GetMilliseconds( void ) = 0; virtual int GetProcessorId( void ) = 0; - virtual const char * FPU_GetState( void ) = 0; virtual bool FPU_StackIsEmpty( void ) = 0; virtual void FPU_SetFTZ( bool enable ) = 0; virtual void FPU_SetDAZ( bool enable ) = 0; diff --git a/neo/sys/win32/win_cpu.cpp b/neo/sys/win32/win_cpu.cpp index 3e0c9c1f..4e0dc410 100644 --- a/neo/sys/win32/win_cpu.cpp +++ b/neo/sys/win32/win_cpu.cpp @@ -141,113 +141,3 @@ empty: return true; #endif } - -/* -=============== -Sys_FPU_GetState - - gets the FPU state without changing the state -=============== -*/ -const char *Sys_FPU_GetState( void ) { -#ifdef _MSC_VER - double fpuStack[8] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; - double *fpuStackPtr = fpuStack; - int i, numValues; - char *ptr; - - __asm { - mov esi, statePtr - mov edi, fpuStackPtr - fnstenv [esi] - mov esi, [esi+8] - xor esi, 0xFFFFFFFF - mov edx, (3<<14) - xor eax, eax - mov ecx, esi - and ecx, edx - jz done - fst qword ptr [edi+0] - inc eax - shr edx, 2 - mov ecx, esi - and ecx, edx - jz done - fxch st(1) - fst qword ptr [edi+8] - inc eax - fxch st(1) - shr edx, 2 - mov ecx, esi - and ecx, edx - jz done - fxch st(2) - fst qword ptr [edi+16] - inc eax - fxch st(2) - shr edx, 2 - mov ecx, esi - and ecx, edx - jz done - fxch st(3) - fst qword ptr [edi+24] - inc eax - fxch st(3) - shr edx, 2 - mov ecx, esi - and ecx, edx - jz done - fxch st(4) - fst qword ptr [edi+32] - inc eax - fxch st(4) - shr edx, 2 - mov ecx, esi - and ecx, edx - jz done - fxch st(5) - fst qword ptr [edi+40] - inc eax - fxch st(5) - shr edx, 2 - mov ecx, esi - and ecx, edx - jz done - fxch st(6) - fst qword ptr [edi+48] - inc eax - fxch st(6) - shr edx, 2 - mov ecx, esi - and ecx, edx - jz done - fxch st(7) - fst qword ptr [edi+56] - inc eax - fxch st(7) - done: - mov numValues, eax - } - - int ctrl = *(int *)&fpuState[0]; - int stat = *(int *)&fpuState[4]; - int tags = *(int *)&fpuState[8]; - int inof = *(int *)&fpuState[12]; - int inse = *(int *)&fpuState[16]; - int opof = *(int *)&fpuState[20]; - int opse = *(int *)&fpuState[24]; - - ptr = fpuString; - ptr += sprintf( ptr,"FPU State:\n" - "num values on stack = %d\n", numValues ); - for ( i = 0; i < 8; i++ ) { - ptr += sprintf( ptr, "ST%d = %1.10e\n", i, fpuStack[i] ); - } - - Sys_FPU_PrintStateFlags( ptr, ctrl, stat, tags, inof, inse, opof, opse ); - - return fpuString; -#else - return ""; -#endif -}