diff options
author | bunnei <bunneidev@gmail.com> | 2020-07-14 18:38:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-14 18:38:03 +0200 |
commit | e2730372b8b26bf3141bf91107f9982e270f751b (patch) | |
tree | fb09276b0a1a736c6b106f1c6b51af9f97b3c307 /src/core | |
parent | Merge pull request #4282 from Morph1984/fs-size (diff) | |
parent | configure_cpu: Split optimization settings off into Debug tab (diff) | |
download | yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.tar yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.tar.gz yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.tar.bz2 yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.tar.lz yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.tar.xz yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.tar.zst yuzu-e2730372b8b26bf3141bf91107f9982e270f751b.zip |
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& // Timing config.wall_clock_cntpct = uses_wall_clock; - // Optimizations - if (Settings::values.disable_cpu_opt) { - config.enable_optimizations = false; - config.enable_fast_dispatch = false; + // Safe optimizations + if (Settings::values.cpu_accuracy != Settings::CPUAccuracy::Accurate) { + if (!Settings::values.cpuopt_page_tables) { + config.page_table = nullptr; + } + if (!Settings::values.cpuopt_block_linking) { + config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking; + } + if (!Settings::values.cpuopt_return_stack_buffer) { + config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer; + } + if (!Settings::values.cpuopt_fast_dispatcher) { + config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch; + } + if (!Settings::values.cpuopt_context_elimination) { + config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination; + } + if (!Settings::values.cpuopt_const_prop) { + config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp; + } + if (!Settings::values.cpuopt_misc_ir) { + config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt; + } + if (!Settings::values.cpuopt_reduce_misalign_checks) { + config.only_detect_misalignment_via_page_table_on_page_boundary = false; + } } 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& // Unpredictable instructions config.define_unpredictable_behaviour = true; - // Optimizations - if (Settings::values.disable_cpu_opt) { - config.enable_optimizations = false; - config.enable_fast_dispatch = false; - } - // Timing config.wall_clock_cntpct = uses_wall_clock; + // Safe optimizations + if (Settings::values.cpu_accuracy != Settings::CPUAccuracy::Accurate) { + if (!Settings::values.cpuopt_page_tables) { + config.page_table = nullptr; + } + if (!Settings::values.cpuopt_block_linking) { + config.optimizations &= ~Dynarmic::OptimizationFlag::BlockLinking; + } + if (!Settings::values.cpuopt_return_stack_buffer) { + config.optimizations &= ~Dynarmic::OptimizationFlag::ReturnStackBuffer; + } + if (!Settings::values.cpuopt_fast_dispatcher) { + config.optimizations &= ~Dynarmic::OptimizationFlag::FastDispatch; + } + if (!Settings::values.cpuopt_context_elimination) { + config.optimizations &= ~Dynarmic::OptimizationFlag::GetSetElimination; + } + if (!Settings::values.cpuopt_const_prop) { + config.optimizations &= ~Dynarmic::OptimizationFlag::ConstProp; + } + if (!Settings::values.cpuopt_misc_ir) { + config.optimizations &= ~Dynarmic::OptimizationFlag::MiscIROpt; + } + if (!Settings::values.cpuopt_reduce_misalign_checks) { + config.only_detect_misalignment_via_page_table_on_page_boundary = false; + } + } + return std::make_shared<Dynarmic::A64::Jit>(config); } 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 { Extreme = 2, }; +enum class CPUAccuracy { + Accurate = 0, + DebugMode = 1, +}; + extern bool configuring_global; template <typename Type> @@ -402,6 +407,18 @@ struct Values { // Core Setting<bool> use_multi_core; + // Cpu + CPUAccuracy cpu_accuracy; + + bool cpuopt_page_tables; + bool cpuopt_block_linking; + bool cpuopt_return_stack_buffer; + bool cpuopt_fast_dispatcher; + bool cpuopt_context_elimination; + bool cpuopt_const_prop; + bool cpuopt_misc_ir; + bool cpuopt_reduce_misalign_checks; + // Renderer Setting<RendererBackend> renderer_backend; bool renderer_debug; @@ -476,7 +493,6 @@ struct Values { bool dump_nso; bool reporting_services; bool quest_flag; - bool disable_cpu_opt; bool disable_macro_jit; // Misceallaneous |