On 12/11/24 18:20, Philippe Mathieu-Daudé wrote:
From: Philippe Mathieu-Daudé <f4...@amsat.org>

Introduce the nanoMIPS decodetree configs for the 16-bit
and 32-bit instructions.

Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
Reviewed-by: Aleksandar Rikalo <arik...@gmail.com>
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  target/mips/tcg/translate.h              |  2 ++
  target/mips/tcg/nanomips16.decode        |  8 ++++++++
  target/mips/tcg/nanomips32.decode        |  8 ++++++++
  target/mips/tcg/nanomips_translate.c     | 14 ++++++++++++++
  target/mips/tcg/nanomips_translate.c.inc |  7 +++++++
  target/mips/tcg/meson.build              |  3 +++
  6 files changed, 42 insertions(+)
  create mode 100644 target/mips/tcg/nanomips16.decode
  create mode 100644 target/mips/tcg/nanomips32.decode
  create mode 100644 target/mips/tcg/nanomips_translate.c


diff --git a/target/mips/tcg/nanomips_translate.c 
b/target/mips/tcg/nanomips_translate.c
new file mode 100644
index 0000000000..c148c13ed9
--- /dev/null
+++ b/target/mips/tcg/nanomips_translate.c
@@ -0,0 +1,14 @@
+/*
+ * MIPS emulation for QEMU - nanoMIPS translation routines
+ *
+ * Copyright (c) 2021 Philippe Mathieu-Daudé <f4...@amsat.org>
+ *
+ * SPDX-License-Identifier: LGPL-2.1-or-later
+ */
+
+#include "qemu/osdep.h"
+#include "translate.h"
+
+/* Include the auto-generated decoders.  */
+#include "decode-nanomips16.c.inc"
+#include "decode-nanomips32.c.inc"
diff --git a/target/mips/tcg/nanomips_translate.c.inc 
b/target/mips/tcg/nanomips_translate.c.inc
index 1e274143bb..e401b92bfd 100644
--- a/target/mips/tcg/nanomips_translate.c.inc
+++ b/target/mips/tcg/nanomips_translate.c.inc
@@ -4482,6 +4482,13 @@ static int decode_isa_nanomips(CPUMIPSState *env, 
DisasContext *ctx)
          return 2;
      }
+ if (decode_isa_nanomips16(ctx, ctx->opcode)) {
+        return 2;
+    }
+    if (decode_isa_nanomips32(ctx, ctx->opcode)) {

This call is incorrect, the caller previously called
translator_lduw() so ctx->opcode is incomplete.

+        return 4;
+    }

Discarding this series for now.

Reply via email to