@samitouri / QOSamiQemu / commits / 50d6757147

target/arm: Make IT insn undef when not present

The IT insn is introduced for A-profile starting in v6T2; for M-profile it is present when the Main Extension is implemented (which includes v7M and excludes v6M). We were missing the feature-check, so fail to UNDEF on earlier cores. Add the missing check. Cc: qemu-stable@nongnu.org Fixes: 9ee6e8bb853bde ("ARMv7 support.") Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20260821132550.168896-3-peter.maydell@linaro.org

Peter Maydell committed Aug 21, 2026 at 14:25 UTC 50d6757147dbc74b1b904535afaf986f72e942ae
1 file changed +11
target/arm/tcg/translate.c
+11
@@ -1,3 +1,4 @@
1 +
2 /*
3 * ARM translation
4 *
@@ -6038,6 +6039,16 @@ static bool trans_IT(DisasContext *s, arg_IT *a)
6039 {
6040 int cond_mask = a->cond_mask;
6041
6042 + /*
6043 + * IT insn introduced in v6T2 for A-profile; it is only present
6044 + * on M-profile if the Main Extension is implemented.
6045 + */
6046 + if (!(arm_dc_feature(s, ARM_FEATURE_M)
6047 + ? arm_dc_feature(s, ARM_FEATURE_M_MAIN)
6048 + : arm_dc_feature(s, ARM_FEATURE_THUMB2))) {
6049 + return false;
6050 + }
6051 +
6052 /*
6053 * No actual code generated for this insn, just setup state.
6054 *