[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 32/90] target/sparc: Move UMUL, SMUL to decodetree
From: |
Richard Henderson |
Subject: |
[PATCH v3 32/90] target/sparc: Move UMUL, SMUL to decodetree |
Date: |
Fri, 20 Oct 2023 22:31:00 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/sparc/insns.decode | 2 ++
target/sparc/translate.c | 21 +++------------------
2 files changed, 5 insertions(+), 18 deletions(-)
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index 694d2c3648..f214baf465 100644
--- a/target/sparc/insns.decode
+++ b/target/sparc/insns.decode
@@ -167,6 +167,8 @@ XORN 10 ..... 0.0111 ..... . .............
@r_r_ri_cc
ADDC 10 ..... 0.1000 ..... . ............. @r_r_ri_cc
MULX 10 ..... 001001 ..... . ............. @r_r_ri_cc0
+UMUL 10 ..... 0.1010 ..... . ............. @r_r_ri_cc
+SMUL 10 ..... 0.1011 ..... . ............. @r_r_ri_cc
Tcc_r 10 0 cond:4 111010 rs1:5 0 cc:1 0000000 rs2:5
{
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 4ce87f59b9..4744e8caca 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -2882,6 +2882,7 @@ static void gen_faligndata(TCGv dst, TCGv gsr, TCGv s1,
TCGv s2)
#define avail_ASR17(C) ((C)->def->features & CPU_FEATURE_ASR17)
#define avail_GL(C) ((C)->def->features & CPU_FEATURE_GL)
#define avail_HYPV(C) ((C)->def->features & CPU_FEATURE_HYPV)
+#define avail_MUL(C) ((C)->def->features & CPU_FEATURE_MUL)
#define avail_POWERDOWN(C) ((C)->def->features & CPU_FEATURE_POWERDOWN)
/* Default case for non jump instructions. */
@@ -4170,6 +4171,8 @@ TRANS(ANDN, ALL, do_arith, a, CC_OP_LOGIC,
tcg_gen_andc_tl, NULL)
TRANS(ORN, ALL, do_arith, a, CC_OP_LOGIC, tcg_gen_orc_tl, NULL)
TRANS(XORN, ALL, do_arith, a, CC_OP_LOGIC, tcg_gen_eqv_tl, NULL)
TRANS(MULX, 64, do_arith, a, 0, tcg_gen_mul_tl, tcg_gen_muli_tl)
+TRANS(UMUL, MUL, do_arith, a, CC_OP_LOGIC, gen_op_umul, NULL)
+TRANS(SMUL, MUL, do_arith, a, CC_OP_LOGIC, gen_op_smul, NULL)
static bool trans_OR(DisasContext *dc, arg_r_r_ri_cc *a)
{
@@ -4660,24 +4663,6 @@ static void disas_sparc_legacy(DisasContext *dc,
unsigned int insn)
cpu_src1 = get_src1(dc, insn);
cpu_src2 = get_src2(dc, insn);
switch (xop & ~0x10) {
- case 0xa: /* umul */
- CHECK_IU_FEATURE(dc, MUL);
- gen_op_umul(cpu_dst, cpu_src1, cpu_src2);
- if (xop & 0x10) {
- tcg_gen_mov_tl(cpu_cc_dst, cpu_dst);
- tcg_gen_movi_i32(cpu_cc_op, CC_OP_LOGIC);
- dc->cc_op = CC_OP_LOGIC;
- }
- break;
- case 0xb: /* smul */
- CHECK_IU_FEATURE(dc, MUL);
- gen_op_smul(cpu_dst, cpu_src1, cpu_src2);
- if (xop & 0x10) {
- tcg_gen_mov_tl(cpu_cc_dst, cpu_dst);
- tcg_gen_movi_i32(cpu_cc_op, CC_OP_LOGIC);
- dc->cc_op = CC_OP_LOGIC;
- }
- break;
case 0xc: /* subx, V9 subc */
gen_op_subx_int(dc, cpu_dst, cpu_src1, cpu_src2,
(xop & 0x10));
--
2.34.1
- [PATCH v3 31/90] target/sparc: Move MULX to decodetree, (continued)
- [PATCH v3 31/90] target/sparc: Move MULX to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 33/90] target/sparc: Move SUBC to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 38/90] target/sparc: Move MOVcc, MOVR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 23/90] target/sparc: Move RDWIM, RDPR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 36/90] target/sparc: Move TADD, TSUB, MULS to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 26/90] target/sparc: Move WRPSR, SAVED, RESTORED to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 22/90] target/sparc: Move RDPSR, RDHPR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 24/90] target/sparc: Move RDTBR, FLUSHW to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 25/90] target/sparc: Move WRASR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 29/90] target/sparc: Move basic arithmetic to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 32/90] target/sparc: Move UMUL, SMUL to decodetree,
Richard Henderson <=
- [PATCH v3 37/90] target/sparc: Move SLL, SRL, SRA to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 34/90] target/sparc: Move UDIVX, SDIVX to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 35/90] target/sparc: Move UDIV, SDIV to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 39/90] target/sparc: Move POPC to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 40/90] target/sparc: Convert remaining v8 coproc insns to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 42/90] target/sparc: Move FLUSH, SAVE, RESTORE to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 41/90] target/sparc: Move JMPL, RETT, RETURN to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 46/90] target/sparc: Split out ldst functions with asi pre-computed, Richard Henderson, 2023/10/21
- [PATCH v3 43/90] target/sparc: Move DONE, RETRY to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 48/90] target/sparc: Move simple integer load/store to decodetree, Richard Henderson, 2023/10/21