[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 60/90] target/sparc: Move ARRAY* to decodetree
From: |
Richard Henderson |
Subject: |
[PATCH v2 60/90] target/sparc: Move ARRAY* to decodetree |
Date: |
Mon, 16 Oct 2023 23:12:14 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/sparc/insns.decode | 4 +++
target/sparc/translate.c | 54 ++++++++++++++++++++++++---------------
2 files changed, 37 insertions(+), 21 deletions(-)
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index fb104e77d1..07a84b109c 100644
--- a/target/sparc/insns.decode
+++ b/target/sparc/insns.decode
@@ -241,6 +241,10 @@ RETRY 10 00001 111110 00000 0 0000000000000
EDGE32N 10 ..... 110110 ..... 0 0000 1001 ..... @r_r_r
EDGE32Lcc 10 ..... 110110 ..... 0 0000 1010 ..... @r_r_r
EDGE32LN 10 ..... 110110 ..... 0 0000 1011 ..... @r_r_r
+
+ ARRAY8 10 ..... 110110 ..... 0 0001 0000 ..... @r_r_r
+ ARRAY16 10 ..... 110110 ..... 0 0001 0010 ..... @r_r_r
+ ARRAY32 10 ..... 110110 ..... 0 0001 0100 ..... @r_r_r
]
NCP 10 ----- 110110 ----- --------- ----- # v8 CPop1
}
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 5145692885..87f3ab27b1 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -72,6 +72,10 @@ static void gen_helper_st_asi(TCGv_env e, TCGv a, TCGv_i64 r,
g_assert_not_reached();
}
# endif
+static void gen_helper_array8(TCGv r, TCGv a, TCGv b)
+{
+ g_assert_not_reached();
+}
#endif
/* Dynamic PC, must exit to main loop. */
@@ -679,6 +683,18 @@ static void gen_op_popc(TCGv dst, TCGv src1, TCGv src2)
tcg_gen_ctpop_tl(dst, src2);
}
+static void gen_op_array16(TCGv dst, TCGv src1, TCGv src2)
+{
+ gen_helper_array8(dst, src1, src2);
+ tcg_gen_shli_tl(dst, dst, 1);
+}
+
+static void gen_op_array32(TCGv dst, TCGv src1, TCGv src2)
+{
+ gen_helper_array8(dst, src1, src2);
+ tcg_gen_shli_tl(dst, dst, 2);
+}
+
// 1
static void gen_op_eval_ba(TCGv dst)
{
@@ -4302,6 +4318,22 @@ TRANS(EDGE16LN, VIS2, gen_edge, a, 16, 0, 1)
TRANS(EDGE32N, VIS2, gen_edge, a, 32, 0, 0)
TRANS(EDGE32LN, VIS2, gen_edge, a, 32, 0, 1)
+static bool do_rrr(DisasContext *dc, arg_r_r_r *a,
+ void (*func)(TCGv, TCGv, TCGv))
+{
+ TCGv dst = gen_dest_gpr(dc, a->rd);
+ TCGv src1 = gen_load_gpr(dc, a->rs1);
+ TCGv src2 = gen_load_gpr(dc, a->rs2);
+
+ func(dst, src1, src2);
+ gen_store_gpr(dc, a->rd, dst);
+ return advance_pc(dc);
+}
+
+TRANS(ARRAY8, VIS1, do_rrr, a, gen_helper_array8)
+TRANS(ARRAY16, VIS1, do_rrr, a, gen_op_array16)
+TRANS(ARRAY32, VIS1, do_rrr, a, gen_op_array32)
+
static bool do_shift_r(DisasContext *dc, arg_shiftr *a, bool l, bool u)
{
TCGv dst, src1, src2;
@@ -5199,30 +5231,10 @@ static void disas_sparc_legacy(DisasContext *dc,
unsigned int insn)
case 0x009: /* VIS II edge32n */
case 0x00a: /* VIS I edge32lcc */
case 0x00b: /* VIS II edge32ln */
- g_assert_not_reached(); /* in decodetree */
case 0x010: /* VIS I array8 */
- CHECK_FPU_FEATURE(dc, VIS1);
- cpu_src1 = gen_load_gpr(dc, rs1);
- cpu_src2 = gen_load_gpr(dc, rs2);
- gen_helper_array8(cpu_dst, cpu_src1, cpu_src2);
- gen_store_gpr(dc, rd, cpu_dst);
- break;
case 0x012: /* VIS I array16 */
- CHECK_FPU_FEATURE(dc, VIS1);
- cpu_src1 = gen_load_gpr(dc, rs1);
- cpu_src2 = gen_load_gpr(dc, rs2);
- gen_helper_array8(cpu_dst, cpu_src1, cpu_src2);
- tcg_gen_shli_i64(cpu_dst, cpu_dst, 1);
- gen_store_gpr(dc, rd, cpu_dst);
- break;
case 0x014: /* VIS I array32 */
- CHECK_FPU_FEATURE(dc, VIS1);
- cpu_src1 = gen_load_gpr(dc, rs1);
- cpu_src2 = gen_load_gpr(dc, rs2);
- gen_helper_array8(cpu_dst, cpu_src1, cpu_src2);
- tcg_gen_shli_i64(cpu_dst, cpu_dst, 2);
- gen_store_gpr(dc, rd, cpu_dst);
- break;
+ g_assert_not_reached(); /* in decodetree */
case 0x018: /* VIS I alignaddr */
CHECK_FPU_FEATURE(dc, VIS1);
cpu_src1 = gen_load_gpr(dc, rs1);
--
2.34.1
- [PATCH v2 50/90] target/sparc: Move LDSTUB, LDSTUBA to decodetree, (continued)
- [PATCH v2 50/90] target/sparc: Move LDSTUB, LDSTUBA to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 51/90] target/sparc: Move SWAP, SWAPA to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 53/90] target/sparc: Move PREFETCH, PREFETCHA to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 55/90] target/sparc: Move simple fp load/store to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 57/90] target/sparc: Move LDFSR, STFSR to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 58/90] target/sparc: Merge LDFSR, LDXFSR implementations, Richard Henderson, 2023/10/17
- [PATCH v2 61/90] target/sparc: Move ADDRALIGN* to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 64/90] target/sparc: Move FMOVD, FNEGD, FABSD, FSRC*D, FNOT*D to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 63/90] target/sparc: Move FMOVS, FNEGS, FABSS, FSRC*S, FNOT*S to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 59/90] target/sparc: Move EDGE* to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 60/90] target/sparc: Move ARRAY* to decodetree,
Richard Henderson <=
- [PATCH v2 65/90] target/sparc: Use tcg_gen_vec_{add,sub}*, Richard Henderson, 2023/10/17
- [PATCH v2 68/90] target/sparc: Move PDIST to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 70/90] target/sparc: Move gen_fop_FF insns to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 73/90] target/sparc: Move gen_fop_FFF insns to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 75/90] target/sparc: Move gen_fop_QQQ insns to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 69/90] target/sparc: Move gen_gsr_fop_DDD insns to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 79/90] target/sparc: Move FiTOd, FsTOd, FsTOx to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 72/90] target/sparc: Move FSQRTq to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 74/90] target/sparc: Move gen_fop_DDD insns to decodetree, Richard Henderson, 2023/10/17
- [PATCH v2 78/90] target/sparc: Move gen_fop_FD insns to decodetree, Richard Henderson, 2023/10/17