target/arm: Use tcg_constant for gen_srs

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20220426163043.100432-28-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Richard Henderson 2022-04-26 09:30:23 -07:00 committed by Peter Maydell
parent dfbbf5e1f9
commit cca8046259
1 changed files with 2 additions and 6 deletions

View File

@ -5137,12 +5137,10 @@ static void gen_srs(DisasContext *s,
} }
addr = tcg_temp_new_i32(); addr = tcg_temp_new_i32();
tmp = tcg_const_i32(mode);
/* get_r13_banked() will raise an exception if called from System mode */ /* get_r13_banked() will raise an exception if called from System mode */
gen_set_condexec(s); gen_set_condexec(s);
gen_set_pc_im(s, s->pc_curr); gen_set_pc_im(s, s->pc_curr);
gen_helper_get_r13_banked(addr, cpu_env, tmp); gen_helper_get_r13_banked(addr, cpu_env, tcg_constant_i32(mode));
tcg_temp_free_i32(tmp);
switch (amode) { switch (amode) {
case 0: /* DA */ case 0: /* DA */
offset = -4; offset = -4;
@ -5185,9 +5183,7 @@ static void gen_srs(DisasContext *s,
abort(); abort();
} }
tcg_gen_addi_i32(addr, addr, offset); tcg_gen_addi_i32(addr, addr, offset);
tmp = tcg_const_i32(mode); gen_helper_set_r13_banked(cpu_env, tcg_constant_i32(mode), addr);
gen_helper_set_r13_banked(cpu_env, tmp, addr);
tcg_temp_free_i32(tmp);
} }
tcg_temp_free_i32(addr); tcg_temp_free_i32(addr);
s->base.is_jmp = DISAS_UPDATE_EXIT; s->base.is_jmp = DISAS_UPDATE_EXIT;