[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 55/77] target/microblaze: Move bimm to BIMM_FLAG
From: |
Richard Henderson |
Subject: |
[PATCH 55/77] target/microblaze: Move bimm to BIMM_FLAG |
Date: |
Tue, 25 Aug 2020 13:59:28 -0700 |
It makes sense to keep BIMM with D_FLAG, as they can be written
back to iflags at the same time. BIMM_FLAG does not need to be
added to IFLAGS_TB_MASK because it does not affect the next TB,
only the exception path out of the current TB. Renumber IMM_FLAG,
as the value 4 holds no particular significance; pack these two
flags at the bottom of the bitfield.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/microblaze/cpu.h | 4 ++--
target/microblaze/helper.c | 2 +-
target/microblaze/translate.c | 12 +++++-------
3 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/target/microblaze/cpu.h b/target/microblaze/cpu.h
index 2fc7cf26f1..a5df1fa28f 100644
--- a/target/microblaze/cpu.h
+++ b/target/microblaze/cpu.h
@@ -231,7 +231,6 @@ typedef struct CPUMBState CPUMBState;
struct CPUMBState {
uint32_t btaken;
uint32_t btarget;
- uint32_t bimm;
uint32_t imm;
uint32_t regs[32];
@@ -253,7 +252,8 @@ struct CPUMBState {
uint32_t res_val;
/* Internal flags. */
-#define IMM_FLAG 4
+#define IMM_FLAG (1 << 0)
+#define BIMM_FLAG (1 << 1)
/* MSR_EE (1 << 8) */
/* MSR_UM (1 << 11) */
/* MSR_VM (1 << 13) */
diff --git a/target/microblaze/helper.c b/target/microblaze/helper.c
index f8e2ca12a9..06f4322e09 100644
--- a/target/microblaze/helper.c
+++ b/target/microblaze/helper.c
@@ -166,7 +166,7 @@ void mb_cpu_do_interrupt(CPUState *cs)
/* Reexecute the branch. */
env->regs[17] -= 4;
/* was the branch immprefixed?. */
- if (env->bimm) {
+ if (env->iflags & BIMM_FLAG) {
env->regs[17] -= 4;
log_cpu_state_mask(CPU_LOG_INT, cs, 0);
}
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 42d6d2a593..7fd1efd3fb 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -1337,13 +1337,11 @@ static void eval_cond_jmp(DisasContext *dc, TCGv_i32
pc_true, TCGv_i32 pc_false)
static void dec_setup_dslot(DisasContext *dc)
{
- TCGv_i32 tmp = tcg_const_i32(dc->type_b && (dc->tb_flags & IMM_FLAG));
-
- dc->delayed_branch = 2;
- dc->tb_flags |= D_FLAG;
-
- tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUMBState, bimm));
- tcg_temp_free_i32(tmp);
+ dc->delayed_branch = 2;
+ dc->tb_flags |= D_FLAG;
+ if (dc->type_b && (dc->tb_flags & IMM_FLAG)) {
+ dc->tb_flags |= BIMM_FLAG;
+ }
}
static void dec_bcc(DisasContext *dc)
--
2.25.1
- [PATCH 47/77] target/microblaze: Convert dec_fpu to decodetree, (continued)
- [PATCH 47/77] target/microblaze: Convert dec_fpu to decodetree, Richard Henderson, 2020/08/25
- [PATCH 46/77] target/microblaze: Convert dec_imm to decodetree, Richard Henderson, 2020/08/25
- [PATCH 48/77] target/microblaze: Fix cpu unwind for fpu exceptions, Richard Henderson, 2020/08/25
- [PATCH 49/77] target/microblaze: Mark fpu helpers TCG_CALL_NO_WG, Richard Henderson, 2020/08/25
- [PATCH 50/77] target/microblaze: Replace MSR_EE_FLAG with MSR_EE, Richard Henderson, 2020/08/25
- [PATCH 51/77] target/microblaze: Cache mem_index in DisasContext, Richard Henderson, 2020/08/25
- [PATCH 52/77] target/microblaze: Fix cpu unwind for stackprot, Richard Henderson, 2020/08/25
- [PATCH 53/77] target/microblaze: Convert dec_load and dec_store to decodetree, Richard Henderson, 2020/08/25
- [PATCH 54/77] target/microblaze: Assert no overlap in flags making up tb_flags, Richard Henderson, 2020/08/25
- [PATCH 57/77] tcg: Add tcg_get_insn_start_param, Richard Henderson, 2020/08/25
- [PATCH 55/77] target/microblaze: Move bimm to BIMM_FLAG,
Richard Henderson <=
- [PATCH 56/77] target/microblaze: Store "current" iflags in insn_start, Richard Henderson, 2020/08/25
- [PATCH 58/77] target/microblaze: Use cc->do_unaligned_access, Richard Henderson, 2020/08/25
- [PATCH 59/77] target/microblaze: Replace clear_imm with tb_flags_to_set, Richard Henderson, 2020/08/25
- [PATCH 60/77] target/microblaze: Replace delayed_branch with tb_flags_to_set, Richard Henderson, 2020/08/25
- [PATCH 61/77] target/microblaze: Tidy mb_cpu_dump_state, Richard Henderson, 2020/08/25
- [PATCH 62/77] target/microblaze: Try to keep imm and delay slot together, Richard Henderson, 2020/08/25
- [PATCH 63/77] target/microblaze: Convert brk and brki to decodetree, Richard Henderson, 2020/08/25