diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_32.cpp | 30 | ||||
| -rw-r--r-- | src/core/arm/dynarmic/arm_dynarmic_64.cpp | 34 | ||||
| -rw-r--r-- | src/core/settings.h | 18 |
3 files changed, 71 insertions, 11 deletions
diff --git a/src/core/arm/dynarmic/arm_dynarmic_32.cpp b/src/core/arm/dynarmic/arm_dynarmic_32.cpp index 0d4ab95b7..443ca72eb 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_32.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_32.cpp | |||
| @@ -142,10 +142,32 @@ std::shared_ptr<Dynarmic::A32::Jit> ARM_Dynarmic_32::MakeJit(Common::PageTable& | |||
| 142 | // Timing | 142 | // Timing |
| 143 | config.wall_clock_cntpct = uses_wall_clock; | 143 | config.wall_clock_cntpct = uses_wall_clock; |
| 144 | 144 | ||
| 145 | // Optimizations | 145 | // Safe optimizations |
| 146 | if (Settings::values.disable_cpu_opt) { | 146 | if (Settings::values.cpu_accuracy != Settings::CPUAccuracy::Accurate) { |
| 147 | config.enable_optimizations = false; | 147 | if (!Settings::values.cpuopt_page_tables) { |
| 148 | config.enable_fast_dispatch = false; | 148 | config.page_table = nullptr; |
| 149 | } | ||
| 150 | if (!Settings::values.cpuopt_block_linking) { | ||
| 151 | config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking; | ||
| 152 | } | ||
| 153 | if (!Settings::values.cpuopt_return_stack_buffer) { | ||
| 154 | config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer; | ||
| 155 | } | ||
| 156 | if (!Settings::values.cpuopt_fast_dispatcher) { | ||
| 157 | config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch; | ||
| 158 | } | ||
| 159 | if (!Settings::values.cpuopt_context_elimination) { | ||
| 160 | config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination; | ||
| 161 | } | ||
| 162 | if (!Settings::values.cpuopt_const_prop) { | ||
| 163 | config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp; | ||
| 164 | } | ||
| 165 | if (!Settings::values.cpuopt_misc_ir) { | ||
| 166 | config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt; | ||
| 167 | } | ||
| 168 | if (!Settings::values.cpuopt_reduce_misalign_checks) { | ||
| 169 | config.only_detect_misalignment_via_page_table_on_page_boundary = false; | ||
| 170 | } | ||
| 149 | } | 171 | } |
| 150 | 172 | ||
| 151 | return std::make_unique<Dynarmic::A32::Jit>(config); | 173 | return std::make_unique<Dynarmic::A32::Jit>(config); |
diff --git a/src/core/arm/dynarmic/arm_dynarmic_64.cpp b/src/core/arm/dynarmic/arm_dynarmic_64.cpp index 790981034..a63a04a25 100644 --- a/src/core/arm/dynarmic/arm_dynarmic_64.cpp +++ b/src/core/arm/dynarmic/arm_dynarmic_64.cpp | |||
| @@ -191,15 +191,37 @@ std::shared_ptr<Dynarmic::A64::Jit> ARM_Dynarmic_64::MakeJit(Common::PageTable& | |||
| 191 | // Unpredictable instructions | 191 | // Unpredictable instructions |
| 192 | config.define_unpredictable_behaviour = true; | 192 | config.define_unpredictable_behaviour = true; |
| 193 | 193 | ||
| 194 | // Optimizations | ||
| 195 | if (Settings::values.disable_cpu_opt) { | ||
| 196 | config.enable_optimizations = false; | ||
| 197 | config.enable_fast_dispatch = false; | ||
| 198 | } | ||
| 199 | |||
| 200 | // Timing | 194 | // Timing |
| 201 | config.wall_clock_cntpct = uses_wall_clock; | 195 | config.wall_clock_cntpct = uses_wall_clock; |
| 202 | 196 | ||
| 197 | // Safe optimizations | ||
| 198 | if (Settings::values.cpu_accuracy != Settings::CPUAccuracy::Accurate) { | ||
| 199 | if (!Settings::values.cpuopt_page_tables) { | ||
| 200 | config.page_table = nullptr; | ||
| 201 | } | ||
| 202 | if (!Settings::values.cpuopt_block_linking) { | ||
| 203 | config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking; | ||
| 204 | } | ||
| 205 | if (!Settings::values.cpuopt_return_stack_buffer) { | ||
| 206 | config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer; | ||
| 207 | } | ||
| 208 | if (!Settings::values.cpuopt_fast_dispatcher) { | ||
| 209 | config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch; | ||
| 210 | } | ||
| 211 | if (!Settings::values.cpuopt_context_elimination) { | ||
| 212 | config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination; | ||
| 213 | } | ||
| 214 | if (!Settings::values.cpuopt_const_prop) { | ||
| 215 | config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp; | ||
| 216 | } | ||
| 217 | if (!Settings::values.cpuopt_misc_ir) { | ||
| 218 | config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt; | ||
| 219 | } | ||
| 220 | if (!Settings::values.cpuopt_reduce_misalign_checks) { | ||
| 221 | config.only_detect_misalignment_via_page_table_on_page_boundary = false; | ||
| 222 | } | ||
| 223 | } | ||
| 224 | |||
| 203 | return std::make_shared<Dynarmic::A64::Jit>(config); | 225 | return std::make_shared<Dynarmic::A64::Jit>(config); |
| 204 | } | 226 | } |
| 205 | 227 | ||
diff --git a/src/core/settings.h b/src/core/settings.h index 29dc57c16..3eb336f75 100644 --- a/src/core/settings.h +++ b/src/core/settings.h | |||
| @@ -357,6 +357,11 @@ enum class GPUAccuracy : u32 { | |||
| 357 | Extreme = 2, | 357 | Extreme = 2, |
| 358 | }; | 358 | }; |
| 359 | 359 | ||
| 360 | enum class CPUAccuracy { | ||
| 361 | Accurate = 0, | ||
| 362 | DebugMode = 1, | ||
| 363 | }; | ||
| 364 | |||
| 360 | extern bool configuring_global; | 365 | extern bool configuring_global; |
| 361 | 366 | ||
| 362 | template <typename Type> | 367 | template <typename Type> |
| @@ -402,6 +407,18 @@ struct Values { | |||
| 402 | // Core | 407 | // Core |
| 403 | Setting<bool> use_multi_core; | 408 | Setting<bool> use_multi_core; |
| 404 | 409 | ||
| 410 | // Cpu | ||
| 411 | CPUAccuracy cpu_accuracy; | ||
| 412 | |||
| 413 | bool cpuopt_page_tables; | ||
| 414 | bool cpuopt_block_linking; | ||
| 415 | bool cpuopt_return_stack_buffer; | ||
| 416 | bool cpuopt_fast_dispatcher; | ||
| 417 | bool cpuopt_context_elimination; | ||
| 418 | bool cpuopt_const_prop; | ||
| 419 | bool cpuopt_misc_ir; | ||
| 420 | bool cpuopt_reduce_misalign_checks; | ||
| 421 | |||
| 405 | // Renderer | 422 | // Renderer |
| 406 | Setting<RendererBackend> renderer_backend; | 423 | Setting<RendererBackend> renderer_backend; |
| 407 | bool renderer_debug; | 424 | bool renderer_debug; |
| @@ -476,7 +493,6 @@ struct Values { | |||
| 476 | bool dump_nso; | 493 | bool dump_nso; |
| 477 | bool reporting_services; | 494 | bool reporting_services; |
| 478 | bool quest_flag; | 495 | bool quest_flag; |
| 479 | bool disable_cpu_opt; | ||
| 480 | bool disable_macro_jit; | 496 | bool disable_macro_jit; |
| 481 | 497 | ||
| 482 | // Misceallaneous | 498 | // Misceallaneous |