Branch-likely instructions were introduced in MIPS II; on MIPS I
they signal Reserved Instruction. BEQL/BNEL and the REGIMM likely
forms already check ISA_MIPS2, but BLEZL and BGTZL (non-R6) did not.

Fixes: d9224450208e ("target-mips: Tighten ISA level checks")
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
 target/mips/tcg/translate.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index 10811db827c9..f521e0ec5bd0 100644
--- a/target/mips/tcg/translate.c
+++ b/target/mips/tcg/translate.c
@@ -14621,6 +14621,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, 
DisasContext *ctx)
             gen_compute_compact_branch(ctx, op, rs, rt, imm << 2);
         } else {
             /* OPC_BLEZL */
+            check_insn(ctx, ISA_MIPS2);
             gen_compute_branch(ctx, op, 4, rs, rt, imm << 2, 4);
         }
         break;
@@ -14634,6 +14635,7 @@ static bool decode_opc_legacy(CPUMIPSState *env, 
DisasContext *ctx)
             gen_compute_compact_branch(ctx, op, rs, rt, imm << 2);
         } else {
             /* OPC_BGTZL */
+            check_insn(ctx, ISA_MIPS2);
             gen_compute_branch(ctx, op, 4, rs, rt, imm << 2, 4);
         }
         break;
-- 
2.55.0


Reply via email to