diff options
| author | 2022-04-22 22:06:42 -0400 | |
|---|---|---|
| committer | 2022-06-21 20:36:24 -0400 | |
| commit | 30e8876ea48a8c5246c320d98c0c1921e9535214 (patch) | |
| tree | 22572e7c529592b28f230aca4e9262cdb3fb234e | |
| parent | Merge pull request #8432 from liamwhite/watchpoint (diff) | |
| download | yuzu-30e8876ea48a8c5246c320d98c0c1921e9535214.tar.gz yuzu-30e8876ea48a8c5246c320d98c0c1921e9535214.tar.xz yuzu-30e8876ea48a8c5246c320d98c0c1921e9535214.zip | |
core/arm: re-enable cycle counting
Diffstat (limited to '')
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.cpp | 13 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 13 |
2 files changed, 20 insertions, 6 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 8c90c8be0..8ae16c4d9 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp | |||
| @@ -112,7 +112,9 @@ public: | |||
| 112 | } | 112 | } |
| 113 | 113 | ||
| 114 | void AddTicks(u64 ticks) override { | 114 | void AddTicks(u64 ticks) override { |
| 115 | ASSERT_MSG(!parent.uses_wall_clock, "This should never happen - dynarmic ticking disabled"); | 115 | if (parent.uses_wall_clock) { |
| 116 | return; | ||
| 117 | } | ||
| 116 | 118 | ||
| 117 | // Divide the number of ticks by the amount of CPU cores. TODO(Subv): This yields only a | 119 | // Divide the number of ticks by the amount of CPU cores. TODO(Subv): This yields only a |
| 118 | // rough approximation of the amount of executed ticks in the system, it may be thrown off | 120 | // rough approximation of the amount of executed ticks in the system, it may be thrown off |
| @@ -129,7 +131,12 @@ public: | |||
| 129 | } | 131 | } |
| 130 | 132 | ||
| 131 | u64 GetTicksRemaining() override { | 133 | u64 GetTicksRemaining() override { |
| 132 | ASSERT_MSG(!parent.uses_wall_clock, "This should never happen - dynarmic ticking disabled"); | 134 | if (parent.uses_wall_clock) { |
| 135 | if (!parent.interrupt_handlers[parent.core_index].IsInterrupted()) { | ||
| 136 | return minimum_run_cycles; | ||
| 137 | } | ||
| 138 | return 0U; | ||
| 139 | } | ||
| 133 | 140 | ||
| 134 | return std::max<s64>(parent.system.CoreTiming().GetDowncount(), 0); | 141 | return std::max<s64>(parent.system.CoreTiming().GetDowncount(), 0); |
| 135 | } | 142 | } |
| @@ -182,7 +189,7 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable* | |||
| 182 | 189 | ||
| 183 | // Timing | 190 | // Timing |
| 184 | config.wall_clock_cntpct = uses_wall_clock; | 191 | config.wall_clock_cntpct = uses_wall_clock; |
| 185 | config.enable_cycle_counting = !uses_wall_clock; | 192 | config.enable_cycle_counting = true; |
| 186 | 193 | ||
| 187 | // Code cache size | 194 | // Code cache size |
| 188 | config.code_cache_size = 512_MiB; | 195 | config.code_cache_size = 512_MiB; |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 4370ca294..ff25cfe16 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp | |||
| @@ -157,7 +157,9 @@ public: | |||
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | void AddTicks(u64 ticks) override { | 159 | void AddTicks(u64 ticks) override { |
| 160 | ASSERT_MSG(!parent.uses_wall_clock, "This should never happen - dynarmic ticking disabled"); | 160 | if (parent.uses_wall_clock) { |
| 161 | return; | ||
| 162 | } | ||
| 161 | 163 | ||
| 162 | // Divide the number of ticks by the amount of CPU cores. TODO(Subv): This yields only a | 164 | // Divide the number of ticks by the amount of CPU cores. TODO(Subv): This yields only a |
| 163 | // rough approximation of the amount of executed ticks in the system, it may be thrown off | 165 | // rough approximation of the amount of executed ticks in the system, it may be thrown off |
| @@ -172,7 +174,12 @@ public: | |||
| 172 | } | 174 | } |
| 173 | 175 | ||
| 174 | u64 GetTicksRemaining() override { | 176 | u64 GetTicksRemaining() override { |
| 175 | ASSERT_MSG(!parent.uses_wall_clock, "This should never happen - dynarmic ticking disabled"); | 177 | if (parent.uses_wall_clock) { |
| 178 | if (!parent.interrupt_handlers[parent.core_index].IsInterrupted()) { | ||
| 179 | return minimum_run_cycles; | ||
| 180 | } | ||
| 181 | return 0U; | ||
| 182 | } | ||
| 176 | 183 | ||
| 177 | return std::max<s64>(parent.system.CoreTiming().GetDowncount(), 0); | 184 | return std::max<s64>(parent.system.CoreTiming().GetDowncount(), 0); |
| 178 | } | 185 | } |
| @@ -246,7 +253,7 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable* | |||
| 246 | 253 | ||
| 247 | // Timing | 254 | // Timing |
| 248 | config.wall_clock_cntpct = uses_wall_clock; | 255 | config.wall_clock_cntpct = uses_wall_clock; |
| 249 | config.enable_cycle_counting = !uses_wall_clock; | 256 | config.enable_cycle_counting = true; |
| 250 | 257 | ||
| 251 | // Code cache size | 258 | // Code cache size |
| 252 | config.code_cache_size = 512_MiB; | 259 | config.code_cache_size = 512_MiB; |