Commit a892dd7a13 for qemu.org
commit a892dd7a1392eafc344b7b6ccee868bb6c8d0c3e
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date: Tue Nov 10 19:54:42 2026 +0100
target/mips: Check for MIPS II when decoding BLEZL/BGTZL
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é <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20261113161158.25811-2-philmd@oss.qualcomm.com>
diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c
index 10811db827..f521e0ec5b 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;