[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 27/70] tcg/tci: Reuse tci_args_l for exit_tb
From: |
Richard Henderson |
Subject: |
[PATCH v3 27/70] tcg/tci: Reuse tci_args_l for exit_tb |
Date: |
Sun, 7 Feb 2021 18:37:09 -0800 |
Do not emit a uint64_t, but a tcg_target_ulong, aka uintptr_t.
This reduces the size of the constant on 32-bit hosts.
The assert for label != NULL has to be removed because that
is a valid value for exit_tb.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/tci.c | 13 ++++---------
tcg/tci/tcg-target.c.inc | 2 +-
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/tcg/tci.c b/tcg/tci.c
index 92b13829c3..57b6defe09 100644
--- a/tcg/tci.c
+++ b/tcg/tci.c
@@ -160,9 +160,7 @@ tci_read_ulong(const tcg_target_ulong *regs, const uint8_t
**tb_ptr)
static tcg_target_ulong tci_read_label(const uint8_t **tb_ptr)
{
- tcg_target_ulong label = tci_read_i(tb_ptr);
- tci_assert(label != 0);
- return label;
+ return tci_read_i(tb_ptr);
}
/*
@@ -417,7 +415,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState
*env,
tcg_target_ulong regs[TCG_TARGET_NB_REGS];
long tcg_temps[CPU_TEMP_BUF_NLONGS];
uintptr_t sp_value = (uintptr_t)(tcg_temps + CPU_TEMP_BUF_NLONGS);
- uintptr_t ret = 0;
regs[TCG_AREG0] = (tcg_target_ulong)env;
regs[TCG_REG_CALL_STACK] = sp_value;
@@ -832,9 +829,9 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState
*env,
/* QEMU specific operations. */
case INDEX_op_exit_tb:
- ret = *(uint64_t *)tb_ptr;
- goto exit;
- break;
+ tci_args_l(&tb_ptr, &ptr);
+ return (uintptr_t)ptr;
+
case INDEX_op_goto_tb:
/* Jump address is aligned */
tb_ptr = QEMU_ALIGN_PTR_UP(tb_ptr, 4);
@@ -992,6 +989,4 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState
*env,
}
tci_assert(tb_ptr == old_code_ptr + op_size);
}
-exit:
- return ret;
}
diff --git a/tcg/tci/tcg-target.c.inc b/tcg/tci/tcg-target.c.inc
index c79f9c32d8..ff8040510f 100644
--- a/tcg/tci/tcg-target.c.inc
+++ b/tcg/tci/tcg-target.c.inc
@@ -401,7 +401,7 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc, const
TCGArg *args,
switch (opc) {
case INDEX_op_exit_tb:
- tcg_out64(s, args[0]);
+ tcg_out_i(s, args[0]);
break;
case INDEX_op_goto_tb:
--
2.25.1
- [PATCH v3 19/70] tcg/tci: Split out tci_args_rr, (continued)
- [PATCH v3 19/70] tcg/tci: Split out tci_args_rr, Richard Henderson, 2021/02/07
- [PATCH v3 20/70] tcg/tci: Split out tci_args_rrr, Richard Henderson, 2021/02/07
- [PATCH v3 21/70] tcg/tci: Split out tci_args_rrrc, Richard Henderson, 2021/02/07
- [PATCH v3 17/70] tcg/tci: Rename tci_read_r to tci_read_rval, Richard Henderson, 2021/02/07
- [PATCH v3 22/70] tcg/tci: Split out tci_args_l, Richard Henderson, 2021/02/07
- [PATCH v3 24/70] tcg/tci: Split out tci_args_rrcl and tci_args_rrrrcl, Richard Henderson, 2021/02/07
- [PATCH v3 26/70] tcg/tci: Reuse tci_args_l for calls., Richard Henderson, 2021/02/07
- [PATCH v3 23/70] tcg/tci: Split out tci_args_rrrrrc, Richard Henderson, 2021/02/07
- [PATCH v3 28/70] tcg/tci: Reuse tci_args_l for goto_tb, Richard Henderson, 2021/02/07
- [PATCH v3 31/70] tcg/tci: Clean up deposit operations, Richard Henderson, 2021/02/07
- [PATCH v3 27/70] tcg/tci: Reuse tci_args_l for exit_tb,
Richard Henderson <=
- [PATCH v3 33/70] tcg/tci: Split out tci_args_{rrm,rrrm,rrrrm}, Richard Henderson, 2021/02/07
- [PATCH v3 39/70] tcg/tci: Improve tcg_target_call_clobber_regs, Richard Henderson, 2021/02/07
- [PATCH v3 38/70] tcg/tci: Use ffi for calls, Richard Henderson, 2021/02/07
- [PATCH v3 25/70] tcg/tci: Split out tci_args_ri and tci_args_rI, Richard Henderson, 2021/02/07
- [PATCH v3 37/70] tcg: Build ffi data structures for helpers, Richard Henderson, 2021/02/07
- [PATCH v3 34/70] tcg/tci: Hoist op_size checking into tci_args_*, Richard Henderson, 2021/02/07
- [PATCH v3 36/70] tcg/tci: Implement the disassembler properly, Richard Henderson, 2021/02/07
- [PATCH v3 29/70] tcg/tci: Split out tci_args_rrrrrr, Richard Henderson, 2021/02/07
- [PATCH v3 35/70] tcg/tci: Remove tci_disas, Richard Henderson, 2021/02/07
- [PATCH v3 32/70] tcg/tci: Reduce qemu_ld/st TCGMemOpIdx operand to 32-bits, Richard Henderson, 2021/02/07