diff mbox series

[PATCH-for-6.2,1/4] target/mips: Simpify PREF opcode

Message ID 20210801234202.3167676-2-f4bug@amsat.org
State New
Headers show
Series target/mips: Decodetree housekeeping | expand

Commit Message

Philippe Mathieu-Daudé Aug. 1, 2021, 11:41 p.m. UTC
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>
---
 target/mips/tcg/translate.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Richard Henderson Aug. 2, 2021, 7:07 p.m. UTC | #1
On 8/1/21 1:41 PM, Philippe Mathieu-Daudé wrote:
> 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>
> ---
>   target/mips/tcg/translate.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~
diff mbox series

Patch

diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index 34a96159d15..05efd25e29d 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -15738,12 +15738,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). */