]> git.proxmox.com Git - mirror_qemu.git/commit
target/i386: validate VEX.W for AVX instructions
authorPaolo Bonzini <pbonzini@redhat.com>
Mon, 9 Oct 2023 16:16:27 +0000 (18:16 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 25 Oct 2023 15:35:07 +0000 (17:35 +0200)
commite000687f1266d031528758271d0b16e288394ede
tree3b8a74be2cc7b8cb7d3bb881be7995fd783cfb9a
parent183e6679e39fb5bcc17dbebaf668c1e83d8e57ee
target/i386: validate VEX.W for AVX instructions

Instructions in VEX exception class 6 generally look at the value of
VEX.W.  Note that the manual places some instructions incorrectly in
class 4, for example VPERMQ which has no non-VEX encoding and no legacy
SSE analogue.  AMD does a mess of its own, as documented in the comment
that this patch adds.

Most of them are checked for VEX.W=0, and are listed in the manual
(though with an omission) in table 2-16; VPERMQ and VPERMPD check for
VEX.W=1, which is only listed in the instruction description.  Others,
such as VPSRLV, VPSLLV and the FMA3 instructions, use VEX.W to switch
between a 32-bit and 64-bit operation.

Fix more of the class 4/class 6 mismatches, and implement the check for
VEX.W in TCG.

Acked-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/decode-new.c.inc
target/i386/tcg/decode-new.h