Browse Source
[dynarmic] attempt fix totk regression from #358 (#3013)
Signed-off-by: lizzie <lizzie@eden-emu.dev>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3013
Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Reviewed-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
pull/3022/head
lizzie
3 months ago
committed by
crueter
No known key found for this signature in database
GPG Key ID: 425ACD2D4830EBC6
3 changed files with
13 additions and
8 deletions
-
src/core/arm/dynarmic/arm_dynarmic_32.cpp
-
src/core/arm/dynarmic/arm_dynarmic_64.cpp
-
src/dynarmic/src/dynarmic/backend/x64/a64_interface.cpp
|
|
|
@ -210,9 +210,12 @@ std::shared_ptr<Dynarmic::A32::Jit> ArmDynarmic32::MakeJit(Common::PageTable* pa |
|
|
|
config.wall_clock_cntpct = m_uses_wall_clock; |
|
|
|
config.enable_cycle_counting = !m_uses_wall_clock; |
|
|
|
|
|
|
|
// Code cache size - max in ARM is 128MiB, max in x86_64 is 2GiB
|
|
|
|
// Solaris doesn't support kPageSize >= 512MiB
|
|
|
|
// Code cache size
|
|
|
|
#if defined(ARCHITECTURE_arm64) || defined(__sun__)
|
|
|
|
config.code_cache_size = std::uint32_t(128_MiB); |
|
|
|
#else
|
|
|
|
config.code_cache_size = std::uint32_t(512_MiB); |
|
|
|
#endif
|
|
|
|
|
|
|
|
// Allow memory fault handling to work
|
|
|
|
if (m_system.DebuggerEnabled()) { |
|
|
|
|
|
|
|
@ -269,9 +269,12 @@ std::shared_ptr<Dynarmic::A64::Jit> ArmDynarmic64::MakeJit(Common::PageTable* pa |
|
|
|
config.wall_clock_cntpct = m_uses_wall_clock; |
|
|
|
config.enable_cycle_counting = !m_uses_wall_clock; |
|
|
|
|
|
|
|
// Code cache size - max in ARM is 128MiB, max in x86_64 is 2GiB
|
|
|
|
// Solaris doesn't support kPageSize >= 512MiB
|
|
|
|
// Code cache size
|
|
|
|
#if defined(ARCHITECTURE_arm64) || defined(__sun__)
|
|
|
|
config.code_cache_size = std::uint32_t(128_MiB); |
|
|
|
#else
|
|
|
|
config.code_cache_size = std::uint32_t(512_MiB); |
|
|
|
#endif
|
|
|
|
|
|
|
|
// Allow memory fault handling to work
|
|
|
|
if (m_system.DebuggerEnabled()) { |
|
|
|
|
|
|
|
@ -80,16 +80,15 @@ public: |
|
|
|
}; |
|
|
|
|
|
|
|
// TODO: Check code alignment
|
|
|
|
const CodePtr aligned_code_ptr = CodePtr((uintptr_t(GetCurrentBlock()) + 15) & ~uintptr_t(15)); |
|
|
|
const CodePtr current_code_ptr = [this, aligned_code_ptr] { |
|
|
|
|
|
|
|
const CodePtr current_code_ptr = [this] { |
|
|
|
// RSB optimization
|
|
|
|
const u32 new_rsb_ptr = (jit_state.rsb_ptr - 1) & A64JitState::RSBPtrMask; |
|
|
|
if (jit_state.GetUniqueHash() == jit_state.rsb_location_descriptors[new_rsb_ptr]) { |
|
|
|
jit_state.rsb_ptr = new_rsb_ptr; |
|
|
|
return CodePtr(jit_state.rsb_codeptrs[new_rsb_ptr]); |
|
|
|
} |
|
|
|
return aligned_code_ptr; |
|
|
|
//return GetCurrentBlock();
|
|
|
|
return CodePtr((uintptr_t(GetCurrentBlock()) + 15) & ~uintptr_t(15)); |
|
|
|
}(); |
|
|
|
|
|
|
|
const HaltReason hr = block_of_code.RunCode(&jit_state, current_code_ptr); |
|
|
|
|