From: Paolo Bonzini Date: Mon, 24 Nov 2025 13:12:49 +0000 (+0100) Subject: target/i386/tcg: ignore V3 in 32-bit mode X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0db1b556e4bcd7a51f222cda9e14850f88fe3f88;p=thirdparty%2Fqemu.git target/i386/tcg: ignore V3 in 32-bit mode From the manual: "In 64-bit mode all 4 bits may be used. [...] In 32-bit and 16-bit modes bit 6 must be 1 (if bit 6 is not 1, the 2-byte VEX version will generate LDS instruction and the 3-byte VEX version will ignore this bit)." Cc: qemu-stable@nongnu.org Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- diff --git a/target/i386/tcg/decode-new.c.inc b/target/i386/tcg/decode-new.c.inc index 0f8c5d1693..dfaffec599 100644 --- a/target/i386/tcg/decode-new.c.inc +++ b/target/i386/tcg/decode-new.c.inc @@ -2665,7 +2665,7 @@ static void disas_insn(DisasContext *s, CPUState *cpu) goto unknown_op; } } - s->vex_v = (~vex3 >> 3) & 0xf; + s->vex_v = (~vex3 >> 3) & (CODE64(s) ? 15 : 7); s->vex_l = (vex3 >> 2) & 1; s->prefix |= pp_prefix[vex3 & 3] | PREFIX_VEX; }