[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 30/88] target/hppa: Mask inputs in copy_iaoq_entry
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v3 30/88] target/hppa: Mask inputs in copy_iaoq_entry |
|
Date: |
Wed, 1 Nov 2023 18:29:18 -0700 |
Ensure that the destination is always a valid GVA offset.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/translate.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index c2db2782f4..cf05d8b6e4 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -720,10 +720,22 @@ static target_ureg gva_offset_mask(DisasContext *ctx)
static void copy_iaoq_entry(DisasContext *ctx, TCGv_reg dest,
target_ureg ival, TCGv_reg vval)
{
- if (unlikely(ival == -1)) {
+ target_ureg mask = gva_offset_mask(ctx);
+
+ if (ival != -1) {
+ tcg_gen_movi_reg(dest, ival & mask);
+ return;
+ }
+ tcg_debug_assert(vval != NULL);
+
+ /*
+ * We know that the IAOQ is already properly masked.
+ * This optimization is primarily for "iaoq_f = iaoq_b".
+ */
+ if (vval == cpu_iaoq_f || vval == cpu_iaoq_b) {
tcg_gen_mov_reg(dest, vval);
} else {
- tcg_gen_movi_reg(dest, ival);
+ tcg_gen_andi_reg(dest, vval, mask);
}
}
--
2.34.1
- [PATCH v3 11/88] target/hppa: Remove load_const, (continued)
- [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, 2023/11/01
- [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 <=
- [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, 2023/11/01
- [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