[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 26/77] target/microblaze: Use DISAS_NORETURN
From: |
Richard Henderson |
Subject: |
[PATCH 26/77] target/microblaze: Use DISAS_NORETURN |
Date: |
Tue, 25 Aug 2020 13:58:59 -0700 |
Both exceptions and gen_goto_tb do not return. Use the
official DISAS_NORETURN enumerator for this case.
This eliminates all use of DISAS_TB_JUMP.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/microblaze/translate.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 0c9b4ffa5a..53ca0bfb38 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -51,7 +51,6 @@
/* is_jmp field values */
#define DISAS_JUMP DISAS_TARGET_0 /* only pc was modified dynamically */
#define DISAS_UPDATE DISAS_TARGET_1 /* cpu state was modified dynamically */
-#define DISAS_TB_JUMP DISAS_TARGET_2 /* only pc was modified statically */
static TCGv_i32 cpu_R[32];
static TCGv_i32 cpu_pc;
@@ -111,7 +110,7 @@ static void gen_raise_exception(DisasContext *dc, uint32_t
index)
gen_helper_raise_exception(cpu_env, tmp);
tcg_temp_free_i32(tmp);
- dc->is_jmp = DISAS_UPDATE;
+ dc->is_jmp = DISAS_NORETURN;
}
static void gen_raise_exception_sync(DisasContext *dc, uint32_t index)
@@ -149,6 +148,7 @@ static void gen_goto_tb(DisasContext *dc, int n,
target_ulong dest)
tcg_gen_movi_i32(cpu_pc, dest);
tcg_gen_exit_tb(NULL, 0);
}
+ dc->is_jmp = DISAS_NORETURN;
}
/*
@@ -1675,7 +1675,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
*tb, int max_insns)
} else if (dc->jmp == JMP_DIRECT) {
t_sync_flags(dc);
gen_goto_tb(dc, 0, dc->jmp_pc);
- dc->is_jmp = DISAS_TB_JUMP;
} else if (dc->jmp == JMP_DIRECT_CC) {
TCGLabel *l1 = gen_new_label();
t_sync_flags(dc);
@@ -1684,8 +1683,6 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
*tb, int max_insns)
gen_goto_tb(dc, 1, dc->pc);
gen_set_label(l1);
gen_goto_tb(dc, 0, dc->jmp_pc);
-
- dc->is_jmp = DISAS_TB_JUMP;
}
break;
}
@@ -1717,7 +1714,9 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock
*tb, int max_insns)
}
t_sync_flags(dc);
- if (unlikely(cs->singlestep_enabled)) {
+ if (dc->is_jmp == DISAS_NORETURN) {
+ /* nothing more to generate */
+ } else if (unlikely(cs->singlestep_enabled)) {
TCGv_i32 tmp = tcg_const_i32(EXCP_DEBUG);
if (dc->is_jmp != DISAS_JUMP) {
@@ -1730,16 +1729,14 @@ void gen_intermediate_code(CPUState *cs,
TranslationBlock *tb, int max_insns)
case DISAS_NEXT:
gen_goto_tb(dc, 1, npc);
break;
- default:
case DISAS_JUMP:
case DISAS_UPDATE:
/* indicate that the hash table must be used
to find the next TB */
tcg_gen_exit_tb(NULL, 0);
break;
- case DISAS_TB_JUMP:
- /* nothing more to generate */
- break;
+ default:
+ g_assert_not_reached();
}
}
gen_tb_end(tb, num_insns);
--
2.25.1
- [PATCH 16/77] target/microblaze: Fix width of FSR, (continued)
- [PATCH 16/77] target/microblaze: Fix width of FSR, Richard Henderson, 2020/08/25
- [PATCH 17/77] target/microblaze: Fix width of BTR, Richard Henderson, 2020/08/25
- [PATCH 18/77] target/microblaze: Fix width of EDR, Richard Henderson, 2020/08/25
- [PATCH 19/77] target/microblaze: Remove cpu_ear, Richard Henderson, 2020/08/25
- [PATCH 20/77] target/microblaze: Tidy raising of exceptions, Richard Henderson, 2020/08/25
- [PATCH 21/77] target/microblaze: Mark raise_exception as noreturn, Richard Henderson, 2020/08/25
- [PATCH 22/77] target/microblaze: Remove helper_debug and env->debug, Richard Henderson, 2020/08/25
- [PATCH 23/77] target/microblaze: Rename env_* tcg variables to cpu_*, Richard Henderson, 2020/08/25
- [PATCH 24/77] target/microblaze: Tidy mb_tcg_init, Richard Henderson, 2020/08/25
- [PATCH 27/77] target/microblaze: Check singlestep_enabled in gen_goto_tb, Richard Henderson, 2020/08/25
- [PATCH 26/77] target/microblaze: Use DISAS_NORETURN,
Richard Henderson <=
- [PATCH 30/77] target/microblaze: Remove SIM_COMPAT, Richard Henderson, 2020/08/25
- [PATCH 29/77] target/microblaze: Convert to translator_loop, Richard Henderson, 2020/08/25
- [PATCH 32/77] target/microblaze: Remove empty D macros, Richard Henderson, 2020/08/25
- [PATCH 25/77] target/microblaze: Split out MSR[C] to its own variable, Richard Henderson, 2020/08/25
- [PATCH 33/77] target/microblaze: Remove LOG_DIS, Richard Henderson, 2020/08/25
- [PATCH 36/77] target/microblaze: Convert dec_add to decodetree, Richard Henderson, 2020/08/25
- [PATCH 37/77] target/microblaze: Convert dec_sub to decodetree, Richard Henderson, 2020/08/25
- [PATCH 28/77] target/microblaze: Convert to DisasContextBase, Richard Henderson, 2020/08/25
- [PATCH 31/77] target/microblaze: Remove DISAS_GNU, Richard Henderson, 2020/08/25
- [PATCH 34/77] target/microblaze: Ensure imm constant is always available, Richard Henderson, 2020/08/25