x86emitter: remove the never called SIMD_ExceptionTest function

This commit is contained in:
Gregory Hainaut 2015-11-28 22:02:08 +01:00
parent a026a1979f
commit d5efd6eacb
5 changed files with 0 additions and 110 deletions

View File

@ -114,7 +114,6 @@ public:
u32 CalculateMHz() const;
void SIMD_ExceptionTest();
void SIMD_EstablishMXCSRmask();
protected:

View File

@ -35,18 +35,6 @@ bool CanEmitShit()
return true;
}
bool CanTestInstructionSets()
{
// Not implemented yet for linux. (see cpudetect_internal.h for details)
return false;
}
bool _test_instruction( void* pfnCall )
{
// Not implemented yet for linux. (see cpudetect_internal.h for details)
return false;
}
// Not implemented yet for linux (see cpudetect_internal.h for details)
SingleCoreAffinity::SingleCoreAffinity() {}
SingleCoreAffinity::~SingleCoreAffinity() throw() {}

View File

@ -39,17 +39,6 @@ void x86capabilities::CountLogicalCores()
LogicalCores = CPUs;
}
bool _test_instruction( void* pfnCall )
{
__try {
u128 regsave;
((void (__fastcall *)(void*))pfnCall)( &regsave );
}
__except(EXCEPTION_EXECUTE_HANDLER) { return false; }
return true;
}
bool CanEmitShit()
{
// Under Windows, pre 0.9.6 versions of PCSX2 may not initialize the TLS
@ -65,11 +54,6 @@ bool CanEmitShit()
return true;
}
bool CanTestInstructionSets()
{
return CanEmitShit();
}
SingleCoreAffinity::SingleCoreAffinity()
{
s_threadId = NULL;

View File

@ -25,11 +25,6 @@ __aligned16 x86capabilities x86caps;
static __pagealigned u8 recSSE[__pagesize];
static __pagealigned u8 targetFXSAVE[512];
#ifdef __linux__
# include <sys/time.h>
# include <errno.h>
#endif
static const char* bool_to_char( bool testcond )
{
return testcond ? "true" : "false";
@ -322,77 +317,3 @@ u32 x86capabilities::CalculateMHz() const
else
return (u32)( _CPUSpeedHz( span / 500 ) / 2000 );
}
// Special extended version of SIMD testning, which uses exceptions to double-check the presence
// of SSE2/3/4 instructions. Useful if you don't trust cpuid (at least one report of an invalid
// cpuid has been reported on a Core2 Quad -- the user fixed it by clearing his CMOS).
//
// Results of CPU
void x86capabilities::SIMD_ExceptionTest()
{
HostSys::MemProtectStatic( recSSE, PageAccess_ReadWrite() );
//////////////////////////////////////////////////////////////////////////////////////////
// SIMD Instruction Support Detection (Second Pass)
//
if( CanTestInstructionSets() )
{
xSetPtr( recSSE );
xMOVDQU( ptr[ecx], xmm1 );
xMOVSLDUP( xmm1, xmm0 );
xMOVDQU( xmm1, ptr[ecx] );
xRET();
u8* funcSSSE3 = xGetPtr();
xMOVDQU( ptr[ecx], xmm1 );
xPABS.W( xmm1, xmm0 );
xMOVDQU( xmm1, ptr[ecx] );
xRET();
u8* funcSSE41 = xGetPtr();
xMOVDQU( ptr[ecx], xmm1 );
xBLEND.VPD( xmm1, xmm0 );
xMOVDQU( xmm1, ptr[ecx] );
xRET();
HostSys::MemProtectStatic( recSSE, PageAccess_ExecOnly() );
bool sse3_result = _test_instruction( recSSE ); // sse3
bool ssse3_result = _test_instruction( funcSSSE3 );
bool sse41_result = _test_instruction( funcSSE41 );
// Test for and log any irregularities here.
// We take the instruction test result over cpuid since (in theory) it should be a
// more reliable gauge of the cpu's actual ability. But since a difference in bit
// and actual ability may represent a cmos/bios problem, we report it to the user.
if( sse3_result != !!hasStreamingSIMD3Extensions )
{
Console.Warning( "SSE3 Detection Inconsistency: cpuid=%s, test_result=%s",
bool_to_char( !!hasStreamingSIMD3Extensions ), bool_to_char( sse3_result ) );
hasStreamingSIMD3Extensions = sse3_result;
}
if( ssse3_result != !!hasSupplementalStreamingSIMD3Extensions )
{
Console.Warning( "SSSE3 Detection Inconsistency: cpuid=%s, test_result=%s",
bool_to_char( !!hasSupplementalStreamingSIMD3Extensions ), bool_to_char( ssse3_result ) );
hasSupplementalStreamingSIMD3Extensions = ssse3_result;
}
if( sse41_result != !!hasStreamingSIMD4Extensions )
{
Console.Warning( "SSE4 Detection Inconsistency: cpuid=%s, test_result=%s",
bool_to_char( !!hasStreamingSIMD4Extensions ), bool_to_char( sse41_result ) );
hasStreamingSIMD4Extensions = sse41_result;
}
}
SIMD_EstablishMXCSRmask();
}

View File

@ -52,5 +52,3 @@ public:
//
extern bool CanEmitShit();
extern bool CanTestInstructionSets();
extern bool _test_instruction( void* pfnCall );