[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 80/94] target/sparc: Move FSMULD to decodetree
From: |
Richard Henderson |
Subject: |
[PULL 80/94] target/sparc: Move FSMULD to decodetree |
Date: |
Wed, 25 Oct 2023 17:15:28 -0700 |
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Acked-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/sparc/insns.decode | 1 +
target/sparc/translate.c | 43 +++++++++++++++++++++------------------
2 files changed, 24 insertions(+), 20 deletions(-)
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index f18fd99476..6817d52ca2 100644
--- a/target/sparc/insns.decode
+++ b/target/sparc/insns.decode
@@ -260,6 +260,7 @@ FMULq 10 ..... 110100 ..... 0 0100 1011 .....
@r_r_r
FDIVs 10 ..... 110100 ..... 0 0100 1101 ..... @r_r_r
FDIVd 10 ..... 110100 ..... 0 0100 1110 ..... @r_r_r
FDIVq 10 ..... 110100 ..... 0 0100 1111 ..... @r_r_r
+FsMULd 10 ..... 110100 ..... 0 0110 1001 ..... @r_r_r
FdTOx 10 ..... 110100 00000 0 1000 0010 ..... @r_r2
FxTOd 10 ..... 110100 00000 0 1000 1000 ..... @r_r2
FiTOs 10 ..... 110100 00000 0 1100 0100 ..... @r_r2
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 94ad75b897..6626042776 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -1669,22 +1669,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int
rs,
}
#endif
-static void gen_fop_DFF(DisasContext *dc, int rd, int rs1, int rs2,
- void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i32, TCGv_i32))
-{
- TCGv_i64 dst;
- TCGv_i32 src1, src2;
-
- src1 = gen_load_fpr_F(dc, rs1);
- src2 = gen_load_fpr_F(dc, rs2);
- dst = gen_dest_fpr_D(dc, rd);
-
- gen(dst, tcg_env, src1, src2);
- gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env);
-
- gen_store_fpr_D(dc, rd, dst);
-}
-
static void gen_fop_QDD(DisasContext *dc, int rd, int rs1, int rs2,
void (*gen)(TCGv_ptr, TCGv_i64, TCGv_i64))
{
@@ -4931,6 +4915,28 @@ TRANS(FSUBd, ALL, do_env_ddd, a, gen_helper_fsubd)
TRANS(FMULd, ALL, do_env_ddd, a, gen_helper_fmuld)
TRANS(FDIVd, ALL, do_env_ddd, a, gen_helper_fdivd)
+static bool trans_FsMULd(DisasContext *dc, arg_r_r_r *a)
+{
+ TCGv_i64 dst;
+ TCGv_i32 src1, src2;
+
+ if (gen_trap_ifnofpu(dc)) {
+ return true;
+ }
+ if (!(dc->def->features & CPU_FEATURE_FSMULD)) {
+ return raise_unimpfpop(dc);
+ }
+
+ gen_op_clear_ieee_excp_and_FTT();
+ dst = gen_dest_fpr_D(dc, a->rd);
+ src1 = gen_load_fpr_F(dc, a->rs1);
+ src2 = gen_load_fpr_F(dc, a->rs2);
+ gen_helper_fsmuld(dst, tcg_env, src1, src2);
+ gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env);
+ gen_store_fpr_D(dc, a->rd, dst);
+ return advance_pc(dc);
+}
+
static bool do_dddd(DisasContext *dc, arg_r_r_r *a,
void (*func)(TCGv_i64, TCGv_i64, TCGv_i64, TCGv_i64))
{
@@ -5041,11 +5047,8 @@ static void disas_sparc_legacy(DisasContext *dc,
unsigned int insn)
case 0x47: /* fsubq */
case 0x4b: /* fmulq */
case 0x4f: /* fdivq */
- g_assert_not_reached(); /* in decodetree */
case 0x69: /* fsmuld */
- CHECK_FPU_FEATURE(dc, FSMULD);
- gen_fop_DFF(dc, rd, rs1, rs2, gen_helper_fsmuld);
- break;
+ g_assert_not_reached(); /* in decodetree */
case 0x6e: /* fdmulq */
CHECK_FPU_FEATURE(dc, FLOAT128);
gen_fop_QDD(dc, rd, rs1, rs2, gen_helper_fdmulq);
--
2.34.1
- [PULL 66/94] target/sparc: Move BMASK to decodetree, (continued)
- [PULL 66/94] target/sparc: Move BMASK to decodetree, Richard Henderson, 2023/10/25
- [PULL 69/94] target/sparc: Use tcg_gen_vec_{add,sub}*, Richard Henderson, 2023/10/25
- [PULL 70/94] target/sparc: Move gen_ne_fop_FFF insns to decodetree, Richard Henderson, 2023/10/25
- [PULL 63/94] target/sparc: Move EDGE* to decodetree, Richard Henderson, 2023/10/25
- [PULL 68/94] target/sparc: Move FMOVD, FNEGD, FABSD, FSRC*D, FNOT*D to decodetree, Richard Henderson, 2023/10/25
- [PULL 67/94] target/sparc: Move FMOVS, FNEGS, FABSS, FSRC*S, FNOT*S to decodetree, Richard Henderson, 2023/10/25
- [PULL 71/94] target/sparc: Move gen_ne_fop_DDD insns to decodetree, Richard Henderson, 2023/10/25
- [PULL 59/94] target/sparc: Move simple fp load/store to decodetree, Richard Henderson, 2023/10/25
- [PULL 76/94] target/sparc: Move FSQRTq to decodetree, Richard Henderson, 2023/10/25
- [PULL 75/94] target/sparc: Move gen_fop_DD insns to decodetree, Richard Henderson, 2023/10/25
- [PULL 80/94] target/sparc: Move FSMULD to decodetree,
Richard Henderson <=
- [PULL 81/94] target/sparc: Move FDMULQ to decodetree, Richard Henderson, 2023/10/25
- [PULL 85/94] target/sparc: Move FqTOd, FqTOx to decodetree, Richard Henderson, 2023/10/25
- [PULL 90/94] target/sparc: Convert FCMP, FCMPE to decodetree, Richard Henderson, 2023/10/25
- [PULL 87/94] target/sparc: Move FdTOq, FxTOq to decodetree, Richard Henderson, 2023/10/25
- [PULL 92/94] target/sparc: Move FPACK16, FPACKFIX to decodetree, Richard Henderson, 2023/10/25
- [PULL 91/94] target/sparc: Move FPCMP* to decodetree, Richard Henderson, 2023/10/25
- [PULL 94/94] target/sparc: Remove disas_sparc_legacy, Richard Henderson, 2023/10/25
- [PULL 93/94] target/sparc: Convert FZERO, FONE to decodetree, Richard Henderson, 2023/10/25
- Re: [PULL 00/94] target/sparc: Convert to decodetree, Stefan Hajnoczi, 2023/10/27