[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 72/90] target/sparc: Move FSQRTq to decodetree
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v3 72/90] target/sparc: Move FSQRTq to decodetree |
|
Date: |
Fri, 20 Oct 2023 22:31:40 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/sparc/insns.decode | 1 +
target/sparc/translate.c | 39 +++++++++++++++++++++++----------------
2 files changed, 24 insertions(+), 16 deletions(-)
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index d8a49838a0..6994312909 100644
--- a/target/sparc/insns.decode
+++ b/target/sparc/insns.decode
@@ -247,6 +247,7 @@ FABSs 10 ..... 110100 00000 0 0000 1001 .....
@r_r2
FABSd 10 ..... 110100 00000 0 0000 1010 ..... @r_r2
FSQRTs 10 ..... 110100 00000 0 0010 1001 ..... @r_r2
FSQRTd 10 ..... 110100 00000 0 0010 1010 ..... @r_r2
+FSQRTq 10 ..... 110100 00000 0 0010 1011 ..... @r_r2
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 38ad2034eb..2d594ddc9f 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -71,6 +71,7 @@
#define gen_helper_fpmerge ({ g_assert_not_reached(); NULL; })
#define gen_helper_fexpand ({ g_assert_not_reached(); NULL; })
#define gen_helper_pdist ({ g_assert_not_reached(); NULL; })
+#define gen_helper_fsqrtq ({ g_assert_not_reached(); NULL; })
#define FSR_LDXFSR_MASK ({ qemu_build_not_reached(); 0; })
#define FSR_LDXFSR_OLDMASK ({ qemu_build_not_reached(); 0; })
# ifdef CONFIG_USER_ONLY
@@ -1682,18 +1683,6 @@ static void gen_fop_DDD(DisasContext *dc, int rd, int
rs1, int rs2,
gen_store_fpr_D(dc, rd, dst);
}
-static void gen_fop_QQ(DisasContext *dc, int rd, int rs,
- void (*gen)(TCGv_ptr))
-{
- gen_op_load_fpr_QT1(QFPREG(rs));
-
- 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));
-}
-
#ifdef TARGET_SPARC64
static void gen_ne_fop_QQ(DisasContext *dc, int rd, int rs,
void (*gen)(TCGv_ptr))
@@ -4962,6 +4951,27 @@ TRANS(FSQRTd, ALL, do_env_dd, a, gen_helper_fsqrtd)
TRANS(FxTOd, 64, do_env_dd, a, gen_helper_fxtod)
TRANS(FdTOx, 64, do_env_dd, a, gen_helper_fdtox)
+static bool do_env_qq(DisasContext *dc, arg_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_QT1(QFPREG(a->rs));
+ 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(FSQRTq, ALL, do_env_qq, a, gen_helper_fsqrtq)
+
static bool do_fff(DisasContext *dc, arg_r_r_r *a,
void (*func)(TCGv_i32, TCGv_i32, TCGv_i32))
{
@@ -5107,11 +5117,8 @@ static void disas_sparc_legacy(DisasContext *dc,
unsigned int insn)
case 0x2a: /* fsqrtd */
case 0x82: /* V9 fdtox */
case 0x88: /* V9 fxtod */
- g_assert_not_reached(); /* in decodetree */
case 0x2b: /* fsqrtq */
- CHECK_FPU_FEATURE(dc, FLOAT128);
- gen_fop_QQ(dc, rd, rs2, gen_helper_fsqrtq);
- break;
+ g_assert_not_reached(); /* in decodetree */
case 0x41: /* fadds */
gen_fop_FFF(dc, rd, rs1, rs2, gen_helper_fadds);
break;
--
2.34.1
- [PATCH v3 50/90] target/sparc: Move LDSTUB, LDSTUBA to decodetree, (continued)
- [PATCH v3 50/90] target/sparc: Move LDSTUB, LDSTUBA to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 53/90] target/sparc: Move PREFETCH, PREFETCHA to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 55/90] target/sparc: Move simple fp load/store to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 57/90] target/sparc: Move LDFSR, STFSR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 58/90] target/sparc: Merge LDFSR, LDXFSR implementations, Richard Henderson, 2023/10/21
- [PATCH v3 61/90] target/sparc: Move ADDRALIGN* to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 65/90] target/sparc: Use tcg_gen_vec_{add,sub}*, Richard Henderson, 2023/10/21
- [PATCH v3 62/90] target/sparc: Move BMASK to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 71/90] target/sparc: Move gen_fop_DD insns to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 73/90] target/sparc: Move gen_fop_FFF insns to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 72/90] target/sparc: Move FSQRTq to decodetree,
Richard Henderson <=
- [PATCH v3 75/90] target/sparc: Move gen_fop_QQQ insns to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 76/90] target/sparc: Move FSMULD to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 51/90] target/sparc: Move SWAP, SWAPA to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 54/90] target/sparc: Split out fp ldst functions with asi precomputed, Richard Henderson, 2023/10/21
- [PATCH v3 63/90] target/sparc: Move FMOVS, FNEGS, FABSS, FSRC*S, FNOT*S to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 69/90] target/sparc: Move gen_gsr_fop_DDD insns to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 66/90] target/sparc: Move gen_ne_fop_FFF insns to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 67/90] target/sparc: Move gen_ne_fop_DDD insns to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 68/90] target/sparc: Move PDIST to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 70/90] target/sparc: Move gen_fop_FF insns to decodetree, Richard Henderson, 2023/10/21