[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 24/90] target/sparc: Move RDTBR, FLUSHW to decodetree
From: |
Richard Henderson |
Subject: |
[PATCH v3 24/90] target/sparc: Move RDTBR, FLUSHW to decodetree |
Date: |
Fri, 20 Oct 2023 22:30:52 -0700 |
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/sparc/insns.decode | 5 +++++
target/sparc/translate.c | 23 +++++++++++------------
2 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/target/sparc/insns.decode b/target/sparc/insns.decode
index 99e4f8f671..7fb5fa3b3a 100644
--- a/target/sparc/insns.decode
+++ b/target/sparc/insns.decode
@@ -76,6 +76,11 @@ RDPR_gl 10 rd:5 101010 10000 0 0000000000000
RDPR_strand_status 10 rd:5 101010 11010 0 0000000000000
RDPR_ver 10 rd:5 101010 11111 0 0000000000000
+{
+ FLUSHW 10 00000 101011 00000 0 0000000000000
+ RDTBR 10 rd:5 101011 00000 0 0000000000000
+}
+
Tcc_r 10 0 cond:4 111010 rs1:5 0 cc:1 0000000 rs2:5
{
# For v7, the entire simm13 field is present, but masked to 7 bits.
diff --git a/target/sparc/translate.c b/target/sparc/translate.c
index 70ebf3cf79..4c9079d598 100644
--- a/target/sparc/translate.c
+++ b/target/sparc/translate.c
@@ -3476,6 +3476,7 @@ static TCGv do_rdtba(DisasContext *dc, TCGv dst)
return cpu_tbr;
}
+TRANS(RDTBR, 32, do_rd_special, supervisor(dc), a->rd, do_rdtba)
TRANS(RDPR_tba, 64, do_rd_special, supervisor(dc), a->rd, do_rdtba)
static TCGv do_rdpstate(DisasContext *dc, TCGv dst)
@@ -3614,6 +3615,16 @@ static TCGv do_rdver(DisasContext *dc, TCGv dst)
TRANS(RDPR_ver, 64, do_rd_special, supervisor(dc), a->rd, do_rdver)
+static bool trans_FLUSHW(DisasContext *dc, arg_FLUSHW *a)
+{
+#ifdef TARGET_SPARC64
+ gen_helper_flushw(tcg_env);
+ return advance_pc(dc);
+#else
+ return false;
+#endif
+}
+
#define CHECK_IU_FEATURE(dc, FEATURE) \
if (!((dc)->def->features & CPU_FEATURE_ ## FEATURE)) \
goto illegal_insn;
@@ -3644,18 +3655,6 @@ static void disas_sparc_legacy(DisasContext *dc,
unsigned int insn)
TCGv cpu_dst __attribute__((unused)) = tcg_temp_new();
TCGv cpu_tmp0 __attribute__((unused));
-#if defined(TARGET_SPARC64) || !defined(CONFIG_USER_ONLY)
- if (xop == 0x2b) { /* rdtbr / V9 flushw */
-#ifdef TARGET_SPARC64
- gen_helper_flushw(tcg_env);
-#else
- if (!supervisor(dc))
- goto priv_insn;
- gen_store_gpr(dc, rd, cpu_tbr);
-#endif
- break;
- }
-#endif
if (xop == 0x34) { /* FPU Operations */
if (gen_trap_ifnofpu(dc)) {
goto jmp_insn;
--
2.34.1
- [PATCH v3 21/90] target/sparc: Move RDASR, STBAR, MEMBAR to decodetree, (continued)
- [PATCH v3 21/90] target/sparc: Move RDASR, STBAR, MEMBAR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 27/90] target/sparc: Move WRWIM, WRPR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 28/90] target/sparc: Move WRTBR, WRHPR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 31/90] target/sparc: Move MULX to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 33/90] target/sparc: Move SUBC to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 38/90] target/sparc: Move MOVcc, MOVR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 23/90] target/sparc: Move RDWIM, RDPR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 36/90] target/sparc: Move TADD, TSUB, MULS to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 26/90] target/sparc: Move WRPSR, SAVED, RESTORED to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 22/90] target/sparc: Move RDPSR, RDHPR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 24/90] target/sparc: Move RDTBR, FLUSHW to decodetree,
Richard Henderson <=
- [PATCH v3 25/90] target/sparc: Move WRASR to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 29/90] target/sparc: Move basic arithmetic to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 32/90] target/sparc: Move UMUL, SMUL to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 37/90] target/sparc: Move SLL, SRL, SRA to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 34/90] target/sparc: Move UDIVX, SDIVX to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 35/90] target/sparc: Move UDIV, SDIV to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 39/90] target/sparc: Move POPC to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 40/90] target/sparc: Convert remaining v8 coproc insns to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 42/90] target/sparc: Move FLUSH, SAVE, RESTORE to decodetree, Richard Henderson, 2023/10/21
- [PATCH v3 41/90] target/sparc: Move JMPL, RETT, RETURN to decodetree, Richard Henderson, 2023/10/21