From 9487fa027c99d78c586afa1304a1715b4a6a8f37 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Thu, 23 May 2013 13:55:09 -0700 Subject: [PATCH] libjit doesn't encode mov with imm64 offsets, fixing. --- src/xenia/cpu/libjit/libjit_emitter.cc | 10 ++++++---- third_party/libjit | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/xenia/cpu/libjit/libjit_emitter.cc b/src/xenia/cpu/libjit/libjit_emitter.cc index 083d8d2c1..147307cd1 100644 --- a/src/xenia/cpu/libjit/libjit_emitter.cc +++ b/src/xenia/cpu/libjit/libjit_emitter.cc @@ -1336,8 +1336,9 @@ jit_value_t LibjitEmitter::ReadMemory( // We could store the memory base as a global value (or indirection off of // state) if we wanted to avoid embedding runtime values into the code. jit_value_t address = TouchMemoryAddress(cia, addr); - jit_nint membase = (jit_nint)xe_memory_addr(memory_, 0); - jit_value_t value = jit_insn_load_relative(fn_, address, membase, data_type); + address = jit_insn_add(fn_, address, jit_value_create_nint_constant(fn_, + jit_type_nuint, (jit_nuint)xe_memory_addr(memory_, 0))); + jit_value_t value = jit_insn_load_relative(fn_, address, 0, data_type); if (acquire) { // TODO(benvanik): acquire semantics. // load_value->setAlignment(size); @@ -1403,6 +1404,7 @@ void LibjitEmitter::WriteMemory( // We could store the memory base as a global value (or indirection off of // state) if we wanted to avoid embedding runtime values into the code. jit_value_t address = TouchMemoryAddress(cia, addr); - jit_nint membase = (jit_nint)xe_memory_addr(memory_, 0); - jit_insn_store_relative(fn_, address, membase, value); + address = jit_insn_add(fn_, address, jit_value_create_nint_constant(fn_, + jit_type_nuint, (jit_nuint)xe_memory_addr(memory_, 0))); + jit_insn_store_relative(fn_, address, 0, value); } diff --git a/third_party/libjit b/third_party/libjit index a37e442c5..f2628ca8f 160000 --- a/third_party/libjit +++ b/third_party/libjit @@ -1 +1 @@ -Subproject commit a37e442c53f847d6c80b4007a3d626bc382038dd +Subproject commit f2628ca8f394d6aa905404b57e78db2cf531e5bc