[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 24/54] target/arm: Use tcg_constant for gen_{msr,mrs}
From: |
Peter Maydell |
Subject: |
[PULL 24/54] target/arm: Use tcg_constant for gen_{msr,mrs} |
Date: |
Thu, 28 Apr 2022 15:39:28 +0100 |
From: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20220426163043.100432-25-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
target/arm/translate.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/target/arm/translate.c b/target/arm/translate.c
index 501192ed55f..2e4165be3d2 100644
--- a/target/arm/translate.c
+++ b/target/arm/translate.c
@@ -2845,7 +2845,7 @@ static bool msr_banked_access_decode(DisasContext *s, int
r, int sysm, int rn,
tcg_gen_sextract_i32(tcg_el, tcg_el, ctz32(SCR_EEL2), 1);
tcg_gen_addi_i32(tcg_el, tcg_el, 3);
} else {
- tcg_el = tcg_const_i32(3);
+ tcg_el = tcg_constant_i32(3);
}
gen_exception_el(s, EXCP_UDEF, syn_uncategorized(), tcg_el);
@@ -2880,7 +2880,7 @@ undef:
static void gen_msr_banked(DisasContext *s, int r, int sysm, int rn)
{
- TCGv_i32 tcg_reg, tcg_tgtmode, tcg_regno;
+ TCGv_i32 tcg_reg;
int tgtmode = 0, regno = 0;
if (!msr_banked_access_decode(s, r, sysm, rn, &tgtmode, ®no)) {
@@ -2891,18 +2891,16 @@ static void gen_msr_banked(DisasContext *s, int r, int
sysm, int rn)
gen_set_condexec(s);
gen_set_pc_im(s, s->pc_curr);
tcg_reg = load_reg(s, rn);
- tcg_tgtmode = tcg_const_i32(tgtmode);
- tcg_regno = tcg_const_i32(regno);
- gen_helper_msr_banked(cpu_env, tcg_reg, tcg_tgtmode, tcg_regno);
- tcg_temp_free_i32(tcg_tgtmode);
- tcg_temp_free_i32(tcg_regno);
+ gen_helper_msr_banked(cpu_env, tcg_reg,
+ tcg_constant_i32(tgtmode),
+ tcg_constant_i32(regno));
tcg_temp_free_i32(tcg_reg);
s->base.is_jmp = DISAS_UPDATE_EXIT;
}
static void gen_mrs_banked(DisasContext *s, int r, int sysm, int rn)
{
- TCGv_i32 tcg_reg, tcg_tgtmode, tcg_regno;
+ TCGv_i32 tcg_reg;
int tgtmode = 0, regno = 0;
if (!msr_banked_access_decode(s, r, sysm, rn, &tgtmode, ®no)) {
@@ -2913,11 +2911,9 @@ static void gen_mrs_banked(DisasContext *s, int r, int
sysm, int rn)
gen_set_condexec(s);
gen_set_pc_im(s, s->pc_curr);
tcg_reg = tcg_temp_new_i32();
- tcg_tgtmode = tcg_const_i32(tgtmode);
- tcg_regno = tcg_const_i32(regno);
- gen_helper_mrs_banked(tcg_reg, cpu_env, tcg_tgtmode, tcg_regno);
- tcg_temp_free_i32(tcg_tgtmode);
- tcg_temp_free_i32(tcg_regno);
+ gen_helper_mrs_banked(tcg_reg, cpu_env,
+ tcg_constant_i32(tgtmode),
+ tcg_constant_i32(regno));
store_reg(s, rn, tcg_reg);
s->base.is_jmp = DISAS_UPDATE_EXIT;
}
--
2.25.1
- [PULL 00/54] target-arm queue, Peter Maydell, 2022/04/28
- [PULL 02/54] target/arm: Use tcg_constant in gen_mte_check*, Peter Maydell, 2022/04/28
- [PULL 06/54] target/arm: Use tcg_constant in handle_sys, Peter Maydell, 2022/04/28
- [PULL 04/54] target/arm: Use tcg_constant in gen_adc_CC, Peter Maydell, 2022/04/28
- [PULL 01/54] target/arm: Use tcg_constant in gen_probe_access, Peter Maydell, 2022/04/28
- [PULL 05/54] target/arm: Use tcg_constant in handle_msr_i, Peter Maydell, 2022/04/28
- [PULL 21/54] target/arm: Use tcg_constant in balance of translate-a64.c, Peter Maydell, 2022/04/28
- [PULL 24/54] target/arm: Use tcg_constant for gen_{msr,mrs},
Peter Maydell <=
- [PULL 07/54] target/arm: Use tcg_constant in disas_exc, Peter Maydell, 2022/04/28
- [PULL 15/54] target/arm: Use tcg_constant in handle_{rev16,crc32}, Peter Maydell, 2022/04/28
- [PULL 09/54] target/arm: Use tcg_constant in disas_ld_lit, Peter Maydell, 2022/04/28
- [PULL 11/54] target/arm: Use tcg_constant in disas_add_sum_imm*, Peter Maydell, 2022/04/28
- [PULL 13/54] target/arm: Use tcg_constant in shift_reg_imm, Peter Maydell, 2022/04/28
- [PULL 14/54] target/arm: Use tcg_constant in disas_cond_select, Peter Maydell, 2022/04/28
- [PULL 16/54] target/arm: Use tcg_constant in disas_data_proc_2src, Peter Maydell, 2022/04/28
- [PULL 03/54] target/arm: Use tcg_constant in gen_exception*, Peter Maydell, 2022/04/28
- [PULL 08/54] target/arm: Use tcg_constant in gen_compare_and_swap_pair, Peter Maydell, 2022/04/28
- [PULL 10/54] target/arm: Use tcg_constant in disas_ldst_*, Peter Maydell, 2022/04/28