Tweaking things again. Now not getting very far. Sigh.
This commit is contained in:
parent
f08e80efbc
commit
eee856be04
|
@ -1277,10 +1277,8 @@ void LibjitEmitter::update_fpr_value(uint32_t n, jit_value_t value) {
|
|||
|
||||
jit_value_t LibjitEmitter::TouchMemoryAddress(uint32_t cia, jit_value_t addr) {
|
||||
// Input address is always in 32-bit space.
|
||||
// TODO(benvanik): is this required? It's one extra instruction on every
|
||||
// access...
|
||||
addr = jit_insn_and(fn_,
|
||||
jit_insn_convert(fn_, addr, jit_type_uint, 0),
|
||||
zero_extend(addr, jit_type_nuint),
|
||||
jit_value_create_nint_constant(fn_, jit_type_uint, UINT_MAX));
|
||||
|
||||
// Add runtime memory address checks, if needed.
|
||||
|
@ -1304,6 +1302,12 @@ jit_value_t LibjitEmitter::TouchMemoryAddress(uint32_t cia, jit_value_t addr) {
|
|||
// b.SetInsertPoint(valid_bb);
|
||||
// }
|
||||
|
||||
// Rebase off of memory pointer.
|
||||
addr = jit_insn_add(fn_,
|
||||
addr,
|
||||
jit_value_create_nint_constant(fn_,
|
||||
jit_type_nuint, (jit_nuint)xe_memory_addr(memory_, 0)));
|
||||
|
||||
return addr;
|
||||
}
|
||||
|
||||
|
@ -1333,11 +1337,7 @@ jit_value_t LibjitEmitter::ReadMemory(
|
|||
}
|
||||
|
||||
// Rebase off of memory base pointer.
|
||||
// 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);
|
||||
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.
|
||||
|
@ -1401,10 +1401,6 @@ void LibjitEmitter::WriteMemory(
|
|||
// }
|
||||
|
||||
// Rebase off of memory base pointer.
|
||||
// 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);
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a43165d21fa428b3184b596cf09a03779223f6ea
|
||||
Subproject commit 7a6935159427e59dfdcbddbe1fa03f2c5ad0951e
|
Loading…
Reference in New Issue