[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 75/90] target/sparc: Move gen_fop_QQQ insns to decodetree
From: |
Richard Henderson |
Subject: |
[PATCH v4 75/90] target/sparc: Move gen_fop_QQQ insns to decodetree |
Date: |
Sat, 21 Oct 2023 23:00:16 -0700 |
Move FADDq, FSUBq, FMULq, FDIVq.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/sparc/insns.decode | 4 +++
target/sparc/translate.c | 52 +++++++++++++++++++--------------------
2 files changed, 30 insertions(+), 26 deletions(-)
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index a429c04980..f18fd99476 100644
--- a/target/sparc/insns.decode
+++ b/target/sparc/insns.decode
@@ -250,12 +250,16 @@ FSQRTd 10 ..... 110100 00000 0 0010 1010 .....
@r_r2
FSQRTq 10 ..... 110100 00000 0 0010 1011 ..... @r_r2
FADDs 10 ..... 110100 ..... 0 0100 0001 ..... @r_r_r
FADDd 10 ..... 110100 ..... 0 0100 0010 ..... @r_r_r
+FADDq 10 ..... 110100 ..... 0 0100 0011 ..... @r_r_r
FSUBs 10 ..... 110100 ..... 0 0100 0101 ..... @r_r_r
FSUBd 10 ..... 110100 ..... 0 0100 0110 ..... @r_r_r
+FSUBq 10 ..... 110100 ..... 0 0100 0111 ..... @r_r_r
FMULs 10 ..... 110100 ..... 0 0100 1001 ..... @r_r_r
FMULd 10 ..... 110100 ..... 0 0100 1010 ..... @r_r_r
+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
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 7e0990a021..47f4d0b51c 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -1666,19 +1666,6 @@ static void gen_ne_fop_QQ(DisasContext *dc, int rd, int
rs,
}
#endif
-static void gen_fop_QQQ(DisasContext *dc, int rd, int rs1, int rs2,
- void (*gen)(TCGv_ptr))
-{
- gen_op_load_fpr_QT0(QFPREG(rs1));
- gen_op_load_fpr_QT1(QFPREG(rs2));
-
- gen(tcg_env);
- gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env);
-
- gen_op_store_QT0_fpr(QFPREG(rd));
- gen_update_fprs_dirty(dc, QFPREG(rd));
-}
-
static void gen_fop_DFF(DisasContext *dc, int rd, int rs1, int rs2,
void (*gen)(TCGv_i64, TCGv_ptr, TCGv_i32, TCGv_i32))
{
@@ -5125,6 +5112,31 @@ static bool do_dddd(DisasContext *dc, arg_r_r_r *a,
TRANS(PDIST, VIS1, do_dddd, a, gen_helper_pdist)
+static bool do_env_qqq(DisasContext *dc, arg_r_r_r *a,
+ void (*func)(TCGv_env))
+{
+ if (gen_trap_ifnofpu(dc)) {
+ return true;
+ }
+ if (gen_trap_float128(dc)) {
+ return true;
+ }
+
+ gen_op_clear_ieee_excp_and_FTT();
+ gen_op_load_fpr_QT0(QFPREG(a->rs1));
+ gen_op_load_fpr_QT1(QFPREG(a->rs2));
+ func(tcg_env);
+ gen_helper_check_ieee_exceptions(cpu_fsr, tcg_env);
+ gen_op_store_QT0_fpr(QFPREG(a->rd));
+ gen_update_fprs_dirty(dc, QFPREG(a->rd));
+ return advance_pc(dc);
+}
+
+TRANS(FADDq, ALL, do_env_qqq, a, gen_helper_faddq)
+TRANS(FSUBq, ALL, do_env_qqq, a, gen_helper_fsubq)
+TRANS(FMULq, ALL, do_env_qqq, a, gen_helper_fmulq)
+TRANS(FDIVq, ALL, do_env_qqq, a, gen_helper_fdivq)
+
#define CHECK_IU_FEATURE(dc, FEATURE) \
if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \
goto illegal_insn;
@@ -5186,23 +5198,11 @@ static void disas_sparc_legacy(DisasContext *dc,
unsigned int insn)
case 0x46: /* fsubd */
case 0x4a: /* fmuld */
case 0x4e: /* fdivd */
- g_assert_not_reached(); /* in decodetree */
case 0x43: /* faddq */
- CHECK_FPU_FEATURE(dc, FLOAT128);
- gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_faddq);
- break;
case 0x47: /* fsubq */
- CHECK_FPU_FEATURE(dc, FLOAT128);
- gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fsubq);
- break;
case 0x4b: /* fmulq */
- CHECK_FPU_FEATURE(dc, FLOAT128);
- gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fmulq);
- break;
case 0x4f: /* fdivq */
- CHECK_FPU_FEATURE(dc, FLOAT128);
- gen_fop_QQQ(dc, rd, rs1, rs2, gen_helper_fdivq);
- break;
+ g_assert_not_reached(); /* in decodetree */
case 0x69: /* fsmuld */
CHECK_FPU_FEATURE(dc, FSMULD);
gen_fop_DFF(dc, rd, rs1, rs2, gen_helper_fsmuld);
--
2.34.1
- [PATCH v4 77/90] target/sparc: Move FDMULQ to decodetree, (continued)
- [PATCH v4 77/90] target/sparc: Move FDMULQ to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 73/90] target/sparc: Move gen_fop_FFF insns to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 69/90] target/sparc: Move gen_gsr_fop_DDD insns to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 76/90] target/sparc: Move FSMULD to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 68/90] target/sparc: Move PDIST to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 54/90] target/sparc: Split out fp ldst functions with asi precomputed, Richard Henderson, 2023/10/22
- [PATCH v4 53/90] target/sparc: Move PREFETCH, PREFETCHA to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 61/90] target/sparc: Move ADDRALIGN* to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 59/90] target/sparc: Move EDGE* to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 64/90] target/sparc: Move FMOVD, FNEGD, FABSD, FSRC*D, FNOT*D to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 75/90] target/sparc: Move gen_fop_QQQ insns to decodetree,
Richard Henderson <=
- [PATCH v4 63/90] target/sparc: Move FMOVS, FNEGS, FABSS, FSRC*S, FNOT*S to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 67/90] target/sparc: Move gen_ne_fop_DDD insns to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 71/90] target/sparc: Move gen_fop_DD insns to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 74/90] target/sparc: Move gen_fop_DDD insns to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 78/90] target/sparc: Move gen_fop_FD insns to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 79/90] target/sparc: Move FiTOd, FsTOd, FsTOx to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 81/90] target/sparc: Move FqTOd, FqTOx to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 83/90] target/sparc: Move FdTOq, FxTOq to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 82/90] target/sparc: Move FiTOq, FsTOq to decodetree, Richard Henderson, 2023/10/22
- [PATCH v4 90/90] target/sparc: Remove disas_sparc_legacy, Richard Henderson, 2023/10/22
- Prev by Date:
[PATCH v4 64/90] target/sparc: Move FMOVD, FNEGD, FABSD, FSRC*D, FNOT*D to decodetree
- Next by Date:
[PATCH v4 63/90] target/sparc: Move FMOVS, FNEGS, FABSS, FSRC*S, FNOT*S to decodetree
- Previous by thread:
[PATCH v4 64/90] target/sparc: Move FMOVD, FNEGD, FABSD, FSRC*D, FNOT*D to decodetree
- Next by thread:
[PATCH v4 63/90] target/sparc: Move FMOVS, FNEGS, FABSS, FSRC*S, FNOT*S to decodetree
- Index(es):