[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/7] target/nios2: Add DisasContextBase to DisasContext
From: |
Peter Maydell |
Subject: |
Re: [PATCH 4/7] target/nios2: Add DisasContextBase to DisasContext |
Date: |
Mon, 28 Jun 2021 16:27:50 +0100 |
On Sun, 20 Jun 2021 at 06:31, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> Migrate the is_jmp, tb and singlestep_enabled fields
> from DisasContext into the base.
The commit message says we're only moving is_jmp, tb and
singlestep_enabled, but...
> static bool use_goto_tb(DisasContext *dc, uint32_t dest)
> {
> - if (unlikely(dc->singlestep_enabled)) {
> + if (unlikely(dc->base.singlestep_enabled)) {
> return false;
> }
>
> #ifndef CONFIG_USER_ONLY
> - return (dc->tb->pc & TARGET_PAGE_MASK) == (dest & TARGET_PAGE_MASK);
> + return (dc->base.pc_first & TARGET_PAGE_MASK) == (dest &
> TARGET_PAGE_MASK);
...here we change one, but only one, of the uses of a PC related
variable too...
> @@ -812,11 +810,16 @@ void gen_intermediate_code(CPUState *cs,
> TranslationBlock *tb, int max_insns)
> int num_insns;
>
> /* Initialize DC */
> - dc->is_jmp = DISAS_NEXT;
> +
> + dc->base.tb = tb;
> + dc->base.singlestep_enabled = cs->singlestep_enabled;
> + dc->base.is_jmp = DISAS_NEXT;
> + dc->base.pc_first = tb->pc;
> + dc->base.pc_next = tb->pc;
...which AFAICT is the only reason we needed to set pc_first/pc_next
here, which lines are then deleted again in the next patch.
I guess we get to where we're trying to get to in the end.
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
thanks
-- PMM
- [PATCH 0/7] target/nios2: Convert to TranslatorOps, Richard Henderson, 2021/06/20
- [PATCH 1/7] target/nios2: Replace DISAS_TB_JUMP with DISAS_NORETURN, Richard Henderson, 2021/06/20
- [PATCH 2/7] target/nios2: Use global cpu_env, Richard Henderson, 2021/06/20
- [PATCH 7/7] target/nios2: Clean up goto in handle_instruction, Richard Henderson, 2021/06/20
- [PATCH 3/7] target/nios2: Use global cpu_R, Richard Henderson, 2021/06/20
- [PATCH 4/7] target/nios2: Add DisasContextBase to DisasContext, Richard Henderson, 2021/06/20
- Re: [PATCH 4/7] target/nios2: Add DisasContextBase to DisasContext,
Peter Maydell <=
- [PATCH 6/7] target/nios2: Remove assignment to env in handle_instruction, Richard Henderson, 2021/06/20
- [PATCH 5/7] target/nios2: Convert to TranslatorOps, Richard Henderson, 2021/06/20