Print individual CPU capabilities

This commit is contained in:
Phillip Stephens 2016-02-15 09:52:43 -08:00
parent e431d38a76
commit 54b4f388ca
1 changed files with 35 additions and 4 deletions

View File

@ -53,11 +53,42 @@ struct Application : boo::IApplicationCallback
const Zeus::CPUInfo& cpuInf = Zeus::cpuFeatures();
HECL::SystemString cpuName{reinterpret_cast<const char*>(cpuInf.cpuBrand)};
HECL::SystemStringView cpuNameView{cpuName};
HECL::SystemString cpuVendor{reinterpret_cast<const char*>(cpuInf.cpuVendor)};
HECL::SystemStringView cpuVendorView{cpuVendor};
Log.report(LogVisor::Info, _S("CPU Name: %s"), cpuNameView.sys_str().c_str());
Log.report(LogVisor::Info, _S("CPU Vendor: %s"), cpuVendorView.sys_str().c_str());
Log.report(LogVisor::Info, _S("CPU Name: %s"), cpuName.c_str());
Log.report(LogVisor::Info, _S("CPU Vendor: %s"), cpuVendor.c_str());
HECL::SystemString features;
if (cpuInf.AESNI)
features += _S("AES-NI");
if (cpuInf.SSE1)
{
if (!features.empty())
features += _S(", SSE1");
else
features += _S("SSE1");
}
else
{
Log.report(LogVisor::FatalError, _S("URDE requires SSE1 minimum"));
return;
}
if (cpuInf.SSE2)
features += _S(", SSE2");
else
{
Log.report(LogVisor::FatalError, _S("URDE requires SSE2 minimum"));
return;
}
if (cpuInf.SSE3)
features += _S(", SSE3");
if (cpuInf.SSSE3)
features += _S(", SSSE3");
if (cpuInf.SSE4a)
features += _S(", SSE4a");
if (cpuInf.SSE41)
features += _S(", SSE4.1");
if (cpuInf.SSE42)
features += _S(", SSE4.2");
Log.report(LogVisor::Info, _S("CPU Features: %s"), features.c_str());
}
};