[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 35/88] target/hppa: Pass d to do_sed_cond
From: |
Richard Henderson |
Subject: |
[PATCH v3 35/88] target/hppa: Pass d to do_sed_cond |
Date: |
Wed, 1 Nov 2023 18:29:23 -0700 |
Hoist the resolution of d up one level above do_sed_cond.
The MOVB comparison and the existing shift/extract/deposit
are all 32-bit.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/translate.c | 24 +++++++++++++-----------
1 file changed, 13 insertions(+), 11 deletions(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index ac7f1f048c..eb4605a9c7 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -1050,10 +1050,10 @@ static DisasCond do_log_cond(DisasContext *ctx,
unsigned cf, bool d,
/* Similar, but for shift/extract/deposit conditions. */
-static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, TCGv_reg res)
+static DisasCond do_sed_cond(DisasContext *ctx, unsigned orig, bool d,
+ TCGv_reg res)
{
unsigned c, f;
- bool d = false;
/* Convert the compressed condition codes to standard.
0-2 are the same as logicals (nv,<,<=), while 3 is OD.
@@ -3224,7 +3224,8 @@ static bool trans_movb(DisasContext *ctx, arg_movb *a)
tcg_gen_mov_reg(dest, cpu_gr[a->r1]);
}
- cond = do_sed_cond(ctx, a->c, dest);
+ /* All MOVB conditions are 32-bit. */
+ cond = do_sed_cond(ctx, a->c, false, dest);
return do_cbranch(ctx, a->disp, a->n, &cond);
}
@@ -3238,7 +3239,8 @@ static bool trans_movbi(DisasContext *ctx, arg_movbi *a)
dest = dest_gpr(ctx, a->r);
tcg_gen_movi_reg(dest, a->i);
- cond = do_sed_cond(ctx, a->c, dest);
+ /* All MOVBI conditions are 32-bit. */
+ cond = do_sed_cond(ctx, a->c, false, dest);
return do_cbranch(ctx, a->disp, a->n, &cond);
}
@@ -3276,7 +3278,7 @@ static bool trans_shrpw_sar(DisasContext *ctx,
arg_shrpw_sar *a)
/* Install the new nullification. */
cond_free(&ctx->null_cond);
if (a->c) {
- ctx->null_cond = do_sed_cond(ctx, a->c, dest);
+ ctx->null_cond = do_sed_cond(ctx, a->c, false, dest);
}
return nullify_end(ctx);
}
@@ -3312,7 +3314,7 @@ static bool trans_shrpw_imm(DisasContext *ctx,
arg_shrpw_imm *a)
/* Install the new nullification. */
cond_free(&ctx->null_cond);
if (a->c) {
- ctx->null_cond = do_sed_cond(ctx, a->c, dest);
+ ctx->null_cond = do_sed_cond(ctx, a->c, false, dest);
}
return nullify_end(ctx);
}
@@ -3346,7 +3348,7 @@ static bool trans_extrw_sar(DisasContext *ctx,
arg_extrw_sar *a)
/* Install the new nullification. */
cond_free(&ctx->null_cond);
if (a->c) {
- ctx->null_cond = do_sed_cond(ctx, a->c, dest);
+ ctx->null_cond = do_sed_cond(ctx, a->c, false, dest);
}
return nullify_end(ctx);
}
@@ -3373,7 +3375,7 @@ static bool trans_extrw_imm(DisasContext *ctx,
arg_extrw_imm *a)
/* Install the new nullification. */
cond_free(&ctx->null_cond);
if (a->c) {
- ctx->null_cond = do_sed_cond(ctx, a->c, dest);
+ ctx->null_cond = do_sed_cond(ctx, a->c, false, dest);
}
return nullify_end(ctx);
}
@@ -3410,7 +3412,7 @@ static bool trans_depwi_imm(DisasContext *ctx,
arg_depwi_imm *a)
/* Install the new nullification. */
cond_free(&ctx->null_cond);
if (a->c) {
- ctx->null_cond = do_sed_cond(ctx, a->c, dest);
+ ctx->null_cond = do_sed_cond(ctx, a->c, false, dest);
}
return nullify_end(ctx);
}
@@ -3440,7 +3442,7 @@ static bool trans_depw_imm(DisasContext *ctx,
arg_depw_imm *a)
/* Install the new nullification. */
cond_free(&ctx->null_cond);
if (a->c) {
- ctx->null_cond = do_sed_cond(ctx, a->c, dest);
+ ctx->null_cond = do_sed_cond(ctx, a->c, false, dest);
}
return nullify_end(ctx);
}
@@ -3477,7 +3479,7 @@ static bool do_depw_sar(DisasContext *ctx, unsigned rt,
unsigned c,
/* Install the new nullification. */
cond_free(&ctx->null_cond);
if (c) {
- ctx->null_cond = do_sed_cond(ctx, c, dest);
+ ctx->null_cond = do_sed_cond(ctx, c, false, dest);
}
return nullify_end(ctx);
}
--
2.34.1
- [PATCH v3 29/88] target/hppa: Use copy_iaoq_entry for link in do_ibranch, (continued)
- [PATCH v3 29/88] target/hppa: Use copy_iaoq_entry for link in do_ibranch, Richard Henderson, 2023/11/01
- [PATCH v3 33/88] target/hppa: Pass d to do_sub_cond, Richard Henderson, 2023/11/01
- [PATCH v3 34/88] target/hppa: Pass d to do_log_cond, Richard Henderson, 2023/11/01
- [PATCH v3 30/88] target/hppa: Mask inputs in copy_iaoq_entry, Richard Henderson, 2023/11/01
- [PATCH v3 08/88] tcg: Improve expansion of deposit into a constant, Richard Henderson, 2023/11/01
- [PATCH v3 20/88] target/hppa: Make HPPA_BTLB_ENTRIES variable, Richard Henderson, 2023/11/01
- [PATCH v3 27/88] target/hppa: Pass DisasContext to copy_iaoq_entry, Richard Henderson, 2023/11/01
- [PATCH v3 28/88] target/hppa: Always use copy_iaoq_entry to set cpu_iaoq_[fb], Richard Henderson, 2023/11/01
- [PATCH v3 32/88] target/hppa: Pass d to do_cond, Richard Henderson, 2023/11/01
- [PATCH v3 37/88] linux-user/hppa: Fixes for TARGET_ABI32, Richard Henderson, 2023/11/01
- [PATCH v3 35/88] target/hppa: Pass d to do_sed_cond,
Richard Henderson <=
- [PATCH v3 36/88] target/hppa: Pass d to do_unit_cond, Richard Henderson, 2023/11/01
- [PATCH v3 38/88] target/hppa: Drop attempted gdbstub support for hppa64, Richard Henderson, 2023/11/01
- [PATCH v3 39/88] target/hppa: Remove TARGET_HPPA64, Richard Henderson, 2023/11/01
- [PATCH v3 40/88] target/hppa: Decode d for logical instructions, Richard Henderson, 2023/11/01
- [PATCH v3 41/88] target/hppa: Decode d for unit instructions, Richard Henderson, 2023/11/01
- [PATCH v3 43/88] target/hppa: Decode d for add instructions, Richard Henderson, 2023/11/01
- [PATCH v3 42/88] target/hppa: Decode d for cmpclr instructions, Richard Henderson, 2023/11/01
- [PATCH v3 44/88] target/hppa: Decode d for sub instructions, Richard Henderson, 2023/11/01
- [PATCH v3 49/88] target/hppa: Implement LDD, LDCD, LDDA, STD, STDA, Richard Henderson, 2023/11/01
- [PATCH v3 51/88] target/hppa: Implement EXTRD, Richard Henderson, 2023/11/01