From e2bbae3896a9c4c0b8635f4c24720b314163443d Mon Sep 17 00:00:00 2001 From: DrChat Date: Tue, 13 Feb 2018 12:50:33 -0600 Subject: [PATCH] [JIT] Don't bother using a temp for constant addresses < 0x80000000 --- src/xenia/cpu/backend/x64/x64_sequences.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/xenia/cpu/backend/x64/x64_sequences.cc b/src/xenia/cpu/backend/x64/x64_sequences.cc index 0bd483caf..03a609ccb 100644 --- a/src/xenia/cpu/backend/x64/x64_sequences.cc +++ b/src/xenia/cpu/backend/x64/x64_sequences.cc @@ -2139,8 +2139,13 @@ RegExp ComputeMemoryAddress(X64Emitter& e, const T& guest) { // TODO(benvanik): figure out how to do this without a temp. // Since the constant is often 0x8... if we tried to use that as a // displacement it would be sign extended and mess things up. - e.mov(e.eax, static_cast(guest.constant())); - return e.GetMembaseReg() + e.rax; + uint32_t address = static_cast(guest.constant()); + if (address < 0x80000000) { + return e.GetMembaseReg() + address; + } else { + e.mov(e.eax, address); + return e.GetMembaseReg() + e.rax; + } } else { // Clear the top 32 bits, as they are likely garbage. // TODO(benvanik): find a way to avoid doing this.