[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 27/85] target/sparc: Move UMUL, SMUL to decodetree
From: |
Richard Henderson |
Subject: |
[PATCH 27/85] target/sparc: Move UMUL, SMUL to decodetree |
Date: |
Fri, 13 Oct 2023 14:27:48 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/sparc/insns.decode | 4 ++++
target/sparc/translate.c | 20 ++++----------------
2 files changed, 8 insertions(+), 16 deletions(-)
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index d907a4a69f..9cd89cf03b 100644
--- a/target/sparc/insns.decode
+++ b/target/sparc/insns.decode
@@ -175,3 +175,7 @@ XORNcc 10 ..... 010111 ..... . .............
@r_r_ri
ADDC 10 ..... 001000 ..... . ............. @r_r_ri
ADDCcc 10 ..... 011000 ..... . ............. @r_r_ri
MULX 10 ..... 001001 ..... . ............. @r_r_ri
+UMUL 10 ..... 001010 ..... . ............. @r_r_ri
+UMULcc 10 ..... 011010 ..... . ............. @r_r_ri
+SMUL 10 ..... 001011 ..... . ............. @r_r_ri
+SMULcc 10 ..... 011011 ..... . ............. @r_r_ri
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 7a7d517fac..38c1f2f79a 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -4150,6 +4150,8 @@ TRANS(ANDN, ALL, do_arith, a, tcg_gen_andc_tl, NULL)
TRANS(ORN, ALL, do_arith, a, tcg_gen_orc_tl, NULL)
TRANS(XORN, ALL, do_arith, a, tcg_gen_eqv_tl, NULL)
TRANS(MULX, 64, do_arith, a, tcg_gen_mul_tl, tcg_gen_muli_tl)
+TRANS(UMUL, ALL, do_arith, a, gen_op_umul, NULL)
+TRANS(SMUL, ALL, do_arith, a, gen_op_smul, NULL)
TRANS(ADDcc, ALL, do_cc_arith, a, CC_OP_ADD, gen_op_add_cc, NULL)
TRANS(ANDcc, ALL, do_cc_arith, a, CC_OP_LOGIC, tcg_gen_and_tl, tcg_gen_andi_tl)
@@ -4159,6 +4161,8 @@ TRANS(SUBcc, ALL, do_cc_arith, a, CC_OP_SUB,
gen_op_sub_cc, NULL)
TRANS(ANDNcc, ALL, do_cc_arith, a, CC_OP_LOGIC, tcg_gen_andc_tl, NULL)
TRANS(ORNcc, ALL, do_cc_arith, a, CC_OP_LOGIC, tcg_gen_orc_tl, NULL)
TRANS(XORNcc, ALL, do_cc_arith, a, CC_OP_LOGIC, tcg_gen_eqv_tl, NULL)
+TRANS(UMULcc, ALL, do_cc_arith, a, CC_OP_LOGIC, gen_op_umul, NULL)
+TRANS(SMULcc, ALL, do_cc_arith, a, CC_OP_LOGIC, gen_op_smul, NULL)
static TCGv gen_rs2_or_imm(DisasContext *dc, bool imm, int rs2_or_imm)
{
@@ -4621,22 +4625,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 */
- 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 */
- 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 26/85] target/sparc: Move MULX to decodetree, (continued)
- [PATCH 26/85] target/sparc: Move MULX to decodetree, Richard Henderson, 2023/10/13
- [PATCH 23/85] target/sparc: Move WRTBR, WRHPR to decodetree, Richard Henderson, 2023/10/13
- [PATCH 31/85] target/sparc: Move TADD, TSUB, MULS to decodetree, Richard Henderson, 2023/10/13
- [PATCH 29/85] target/sparc: Move UDIVX, SDIVX to decodetree, Richard Henderson, 2023/10/13
- [PATCH 30/85] target/sparc: Move UDIV, SDIV to decodetree, Richard Henderson, 2023/10/13
- [PATCH 34/85] target/sparc: Move POPC to decodetree, Richard Henderson, 2023/10/13
- [PATCH 35/85] target/sparc: Convert remaining v8 coproc insns to decodetree, Richard Henderson, 2023/10/13
- [PATCH 20/85] target/sparc: Move WRASR to decodetree, Richard Henderson, 2023/10/13
- [PATCH 25/85] target/sparc: Move ADDC to decodetree, Richard Henderson, 2023/10/13
- [PATCH 24/85] target/sparc: Move basic arithmetic to decodetree, Richard Henderson, 2023/10/13
- [PATCH 27/85] target/sparc: Move UMUL, SMUL to decodetree,
Richard Henderson <=
- [PATCH 28/85] target/sparc: Move SUBC to decodetree, Richard Henderson, 2023/10/13
- [PATCH 32/85] target/sparc: Move SLL, SRL, SRA to decodetree, Richard Henderson, 2023/10/13
- [PATCH 33/85] target/sparc: Move MOVcc, MOVR to decodetree, Richard Henderson, 2023/10/13
- [PATCH 37/85] target/sparc: Move FLUSH, SAVE, RESTORE to decodetree, Richard Henderson, 2023/10/13
- [PATCH 36/85] target/sparc: Move JMPL, RETT, RETURN to decodetree, Richard Henderson, 2023/10/13
- [PATCH 38/85] target/sparc: Move DONE, RETRY to decodetree, Richard Henderson, 2023/10/13
- [PATCH 39/85] target/sparc: Split out resolve_asi, Richard Henderson, 2023/10/13
- [PATCH 42/85] target/sparc: Use tcg_gen_qemu_{ld, st}_i128 for GET_ASI_DTWINX, Richard Henderson, 2023/10/13
- [PATCH 44/85] target/sparc: Move asi integer load/store to decodetree, Richard Henderson, 2023/10/13
- [PATCH 41/85] target/sparc: Split out ldst functions with asi pre-computed, Richard Henderson, 2023/10/13