Check invalid mask registers
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 20 Oct 2016 22:07:42 +0000 (15:07 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 20 Oct 2016 22:26:23 +0000 (15:26 -0700)
commit9889cbb14ebea4b281408afcfd94ad6646ab370a
treeffad5e2435f482ae1392027828b13905776e5890
parentf90fd8c2f17c7631915103ce5b760830a156ee93
Check invalid mask registers

In 32-bit, the REX_B bit in the 3-byte VEX prefix is ignored and the
the highest bit in VEX.vvvv is either 1 or ignored.  In 64-bit, we
need to check invalid mask registers.

gas/

PR binutis/20705
* testsuite/gas/i386/i386.exp: Run x86-64-opcode-bad.
* testsuite/gas/i386/x86-64-opcode-bad.d: New file.
* testsuite/gas/i386/x86-64-opcode-bad.s: Likewise.

opcodes/

PR binutis/20705
* i386-dis.c (get_valid_dis386): Ignore the REX_B bit and
the highest bit in VEX.vvvv for the 3-byte VEX prefix in
32-bit mode.  Don't check vex.register_specifier in 32-bit
mode.
(OP_E_register): Check invalid mask registers.
(OP_G): Likewise.
(OP_VEX): Likewise.
gas/ChangeLog
gas/testsuite/gas/i386/i386.exp
gas/testsuite/gas/i386/x86-64-opcode-bad.d [new file with mode: 0644]
gas/testsuite/gas/i386/x86-64-opcode-bad.s [new file with mode: 0644]
opcodes/ChangeLog
opcodes/i386-dis.c