On 12/5/25 19:20, Richard Henderson wrote:
For native code generation, zero-extending 32-bit addresses for
the slow path helpers happens in tcg_out_{ld,st}_helper_args,
but there isn't really a slow path for TCI, so that didn't happen.
Make the extension for TCI explicit in the opcode stream,
much like we already do for plugins and atomic helpers.
tcg/tcg-op-ldst.c | 72 +++++++++++++++++++++++++++++++++++++++--------
@@ -234,6 +258,7 @@ static void tcg_gen_qemu_ld_i32_int(TCGv_i32 val, TCGTemp
*addr,
+ TCGTemp *addr_new;
+ addr_new = tci_extend_addr(addr);
copy_addr = plugin_maybe_preserve_addr(addr);
- gen_ldst1(INDEX_op_qemu_ld, TCG_TYPE_I32, tcgv_i32_temp(val), addr, oi);
+ gen_ldst1(INDEX_op_qemu_ld, TCG_TYPE_I32, tcgv_i32_temp(val), addr_new,
oi);
plugin_gen_mem_callbacks_i32(val, copy_addr, addr, orig_oi,
QEMU_PLUGIN_MEM_R);
+ maybe_free_addr(addr, addr_new);
Just a tiny follow-up nit: I'd use a name like addr_tci here, not
addr_new, - I think this is a bit more understandable than a too generic
addr_new. Also for maybe_free_addr() - maybe_free_tci_addr().
FWIW.
Thanks,
/mjt