Get rid of Sys_GetProcessorString()

This was only used for a printf() and not implemented for all
the platforms we can now run on.
We also don't want to force a CPU type on Windows.
This commit is contained in:
dhewg 2011-12-21 22:59:49 +01:00
parent 4150029322
commit d4281b56bf
9 changed files with 0 additions and 120 deletions

View file

@ -208,7 +208,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::GetProcessorString( void ) { return ""; }
const char * idSysLocal::FPU_GetState( void ) { return ""; }
bool idSysLocal::FPU_StackIsEmpty( void ) { return true; }
void idSysLocal::FPU_SetFTZ( bool enable ) {}

View file

@ -1800,7 +1800,6 @@ static void GfxInfo_f( const idCmdArgs &args ) {
} else {
common->Printf( "N/A\n" );
}
common->Printf( "CPU: %s\n", Sys_GetProcessorString() );
const char *active[2] = { "", " (ACTIVE)" };
common->Printf( "ARB path ENABLED%s\n", active[tr.backEndRenderer == BE_ARB] );

View file

@ -153,8 +153,6 @@ void Sys_Shutdown( void ) {
Sys_GetProcessorId
===============
*/
static char cpustring[13] = "generic\0";
#if defined(__x86_64__) || defined(__i386__)
#if __x86_64__
# define REG_b "rbx"
@ -176,19 +174,10 @@ static char cpustring[13] = "generic\0";
int Sys_GetProcessorId( void ) {
int eax, ebx, ecx, edx;
int max_std_level, max_ext_level, std_caps=0, ext_caps=0;
union { int i[3]; char c[12]; } vendor;
int i = CPUID_GENERIC;
cpuid(0, max_std_level, ebx, ecx, edx);
vendor.i[0] = ebx;
vendor.i[1] = edx;
vendor.i[2] = ecx;
strncpy(cpustring, vendor.c, 12);
cpustring[12] = 0;
Sys_Printf("Detected '%s' CPU with", cpustring);
if (max_std_level >= 1) {
cpuid(1, eax, ebx, ecx, std_caps);
@ -249,15 +238,6 @@ int Sys_GetProcessorId( void ) {
}
#endif
/*
===============
Sys_GetProcessorString
===============
*/
const char *Sys_GetProcessorString( void ) {
return cpustring;
}
/*
===============
Sys_FPU_EnableExceptions

View file

@ -480,22 +480,6 @@ int Sys_GetProcessorId( void ) {
return cpuid;
}
/*
===============
Sys_GetProcessorString
===============
*/
const char *Sys_GetProcessorString( void ) {
#if defined(__ppc__)
return "ppc CPU with AltiVec extensions";
#elif defined(__i386__)
return "x86 CPU with MMX/SSE/SSE2/SSE3 extensions";
#else
#error
return NULL;
#endif
}
/*
===============
Sys_FPU_EnableExceptions

View file

@ -61,10 +61,6 @@ int idSysLocal::GetProcessorId( void ) {
return Sys_GetProcessorId();
}
const char *idSysLocal::GetProcessorString( void ) {
return Sys_GetProcessorString();
}
const char *idSysLocal::FPU_GetState( void ) {
return Sys_FPU_GetState();
}

View file

@ -48,7 +48,6 @@ public:
virtual unsigned int GetMilliseconds( void );
virtual int GetProcessorId( void );
virtual const char * GetProcessorString( void );
virtual const char * FPU_GetState( void );
virtual bool FPU_StackIsEmpty( void );
virtual void FPU_SetFTZ( bool enable );

View file

@ -147,7 +147,6 @@ unsigned int Sys_Milliseconds( void );
// returns a selection of the CPUID_* flags
int Sys_GetProcessorId( void );
const char * Sys_GetProcessorString( void );
// returns true if the FPU stack is empty
bool Sys_FPU_StackIsEmpty( void );
@ -405,7 +404,6 @@ public:
virtual unsigned int GetMilliseconds( void ) = 0;
virtual int GetProcessorId( void ) = 0;
virtual const char * GetProcessorString( void ) = 0;
virtual const char * FPU_GetState( void ) = 0;
virtual bool FPU_StackIsEmpty( void ) = 0;
virtual void FPU_SetFTZ( bool enable ) = 0;

View file

@ -152,7 +152,6 @@ struct Win32Vars_t {
// desktop gamma is saved here for restoration at exit
static idCVar sys_arch;
static idCVar sys_cpustring;
static idCVar in_mouse;
static idCVar win_allowAltTab;
static idCVar win_notaskkeys;

View file

@ -53,7 +53,6 @@ If you have questions concerning this license or the applicable additional terms
#include <SDL_main.h>
idCVar Win32Vars_t::sys_arch( "sys_arch", "", CVAR_SYSTEM | CVAR_INIT, "" );
idCVar Win32Vars_t::sys_cpustring( "sys_cpustring", "detect", CVAR_SYSTEM | CVAR_INIT, "" );
idCVar Win32Vars_t::in_mouse( "in_mouse", "1", CVAR_SYSTEM | CVAR_BOOL, "enable mouse input" );
idCVar Win32Vars_t::win_allowAltTab( "win_allowAltTab", "0", CVAR_SYSTEM | CVAR_BOOL, "allow Alt-Tab when fullscreen" );
idCVar Win32Vars_t::win_notaskkeys( "win_notaskkeys", "0", CVAR_SYSTEM | CVAR_INTEGER, "disable windows task keys" );
@ -846,70 +845,6 @@ void Sys_Init( void ) {
win32.sys_arch.SetString( "unknown Windows variant" );
}
//
// CPU type
//
if ( !idStr::Icmp( win32.sys_cpustring.GetString(), "detect" ) ) {
idStr string;
win32.cpuid = Sys_GetCPUId();
string.Clear();
if ( win32.cpuid & CPUID_UNSUPPORTED ) {
string += "unsupported CPU";
} else {
string += "CPU";
}
string += " with ";
if ( win32.cpuid & CPUID_MMX ) {
string += "MMX & ";
}
if ( win32.cpuid & CPUID_3DNOW ) {
string += "3DNow! & ";
}
if ( win32.cpuid & CPUID_SSE ) {
string += "SSE & ";
}
if ( win32.cpuid & CPUID_SSE2 ) {
string += "SSE2 & ";
}
if ( win32.cpuid & CPUID_SSE3 ) {
string += "SSE3 & ";
}
string.StripTrailing( " & " );
string.StripTrailing( " with " );
win32.sys_cpustring.SetString( string );
} else {
common->Printf( "forcing CPU type to " );
idLexer src( win32.sys_cpustring.GetString(), idStr::Length( win32.sys_cpustring.GetString() ), "sys_cpustring" );
idToken token;
int id = CPUID_NONE;
while( src.ReadToken( &token ) ) {
if ( token.Icmp( "generic" ) == 0 ) {
id |= CPUID_GENERIC;
} else if ( token.Icmp( "mmx" ) == 0 ) {
id |= CPUID_MMX;
} else if ( token.Icmp( "3dnow" ) == 0 ) {
id |= CPUID_3DNOW;
} else if ( token.Icmp( "sse" ) == 0 ) {
id |= CPUID_SSE;
} else if ( token.Icmp( "sse2" ) == 0 ) {
id |= CPUID_SSE2;
} else if ( token.Icmp( "sse3" ) == 0 ) {
id |= CPUID_SSE3;
}
}
if ( id == CPUID_NONE ) {
common->Printf( "WARNING: unknown sys_cpustring '%s'\n", win32.sys_cpustring.GetString() );
id = CPUID_GENERIC;
}
win32.cpuid = id;
}
common->Printf( "%s\n", win32.sys_cpustring.GetString() );
common->Printf( "%d MB System Memory\n", Sys_GetSystemRam() );
common->Printf( "%d MB Video Memory\n", Sys_GetVideoRam() );
}
@ -932,15 +867,6 @@ int Sys_GetProcessorId( void ) {
return win32.cpuid;
}
/*
================
Sys_GetProcessorString
================
*/
const char *Sys_GetProcessorString( void ) {
return win32.sys_cpustring.GetString();
}
//=======================================================================
//#define SET_THREAD_AFFINITY