@samitouri / QOSamiQemu / commits / d80b70af1c

target/i386/tcg: move check bits out of validate_vex

JMPABS will need the W0 check; move all of these checks together with the others in disas_insn. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Paolo Bonzini committed Nov 24, 2025 at 12:49 UTC d80b70af1cd8c8e3356c75714a223480302bb7a0
1 file changed +9 -18
target/i386/tcg/decode-new.c.inc
+9 -18
@@ -2723,24 +2723,6 @@ static bool validate_vex(DisasContext *s, X86DecodedInsn *decode)
2723 if (s->flags & HF_EM_MASK) {
2724 goto illegal;
2725 }
2726 -
2727 - if (e->check) {
2728 - if (e->check & X86_CHECK_VEX128) {
2729 - if (s->vex_l) {
2730 - goto illegal;
2731 - }
2732 - }
2733 - if (e->check & X86_CHECK_W0) {
2734 - if (s->vex_w) {
2735 - goto illegal;
2736 - }
2737 - }
2738 - if (e->check & X86_CHECK_W1) {
2739 - if (!s->vex_w) {
2740 - goto illegal;
2741 - }
2742 - }
2743 - }
2726 return true;
2727
2728 nm_exception:
@@ -3000,6 +2982,15 @@ static void disas_insn(DisasContext *s, CPUState *cpu)
2982 goto illegal_op;
2983 }
2984 }
2985 + if ((decode.e.check & X86_CHECK_VEX128) && s->vex_l) {
2986 + goto illegal_op;
2987 + }
2988 + if ((decode.e.check & X86_CHECK_W0) && s->vex_w) {
2989 + goto illegal_op;
2990 + }
2991 + if ((decode.e.check & X86_CHECK_W1) && !s->vex_w) {
2992 + goto illegal_op;
2993 + }
2994 }
2995
2996 switch (decode.e.special) {