aboutsummaryrefslogtreecommitdiff
path: root/tcg/tcg-op-ldst.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-03-13 17:35:29 -0700
committerRichard Henderson <richard.henderson@linaro.org>2023-05-16 16:30:29 -0700
commitfcdab382c8b92bcc689b18f8ba5cd036139945bf (patch)
tree1af3dbcdaa22146e0f014704d0d0163a9f70ce2f /tcg/tcg-op-ldst.c
parenteb9d02f24b1ce877a60ffaf6cc1ecc8484740b37 (diff)
downloadqemu-fcdab382c8b92bcc689b18f8ba5cd036139945bf.zip
qemu-fcdab382c8b92bcc689b18f8ba5cd036139945bf.tar.gz
qemu-fcdab382c8b92bcc689b18f8ba5cd036139945bf.tar.bz2
accel/tcg: Widen plugin_gen_empty_mem_callback to i64
Since we do this inside gen_empty_mem_cb anyway, let's do this earlier inside tcg expansion. Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg/tcg-op-ldst.c')
-rw-r--r--tcg/tcg-op-ldst.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/tcg/tcg-op-ldst.c b/tcg/tcg-op-ldst.c
index b695d29..2d5e989 100644
--- a/tcg/tcg-op-ldst.c
+++ b/tcg/tcg-op-ldst.c
@@ -115,13 +115,13 @@ static void tcg_gen_req_mo(TCGBar type)
}
/* Only required for loads, where value might overlap addr. */
-static TCGv plugin_maybe_preserve_addr(TCGv vaddr)
+static TCGv_i64 plugin_maybe_preserve_addr(TCGv vaddr)
{
#ifdef CONFIG_PLUGIN
if (tcg_ctx->plugin_insn != NULL) {
/* Save a copy of the vaddr for use after a load. */
- TCGv temp = tcg_temp_new();
- tcg_gen_mov_tl(temp, vaddr);
+ TCGv_i64 temp = tcg_temp_ebb_new_i64();
+ tcg_gen_extu_tl_i64(temp, vaddr);
return temp;
}
#endif
@@ -129,16 +129,28 @@ static TCGv plugin_maybe_preserve_addr(TCGv vaddr)
}
static void
-plugin_gen_mem_callbacks(TCGv copy_addr, TCGv orig_addr, MemOpIdx oi,
+plugin_gen_mem_callbacks(TCGv_i64 copy_addr, TCGv orig_addr, MemOpIdx oi,
enum qemu_plugin_mem_rw rw)
{
#ifdef CONFIG_PLUGIN
if (tcg_ctx->plugin_insn != NULL) {
qemu_plugin_meminfo_t info = make_plugin_meminfo(oi, rw);
- plugin_gen_empty_mem_callback(copy_addr ? : orig_addr, info);
+
+#if TARGET_LONG_BITS == 64
if (copy_addr) {
- tcg_temp_free(copy_addr);
+ plugin_gen_empty_mem_callback(copy_addr, info);
+ tcg_temp_free_i64(copy_addr);
+ } else {
+ plugin_gen_empty_mem_callback(orig_addr, info);
}
+#else
+ if (!copy_addr) {
+ copy_addr = tcg_temp_ebb_new_i64();
+ tcg_gen_extu_tl_i64(copy_addr, orig_addr);
+ }
+ plugin_gen_empty_mem_callback(copy_addr, info);
+ tcg_temp_free_i64(copy_addr);
+#endif
}
#endif
}
@@ -147,7 +159,7 @@ void tcg_gen_qemu_ld_i32(TCGv_i32 val, TCGv addr, TCGArg idx, MemOp memop)
{
MemOp orig_memop;
MemOpIdx oi;
- TCGv copy_addr;
+ TCGv_i64 copy_addr;
tcg_gen_req_mo(TCG_MO_LD_LD | TCG_MO_ST_LD);
memop = tcg_canonicalize_memop(memop, 0, 0);
@@ -223,7 +235,7 @@ void tcg_gen_qemu_ld_i64(TCGv_i64 val, TCGv addr, TCGArg idx, MemOp memop)
{
MemOp orig_memop;
MemOpIdx oi;
- TCGv copy_addr;
+ TCGv_i64 copy_addr;
if (TCG_TARGET_REG_BITS == 32 && (memop & MO_SIZE) < MO_64) {
tcg_gen_qemu_ld_i32(TCGV_LOW(val), addr, idx, memop);