qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v9 23/84] target/mips: Add emulation of nanoMIPS 16-


From: Aleksandar Markovic
Subject: [Qemu-devel] [PATCH v9 23/84] target/mips: Add emulation of nanoMIPS 16-bit shift instructions
Date: Thu, 16 Aug 2018 16:57:16 +0200

From: Yongbok Kim <address@hidden>

Add emulation of nanoMIPS 16-bit shift instructions.

Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Yongbok Kim <address@hidden>
Signed-off-by: Aleksandar Markovic <address@hidden>
Signed-off-by: Stefan Markovic <address@hidden>
---
 target/mips/translate.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/target/mips/translate.c b/target/mips/translate.c
index 05c8b8f..855802d 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -16660,6 +16660,21 @@ static int decode_nanomips_opc(CPUMIPSState *env, 
DisasContext *ctx)
     case NM_P16_MV:
         break;
     case NM_P16_SHIFT:
+        {
+            int shift = extract32(ctx->opcode, 0, 3);
+            uint32_t opc = 0;
+            shift = (shift == 0) ? 8 : shift;
+
+            switch (extract32(ctx->opcode, 3, 1)) {
+            case NM_SLL16:
+                opc = OPC_SLL;
+                break;
+            case NM_SRL16:
+                opc = OPC_SRL;
+                break;
+            }
+            gen_shift_imm(ctx, opc, rt, rs, shift);
+        }
         break;
     case NM_P16C:
         break;
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]