[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v5 46/94] target/sparc: Move FLUSH, SAVE, RESTORE to decodetree
|
From: |
Richard Henderson |
|
Subject: |
[PATCH v5 46/94] target/sparc: Move FLUSH, SAVE, RESTORE to decodetree |
|
Date: |
Sun, 22 Oct 2023 16:28:44 -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 | 4 ++++
target/sparc/translate.c | 35 +++++++++++++++++++++++++----------
2 files changed, 29 insertions(+), 10 deletions(-)
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index 271789ac13..aa90b5c5bb 100644
--- a/target/sparc/insns.decode
+++ b/target/sparc/insns.decode
@@ -223,6 +223,10 @@ JMPL 10 ..... 111000 ..... . .............
@r_r_ri
RETT 10 00000 111001 ..... . ............. @n_r_ri
RETURN 10 00000 111001 ..... . ............. @n_r_ri
}
+NOP 10 00000 111011 ----- 0 00000000----- # FLUSH reg+reg
+NOP 10 00000 111011 ----- 1 ------------- # FLUSH reg+imm
+SAVE 10 ..... 111100 ..... . ............. @r_r_ri
+RESTORE 10 ..... 111101 ..... . ............. @r_r_ri
NCP 10 ----- 110110 ----- --------- ----- # v8 CPop1
NCP 10 ----- 110111 ----- --------- ----- # v8 CPop2
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index f3cb5e5146..e90be8b959 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -4077,6 +4077,11 @@ static bool do_saved_restored(DisasContext *dc, bool
saved)
TRANS(SAVED, 64, do_saved_restored, true)
TRANS(RESTORED, 64, do_saved_restored, false)
+static bool trans_NOP(DisasContext *dc, arg_NOP *a)
+{
+ return advance_pc(dc);
+}
+
static bool trans_NOP_v7(DisasContext *dc, arg_NOP_v7 *a)
{
/*
@@ -4454,6 +4459,24 @@ static bool do_return(DisasContext *dc, int rd, TCGv src)
TRANS(RETURN, 64, do_add_special, a, do_return)
+static bool do_save(DisasContext *dc, int rd, TCGv src)
+{
+ gen_helper_save(tcg_env);
+ gen_store_gpr(dc, rd, src);
+ return advance_pc(dc);
+}
+
+TRANS(SAVE, ALL, do_add_special, a, do_save)
+
+static bool do_restore(DisasContext *dc, int rd, TCGv src)
+{
+ gen_helper_restore(tcg_env);
+ gen_store_gpr(dc, rd, src);
+ return advance_pc(dc);
+}
+
+TRANS(RESTORE, ALL, do_add_special, a, do_restore)
+
#define CHECK_IU_FEATURE(dc, FEATURE) \
if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \
goto illegal_insn;
@@ -5269,18 +5292,10 @@ static void disas_sparc_legacy(DisasContext *dc,
unsigned int insn)
switch (xop) {
case 0x38: /* jmpl */
case 0x39: /* rett, V9 return */
- g_assert_not_reached(); /* in decode tree */
- case 0x3b: /* flush */
- /* nop */
- break;
+ case 0x3b: /* flush */
case 0x3c: /* save */
- gen_helper_save(tcg_env);
- gen_store_gpr(dc, rd, cpu_tmp0);
- break;
case 0x3d: /* restore */
- gen_helper_restore(tcg_env);
- gen_store_gpr(dc, rd, cpu_tmp0);
- break;
+ g_assert_not_reached(); /* in decode tree */
#if !defined(CONFIG_USER_ONLY) && defined(TARGET_SPARC64)
case 0x3e: /* V9 done/retry */
{
--
2.34.1
- [PATCH v5 23/94] target/sparc: Move RDPSR, RDHPR to decodetree, (continued)
- [PATCH v5 23/94] target/sparc: Move RDPSR, RDHPR to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 27/94] target/sparc: Move WRPSR, SAVED, RESTORED to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 28/94] target/sparc: Move WRWIM, WRPR to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 35/94] target/sparc: Move MULX to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 37/94] target/sparc: Move SUBC to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 39/94] target/sparc: Move UDIV, SDIV to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 40/94] target/sparc: Move TADD, TSUB, MULS to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 41/94] target/sparc: Move SLL, SRL, SRA to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 45/94] target/sparc: Move JMPL, RETT, RETURN to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 42/94] target/sparc: Move MOVcc, MOVR to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 46/94] target/sparc: Move FLUSH, SAVE, RESTORE to decodetree,
Richard Henderson <=
- [PATCH v5 44/94] target/sparc: Convert remaining v8 coproc insns to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 49/94] target/sparc: Drop ifdef around get_asi and friends, Richard Henderson, 2023/10/22
- [PATCH v5 43/94] target/sparc: Move POPC to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 48/94] target/sparc: Split out resolve_asi, Richard Henderson, 2023/10/22
- [PATCH v5 51/94] target/sparc: Use tcg_gen_qemu_{ld, st}_i128 for GET_ASI_DTWINX, Richard Henderson, 2023/10/22
- [PATCH v5 52/94] target/sparc: Move simple integer load/store to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 47/94] target/sparc: Move DONE, RETRY to decodetree, Richard Henderson, 2023/10/22
- [PATCH v5 58/94] target/sparc: Split out fp ldst functions with asi precomputed, Richard Henderson, 2023/10/22
- [PATCH v5 50/94] target/sparc: Split out ldst functions with asi pre-computed, Richard Henderson, 2023/10/22
- [PATCH v5 53/94] target/sparc: Move asi integer load/store to decodetree, Richard Henderson, 2023/10/22