2009-07-03 00:49:40 +00:00
|
|
|
/* Cpudetection lib
|
2009-09-08 12:08:10 +00:00
|
|
|
* Copyright (C) 2002-2009 PCSX2 Dev Team
|
2009-10-05 11:05:11 +00:00
|
|
|
*
|
2009-09-08 12:08:10 +00:00
|
|
|
* PCSX2 is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU Lesser General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
2009-07-03 00:49:40 +00:00
|
|
|
*
|
2009-09-08 12:08:10 +00:00
|
|
|
* PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
2009-07-03 20:12:33 +00:00
|
|
|
*
|
2009-09-08 12:08:10 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with PCSX2.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
2009-07-03 00:49:40 +00:00
|
|
|
*/
|
2009-10-05 11:05:11 +00:00
|
|
|
|
2009-07-03 00:49:40 +00:00
|
|
|
#include "PrecompiledHeader.h"
|
2009-11-16 13:54:32 +00:00
|
|
|
#include "cpudetect_internal.h"
|
2009-10-07 19:20:11 +00:00
|
|
|
#include "internal.h"
|
|
|
|
|
2009-07-03 00:49:40 +00:00
|
|
|
using namespace x86Emitter;
|
|
|
|
|
2009-10-05 02:15:49 +00:00
|
|
|
__aligned16 x86CPU_INFO x86caps;
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
#ifdef __LINUX__
|
|
|
|
# include <sys/time.h>
|
|
|
|
# include <errno.h>
|
|
|
|
#endif
|
|
|
|
|
2009-11-16 14:08:53 +00:00
|
|
|
static const char* bool_to_char( bool testcond )
|
2009-07-03 00:49:40 +00:00
|
|
|
{
|
2009-11-16 13:54:32 +00:00
|
|
|
return testcond ? "true" : "false";
|
2009-07-03 00:49:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
static s64 CPUSpeedHz( u64 time )
|
|
|
|
{
|
|
|
|
u64 timeStart, timeStop;
|
|
|
|
s64 startTick, endTick;
|
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
if( ! x86caps.hasTimeStampCounter )
|
2009-11-16 13:54:32 +00:00
|
|
|
return 0;
|
2009-07-03 00:49:40 +00:00
|
|
|
|
2009-11-16 13:54:32 +00:00
|
|
|
SingleCoreAffinity affinity_lock;
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
// Align the cpu execution to a cpuTick boundary.
|
|
|
|
|
|
|
|
do { timeStart = GetCPUTicks();
|
|
|
|
} while( GetCPUTicks() == timeStart );
|
|
|
|
|
|
|
|
do
|
|
|
|
{
|
2009-11-16 13:54:32 +00:00
|
|
|
timeStop = GetCPUTicks();
|
|
|
|
startTick = __rdtsc();
|
2009-07-03 00:49:40 +00:00
|
|
|
} while( ( timeStop - timeStart ) == 0 );
|
|
|
|
|
|
|
|
timeStart = timeStop;
|
|
|
|
do
|
|
|
|
{
|
|
|
|
timeStop = GetCPUTicks();
|
2009-11-16 13:54:32 +00:00
|
|
|
endTick = __rdtsc();
|
2009-07-03 00:49:40 +00:00
|
|
|
}
|
|
|
|
while( ( timeStop - timeStart ) < time );
|
|
|
|
|
|
|
|
return (s64)( endTick - startTick );
|
|
|
|
}
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////
|
2009-07-03 20:12:33 +00:00
|
|
|
void cpudetectInit()
|
2009-07-03 00:49:40 +00:00
|
|
|
{
|
2009-12-07 22:43:16 +00:00
|
|
|
u32 regs[ 4 ];
|
|
|
|
u32 cmds;
|
|
|
|
//AMD 64 STUFF
|
|
|
|
u32 x86_64_8BITBRANDID;
|
|
|
|
u32 x86_64_12BITBRANDID;
|
|
|
|
|
|
|
|
memzero( x86caps.VendorName );
|
|
|
|
x86caps.FamilyID = 0;
|
|
|
|
x86caps.Model = 0;
|
|
|
|
x86caps.TypeID = 0;
|
|
|
|
x86caps.StepID = 0;
|
|
|
|
x86caps.Flags = 0;
|
|
|
|
x86caps.EFlags = 0;
|
|
|
|
|
|
|
|
//memzero( regs );
|
|
|
|
iCpuId( 0, regs );
|
|
|
|
|
|
|
|
cmds = regs[ 0 ];
|
|
|
|
((u32*)x86caps.VendorName)[ 0 ] = regs[ 1 ];
|
|
|
|
((u32*)x86caps.VendorName)[ 1 ] = regs[ 3 ];
|
|
|
|
((u32*)x86caps.VendorName)[ 2 ] = regs[ 2 ];
|
|
|
|
|
|
|
|
u32 LogicalCoresPerPhysicalCPU = 0;
|
|
|
|
u32 PhysicalCoresPerPhysicalCPU = 1;
|
|
|
|
|
|
|
|
if ( cmds >= 0x00000001 )
|
|
|
|
{
|
|
|
|
iCpuId( 0x00000001, regs );
|
|
|
|
|
|
|
|
x86caps.StepID = regs[ 0 ] & 0xf;
|
|
|
|
x86caps.Model = (regs[ 0 ] >> 4) & 0xf;
|
|
|
|
x86caps.FamilyID = (regs[ 0 ] >> 8) & 0xf;
|
|
|
|
x86caps.TypeID = (regs[ 0 ] >> 12) & 0x3;
|
|
|
|
x86_64_8BITBRANDID = regs[ 1 ] & 0xff;
|
|
|
|
x86caps.Flags = regs[ 3 ];
|
|
|
|
x86caps.Flags2 = regs[ 2 ];
|
|
|
|
|
|
|
|
LogicalCoresPerPhysicalCPU = ( regs[1] >> 16 ) & 0xff;
|
|
|
|
}
|
|
|
|
|
|
|
|
// detect multicore for Intel cpu
|
|
|
|
|
|
|
|
if ((cmds >= 0x00000004) && !strcmp("GenuineIntel",x86caps.VendorName))
|
|
|
|
{
|
|
|
|
iCpuId( 0x00000004, regs );
|
|
|
|
PhysicalCoresPerPhysicalCPU += ( regs[0] >> 26) & 0x3f;
|
|
|
|
}
|
|
|
|
|
|
|
|
iCpuId( 0x80000000, regs );
|
|
|
|
cmds = regs[ 0 ];
|
|
|
|
if ( cmds >= 0x80000001 )
|
|
|
|
{
|
|
|
|
iCpuId( 0x80000001, regs );
|
|
|
|
|
|
|
|
x86_64_12BITBRANDID = regs[1] & 0xfff;
|
|
|
|
x86caps.EFlags2 = regs[ 2 ];
|
|
|
|
x86caps.EFlags = regs[ 3 ];
|
|
|
|
}
|
|
|
|
|
|
|
|
// detect multicore for AMD cpu
|
|
|
|
|
|
|
|
if ((cmds >= 0x80000008) && !strcmp("AuthenticAMD",x86caps.VendorName))
|
|
|
|
{
|
|
|
|
iCpuId( 0x80000008, regs );
|
|
|
|
PhysicalCoresPerPhysicalCPU += ( regs[2] ) & 0xff;
|
|
|
|
}
|
2009-07-03 20:12:33 +00:00
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
switch(x86caps.TypeID)
|
2009-07-03 00:49:40 +00:00
|
|
|
{
|
|
|
|
case 0:
|
2009-07-29 14:00:00 +00:00
|
|
|
strcpy( x86caps.TypeName, "Standard OEM");
|
2009-07-03 00:49:40 +00:00
|
|
|
break;
|
|
|
|
case 1:
|
2009-07-29 14:00:00 +00:00
|
|
|
strcpy( x86caps.TypeName, "Overdrive");
|
2009-07-03 00:49:40 +00:00
|
|
|
break;
|
|
|
|
case 2:
|
2009-07-29 14:00:00 +00:00
|
|
|
strcpy( x86caps.TypeName, "Dual");
|
2009-07-03 00:49:40 +00:00
|
|
|
break;
|
|
|
|
case 3:
|
2009-07-29 14:00:00 +00:00
|
|
|
strcpy( x86caps.TypeName, "Reserved");
|
2009-07-03 00:49:40 +00:00
|
|
|
break;
|
|
|
|
default:
|
2009-07-29 14:00:00 +00:00
|
|
|
strcpy( x86caps.TypeName, "Unknown");
|
2009-07-03 00:49:40 +00:00
|
|
|
break;
|
|
|
|
}
|
2009-11-02 07:00:59 +00:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
// vendor identification, currently unneeded.
|
|
|
|
// It's really not recommended that we base much (if anything) on CPU vendor names.
|
|
|
|
// But the code is left in as an ifdef, for possible future reference.
|
|
|
|
|
|
|
|
int cputype=0; // Cpu type
|
|
|
|
static const char* Vendor_Intel = "GenuineIntel";
|
|
|
|
static const char* Vendor_AMD = "AuthenticAMD";
|
|
|
|
|
|
|
|
if( memcmp( x86caps.VendorName, Vendor_Intel, 12 ) == 0 ) { cputype = 0; } else
|
|
|
|
if( memcmp( x86caps.VendorName, Vendor_AMD, 12 ) == 0 ) { cputype = 1; }
|
|
|
|
|
|
|
|
if ( x86caps.VendorName[ 0 ] == 'G' ) { cputype = 0; }
|
|
|
|
if ( x86caps.VendorName[ 0 ] == 'A' ) { cputype = 1; }
|
|
|
|
#endif
|
2009-07-03 20:12:33 +00:00
|
|
|
|
2009-09-23 12:53:32 +00:00
|
|
|
memzero( x86caps.FamilyName );
|
2009-07-29 14:00:00 +00:00
|
|
|
iCpuId( 0x80000002, (u32*)x86caps.FamilyName);
|
|
|
|
iCpuId( 0x80000003, (u32*)(x86caps.FamilyName+16));
|
|
|
|
iCpuId( 0x80000004, (u32*)(x86caps.FamilyName+32));
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
//capabilities
|
2009-07-29 14:00:00 +00:00
|
|
|
x86caps.hasFloatingPointUnit = ( x86caps.Flags >> 0 ) & 1;
|
|
|
|
x86caps.hasVirtual8086ModeEnhancements = ( x86caps.Flags >> 1 ) & 1;
|
|
|
|
x86caps.hasDebuggingExtensions = ( x86caps.Flags >> 2 ) & 1;
|
|
|
|
x86caps.hasPageSizeExtensions = ( x86caps.Flags >> 3 ) & 1;
|
|
|
|
x86caps.hasTimeStampCounter = ( x86caps.Flags >> 4 ) & 1;
|
|
|
|
x86caps.hasModelSpecificRegisters = ( x86caps.Flags >> 5 ) & 1;
|
|
|
|
x86caps.hasPhysicalAddressExtension = ( x86caps.Flags >> 6 ) & 1;
|
|
|
|
x86caps.hasMachineCheckArchitecture = ( x86caps.Flags >> 7 ) & 1;
|
|
|
|
x86caps.hasCOMPXCHG8BInstruction = ( x86caps.Flags >> 8 ) & 1;
|
|
|
|
x86caps.hasAdvancedProgrammableInterruptController = ( x86caps.Flags >> 9 ) & 1;
|
|
|
|
x86caps.hasSEPFastSystemCall = ( x86caps.Flags >> 11 ) & 1;
|
|
|
|
x86caps.hasMemoryTypeRangeRegisters = ( x86caps.Flags >> 12 ) & 1;
|
|
|
|
x86caps.hasPTEGlobalFlag = ( x86caps.Flags >> 13 ) & 1;
|
|
|
|
x86caps.hasMachineCheckArchitecture = ( x86caps.Flags >> 14 ) & 1;
|
|
|
|
x86caps.hasConditionalMoveAndCompareInstructions = ( x86caps.Flags >> 15 ) & 1;
|
|
|
|
x86caps.hasFGPageAttributeTable = ( x86caps.Flags >> 16 ) & 1;
|
|
|
|
x86caps.has36bitPageSizeExtension = ( x86caps.Flags >> 17 ) & 1;
|
|
|
|
x86caps.hasProcessorSerialNumber = ( x86caps.Flags >> 18 ) & 1;
|
|
|
|
x86caps.hasCFLUSHInstruction = ( x86caps.Flags >> 19 ) & 1;
|
|
|
|
x86caps.hasDebugStore = ( x86caps.Flags >> 21 ) & 1;
|
|
|
|
x86caps.hasACPIThermalMonitorAndClockControl = ( x86caps.Flags >> 22 ) & 1;
|
|
|
|
x86caps.hasMultimediaExtensions = ( x86caps.Flags >> 23 ) & 1; //mmx
|
|
|
|
x86caps.hasFastStreamingSIMDExtensionsSaveRestore = ( x86caps.Flags >> 24 ) & 1;
|
|
|
|
x86caps.hasStreamingSIMDExtensions = ( x86caps.Flags >> 25 ) & 1; //sse
|
|
|
|
x86caps.hasStreamingSIMD2Extensions = ( x86caps.Flags >> 26 ) & 1; //sse2
|
|
|
|
x86caps.hasSelfSnoop = ( x86caps.Flags >> 27 ) & 1;
|
|
|
|
x86caps.hasMultiThreading = ( x86caps.Flags >> 28 ) & 1;
|
|
|
|
x86caps.hasThermalMonitor = ( x86caps.Flags >> 29 ) & 1;
|
|
|
|
x86caps.hasIntel64BitArchitecture = ( x86caps.Flags >> 30 ) & 1;
|
2009-07-03 20:12:33 +00:00
|
|
|
|
2009-07-03 00:49:40 +00:00
|
|
|
//that is only for AMDs
|
2009-07-29 14:00:00 +00:00
|
|
|
x86caps.hasMultimediaExtensionsExt = ( x86caps.EFlags >> 22 ) & 1; //mmx2
|
|
|
|
x86caps.hasAMD64BitArchitecture = ( x86caps.EFlags >> 29 ) & 1; //64bit cpu
|
|
|
|
x86caps.has3DNOWInstructionExtensionsExt = ( x86caps.EFlags >> 30 ) & 1; //3dnow+
|
|
|
|
x86caps.has3DNOWInstructionExtensions = ( x86caps.EFlags >> 31 ) & 1; //3dnow
|
|
|
|
x86caps.hasStreamingSIMD4ExtensionsA = ( x86caps.EFlags2 >> 6 ) & 1; //INSERTQ / EXTRQ / MOVNT
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
InitCPUTicks();
|
|
|
|
u64 span = GetTickFrequency();
|
|
|
|
|
|
|
|
if( (span % 1000) < 400 ) // helps minimize rounding errors
|
2009-07-29 14:00:00 +00:00
|
|
|
x86caps.Speed = (u32)( CPUSpeedHz( span / 1000 ) / 1000 );
|
2009-07-03 00:49:40 +00:00
|
|
|
else
|
2009-07-29 14:00:00 +00:00
|
|
|
x86caps.Speed = (u32)( CPUSpeedHz( span / 500 ) / 2000 );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
// --> SSE3 / SSSE3 / SSE4.1 / SSE 4.2 detection <--
|
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
x86caps.hasStreamingSIMD3Extensions = ( x86caps.Flags2 >> 0 ) & 1; //sse3
|
|
|
|
x86caps.hasSupplementalStreamingSIMD3Extensions = ( x86caps.Flags2 >> 9 ) & 1; //ssse3
|
|
|
|
x86caps.hasStreamingSIMD4Extensions = ( x86caps.Flags2 >> 19 ) & 1; //sse4.1
|
|
|
|
x86caps.hasStreamingSIMD4Extensions2 = ( x86caps.Flags2 >> 20 ) & 1; //sse4.2
|
2009-07-03 00:49:40 +00:00
|
|
|
|
2009-11-02 07:00:59 +00:00
|
|
|
static __pagealigned u8 recSSE[__pagesize];
|
|
|
|
HostSys::MemProtectStatic( recSSE, Protect_ReadWrite, true );
|
|
|
|
|
2009-07-03 00:49:40 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////
|
2009-11-16 13:54:32 +00:00
|
|
|
// SIMD Instruction Support Detection (Second Pass)
|
2009-07-03 00:49:40 +00:00
|
|
|
//
|
|
|
|
|
2009-11-16 13:54:32 +00:00
|
|
|
if( CanTestInstructionSets() )
|
2009-07-03 00:49:40 +00:00
|
|
|
{
|
|
|
|
xSetPtr( recSSE );
|
2009-12-07 22:43:16 +00:00
|
|
|
xMOVDQU( ptr[ecx], xmm1 );
|
2009-07-03 00:49:40 +00:00
|
|
|
xMOVSLDUP( xmm1, xmm0 );
|
2009-12-07 22:43:16 +00:00
|
|
|
xMOVDQU( xmm1, ptr[ecx] );
|
2009-07-03 00:49:40 +00:00
|
|
|
xRET();
|
|
|
|
|
|
|
|
u8* funcSSSE3 = xGetPtr();
|
2009-12-07 22:43:16 +00:00
|
|
|
xMOVDQU( ptr[ecx], xmm1 );
|
|
|
|
xPABS.W( xmm1, xmm0 );
|
|
|
|
xMOVDQU( xmm1, ptr[ecx] );
|
2009-07-03 00:49:40 +00:00
|
|
|
xRET();
|
|
|
|
|
|
|
|
u8* funcSSE41 = xGetPtr();
|
2009-12-07 22:43:16 +00:00
|
|
|
xMOVDQU( ptr[ecx], xmm1 );
|
2009-07-03 00:49:40 +00:00
|
|
|
xBLEND.VPD( xmm1, xmm0 );
|
2009-12-07 22:43:16 +00:00
|
|
|
xMOVDQU( xmm1, ptr[ecx] );
|
2009-07-03 00:49:40 +00:00
|
|
|
xRET();
|
2009-07-03 20:12:33 +00:00
|
|
|
|
2009-07-03 00:49:40 +00:00
|
|
|
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.
|
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
if( sse3_result != !!x86caps.hasStreamingSIMD3Extensions )
|
2009-07-03 00:49:40 +00:00
|
|
|
{
|
2009-10-29 13:32:40 +00:00
|
|
|
Console.Warning( "SSE3 Detection Inconsistency: cpuid=%s, test_result=%s",
|
2009-09-08 05:37:40 +00:00
|
|
|
bool_to_char( !!x86caps.hasStreamingSIMD3Extensions ), bool_to_char( sse3_result ) );
|
2009-07-03 20:12:33 +00:00
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
x86caps.hasStreamingSIMD3Extensions = sse3_result;
|
2009-07-03 00:49:40 +00:00
|
|
|
}
|
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
if( ssse3_result != !!x86caps.hasSupplementalStreamingSIMD3Extensions )
|
2009-07-03 00:49:40 +00:00
|
|
|
{
|
2009-10-29 13:32:40 +00:00
|
|
|
Console.Warning( "SSSE3 Detection Inconsistency: cpuid=%s, test_result=%s",
|
2009-09-08 05:37:40 +00:00
|
|
|
bool_to_char( !!x86caps.hasSupplementalStreamingSIMD3Extensions ), bool_to_char( ssse3_result ) );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
x86caps.hasSupplementalStreamingSIMD3Extensions = ssse3_result;
|
2009-07-03 00:49:40 +00:00
|
|
|
}
|
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
if( sse41_result != !!x86caps.hasStreamingSIMD4Extensions )
|
2009-07-03 00:49:40 +00:00
|
|
|
{
|
2009-10-29 13:32:40 +00:00
|
|
|
Console.Warning( "SSE4 Detection Inconsistency: cpuid=%s, test_result=%s",
|
2009-09-08 05:37:40 +00:00
|
|
|
bool_to_char( !!x86caps.hasStreamingSIMD4Extensions ), bool_to_char( sse41_result ) );
|
2009-07-03 00:49:40 +00:00
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
x86caps.hasStreamingSIMD4Extensions = sse41_result;
|
2009-07-03 00:49:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-10-29 13:32:40 +00:00
|
|
|
Console.Warning(
|
2009-07-03 00:49:40 +00:00
|
|
|
"Notice: Could not allocate memory for SSE3/4 detection.\n"
|
|
|
|
"\tRelying on CPUID results. [this is not an error]"
|
|
|
|
);
|
|
|
|
}
|
2009-11-02 16:26:35 +00:00
|
|
|
|
2009-11-02 07:00:59 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Establish MXCSR Mask...
|
|
|
|
|
2009-11-02 13:42:28 +00:00
|
|
|
MXCSR_Mask.bitmask = 0xFFBF;
|
|
|
|
if( x86caps.hasFastStreamingSIMDExtensionsSaveRestore )
|
2009-11-02 07:00:59 +00:00
|
|
|
{
|
2009-11-02 16:26:35 +00:00
|
|
|
// the fxsave buffer should be 16-byte aligned. I just save it to an unused portion of
|
|
|
|
// recSSE, since it has plenty of room to spare.
|
|
|
|
|
2009-11-02 07:00:59 +00:00
|
|
|
xSetPtr( recSSE );
|
2009-11-02 16:26:35 +00:00
|
|
|
xFXSAVE( recSSE + 1024 );
|
2009-11-02 07:00:59 +00:00
|
|
|
xRET();
|
|
|
|
|
2009-11-02 13:42:28 +00:00
|
|
|
CallAddress( recSSE );
|
2009-11-02 07:00:59 +00:00
|
|
|
|
2009-11-02 16:26:35 +00:00
|
|
|
u32 result = (u32&)recSSE[1024+28]; // bytes 28->32 are the MXCSR_Mask.
|
2009-11-02 13:42:28 +00:00
|
|
|
if( result != 0 )
|
|
|
|
MXCSR_Mask.bitmask = result;
|
2009-11-02 07:00:59 +00:00
|
|
|
}
|
2009-07-03 00:49:40 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Core Counting!
|
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
if( !x86caps.hasMultiThreading || LogicalCoresPerPhysicalCPU == 0 )
|
2009-07-03 00:49:40 +00:00
|
|
|
LogicalCoresPerPhysicalCPU = 1;
|
|
|
|
|
2009-07-29 14:00:00 +00:00
|
|
|
// This will assign values into x86caps.LogicalCores and PhysicalCores
|
2009-11-16 13:54:32 +00:00
|
|
|
CountLogicalCores( LogicalCoresPerPhysicalCPU, PhysicalCoresPerPhysicalCPU );
|
2009-07-03 00:49:40 +00:00
|
|
|
}
|
|
|
|
|