Signed-off-by: Fredrik Noring <noring@nocrew.org>
---
target/mips/translate.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/target/mips/translate.c b/target/mips/translate.c
index c3ed4c21ce..007dfd2975 100644
--- a/target/mips/translate.c
+++ b/target/mips/translate.c
@@ -28329,8 +28329,11 @@ 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);
+ if (ctx->insn_flags & INSN_R5900) {
+ /* The R5900 implements PREF. */
+ } else {
+ check_insn(ctx, ISA_MIPS4 | ISA_MIPS32);
+ }
/* Treat as NOP. */
break;
--
2.18.1