diff options
| author | DrChat <arkolbed@gmail.com> | 2018-02-13 12:50:33 -0600 |
|---|---|---|
| committer | DrChat <arkolbed@gmail.com> | 2018-02-13 13:09:40 -0600 |
| commit | e2bbae3896a9c4c0b8635f4c24720b314163443d (patch) | |
| tree | ebd525d457db6be2a6962077f1f12b3dca5aeebe | |
| parent | 190108dab6732d9db5c8595e1358b7b034cb5a14 (diff) | |
[JIT] Don't bother using a temp for constant addresses < 0x80000000
| -rw-r--r-- | src/xenia/cpu/backend/x64/x64_sequences.cc | 9 |
1 files 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<uint32_t>(guest.constant())); - return e.GetMembaseReg() + e.rax; + uint32_t address = static_cast<uint32_t>(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. |
