qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <f4bug@amsat.org>
To: Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
	Peer Adelt <peer.adelt@hni.uni-paderborn.de>,
	Richard Henderson <rth@twiddle.net>
Cc: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	qemu-devel@nongnu.org, "Aurelien Jarno" <aurelien@aurel32.net>,
	"Aleksandar Markovic" <amarkovic@wavecomp.com>
Subject: [Qemu-devel] [RFC PATCH 08/11] target/mips: Add a decodetree stub
Date: Mon, 12 Nov 2018 00:36:19 +0100	[thread overview]
Message-ID: <20181111233622.8976-9-f4bug@amsat.org> (raw)
In-Reply-To: <20181111233622.8976-1-f4bug@amsat.org>

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 target/mips/Makefile.objs   |  8 ++++++++
 target/mips/insns.decode    |  2 ++
 target/mips/translate.c     |  7 +++++++
 target/mips/translate.inc.c | 13 +++++++++++++
 4 files changed, 30 insertions(+)
 create mode 100644 target/mips/insns.decode
 create mode 100644 target/mips/translate.inc.c

diff --git a/target/mips/Makefile.objs b/target/mips/Makefile.objs
index 651f36f517..3510835d57 100644
--- a/target/mips/Makefile.objs
+++ b/target/mips/Makefile.objs
@@ -2,3 +2,11 @@ obj-y += translate.o dsp_helper.o op_helper.o lmi_helper.o helper.o cpu.o
 obj-y += gdbstub.o msa_helper.o mips-semi.o
 obj-$(CONFIG_SOFTMMU) += machine.o cp0_timer.o
 obj-$(CONFIG_KVM) += kvm.o
+
+DECODETREE = $(SRC_PATH)/scripts/decodetree.py
+
+target/mips/decode.inc.c: $(SRC_PATH)/target/mips/insns.decode $(DECODETREE)
+	$(call quiet-command,\
+	  $(PYTHON) $(DECODETREE) -o $@ $<, "GEN", $(TARGET_DIR)$@)
+
+target/mips/translate.o: target/mips/decode.inc.c
diff --git a/target/mips/insns.decode b/target/mips/insns.decode
new file mode 100644
index 0000000000..7fbf21cbb9
--- /dev/null
+++ b/target/mips/insns.decode
@@ -0,0 +1,2 @@
+# MIPS32/MIPS64 Instruction Set
+#
diff --git a/target/mips/translate.c b/target/mips/translate.c
index e726f3ec00..560325c563 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -27848,6 +27848,8 @@ static void gen_msa(CPUMIPSState *env, DisasContext *ctx)
 
 }
 
+#include "translate.inc.c"
+
 static void decode_opc(CPUMIPSState *env, DisasContext *ctx)
 {
     int32_t offset;
@@ -27872,6 +27874,11 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)
         gen_set_label(l1);
     }
 
+    /* Transition to the auto-generated decoder.  */
+    if (decode(ctx, ctx->opcode)) {
+        return;
+    }
+
     op = MASK_OP_MAJOR(ctx->opcode);
     rs = (ctx->opcode >> 21) & 0x1f;
     rt = (ctx->opcode >> 16) & 0x1f;
diff --git a/target/mips/translate.inc.c b/target/mips/translate.inc.c
new file mode 100644
index 0000000000..69fe78ac89
--- /dev/null
+++ b/target/mips/translate.inc.c
@@ -0,0 +1,13 @@
+/*
+ *  MIPS emulation for QEMU - MIPS32 translation routines
+ *
+ *  Copyright (c) 2004-2005 Jocelyn Mayer
+ *  Copyright (c) 2006 Marius Groeger (FPU operations)
+ *  Copyright (c) 2006 Thiemo Seufer (MIPS32R2 support)
+ *  Copyright (c) 2018 Philippe Mathieu-Daudé
+ *
+ * This code is licensed under the GNU GPLv2 and later.
+ */
+
+/* Include the auto-generated decoder.  */
+#include "decode.inc.c"
-- 
2.17.2

  parent reply	other threads:[~2018-11-11 23:36 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-11 23:36 [Qemu-devel] [RFC PATCH 00/11] decodetree: Add tokens to ease checking ISA flags Philippe Mathieu-Daudé
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 01/11] MAINTAINERS: Add scripts/decodetree.py to the TCG section Philippe Mathieu-Daudé
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 02/11] decodetree: Add multiple include guard Philippe Mathieu-Daudé
2018-11-12 22:30   ` Eduardo Habkost
2018-11-12 23:30     ` Philippe Mathieu-Daudé
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 03/11] target/mips: Move the !ISA_MIPS32R6 check out of decode_opc_special2_legacy Philippe Mathieu-Daudé
2018-11-12  8:16   ` Richard Henderson
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 04/11] target/mips: Avoid access to CPUMIPSState from decode* functions Philippe Mathieu-Daudé
2018-11-12  8:17   ` Richard Henderson
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 05/11] decodetree: Force Python to print unsigned values Philippe Mathieu-Daudé
2018-11-12  8:20   ` Richard Henderson
2018-11-12  8:57     ` Philippe Mathieu-Daudé
2018-11-12 17:03   ` Eduardo Habkost
2018-11-12 18:52     ` Philippe Mathieu-Daudé
2018-11-12 18:56       ` Philippe Mathieu-Daudé
2018-11-12 19:01       ` Richard Henderson
2018-11-12 21:41       ` Eduardo Habkost
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 06/11] scripts/decodetree: Allow empty specifications Philippe Mathieu-Daudé
2018-11-12  8:21   ` Richard Henderson
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 07/11] scripts/decodetree: Add add_func_check() Philippe Mathieu-Daudé
2018-11-12  8:31   ` Richard Henderson
2018-11-11 23:36 ` Philippe Mathieu-Daudé [this message]
2018-11-12  5:37   ` [Qemu-devel] [RFC PATCH 08/11] target/mips: Add a decodetree stub Aleksandar Markovic
2018-11-12  8:58     ` Richard Henderson
2018-11-12 10:04       ` Aleksandar Markovic
2018-11-12 10:55         ` Richard Henderson
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 09/11] target/mips: Port SYNCI to decodetree Philippe Mathieu-Daudé
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 10/11] scripts/decodetree: Add add_cond_check() Philippe Mathieu-Daudé
2018-11-11 23:36 ` [Qemu-devel] [RFC PATCH 11/11] target/mips: Port MIPS64 DCL[Z/O] to decodetree Philippe Mathieu-Daudé
2018-11-12  9:14   ` Richard Henderson
2018-11-12  9:17     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181111233622.8976-9-f4bug@amsat.org \
    --to=f4bug@amsat.org \
    --cc=amarkovic@wavecomp.com \
    --cc=aurelien@aurel32.net \
    --cc=kbastian@mail.uni-paderborn.de \
    --cc=peer.adelt@hni.uni-paderborn.de \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).