diff options
author | Marshall Mohror <mohror64@gmail.com> | 2022-07-06 20:00:00 +0200 |
---|---|---|
committer | Marshall Mohror <mohror64@gmail.com> | 2022-07-06 20:00:00 +0200 |
commit | e71d457af923f373505729fe5a335e6768f6144a (patch) | |
tree | 535a7a3ddd28e3a98f5984e0730277cd74850cea /src/common/x64 | |
parent | common/x64: Use TSC clock rate from CPUID when available (diff) | |
download | yuzu-e71d457af923f373505729fe5a335e6768f6144a.tar yuzu-e71d457af923f373505729fe5a335e6768f6144a.tar.gz yuzu-e71d457af923f373505729fe5a335e6768f6144a.tar.bz2 yuzu-e71d457af923f373505729fe5a335e6768f6144a.tar.lz yuzu-e71d457af923f373505729fe5a335e6768f6144a.tar.xz yuzu-e71d457af923f373505729fe5a335e6768f6144a.tar.zst yuzu-e71d457af923f373505729fe5a335e6768f6144a.zip |
Diffstat (limited to 'src/common/x64')
-rw-r--r-- | src/common/x64/cpu_detect.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/x64/cpu_detect.cpp b/src/common/x64/cpu_detect.cpp index 4230b2da6..1a27532d4 100644 --- a/src/common/x64/cpu_detect.cpp +++ b/src/common/x64/cpu_detect.cpp @@ -170,8 +170,11 @@ static CPUCaps Detect() { // The CPU model can be detected to use the values from turbostat // https://github.com/torvalds/linux/blob/master/tools/power/x86/turbostat/turbostat.c#L5569 // but it's easier to just estimate the TSC tick rate for these cases. - caps.tsc_frequency = static_cast<u64>(caps.crystal_frequency) * - caps.tsc_crystal_ratio_numerator / caps.tsc_crystal_ratio_denominator; + if (caps.tsc_crystal_ratio_denominator) { + caps.tsc_frequency = static_cast<u64>(caps.crystal_frequency) * + caps.tsc_crystal_ratio_numerator / + caps.tsc_crystal_ratio_denominator; + } } if (max_std_fn >= 0x16) { |