[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 26/76] target/microblaze: Use DISAS_NORETURN
From: |
Richard Henderson |
Subject: |
[PATCH v2 26/76] target/microblaze: Use DISAS_NORETURN |
Date: |
Fri, 28 Aug 2020 07:18:39 -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 v2 16/76] target/microblaze: Fix width of FSR, (continued)
- [PATCH v2 16/76] target/microblaze: Fix width of FSR, Richard Henderson, 2020/08/28
- [PATCH v2 17/76] target/microblaze: Fix width of BTR, Richard Henderson, 2020/08/28
- [PATCH v2 18/76] target/microblaze: Fix width of EDR, Richard Henderson, 2020/08/28
- [PATCH v2 19/76] target/microblaze: Remove cpu_ear, Richard Henderson, 2020/08/28
- [PATCH v2 20/76] target/microblaze: Tidy raising of exceptions, Richard Henderson, 2020/08/28
- [PATCH v2 21/76] target/microblaze: Mark raise_exception as noreturn, Richard Henderson, 2020/08/28
- [PATCH v2 22/76] target/microblaze: Remove helper_debug and env->debug, Richard Henderson, 2020/08/28
- [PATCH v2 24/76] target/microblaze: Tidy mb_tcg_init, Richard Henderson, 2020/08/28
- [PATCH v2 23/76] target/microblaze: Rename env_* tcg variables to cpu_*, Richard Henderson, 2020/08/28
- [PATCH v2 26/76] target/microblaze: Use DISAS_NORETURN,
Richard Henderson <=
- [PATCH v2 25/76] target/microblaze: Split out MSR[C] to its own variable, Richard Henderson, 2020/08/28
- [PATCH v2 27/76] target/microblaze: Check singlestep_enabled in gen_goto_tb, Richard Henderson, 2020/08/28
- [PATCH v2 29/76] target/microblaze: Convert to translator_loop, Richard Henderson, 2020/08/28
- [PATCH v2 30/76] target/microblaze: Remove SIM_COMPAT, Richard Henderson, 2020/08/28
- [PATCH v2 28/76] target/microblaze: Convert to DisasContextBase, Richard Henderson, 2020/08/28
- [PATCH v2 31/76] target/microblaze: Remove DISAS_GNU, Richard Henderson, 2020/08/28
- [PATCH v2 33/76] target/microblaze: Remove LOG_DIS, Richard Henderson, 2020/08/28
- [PATCH v2 32/76] target/microblaze: Remove empty D macros, Richard Henderson, 2020/08/28