Get rid of Sys_FPU_StackIsEmpty()

Same as with Sys_FPU_GetState().
This commit is contained in:
dhewg 2012-07-05 23:01:39 +02:00
parent 0ccef1eba8
commit b58f51dbfa
11 changed files with 0 additions and 74 deletions

View file

@ -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; }
bool idSysLocal::FPU_StackIsEmpty( void ) { return true; }
void idSysLocal::FPU_SetFTZ( bool enable ) {}
void idSysLocal::FPU_SetDAZ( bool enable ) {}

View file

@ -2656,10 +2656,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const {
float ratio_x;
float ratio_y;
if ( !sys->FPU_StackIsEmpty() ) {
Error( "idGameLocal::CalcFov: FPU stack not empty" );
}
// first, calculate the vertical fov based on a 640x480 view
x = 640.0f / tan( base_fov / 360.0f * idMath::PI );
y = atan2( 480.0f, x );

View file

@ -561,14 +561,6 @@ void idEvent::ServiceEvents( void ) {
assert( event->object );
event->object->ProcessEventArgPtr( ev, args );
#if 0
// event functions may never leave return values on the FPU stack
// enable this code to check if any event call left values on the FPU stack
if ( !sys->FPU_StackIsEmpty() ) {
gameLocal.Error( "idEvent::ServiceEvents %d: %s left a value on the FPU stack\n", num, ev->GetName() );
}
#endif
// return the event to the free list
event->Free();
@ -661,14 +653,6 @@ void idEvent::ServiceFastEvents() {
assert( event->object );
event->object->ProcessEventArgPtr( ev, args );
#if 0
// event functions may never leave return values on the FPU stack
// enable this code to check if any event call left values on the FPU stack
if ( !sys->FPU_StackIsEmpty() ) {
gameLocal.Error( "idEvent::ServiceEvents %d: %s left a value on the FPU stack\n", num, event->eventdef->GetName() );
}
#endif
// return the event to the free list
event->Free();

View file

@ -2426,11 +2426,6 @@ void idCommonLocal::Frame( void ) {
// set idLib frame number for frame based memory dumps
idLib::frameNumber = com_frameNumber;
// 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() ) {
FatalError( "idCommon::Frame: the FPU stack is not empty at the end of the frame\n" );
}
}
catch( idException & ) {

View file

@ -2391,10 +2391,6 @@ void idGameLocal::CalcFov( float base_fov, float &fov_x, float &fov_y ) const {
float ratio_x;
float ratio_y;
if ( !sys->FPU_StackIsEmpty() ) {
Error( "idGameLocal::CalcFov: FPU stack not empty" );
}
// first, calculate the vertical fov based on a 640x480 view
x = 640.0f / tan( base_fov / 360.0f * idMath::PI );
y = atan2( 480.0f, x );

View file

@ -528,14 +528,6 @@ void idEvent::ServiceEvents( void ) {
assert( event->object );
event->object->ProcessEventArgPtr( ev, args );
#if 0
// event functions may never leave return values on the FPU stack
// enable this code to check if any event call left values on the FPU stack
if ( !sys->FPU_StackIsEmpty() ) {
gameLocal.Error( "idEvent::ServiceEvents %d: %s left a value on the FPU stack\n", num, ev->GetName() );
}
#endif
// return the event to the free list
event->Free();

View file

@ -315,10 +315,6 @@ void Sys_SetClipboardData( const char *string ) {
Sys_Printf( "TODO: Sys_SetClipboardData\n" );
}
bool Sys_FPU_StackIsEmpty( void ) {
return true;
}
/*
================
Sys_LockMemory

View file

@ -61,10 +61,6 @@ int idSysLocal::GetProcessorId( void ) {
return Sys_GetProcessorId();
}
bool idSysLocal::FPU_StackIsEmpty( void ) {
return Sys_FPU_StackIsEmpty();
}
void idSysLocal::FPU_SetFTZ( bool enable ) {
Sys_FPU_SetFTZ( enable );
}

View file

@ -48,7 +48,6 @@ public:
virtual unsigned int GetMilliseconds( void );
virtual int GetProcessorId( void );
virtual bool FPU_StackIsEmpty( void );
virtual void FPU_SetFTZ( bool enable );
virtual void FPU_SetDAZ( bool enable );

View file

@ -133,9 +133,6 @@ unsigned int Sys_Milliseconds( void );
// returns a selection of the CPUID_* flags
int Sys_GetProcessorId( void );
// returns true if the FPU stack is empty
bool Sys_FPU_StackIsEmpty( void );
// sets the FPU precision
void Sys_FPU_SetPrecision();
@ -365,7 +362,6 @@ public:
virtual unsigned int GetMilliseconds( void ) = 0;
virtual int GetProcessorId( void ) = 0;
virtual bool FPU_StackIsEmpty( void ) = 0;
virtual void FPU_SetFTZ( bool enable ) = 0;
virtual void FPU_SetDAZ( bool enable ) = 0;

View file

@ -118,26 +118,3 @@ int Sys_FPU_PrintStateFlags( char *ptr, int ctrl, int stat, int tags, int inof,
return 0;
#endif
}
/*
===============
Sys_FPU_StackIsEmpty
===============
*/
bool Sys_FPU_StackIsEmpty( void ) {
#ifdef _MSC_VER
__asm {
mov eax, statePtr
fnstenv [eax]
mov eax, [eax+8]
xor eax, 0xFFFFFFFF
and eax, 0x0000FFFF
jz empty
}
return false;
empty:
return true;
#else
return true;
#endif
}