OSDN Git Service

target/mips: Simplify PREF opcode
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Thu, 29 Jul 2021 14:02:57 +0000 (16:02 +0200)
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>
Wed, 25 Aug 2021 11:00:37 +0000 (13:00 +0200)
check_insn() checks for any bit in the set, and INSN_R5900 is
just another bit added to the set. No need to special-case it.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20210801234202.3167676-2-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
target/mips/tcg/translate.c

index bf71724..6b95cca 100644 (file)
@@ -15739,12 +15739,8 @@ static bool decode_opc_legacy(CPUMIPSState *env, DisasContext *ctx)
         /* Treat as NOP. */
         break;
     case OPC_PREF:
-        if (ctx->insn_flags & INSN_R5900) {
-            /* Treat as NOP. */
-        } else {
-            check_insn(ctx, ISA_MIPS4 | ISA_MIPS_R1);
-            /* Treat as NOP. */
-        }
+        check_insn(ctx, ISA_MIPS4 | ISA_MIPS_R1 | INSN_R5900);
+        /* Treat as NOP. */
         break;
 
     /* Floating point (COP1). */