[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 29/85] target/hppa: sar register allows only 5 bits on 32-bit CPU
|
From: |
Richard Henderson |
|
Subject: |
[PULL 29/85] target/hppa: sar register allows only 5 bits on 32-bit CPU |
|
Date: |
Mon, 6 Nov 2023 19:03:11 -0800 |
From: Helge Deller <deller@gmx.de>
The sar shift amount register is limited to 5 bits when running
a 32-bit CPU. Strip off the remaining bits.
The interesting part is, that this register allows to detect at runtime
if a physical CPU is capable to execute PA2.0 (64-bit) instructions.
Signed-off-by: Helge Deller <deller@gmx.de>
---
target/hppa/translate.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index cf05d8b6e4..1694b988ae 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -2176,7 +2176,7 @@ static bool trans_mtctl(DisasContext *ctx, arg_mtctl *a)
if (ctl == CR_SAR) {
reg = load_gpr(ctx, a->r);
tmp = tcg_temp_new();
- tcg_gen_andi_reg(tmp, reg, TARGET_REGISTER_BITS - 1);
+ tcg_gen_andi_reg(tmp, reg, ctx->is_pa20 ? 63 : 31);
save_or_nullify(ctx, cpu_sar, tmp);
cond_free(&ctx->null_cond);
@@ -2237,7 +2237,7 @@ static bool trans_mtsarcm(DisasContext *ctx, arg_mtsarcm
*a)
TCGv_reg tmp = tcg_temp_new();
tcg_gen_not_reg(tmp, load_gpr(ctx, a->r));
- tcg_gen_andi_reg(tmp, tmp, TARGET_REGISTER_BITS - 1);
+ tcg_gen_andi_reg(tmp, tmp, ctx->is_pa20 ? 63 : 31);
save_or_nullify(ctx, cpu_sar, tmp);
cond_free(&ctx->null_cond);
--
2.34.1
- [PULL 16/85] target/hppa: Fix extrw and depw with sar for hppa64, (continued)
- [PULL 16/85] target/hppa: Fix extrw and depw with sar for hppa64, Richard Henderson, 2023/11/06
- [PULL 17/85] target/hppa: Introduce TYPE_HPPA64_CPU, Richard Henderson, 2023/11/06
- [PULL 06/85] target/hppa: Populate an interval tree with valid tlb entries, Richard Henderson, 2023/11/06
- [PULL 26/85] target/hppa: Always use copy_iaoq_entry to set cpu_iaoq_[fb], Richard Henderson, 2023/11/06
- [PULL 07/85] target/hppa: Remove get_temp, Richard Henderson, 2023/11/06
- [PULL 09/85] target/hppa: Remove load_const, Richard Henderson, 2023/11/06
- [PULL 25/85] target/hppa: Pass DisasContext to copy_iaoq_entry, Richard Henderson, 2023/11/06
- [PULL 19/85] target/hppa: Implement cpu_list, Richard Henderson, 2023/11/06
- [PULL 27/85] target/hppa: Use copy_iaoq_entry for link in do_ibranch, Richard Henderson, 2023/11/06
- [PULL 28/85] target/hppa: Mask inputs in copy_iaoq_entry, Richard Henderson, 2023/11/06
- [PULL 29/85] target/hppa: sar register allows only 5 bits on 32-bit CPU,
Richard Henderson <=
- [PULL 31/85] target/hppa: Pass d to do_sub_cond, Richard Henderson, 2023/11/06
- [PULL 21/85] target/hppa: Update cpu_hppa_get/put_psw for hppa64, Richard Henderson, 2023/11/06
- [PULL 33/85] target/hppa: Pass d to do_sed_cond, Richard Henderson, 2023/11/06
- [PULL 23/85] target/hppa: Adjust hppa_cpu_dump_state for hppa64, Richard Henderson, 2023/11/06
- [PULL 24/85] target/hppa: Fix hppa64 addressing, Richard Henderson, 2023/11/06
- [PULL 35/85] linux-user/hppa: Fixes for TARGET_ABI32, Richard Henderson, 2023/11/06
- [PULL 34/85] target/hppa: Pass d to do_unit_cond, Richard Henderson, 2023/11/06
- [PULL 39/85] target/hppa: Decode d for unit instructions, Richard Henderson, 2023/11/06
- [PULL 20/85] target/hppa: Implement hppa_cpu_class_by_name, Richard Henderson, 2023/11/06
- [PULL 32/85] target/hppa: Pass d to do_log_cond, Richard Henderson, 2023/11/06