[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 47/88] target/hppa: Decode CMPIB double-word
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v3 47/88] target/hppa: Decode CMPIB double-word |
|
Date: |
Wed, 1 Nov 2023 18:29:35 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/insns.decode | 10 ++++++++--
target/hppa/translate.c | 11 ++++++++++-
2 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/target/hppa/insns.decode b/target/hppa/insns.decode
index fc327e2bb3..48f09c9b06 100644
--- a/target/hppa/insns.decode
+++ b/target/hppa/insns.decode
@@ -51,6 +51,7 @@
%pos_to_m 0:1 !function=pos_to_m
%neg_to_m 0:1 !function=neg_to_m
%a_to_m 2:1 !function=neg_to_m
+%cmpbid_c 13:2 !function=cmpbid_c
####
# Argument set definitions
@@ -69,6 +70,7 @@
&rrb_c_f disp n c f r1 r2
&rrb_c_d_f disp n c d f r1 r2
&rib_c_f disp n c f r i
+&rib_c_d_f disp n c d f r i
####
# Format definitions
@@ -88,6 +90,8 @@
&rrb_c_d_f disp=%assemble_12
@rib_cf ...... r:5 ..... c:3 ........... n:1 . \
&rib_c_f disp=%assemble_12 i=%im5_16
+@rib_cdf ...... r:5 ..... c:3 ........... n:1 . \
+ &rib_c_d_f disp=%assemble_12 i=%im5_16
####
# System
@@ -303,8 +307,10 @@ cmpb 100000 ..... ..... ... ........... . .
@rrb_cdf d=0 f=0
cmpb 100010 ..... ..... ... ........... . . @rrb_cdf d=0 f=1
cmpb 100111 ..... ..... ... ........... . . @rrb_cdf d=1 f=0
cmpb 101111 ..... ..... ... ........... . . @rrb_cdf d=1 f=1
-cmpbi 100001 ..... ..... ... ........... . . @rib_cf f=0
-cmpbi 100011 ..... ..... ... ........... . . @rib_cf f=1
+cmpbi 100001 ..... ..... ... ........... . . @rib_cdf d=0 f=0
+cmpbi 100011 ..... ..... ... ........... . . @rib_cdf d=0 f=1
+cmpbi 111011 r:5 ..... f:1 .. ........... n:1 . \
+ &rib_c_d_f d=1 disp=%assemble_12 c=%cmpbid_c i=%im5_16
addb 101000 ..... ..... ... ........... . . @rrb_cf f=0
addb 101010 ..... ..... ... ........... . . @rrb_cf f=1
diff --git a/target/hppa/translate.c b/target/hppa/translate.c
index 6cd06fbc0d..7f767fea64 100644
--- a/target/hppa/translate.c
+++ b/target/hppa/translate.c
@@ -329,6 +329,12 @@ static int expand_shl11(DisasContext *ctx, int val)
return val << 11;
}
+/* Translate CMPI doubleword conditions to standard. */
+static int cmpbid_c(DisasContext *ctx, int val)
+{
+ return val ? val : 4; /* 0 == "*<<" */
+}
+
/* Include the auto-generated decoder. */
#include "decode-insns.c.inc"
@@ -3122,9 +3128,12 @@ static bool trans_cmpb(DisasContext *ctx, arg_cmpb *a)
static bool trans_cmpbi(DisasContext *ctx, arg_cmpbi *a)
{
+ if (!ctx->is_pa20 && a->d) {
+ return false;
+ }
nullify_over(ctx);
return do_cmpb(ctx, a->r, tcg_constant_reg(a->i),
- a->c, a->f, false, a->n, a->disp);
+ a->c, a->f, a->d, a->n, a->disp);
}
static bool do_addb(DisasContext *ctx, unsigned r, TCGv_reg in1,
--
2.34.1
- [PATCH v3 74/88] hw/hppa: Translate phys addresses for the cpu, (continued)
- [PATCH v3 74/88] hw/hppa: Translate phys addresses for the cpu, Richard Henderson, 2023/11/01
- [PATCH v3 70/88] target/hppa: Fix interruption based on default PSW, Richard Henderson, 2023/11/01
- [PATCH v3 56/88] hw/hppa: Use uint32_t instead of target_ureg, Richard Henderson, 2023/11/01
- [PATCH v3 58/88] target/hppa: Remove most of the TARGET_REGISTER_BITS redirections, Richard Henderson, 2023/11/01
- [PATCH v3 72/88] target/hppa: Return zero for r0 from load_gpr, Richard Henderson, 2023/11/01
- [PATCH v3 79/88] target/hppa: Clear upper bits in mtctl for pa1.x, Richard Henderson, 2023/11/01
- [PATCH v3 66/88] target/hppa: Implement HSHL, HSHR, Richard Henderson, 2023/11/01
- [PATCH v3 76/88] target/hppa: Implement pa2.0 data prefetch instructions, Richard Henderson, 2023/11/01
- [PATCH v3 63/88] target/hppa: Implement HADD, Richard Henderson, 2023/11/01
- [PATCH v3 48/88] target/hppa: Decode ADDB double-word, Richard Henderson, 2023/11/01
- [PATCH v3 47/88] target/hppa: Decode CMPIB double-word,
Richard Henderson <=
- [PATCH v3 68/88] target/hppa: Implement MIXH, MIXW, Richard Henderson, 2023/11/01
- [PATCH v3 80/88] target/hppa: Add unwind_breg to CPUHPPAState, Richard Henderson, 2023/11/01
- [PATCH v3 82/88] target/hppa: Update IIAOQ, IIASQ for pa2.0, Richard Henderson, 2023/11/01
- [PATCH v3 83/88] target/hppa: Improve interrupt logging, Richard Henderson, 2023/11/01
- [PATCH v3 81/88] target/hppa: Create raise_exception_with_ior, Richard Henderson, 2023/11/01
- [PATCH v3 85/88] hw/pci-host/astro: Trigger CPU irq on CPU HPA in high memory, Richard Henderson, 2023/11/01
- [PATCH v3 84/88] hw/pci-host/astro: Map Astro chip into 64-bit I/O memory region, Richard Henderson, 2023/11/01
- [PATCH v3 86/88] hw/hppa: Turn on 64-bit CPU for C3700 machine, Richard Henderson, 2023/11/01
- [PATCH v3 87/88] hw/hppa: Allow C3700 with 64-bit and B160L with 32-bit CPU only, Richard Henderson, 2023/11/01
- [PATCH v3 88/88] hw/hppa: Map PDC ROM and I/O memory area into lower memory, Richard Henderson, 2023/11/01