Skip to content

Commit

Permalink
target/arm: Use insn_start from DisasContextBase
Browse files Browse the repository at this point in the history
To keep the multiple update check, replace insn_start
with insn_start_updated.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Apr 8, 2024
1 parent f3572df commit 14318e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion target/arm/tcg/translate-a64.c
Original file line number Diff line number Diff line change
Expand Up @@ -14179,7 +14179,7 @@ static void aarch64_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)
pc_arg &= ~TARGET_PAGE_MASK;
}
tcg_gen_insn_start(pc_arg, 0, 0);
dc->insn_start = tcg_last_op();
dc->insn_start_updated = false;
}

static void aarch64_tr_translate_insn(DisasContextBase *dcbase, CPUState *cpu)
Expand Down
2 changes: 1 addition & 1 deletion target/arm/tcg/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -9273,7 +9273,7 @@ static void arm_tr_insn_start(DisasContextBase *dcbase, CPUState *cpu)
condexec_bits = (dc->condexec_cond << 4) | (dc->condexec_mask >> 1);
}
tcg_gen_insn_start(pc_arg, condexec_bits, 0);
dc->insn_start = tcg_last_op();
dc->insn_start_updated = false;
}

static bool arm_check_kernelpage(DisasContext *dc)
Expand Down
12 changes: 6 additions & 6 deletions target/arm/tcg/translate.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ typedef struct DisasContext {
uint8_t gm_blocksize;
/* True if this page is guarded. */
bool guarded_page;
/* True if the current insn_start has been updated. */
bool insn_start_updated;
/* Bottom two bits of XScale c15_cpar coprocessor access control reg */
int c15_cpar;
/* TCG op of the current insn_start. */
TCGOp *insn_start;
/* Offset from VNCR_EL2 when FEAT_NV2 redirects this reg to memory */
uint32_t nv2_redirect_offset;
} DisasContext;
Expand Down Expand Up @@ -276,10 +276,10 @@ static inline void disas_set_insn_syndrome(DisasContext *s, uint32_t syn)
syn &= ARM_INSN_START_WORD2_MASK;
syn >>= ARM_INSN_START_WORD2_SHIFT;

/* We check and clear insn_start_idx to catch multiple updates. */
assert(s->insn_start != NULL);
tcg_set_insn_start_param(s->insn_start, 2, syn);
s->insn_start = NULL;
/* Check for multiple updates. */
assert(!s->insn_start_updated);
s->insn_start_updated = true;
tcg_set_insn_start_param(s->base.insn_start, 2, syn);
}

static inline int curr_insn_len(DisasContext *s)
Expand Down

0 comments on commit 14318e1

Please sign in to comment.