[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 17/88] target/hppa: Fix bb_sar for hppa64
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v3 17/88] target/hppa: Fix bb_sar for hppa64 |
|
Date: |
Wed, 1 Nov 2023 18:29:05 -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 b0cd12a2d0..ffa367b91f 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 v3 07/88] tcg: Improve expansion of deposit of constant, (continued)
- [PATCH v3 07/88] tcg: Improve expansion of deposit of constant, Richard Henderson, 2023/11/01
- [PATCH v3 10/88] target/hppa: Remove get_temp_tl, Richard Henderson, 2023/11/01
- [PATCH v3 05/88] target/hppa: Split out hppa_flush_tlb_range, Richard Henderson, 2023/11/01
- [PATCH v3 01/88] target/hppa: Include PSW_P in tb flags and mmu index, Richard Henderson, 2023/11/01
- [PATCH v3 02/88] target/hppa: Rename hppa_tlb_entry to HPPATLBEntry, Richard Henderson, 2023/11/01
- [PATCH v3 14/88] target/hppa: Truncate rotate count in trans_shrpw_sar, Richard Henderson, 2023/11/01
- [PATCH v3 09/88] target/hppa: Remove get_temp, Richard Henderson, 2023/11/01
- [PATCH v3 04/88] target/hppa: Always report one page to tlb_set_page, Richard Henderson, 2023/11/01
- [PATCH v3 18/88] target/hppa: Fix extrw and depw with sar for hppa64, Richard Henderson, 2023/11/01
- [PATCH v3 15/88] target/hppa: Fix trans_ds for hppa64, Richard Henderson, 2023/11/01
- [PATCH v3 17/88] target/hppa: Fix bb_sar for hppa64,
Richard Henderson <=
- [PATCH v3 06/88] target/hppa: Populate an interval tree with valid tlb entries, Richard Henderson, 2023/11/01
- [PATCH v3 12/88] target/hppa: Fix hppa64 case in machine.c, Richard Henderson, 2023/11/01
- [PATCH v3 19/88] target/hppa: Introduce TYPE_HPPA64_CPU, Richard Henderson, 2023/11/01
- [PATCH v3 16/88] target/hppa: Fix do_add, do_sub for hppa64, Richard Henderson, 2023/11/01
- [PATCH v3 23/88] target/hppa: Update cpu_hppa_get/put_psw for hppa64, Richard Henderson, 2023/11/01
- [PATCH v3 13/88] target/hppa: Fix load in do_load_32, Richard Henderson, 2023/11/01
- [PATCH v3 11/88] target/hppa: Remove load_const, Richard Henderson, 2023/11/01
- [PATCH v3 22/88] target/hppa: Implement hppa_cpu_class_by_name, Richard Henderson, 2023/11/01
- [PATCH v3 25/88] target/hppa: Adjust hppa_cpu_dump_state for hppa64, Richard Henderson, 2023/11/01
- [PATCH v3 24/88] target/hppa: Handle absolute addresses for pa2.0, Richard Henderson, 2023/11/01