[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 29/78] target/cris: add fallthrough pseudo-keyword
From: |
Emmanouil Pitsidianakis |
Subject: |
[RFC PATCH 29/78] target/cris: add fallthrough pseudo-keyword |
Date: |
Fri, 13 Oct 2023 10:47:33 +0300 |
In preparation of raising -Wimplicit-fallthrough to 5, replace all
fall-through comments with the fallthrough attribute pseudo-keyword.
Signed-off-by: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
---
target/cris/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/cris/translate.c b/target/cris/translate.c
index b3974ba0bb..bdd128db23 100644
--- a/target/cris/translate.c
+++ b/target/cris/translate.c
@@ -3061,94 +3061,94 @@ static void cris_tr_translate_insn(DisasContextBase
*dcbase, CPUState *cs)
static void cris_tr_tb_stop(DisasContextBase *dcbase, CPUState *cpu)
{
DisasContext *dc = container_of(dcbase, DisasContext, base);
DisasJumpType is_jmp = dc->base.is_jmp;
target_ulong npc = dc->pc;
if (is_jmp == DISAS_NORETURN) {
/* If we have a broken branch+delayslot sequence, it's too late. */
assert(dc->delayed_branch != 1);
return;
}
if (dc->clear_locked_irq) {
t_gen_movi_env_TN(locked_irq, 0);
}
/* Broken branch+delayslot sequence. */
if (dc->delayed_branch == 1) {
/* Set env->dslot to the size of the branch insn. */
t_gen_movi_env_TN(dslot, dc->pc - dc->ppc);
cris_store_direct_jmp(dc);
}
cris_evaluate_flags(dc);
/* Evaluate delayed branch destination and fold to another is_jmp case. */
if (is_jmp == DISAS_DBRANCH) {
if (dc->base.tb->flags & 7) {
t_gen_movi_env_TN(dslot, 0);
}
switch (dc->jmp) {
case JMP_DIRECT:
npc = dc->jmp_pc;
is_jmp = dc->cpustate_changed ? DISAS_UPDATE_NEXT : DISAS_TOO_MANY;
break;
case JMP_DIRECT_CC:
/*
* Use a conditional branch if either taken or not-taken path
* can use goto_tb. If neither can, then treat it as indirect.
*/
if (likely(!dc->cpustate_changed)
&& (use_goto_tb(dc, dc->jmp_pc) || use_goto_tb(dc, npc))) {
TCGLabel *not_taken = gen_new_label();
tcg_gen_brcondi_tl(TCG_COND_EQ, env_btaken, 0, not_taken);
gen_goto_tb(dc, 1, dc->jmp_pc);
gen_set_label(not_taken);
/* not-taken case handled below. */
is_jmp = DISAS_TOO_MANY;
break;
}
tcg_gen_movi_tl(env_btarget, dc->jmp_pc);
- /* fall through */
+ fallthrough;
case JMP_INDIRECT:
tcg_gen_movcond_tl(TCG_COND_NE, env_pc,
env_btaken, tcg_constant_tl(0),
env_btarget, tcg_constant_tl(npc));
is_jmp = dc->cpustate_changed ? DISAS_UPDATE : DISAS_JUMP;
/*
* We have now consumed btaken and btarget. Hint to the
* tcg compiler that the writeback to env may be dropped.
*/
tcg_gen_discard_tl(env_btaken);
tcg_gen_discard_tl(env_btarget);
break;
default:
g_assert_not_reached();
}
}
switch (is_jmp) {
case DISAS_TOO_MANY:
gen_goto_tb(dc, 0, npc);
break;
case DISAS_UPDATE_NEXT:
tcg_gen_movi_tl(env_pc, npc);
- /* fall through */
+ fallthrough;
case DISAS_JUMP:
tcg_gen_lookup_and_goto_ptr();
break;
case DISAS_UPDATE:
/* Indicate that interrupts must be re-evaluated before the next TB. */
tcg_gen_exit_tb(NULL, 0);
break;
default:
g_assert_not_reached();
}
}
--
2.39.2
- [RFC PATCH 22/78] target/ppc: add fallthrough pseudo-keyword, (continued)
- [RFC PATCH 22/78] target/ppc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 21/78] target/sparc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 27/78] target/riscv: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 28/78] target/avr: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 24/78] target/alpha: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 25/78] target/i386: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 23/78] target/arm: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 26/78] target/s390x: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 29/78] target/cris: add fallthrough pseudo-keyword,
Emmanouil Pitsidianakis <=
- [RFC PATCH 30/78] target/nios2: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 33/78] target/rx: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 32/78] target/m68k: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 34/78] target/tricore: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 36/78] target/openrisc: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 37/78] target/hexagon: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 42/78] hw/i386: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 31/78] target/xtensa: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 38/78] system/rtc.c: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13
- [RFC PATCH 35/78] target/sh4: add fallthrough pseudo-keyword, Emmanouil Pitsidianakis, 2023/10/13