[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 03/22] tcg/ppc: Remove unused goto_tb code for indirect jump
From: |
Richard Henderson |
Subject: |
[PULL 03/22] tcg/ppc: Remove unused goto_tb code for indirect jump |
Date: |
Tue, 17 Jan 2023 13:10:32 -1000 |
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
tcg/ppc/tcg-target.c.inc | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc
index a95e4001d3..b72e266990 100644
--- a/tcg/ppc/tcg-target.c.inc
+++ b/tcg/ppc/tcg-target.c.inc
@@ -2630,27 +2630,21 @@ static void tcg_out_op(TCGContext *s, TCGOpcode opc,
switch (opc) {
case INDEX_op_goto_tb:
- if (s->tb_jmp_insn_offset) {
- /* Direct jump. */
- if (TCG_TARGET_REG_BITS == 64) {
- /* Ensure the next insns are 8 or 16-byte aligned. */
- while ((uintptr_t)s->code_ptr & (have_isa_2_07 ? 15 : 7)) {
- tcg_out32(s, NOP);
- }
- s->tb_jmp_insn_offset[args[0]] = tcg_current_code_size(s);
- tcg_out32(s, ADDIS | TAI(TCG_REG_TB, TCG_REG_TB, 0));
- tcg_out32(s, ADDI | TAI(TCG_REG_TB, TCG_REG_TB, 0));
- } else {
- s->tb_jmp_insn_offset[args[0]] = tcg_current_code_size(s);
- tcg_out32(s, B);
- s->tb_jmp_reset_offset[args[0]] = tcg_current_code_size(s);
- break;
+ qemu_build_assert(TCG_TARGET_HAS_direct_jump);
+ /* Direct jump. */
+ if (TCG_TARGET_REG_BITS == 64) {
+ /* Ensure the next insns are 8 or 16-byte aligned. */
+ while ((uintptr_t)s->code_ptr & (have_isa_2_07 ? 15 : 7)) {
+ tcg_out32(s, NOP);
}
+ s->tb_jmp_insn_offset[args[0]] = tcg_current_code_size(s);
+ tcg_out32(s, ADDIS | TAI(TCG_REG_TB, TCG_REG_TB, 0));
+ tcg_out32(s, ADDI | TAI(TCG_REG_TB, TCG_REG_TB, 0));
} else {
- /* Indirect jump. */
- tcg_debug_assert(s->tb_jmp_insn_offset == NULL);
- tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_TB, 0,
- (intptr_t)(s->tb_jmp_insn_offset + args[0]));
+ s->tb_jmp_insn_offset[args[0]] = tcg_current_code_size(s);
+ tcg_out32(s, B);
+ s->tb_jmp_reset_offset[args[0]] = tcg_current_code_size(s);
+ break;
}
tcg_out32(s, MTSPR | RS(TCG_REG_TB) | CTR);
tcg_out32(s, BCCTR | BO_ALWAYS);
--
2.34.1
- [PULL 00/22] tcg patch queue, Richard Henderson, 2023/01/17
- [PULL 02/22] tcg/i386: Remove unused goto_tb code for indirect jump, Richard Henderson, 2023/01/17
- [PULL 01/22] tcg: Split out tcg_out_exit_tb, Richard Henderson, 2023/01/17
- [PULL 04/22] tcg/sparc64: Remove unused goto_tb code for indirect jump, Richard Henderson, 2023/01/17
- [PULL 03/22] tcg/ppc: Remove unused goto_tb code for indirect jump,
Richard Henderson <=
- [PULL 05/22] tcg: Replace asserts on tcg_jmp_insn_offset, Richard Henderson, 2023/01/17
- [PULL 06/22] tcg: Introduce set_jmp_insn_offset, Richard Henderson, 2023/01/17
- [PULL 07/22] tcg: Introduce get_jmp_target_addr, Richard Henderson, 2023/01/17
- [PULL 10/22] tcg: Add gen_tb to TCGContext, Richard Henderson, 2023/01/17
- [PULL 08/22] tcg: Split out tcg_out_goto_tb, Richard Henderson, 2023/01/17
- [PULL 11/22] tcg: Add TranslationBlock.jmp_insn_offset, Richard Henderson, 2023/01/17
- [PULL 09/22] tcg: Rename TB_JMP_RESET_OFFSET_INVALID to TB_JMP_OFFSET_INVALID, Richard Henderson, 2023/01/17
- [PULL 13/22] tcg: Move tb_target_set_jmp_target declaration to tcg.h, Richard Henderson, 2023/01/17
- [PULL 12/22] tcg: Change tb_target_set_jmp_target arguments, Richard Henderson, 2023/01/17
- [PULL 14/22] tcg: Always define tb_target_set_jmp_target, Richard Henderson, 2023/01/17