[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 31/88] target/hppa: sar register allows only 5 bits on 32-bit
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v3 31/88] target/hppa: sar register allows only 5 bits on 32-bit CPU |
|
Date: |
Wed, 1 Nov 2023 18:29:19 -0700 |
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
- [PATCH v3 19/88] target/hppa: Introduce TYPE_HPPA64_CPU, (continued)
- [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
- [PATCH v3 21/88] target/hppa: Implement cpu_list, Richard Henderson, 2023/11/01
- [PATCH v3 26/88] target/hppa: Fix hppa64 addressing, Richard Henderson, 2023/11/01
- [PATCH v3 31/88] target/hppa: sar register allows only 5 bits on 32-bit CPU,
Richard Henderson <=
- [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