From 03335d56e84337ba158e3854e52e02a421085d3d Mon Sep 17 00:00:00 2001 From: Will Martin Date: Wed, 21 Jan 2026 09:28:10 +0900 Subject: [PATCH] [A64/Backend] Use 64-bit default indirection on ARM64 - Route ResolveFunction thunk into 64-bit indirection entries when enabled --- src/xenia/cpu/backend/a64/a64_backend.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xenia/cpu/backend/a64/a64_backend.cc b/src/xenia/cpu/backend/a64/a64_backend.cc index 6f18034a5..b102594cd 100644 --- a/src/xenia/cpu/backend/a64/a64_backend.cc +++ b/src/xenia/cpu/backend/a64/a64_backend.cc @@ -123,11 +123,16 @@ bool A64Backend::Initialize(Processor* processor) { guest_to_host_thunk_ = thunk_emitter.EmitGuestToHostThunk(); resolve_function_thunk_ = thunk_emitter.EmitResolveFunctionThunk(); - // Set the code cache to use the ResolveFunction thunk for default - // indirections. +#if XE_A64_INDIRECTION_64BIT + // On ARM64 platforms, we use 64-bit addresses and the indirection table now + // supports 64-bit entries, so we can store the actual thunk address directly. + static_cast(code_cache_.get()) + ->set_indirection_default_64(uint64_t(resolve_function_thunk_)); +#else assert_zero(uint64_t(resolve_function_thunk_) & 0xFFFFFFFF00000000ull); code_cache_->set_indirection_default( uint32_t(uint64_t(resolve_function_thunk_))); +#endif // Allocate some special indirections. code_cache_->CommitExecutableRange(0x9FFF0000, 0x9FFFFFFF);