[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 23/63] target/cris: Add DISAS_UPDATE_NEXT
From: |
Richard Henderson |
Subject: |
[PULL 23/63] target/cris: Add DISAS_UPDATE_NEXT |
Date: |
Tue, 29 Jun 2021 11:54:15 -0700 |
Move this pc update into tb_stop.
We will be able to re-use this code shortly.
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/cris/translate.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/target/cris/translate.c b/target/cris/translate.c
index df92b90d4e..a2124ffcd5 100644
--- a/target/cris/translate.c
+++ b/target/cris/translate.c
@@ -52,9 +52,15 @@
#define BUG() (gen_BUG(dc, __FILE__, __LINE__))
#define BUG_ON(x) ({if (x) BUG();})
-/* 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 */
+/*
+ * Target-specific is_jmp field values
+ */
+/* Only pc was modified dynamically */
+#define DISAS_JUMP DISAS_TARGET_0
+/* Cpu state was modified dynamically, including pc */
+#define DISAS_UPDATE DISAS_TARGET_1
+/* Cpu state was modified dynamically, excluding pc -- use npc */
+#define DISAS_UPDATE_NEXT DISAS_TARGET_2
/* Used by the decoder. */
#define EXTRACT_FIELD(src, start, end) \
@@ -3268,8 +3274,8 @@ static void cris_tr_translate_insn(DisasContextBase
*dcbase, CPUState *cs)
/* Force an update if the per-tb cpu state has changed. */
if (dc->base.is_jmp == DISAS_NEXT && dc->cpustate_changed) {
- dc->base.is_jmp = DISAS_UPDATE;
- tcg_gen_movi_tl(env_pc, dc->pc);
+ dc->base.is_jmp = DISAS_UPDATE_NEXT;
+ return;
}
/*
@@ -3311,6 +3317,7 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase,
CPUState *cpu)
if (unlikely(dc->base.singlestep_enabled)) {
switch (is_jmp) {
case DISAS_TOO_MANY:
+ case DISAS_UPDATE_NEXT:
tcg_gen_movi_tl(env_pc, npc);
/* fall through */
case DISAS_JUMP:
@@ -3327,6 +3334,9 @@ static void cris_tr_tb_stop(DisasContextBase *dcbase,
CPUState *cpu)
case DISAS_TOO_MANY:
gen_goto_tb(dc, 0, npc);
break;
+ case DISAS_UPDATE_NEXT:
+ tcg_gen_movi_tl(env_pc, npc);
+ /* fall through */
case DISAS_JUMP:
case DISAS_UPDATE:
/* Indicate that interupts must be re-evaluated before the next TB. */
--
2.25.1
- [PULL 29/63] tcg: Add tcg_gen_vec_add{sub}16_i32, (continued)
- [PULL 29/63] tcg: Add tcg_gen_vec_add{sub}16_i32, Richard Henderson, 2021/06/29
- [PULL 22/63] target/cris: Set cpustate_changed for rfe/rfn, Richard Henderson, 2021/06/29
- [PULL 19/63] target/cris: Mark helper_raise_exception noreturn, Richard Henderson, 2021/06/29
- [PULL 15/63] target/cris: Replace DISAS_TB_JUMP with DISAS_NORETURN, Richard Henderson, 2021/06/29
- [PULL 13/63] target/cris: Add DisasContextBase to DisasContext, Richard Henderson, 2021/06/29
- [PULL 18/63] target/cris: Convert to TranslatorOps, Richard Henderson, 2021/06/29
- [PULL 11/63] target/avr: Change ctx to DisasContext* in gen_intermediate_code, Richard Henderson, 2021/06/29
- [PULL 20/63] target/cris: Mark static arrays const, Richard Henderson, 2021/06/29
- [PULL 27/63] target/cris: Remove dc->flagx_known, Richard Henderson, 2021/06/29
- [PULL 26/63] target/cris: Improve JMP_INDIRECT, Richard Henderson, 2021/06/29
- [PULL 23/63] target/cris: Add DISAS_UPDATE_NEXT,
Richard Henderson <=
- [PULL 21/63] target/cris: Fold unhandled X_FLAG changes into cpustate_changed, Richard Henderson, 2021/06/29
- [PULL 24/63] target/cris: Add DISAS_DBRANCH, Richard Henderson, 2021/06/29
- [PULL 10/63] target/avr: Add DisasContextBase to DisasContext, Richard Henderson, 2021/06/29
- [PULL 14/63] target/cris: Remove DISAS_SWI, Richard Henderson, 2021/06/29
- [PULL 30/63] tcg: Add tcg_gen_vec_add{sub}8_i32, Richard Henderson, 2021/06/29
- [PULL 25/63] target/cris: Use tcg_gen_lookup_and_goto_ptr, Richard Henderson, 2021/06/29
- [PULL 31/63] tcg: Add tcg_gen_vec_shl{shr}{sar}16i_i32, Richard Henderson, 2021/06/29
- [PULL 32/63] tcg: Add tcg_gen_vec_shl{shr}{sar}8i_i32, Richard Henderson, 2021/06/29
- [PULL 28/63] target/cris: Do not exit tb for X_FLAG changes, Richard Henderson, 2021/06/29
- [PULL 35/63] tcg: Add flags argument to bswap opcodes, Richard Henderson, 2021/06/29