Skip to content

Commit

Permalink
target/hppa: Remove get_temp_tl
Browse files Browse the repository at this point in the history
Replace with tcg_temp_new_tl without recording into ctx.

Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
  • Loading branch information
rth7680 committed Nov 7, 2023
1 parent e12c630 commit a677986
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions target/hppa/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,6 @@ typedef struct DisasContext {
target_ureg iaoq_n;
TCGv_reg iaoq_n_var;

int ntempl;
TCGv_tl templ[4];

DisasCond null_cond;
TCGLabel *null_lab;

Expand Down Expand Up @@ -491,15 +488,6 @@ static void cond_free(DisasCond *cond)
}
}

#ifndef CONFIG_USER_ONLY
static TCGv_tl get_temp_tl(DisasContext *ctx)
{
unsigned i = ctx->ntempl++;
g_assert(i < ARRAY_SIZE(ctx->templ));
return ctx->templ[i] = tcg_temp_new_tl();
}
#endif

static TCGv_reg load_const(DisasContext *ctx, target_sreg v)
{
TCGv_reg t = tcg_temp_new();
Expand Down Expand Up @@ -1374,7 +1362,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base)
if (sp < 0) {
sp = ~sp;
}
spc = get_temp_tl(ctx);
spc = tcg_temp_new_tl();
load_spr(ctx, spc, sp);
return spc;
}
Expand All @@ -1384,7 +1372,7 @@ static TCGv_i64 space_select(DisasContext *ctx, int sp, TCGv_reg base)

ptr = tcg_temp_new_ptr();
tmp = tcg_temp_new();
spc = get_temp_tl(ctx);
spc = tcg_temp_new_tl();

tcg_gen_shri_reg(tmp, base, TARGET_REGISTER_BITS - 5);
tcg_gen_andi_reg(tmp, tmp, 030);
Expand Down Expand Up @@ -1420,7 +1408,7 @@ static void form_gva(DisasContext *ctx, TCGv_tl *pgva, TCGv_reg *pofs,
#ifdef CONFIG_USER_ONLY
*pgva = (modify <= 0 ? ofs : base);
#else
TCGv_tl addr = get_temp_tl(ctx);
TCGv_tl addr = tcg_temp_new_tl();
tcg_gen_extu_reg_tl(addr, modify <= 0 ? ofs : base);
if (ctx->tb_flags & PSW_W) {
tcg_gen_andi_tl(addr, addr, 0x3fffffffffffffffull);
Expand Down Expand Up @@ -4081,9 +4069,6 @@ static void hppa_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs)
/* Bound the number of instructions by those left on the page. */
bound = -(ctx->base.pc_first | TARGET_PAGE_MASK) / 4;
ctx->base.max_insns = MIN(ctx->base.max_insns, bound);

ctx->ntempl = 0;
memset(ctx->templ, 0, sizeof(ctx->templ));
}

static void hppa_tr_tb_start(DisasContextBase *dcbase, CPUState *cs)
Expand Down Expand Up @@ -4112,7 +4097,6 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
DisasContext *ctx = container_of(dcbase, DisasContext, base);
CPUHPPAState *env = cpu_env(cs);
DisasJumpType ret;
int i, n;

/* Execute one insn. */
#ifdef CONFIG_USER_ONLY
Expand Down Expand Up @@ -4151,12 +4135,6 @@ static void hppa_tr_translate_insn(DisasContextBase *dcbase, CPUState *cs)
}
}

/* Forget any temporaries allocated. */
for (i = 0, n = ctx->ntempl; i < n; ++i) {
ctx->templ[i] = NULL;
}
ctx->ntempl = 0;

/* Advance the insn queue. Note that this check also detects
a priority change within the instruction queue. */
if (ret == DISAS_NEXT && ctx->iaoq_b != ctx->iaoq_f + 4) {
Expand Down

0 comments on commit a677986

Please sign in to comment.