[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/61] target/hppa: Remove load_const
|
From: |
Richard Henderson |
|
Subject: |
[PATCH 04/61] target/hppa: Remove load_const |
|
Date: |
Wed, 18 Oct 2023 14:50:38 -0700 |
Replace with tcg_constant_reg.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/translate.c | 21 +++++++--------------
1 file changed, 7 insertions(+), 14 deletions(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 5302381a56..21f97f63a9 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -488,13 +488,6 @@ static void cond_free(DisasCond *cond)
}
}
-static TCGv_reg load_const(DisasContext *ctx, target_sreg v)
-{
- TCGv_reg t = tcg_temp_new();
- tcg_gen_movi_reg(t, v);
- return t;
-}
-
static TCGv_reg load_gpr(DisasContext *ctx, unsigned reg)
{
if (reg == 0) {
@@ -1164,7 +1157,7 @@ static bool do_add_imm(DisasContext *ctx, arg_rri_cf *a,
if (a->cf) {
nullify_over(ctx);
}
- tcg_im = load_const(ctx, a->i);
+ tcg_im = tcg_constant_reg(a->i);
tcg_r2 = load_gpr(ctx, a->r);
do_add(ctx, a->t, tcg_im, tcg_r2, 0, 0, is_tsv, is_tc, 0, a->cf);
return nullify_end(ctx);
@@ -1253,7 +1246,7 @@ static bool do_sub_imm(DisasContext *ctx, arg_rri_cf *a,
bool is_tsv)
if (a->cf) {
nullify_over(ctx);
}
- tcg_im = load_const(ctx, a->i);
+ tcg_im = tcg_constant_reg(a->i);
tcg_r2 = load_gpr(ctx, a->r);
do_sub(ctx, a->t, tcg_im, tcg_r2, is_tsv, 0, 0, a->cf);
return nullify_end(ctx);
@@ -2808,7 +2801,7 @@ static bool trans_cmpiclr(DisasContext *ctx, arg_rri_cf
*a)
nullify_over(ctx);
}
- tcg_im = load_const(ctx, a->i);
+ tcg_im = tcg_constant_reg(a->i);
tcg_r2 = load_gpr(ctx, a->r);
do_cmpclr(ctx, a->t, tcg_im, tcg_r2, a->cf);
@@ -2994,7 +2987,7 @@ static bool trans_cmpb(DisasContext *ctx, arg_cmpb *a)
static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a)
{
nullify_over(ctx);
- return do_cmpb(ctx, a->r, load_const(ctx, a->i), a->c, a->f, a->n,
a->disp);
+ return do_cmpb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n,
a->disp);
}
static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1,
@@ -3033,7 +3026,7 @@ static bool trans_addb(DisasContext *ctx, arg_addb *a)
static bool trans_addbi(DisasContext *ctx, arg_addbi *a)
{
nullify_over(ctx);
- return do_addb(ctx, a->r, load_const(ctx, a->i), a->c, a->f, a->n,
a->disp);
+ return do_addb(ctx, a->r, tcg_constant_reg(a->i), a->c, a->f, a->n,
a->disp);
}
static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar *a)
@@ -3345,7 +3338,7 @@ static bool trans_depwi_sar(DisasContext *ctx,
arg_depwi_sar *a)
if (a->c) {
nullify_over(ctx);
}
- return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen, load_const(ctx, a->i));
+ return do_depw_sar(ctx, a->t, a->c, a->nz, a->clen,
tcg_constant_reg(a->i));
}
static bool trans_be(DisasContext *ctx, arg_be *a)
@@ -3852,7 +3845,7 @@ static bool trans_ftest(DisasContext *ctx, arg_ftest *a)
return true;
}
if (inv) {
- TCGv_reg c = load_const(ctx, mask);
+ TCGv_reg c = tcg_constant_reg(mask);
tcg_gen_or_reg(t, t, c);
ctx->null_cond = cond_make(TCG_COND_EQ, t, c);
} else {
--
2.34.1
- [PATCH 28/61] target/hppa: Drop attempted gdbstub support for hppa64, (continued)
- [PATCH 28/61] target/hppa: Drop attempted gdbstub support for hppa64, Richard Henderson, 2023/10/18
- [PATCH 31/61] target/hppa: Decode d for unit instructions, Richard Henderson, 2023/10/18
- [PATCH 11/61] target/hppa: Fix extrw and depw with sar for hppa64, Richard Henderson, 2023/10/18
- [PATCH 14/61] target/hppa: Implement cpu_list, Richard Henderson, 2023/10/18
- [PATCH 17/61] target/hppa: Handle absolute addresses for pa2.0, Richard Henderson, 2023/10/18
- [PATCH 30/61] target/hppa: Decode d for logical instructions, Richard Henderson, 2023/10/18
- [PATCH 27/61] linux-user/hppa: Fixes for TARGET_ABI32, Richard Henderson, 2023/10/18
- [PATCH 36/61] target/hppa: Decode d for cmpb instructions, Richard Henderson, 2023/10/18
- [PATCH 38/61] target/hppa: Decode ADDB double-word, Richard Henderson, 2023/10/18
- [PATCH 19/61] hw/hppa: Translate phys addresses for the cpu, Richard Henderson, 2023/10/18
- [PATCH 04/61] target/hppa: Remove load_const,
Richard Henderson <=
- [PATCH 20/61] target/hppa: Fix hppa64 addressing, Richard Henderson, 2023/10/18
- [PATCH 25/61] target/hppa: Pass d to do_sed_cond, Richard Henderson, 2023/10/18
- [PATCH 29/61] target/hppa: Remove TARGET_HPPA64, Richard Henderson, 2023/10/18
- [PATCH 34/61] target/hppa: Decode d for sub instructions, Richard Henderson, 2023/10/18
- [PATCH 37/61] target/hppa: Decode CMPIB double-word, Richard Henderson, 2023/10/18
- [PATCH 15/61] target/hppa: Implement hppa_cpu_class_by_name, Richard Henderson, 2023/10/18
- [PATCH 16/61] target/hppa: Update cpu_hppa_get/put_psw for hppa64, Richard Henderson, 2023/10/18
- [PATCH 22/61] target/hppa: Pass d to do_cond, Richard Henderson, 2023/10/18
- [PATCH 23/61] target/hppa: Pass d to do_sub_cond, Richard Henderson, 2023/10/18
- [PATCH 24/61] target/hppa: Pass d to do_log_cond, Richard Henderson, 2023/10/18