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);