mirror of https://github.com/AxioDL/zeus.git
Merge branch 'master' of https://github.com/AxioDL/MathLib
This commit is contained in:
commit
b4ed5b78dc
|
@ -16,8 +16,8 @@ namespace Zeus
|
||||||
{
|
{
|
||||||
struct CPUInfo
|
struct CPUInfo
|
||||||
{
|
{
|
||||||
const char cpuBrand [32] = {0};
|
const char cpuBrand [48] = {0};
|
||||||
const char cpuVendor[64] = {0};
|
const char cpuVendor[32] = {0};
|
||||||
const bool isIntel = false;
|
const bool isIntel = false;
|
||||||
const bool SSE1 = false;
|
const bool SSE1 = false;
|
||||||
const bool SSE2 = false;
|
const bool SSE2 = false;
|
||||||
|
|
22
src/Math.cpp
22
src/Math.cpp
|
@ -35,16 +35,20 @@ void detectCPU()
|
||||||
*reinterpret_cast<int*>((char*)g_cpuFeatures.cpuVendor) = regs[1];
|
*reinterpret_cast<int*>((char*)g_cpuFeatures.cpuVendor) = regs[1];
|
||||||
*reinterpret_cast<int*>((char*)g_cpuFeatures.cpuVendor + 4) = regs[3];
|
*reinterpret_cast<int*>((char*)g_cpuFeatures.cpuVendor + 4) = regs[3];
|
||||||
*reinterpret_cast<int*>((char*)g_cpuFeatures.cpuVendor + 8) = regs[2];
|
*reinterpret_cast<int*>((char*)g_cpuFeatures.cpuVendor + 8) = regs[2];
|
||||||
for (unsigned int i = 0x80000002; i < 0x80000004; i++)
|
getCpuInfo(0x80000000, regs);
|
||||||
|
if (regs[0] >= 0x80000004)
|
||||||
{
|
{
|
||||||
getCpuInfo(i, regs);
|
for (unsigned int i = 0x80000002; i <= 0x80000004; i++)
|
||||||
// Interpret CPU brand string and cache information.
|
{
|
||||||
if (i == 0x80000002)
|
getCpuInfo(i, regs);
|
||||||
memcpy((char*)g_cpuFeatures.cpuBrand, regs, sizeof(regs));
|
// Interpret CPU brand string and cache information.
|
||||||
else if( i == 0x80000003 )
|
if (i == 0x80000002)
|
||||||
memcpy((char*)g_cpuFeatures.cpuBrand + 16, regs, sizeof(regs));
|
memcpy((char*)g_cpuFeatures.cpuBrand, regs, sizeof(regs));
|
||||||
else if( i == 0x80000004 )
|
else if( i == 0x80000003 )
|
||||||
memcpy((char*)g_cpuFeatures.cpuBrand + 32, regs, sizeof(regs));
|
memcpy((char*)g_cpuFeatures.cpuBrand + 16, regs, sizeof(regs));
|
||||||
|
else if( i == 0x80000004 )
|
||||||
|
memcpy((char*)g_cpuFeatures.cpuBrand + 32, regs, sizeof(regs));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getCpuInfo(1, regs);
|
getCpuInfo(1, regs);
|
||||||
|
|
Loading…
Reference in New Issue