[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 60/76] target/microblaze: Replace clear_imm with tb_flags_to_set
From: |
Richard Henderson |
Subject: |
[PULL 60/76] target/microblaze: Replace clear_imm with tb_flags_to_set |
Date: |
Mon, 31 Aug 2020 09:05:45 -0700 |
This more general update variable will be able to handle
delay slots as well.
Tested-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/microblaze/translate.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/target/microblaze/translate.c b/target/microblaze/translate.c
index 597b96ffb3..c0b586f467 100644
--- a/target/microblaze/translate.c
+++ b/target/microblaze/translate.c
@@ -75,7 +75,7 @@ typedef struct DisasContext {
unsigned int cpustate_changed;
unsigned int delayed_branch;
unsigned int tb_flags;
- unsigned int clear_imm;
+ unsigned int tb_flags_to_set;
int mem_index;
#define JMP_NOJMP 0
@@ -535,8 +535,7 @@ static bool trans_imm(DisasContext *dc, arg_imm *arg)
{
dc->ext_imm = arg->imm << 16;
tcg_gen_movi_i32(cpu_imm, dc->ext_imm);
- dc->tb_flags |= IMM_FLAG;
- dc->clear_imm = 0;
+ dc->tb_flags_to_set = IMM_FLAG;
return true;
}
@@ -1688,7 +1687,8 @@ static void mb_tr_translate_insn(DisasContextBase *dcb,
CPUState *cs)
(uint32_t)dc->base.pc_next);
}
- dc->clear_imm = 1;
+ dc->tb_flags_to_set = 0;
+
ir = cpu_ldl_code(env, dc->base.pc_next);
if (!decode(dc, ir)) {
old_decode(dc, ir);
@@ -1700,10 +1700,13 @@ static void mb_tr_translate_insn(DisasContextBase *dcb,
CPUState *cs)
dc->r0_set = false;
}
- if (dc->clear_imm && (dc->tb_flags & IMM_FLAG)) {
- dc->tb_flags &= ~IMM_FLAG;
+ /* Discard the imm global when its contents cannot be used. */
+ if ((dc->tb_flags & ~dc->tb_flags_to_set) & IMM_FLAG) {
tcg_gen_discard_i32(cpu_imm);
}
+
+ dc->tb_flags &= ~IMM_FLAG;
+ dc->tb_flags |= dc->tb_flags_to_set;
dc->base.pc_next += 4;
if (dc->delayed_branch && --dc->delayed_branch == 0) {
--
2.25.1
- [PULL 51/76] target/microblaze: Cache mem_index in DisasContext, (continued)
- [PULL 51/76] target/microblaze: Cache mem_index in DisasContext, Richard Henderson, 2020/08/31
- [PULL 50/76] target/microblaze: Replace MSR_EE_FLAG with MSR_EE, Richard Henderson, 2020/08/31
- [PULL 52/76] target/microblaze: Fix cpu unwind for stackprot, Richard Henderson, 2020/08/31
- [PULL 54/76] target/microblaze: Assert no overlap in flags making up tb_flags, Richard Henderson, 2020/08/31
- [PULL 53/76] target/microblaze: Convert dec_load and dec_store to decodetree, Richard Henderson, 2020/08/31
- [PULL 55/76] target/microblaze: Move bimm to BIMM_FLAG, Richard Henderson, 2020/08/31
- [PULL 56/76] target/microblaze: Fix no-op mb_cpu_transaction_failed, Richard Henderson, 2020/08/31
- [PULL 57/76] target/microblaze: Store "current" iflags in insn_start, Richard Henderson, 2020/08/31
- [PULL 58/76] tcg: Add tcg_get_insn_start_param, Richard Henderson, 2020/08/31
- [PULL 59/76] target/microblaze: Use cc->do_unaligned_access, Richard Henderson, 2020/08/31
- [PULL 60/76] target/microblaze: Replace clear_imm with tb_flags_to_set,
Richard Henderson <=
- [PULL 62/76] target/microblaze: Tidy mb_cpu_dump_state, Richard Henderson, 2020/08/31
- [PULL 61/76] target/microblaze: Replace delayed_branch with tb_flags_to_set, Richard Henderson, 2020/08/31
- [PULL 63/76] target/microblaze: Convert brk and brki to decodetree, Richard Henderson, 2020/08/31
- [PULL 64/76] target/microblaze: Convert mbar to decodetree, Richard Henderson, 2020/08/31
- [PULL 65/76] target/microblaze: Reorganize branching, Richard Henderson, 2020/08/31
- [PULL 66/76] target/microblaze: Convert dec_br to decodetree, Richard Henderson, 2020/08/31
- [PULL 67/76] target/microblaze: Convert dec_bcc to decodetree, Richard Henderson, 2020/08/31
- [PULL 68/76] target/microblaze: Convert dec_rts to decodetree, Richard Henderson, 2020/08/31
- [PULL 69/76] target/microblaze: Tidy do_rti, do_rtb, do_rte, Richard Henderson, 2020/08/31
- [PULL 70/76] target/microblaze: Convert msrclr, msrset to decodetree, Richard Henderson, 2020/08/31