target/mips: Guard check_insn with INSN_R5900 check
authorFredrik Noring <noring@nocrew.org>
Wed, 7 Nov 2018 19:19:45 +0000 (20:19 +0100)
committerAleksandar Markovic <amarkovic@wavecomp.com>
Sat, 17 Nov 2018 18:29:34 +0000 (19:29 +0100)
Explicitely mark handling of PREF instruction for R5900 as
treating the same as NOP.

Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>
Signed-off-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Aleksandar Markovic <amarkovic@wavecomp.com>
target/mips/translate.c

index c79da3c2e4c5c6c055216d86ae0ba850c1ad7499..714f2e6be4803df6afe9599879775e7be1788aac 100644 (file)
@@ -28357,9 +28357,12 @@ static void decode_opc(CPUMIPSState *env, DisasContext *ctx)
         break;
     case OPC_PREF:
         check_insn_opc_removed(ctx, ISA_MIPS32R6);
-        check_insn(ctx, ISA_MIPS4 | ISA_MIPS32 |
-                   INSN_R5900);
-        /* Treat as NOP. */
+        if (ctx->insn_flags & INSN_R5900) {
+            /* Treat as NOP. */
+        } else {
+            check_insn(ctx, ISA_MIPS4 | ISA_MIPS32);
+            /* Treat as NOP. */
+        }
         break;
 
     /* Floating point (COP1). */