[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 37/65] target/hppa: Decode CMPIB double-word
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v2 37/65] target/hppa: Decode CMPIB double-word |
|
Date: |
Fri, 20 Oct 2023 13:43:03 -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 d1d9a4a137..bb55718a4d 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"
@@ -3101,9 +3107,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 v2 13/65] target/hppa: Introduce TYPE_HPPA64_CPU, (continued)
- [PATCH v2 13/65] target/hppa: Introduce TYPE_HPPA64_CPU, Richard Henderson, 2023/10/20
- [PATCH v2 31/65] target/hppa: Decode d for unit instructions, Richard Henderson, 2023/10/20
- [PATCH v2 32/65] target/hppa: Decode d for cmpclr instructions, Richard Henderson, 2023/10/20
- [PATCH v2 16/65] target/hppa: Implement hppa_cpu_class_by_name, Richard Henderson, 2023/10/20
- [PATCH v2 39/65] target/hppa: Implement LDD, LDCD, LDDA, STD, STDA, Richard Henderson, 2023/10/20
- [PATCH v2 38/65] target/hppa: Decode ADDB double-word, Richard Henderson, 2023/10/20
- [PATCH v2 20/65] target/hppa: Fix hppa64 addressing, Richard Henderson, 2023/10/20
- [PATCH v2 21/65] target/hppa: sar register allows only 5 bits on 32-bit CPU, Richard Henderson, 2023/10/20
- [PATCH v2 23/65] target/hppa: Pass d to do_sub_cond, Richard Henderson, 2023/10/20
- [PATCH v2 35/65] target/hppa: Decode d for bb instructions, Richard Henderson, 2023/10/20
- [PATCH v2 37/65] target/hppa: Decode CMPIB double-word,
Richard Henderson <=
- [PATCH v2 26/65] target/hppa: Pass d to do_unit_cond, Richard Henderson, 2023/10/20
- [PATCH v2 24/65] target/hppa: Pass d to do_log_cond, Richard Henderson, 2023/10/20
- [PATCH v2 22/65] target/hppa: Pass d to do_cond, Richard Henderson, 2023/10/20
- [PATCH v2 34/65] target/hppa: Decode d for sub instructions, Richard Henderson, 2023/10/20
- [PATCH v2 36/65] target/hppa: Decode d for cmpb instructions, Richard Henderson, 2023/10/20
- [PATCH v2 41/65] target/hppa: Implement EXTRD, Richard Henderson, 2023/10/20
- [PATCH v2 40/65] target/hppa: Implement DEPD, DEPDI, Richard Henderson, 2023/10/20
- [PATCH v2 42/65] target/hppa: Implement SHRPD, Richard Henderson, 2023/10/20
- [PATCH v2 43/65] target/hppa: Implement CLRBTS, POPBTS, PUSHBTS, PUSHNOM, Richard Henderson, 2023/10/20
- [PATCH v2 44/65] target/hppa: Implement STDBY, Richard Henderson, 2023/10/20