[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 11/65] target/hppa: Fix bb_sar for hppa64
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v2 11/65] target/hppa: Fix bb_sar for hppa64 |
|
Date: |
Fri, 20 Oct 2023 13:42:37 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/translate.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 8ebe7523a7..119422870c 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -3073,14 +3073,21 @@ static bool trans_bb_sar(DisasContext *ctx, arg_bb_sar
*a)
{
TCGv_reg tmp, tcg_r;
DisasCond cond;
+ bool d = false;
nullify_over(ctx);
tmp = tcg_temp_new();
tcg_r = load_gpr(ctx, a->r);
- tcg_gen_shl_reg(tmp, tcg_r, cpu_sar);
+ if (cond_need_ext(ctx, d)) {
+ /* Force shift into [32,63] */
+ tcg_gen_ori_reg(tmp, cpu_sar, 32);
+ tcg_gen_shl_reg(tmp, tcg_r, tmp);
+ } else {
+ tcg_gen_shl_reg(tmp, tcg_r, cpu_sar);
+ }
- cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp);
+ cond = cond_make_0_tmp(a->c ? TCG_COND_GE : TCG_COND_LT, tmp);
return do_cbranch(ctx, a->disp, a->n, &cond);
}
@@ -3088,12 +3095,15 @@ static bool trans_bb_imm(DisasContext *ctx, arg_bb_imm
*a)
{
TCGv_reg tmp, tcg_r;
DisasCond cond;
+ bool d = false;
+ int p;
nullify_over(ctx);
tmp = tcg_temp_new();
tcg_r = load_gpr(ctx, a->r);
- tcg_gen_shli_reg(tmp, tcg_r, a->p);
+ p = a->p | (cond_need_ext(ctx, d) ? 32 : 0);
+ tcg_gen_shli_reg(tmp, tcg_r, p);
cond = cond_make_0(a->c ? TCG_COND_GE : TCG_COND_LT, tmp);
return do_cbranch(ctx, a->disp, a->n, &cond);
--
2.34.1
- [PATCH v2 19/65] target/hppa: Adjust hppa_cpu_dump_state for hppa64, (continued)
- [PATCH v2 19/65] target/hppa: Adjust hppa_cpu_dump_state for hppa64, Richard Henderson, 2023/10/20
- [PATCH v2 25/65] target/hppa: Pass d to do_sed_cond, Richard Henderson, 2023/10/20
- [PATCH v2 27/65] linux-user/hppa: Fixes for TARGET_ABI32, Richard Henderson, 2023/10/20
- [PATCH v2 30/65] target/hppa: Decode d for logical instructions, Richard Henderson, 2023/10/20
- [PATCH v2 28/65] target/hppa: Drop attempted gdbstub support for hppa64, Richard Henderson, 2023/10/20
- [PATCH v2 33/65] target/hppa: Decode d for add instructions, Richard Henderson, 2023/10/20
- [PATCH v2 29/65] target/hppa: Remove TARGET_HPPA64, Richard Henderson, 2023/10/20
- [PATCH v2 06/65] target/hppa: Fix hppa64 case in machine.c, Richard Henderson, 2023/10/20
- [PATCH v2 05/65] target/hppa: Remove load_const, Richard Henderson, 2023/10/20
- [PATCH v2 11/65] target/hppa: Fix bb_sar for hppa64,
Richard Henderson <=
- [PATCH v2 14/65] target/hppa: Make HPPA_BTLB_ENTRIES variable, Richard Henderson, 2023/10/20
- [PATCH v2 13/65] target/hppa: Introduce TYPE_HPPA64_CPU, Richard Henderson, 2023/10/20
- [PATCH v2 31/65] target/hppa: Decode d for unit instructions, Richard Henderson, 2023/10/20
- [PATCH v2 32/65] target/hppa: Decode d for cmpclr instructions, Richard Henderson, 2023/10/20
- [PATCH v2 16/65] target/hppa: Implement hppa_cpu_class_by_name, Richard Henderson, 2023/10/20
- [PATCH v2 39/65] target/hppa: Implement LDD, LDCD, LDDA, STD, STDA, Richard Henderson, 2023/10/20
- [PATCH v2 38/65] target/hppa: Decode ADDB double-word, Richard Henderson, 2023/10/20
- [PATCH v2 20/65] target/hppa: Fix hppa64 addressing, Richard Henderson, 2023/10/20
- [PATCH v2 21/65] target/hppa: sar register allows only 5 bits on 32-bit CPU, Richard Henderson, 2023/10/20