[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 43/67] target/hppa: Avoid use of tcg_const_i32 throughout
From: |
Richard Henderson |
Subject: |
[PULL 43/67] target/hppa: Avoid use of tcg_const_i32 throughout |
Date: |
Tue, 7 Mar 2023 09:58:24 -0800 |
All uses were read-write, so replace with a new
allocation and initialization.
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/translate.c | 21 +++++++++++----------
1 file changed, 11 insertions(+), 10 deletions(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 3ea50d0cec..6a3154ebc6 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -135,8 +135,6 @@
#define tcg_gen_extract_reg tcg_gen_extract_i64
#define tcg_gen_sextract_reg tcg_gen_sextract_i64
#define tcg_gen_extract2_reg tcg_gen_extract2_i64
-#define tcg_const_reg tcg_const_i64
-#define tcg_const_local_reg tcg_const_local_i64
#define tcg_constant_reg tcg_constant_i64
#define tcg_gen_movcond_reg tcg_gen_movcond_i64
#define tcg_gen_add2_reg tcg_gen_add2_i64
@@ -228,8 +226,6 @@
#define tcg_gen_extract_reg tcg_gen_extract_i32
#define tcg_gen_sextract_reg tcg_gen_sextract_i32
#define tcg_gen_extract2_reg tcg_gen_extract2_i32
-#define tcg_const_reg tcg_const_i32
-#define tcg_const_local_reg tcg_const_local_i32
#define tcg_constant_reg tcg_constant_i32
#define tcg_gen_movcond_reg tcg_gen_movcond_i32
#define tcg_gen_add2_reg tcg_gen_add2_i32
@@ -574,7 +570,9 @@ static TCGv_i32 load_frw_i32(unsigned rt)
static TCGv_i32 load_frw0_i32(unsigned rt)
{
if (rt == 0) {
- return tcg_const_i32(0);
+ TCGv_i32 ret = tcg_temp_new_i32();
+ tcg_gen_movi_i32(ret, 0);
+ return ret;
} else {
return load_frw_i32(rt);
}
@@ -582,15 +580,15 @@ static TCGv_i32 load_frw0_i32(unsigned rt)
static TCGv_i64 load_frw0_i64(unsigned rt)
{
+ TCGv_i64 ret = tcg_temp_new_i64();
if (rt == 0) {
- return tcg_const_i64(0);
+ tcg_gen_movi_i64(ret, 0);
} else {
- TCGv_i64 ret = tcg_temp_new_i64();
tcg_gen_ld32u_i64(ret, cpu_env,
offsetof(CPUHPPAState, fr[rt & 31])
+ (rt & 32 ? LO_OFS : HI_OFS));
- return ret;
}
+ return ret;
}
static void save_frw_i32(unsigned rt, TCGv_i32 val)
@@ -613,7 +611,9 @@ static TCGv_i64 load_frd(unsigned rt)
static TCGv_i64 load_frd0(unsigned rt)
{
if (rt == 0) {
- return tcg_const_i64(0);
+ TCGv_i64 ret = tcg_temp_new_i64();
+ tcg_gen_movi_i64(ret, 0);
+ return ret;
} else {
return load_frd(rt);
}
@@ -3330,7 +3330,8 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt,
unsigned c,
/* Convert big-endian bit numbering in SAR to left-shift. */
tcg_gen_xori_reg(shift, cpu_sar, TARGET_REGISTER_BITS - 1);
- mask = tcg_const_reg(msb + (msb - 1));
+ mask = tcg_temp_new();
+ tcg_gen_movi_reg(mask, msb + (msb - 1));
tcg_gen_and_reg(tmp, val, mask);
if (rs) {
tcg_gen_shl_reg(mask, mask, shift);
--
2.34.1
- [PULL 37/67] target/xtensa: Remove `NB_MMU_MODES` define, (continued)
- [PULL 37/67] target/xtensa: Remove `NB_MMU_MODES` define, Richard Henderson, 2023/03/07
- [PULL 35/67] target/sparc: Remove `NB_MMU_MODES` define, Richard Henderson, 2023/03/07
- [PULL 33/67] target/s390x: Remove `NB_MMU_MODES` define, Richard Henderson, 2023/03/07
- [PULL 38/67] include/exec: Remove guards around `NB_MMU_MODES`, Richard Henderson, 2023/03/07
- [PULL 32/67] target/rx: Remove `NB_MMU_MODES` define, Richard Henderson, 2023/03/07
- [PULL 36/67] target/tricore: Remove `NB_MMU_MODES` define, Richard Henderson, 2023/03/07
- [PULL 39/67] target/avr: Avoid use of tcg_const_i32 in SBIC, SBIS, Richard Henderson, 2023/03/07
- [PULL 31/67] target/riscv: Remove `NB_MMU_MODES` define, Richard Henderson, 2023/03/07
- [PULL 40/67] target/avr: Avoid use of tcg_const_i32 throughout, Richard Henderson, 2023/03/07
- [PULL 41/67] target/cris: Avoid use of tcg_const_i32 throughout, Richard Henderson, 2023/03/07
- [PULL 43/67] target/hppa: Avoid use of tcg_const_i32 throughout,
Richard Henderson <=
- [PULL 42/67] target/hppa: Avoid tcg_const_i64 in trans_fid_f, Richard Henderson, 2023/03/07
- [PULL 45/67] target/m68k: Avoid tcg_const_i32 when modified, Richard Henderson, 2023/03/07
- [PULL 44/67] target/i386: Avoid use of tcg_const_* throughout, Richard Henderson, 2023/03/07
- [PULL 46/67] target/m68k: Avoid tcg_const_i32 in bfop_reg, Richard Henderson, 2023/03/07
- [PULL 48/67] target/mips: Split out gen_lxl, Richard Henderson, 2023/03/07
- [PULL 49/67] target/mips: Split out gen_lxr, Richard Henderson, 2023/03/07
- [PULL 52/67] target/ppc: Split out gen_vx_vmul10, Richard Henderson, 2023/03/07
- [PULL 51/67] target/mips: Avoid tcg_const_* throughout, Richard Henderson, 2023/03/07
- [PULL 55/67] target/rx: Use cpu_psw_z as temp in flags computation, Richard Henderson, 2023/03/07
- [PULL 50/67] target/mips: Avoid tcg_const_tl in gen_r6_ld, Richard Henderson, 2023/03/07