[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 76/94] target/sparc: Move FSQRTq to decodetree
From: |
Richard Henderson |
Subject: |
[PULL 76/94] target/sparc: Move FSQRTq to decodetree |
Date: |
Wed, 25 Oct 2023 17:15:24 -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 | 38 ++++++++++++++++++++++----------------
2 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index 1d766fab21..4cb250265d 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 307fbc4628..93efdf3383 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -1686,18 +1686,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))
@@ -4845,6 +4833,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))
{
@@ -4990,11 +4999,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
- [PULL 88/94] target/sparc: Move FMOVq, FNEGq, FABSq to decodetree, (continued)
- [PULL 88/94] target/sparc: Move FMOVq, FNEGq, FABSq to decodetree, Richard Henderson, 2023/10/25
- [PULL 62/94] target/sparc: Merge LDFSR, LDXFSR implementations, Richard Henderson, 2023/10/25
- [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 <=
- [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, 2023/10/25
- [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