On 12/11/24 14:30, Richard Henderson wrote:
On 11/11/24 14:44, Philippe Mathieu-Daudé wrote:
From: Philippe Mathieu-Daudé <f4...@amsat.org>

Simply call the generic gen_lsa() helper, taking care
to substract 1 to the shift field.

Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <phi...@linaro.org>
---
  target/mips/tcg/nanomips32.decode        |  8 ++++++++
  target/mips/tcg/nanomips_translate.c     | 12 ++++++++++++
  target/mips/tcg/nanomips_translate.c.inc |  9 ---------
  3 files changed, 20 insertions(+), 9 deletions(-)


diff --git a/target/mips/tcg/nanomips_translate.c b/target/mips/tcg/nanomips_translate.c
index c148c13ed9..9a6db4a828 100644
--- a/target/mips/tcg/nanomips_translate.c
+++ b/target/mips/tcg/nanomips_translate.c
@@ -9,6 +9,18 @@
  #include "qemu/osdep.h"
  #include "translate.h"
+static inline int minus_1(DisasContext *ctx, int x)
+{
+    return x - 1;
+}
+
  /* Include the auto-generated decoders.  */
  #include "decode-nanomips16.c.inc"
  #include "decode-nanomips32.c.inc"
+
+static bool trans_LSA(DisasContext *ctx, arg_r *a)
+{
+    gen_lsa(ctx, a->rd, a->rt, a->rs, a->sa);

I think decoding shift-amount - 1 is misleading.

Yeah I thought the same while rebasing ...

Surely it would be better for other callers to pass extract(...) + 1?

... but was too lazy to do the changes :p



r~



Reply via email to