mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
Add experimental TSC frequency detection
This commit is contained in:
parent
cb5c26f2b5
commit
c062000288
2 changed files with 25 additions and 1 deletions
|
@ -110,6 +110,15 @@ std::string utils::get_system_info()
|
||||||
|
|
||||||
fmt::append(result, "%s | %d Threads | %.2f GiB RAM", brand, num_proc, mem_total / (1024.0f * 1024 * 1024));
|
fmt::append(result, "%s | %d Threads | %.2f GiB RAM", brand, num_proc, mem_total / (1024.0f * 1024 * 1024));
|
||||||
|
|
||||||
|
if (const ullong tsc_freq = get_tsc_freq())
|
||||||
|
{
|
||||||
|
fmt::append(result, " | TSC: %.02fGHz", tsc_freq / 1000000000.);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
fmt::append(result, " | TSC: Bad");
|
||||||
|
}
|
||||||
|
|
||||||
if (has_avx())
|
if (has_avx())
|
||||||
{
|
{
|
||||||
result += " | AVX";
|
result += " | AVX";
|
||||||
|
@ -138,7 +147,7 @@ std::string utils::get_system_info()
|
||||||
{
|
{
|
||||||
result += "-FA";
|
result += "-FA";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!has_mpx())
|
if (!has_mpx())
|
||||||
{
|
{
|
||||||
result += " disabled by default";
|
result += " disabled by default";
|
||||||
|
@ -214,3 +223,16 @@ std::string utils::get_OS_version()
|
||||||
#endif
|
#endif
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ullong utils::get_tsc_freq()
|
||||||
|
{
|
||||||
|
#ifdef _WIN32
|
||||||
|
LARGE_INTEGER freq;
|
||||||
|
if (!QueryPerformanceFrequency(&freq) || freq.QuadPart > 9'999'999)
|
||||||
|
return 0;
|
||||||
|
return freq.QuadPart * 1024;
|
||||||
|
#else
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
|
@ -50,4 +50,6 @@ namespace utils
|
||||||
std::string get_firmware_version();
|
std::string get_firmware_version();
|
||||||
|
|
||||||
std::string get_OS_version();
|
std::string get_OS_version();
|
||||||
|
|
||||||
|
ullong get_tsc_freq();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue