[PATCH] x86: fix operand size checking
H.J. Lu
hjl.tools@gmail.com
Sat Jul 14 18:48:00 GMT 2018
On Fri, Jul 13, 2018 at 7:19 AM, Jan Beulich <JBeulich@suse.com> wrote:
> Currently mov to/from control, debug, and test register insns accept any
> size GPR operand (general pattern: templates with D set and both
> operands being registers in distinct register files). This is due to
> improper checking of the reverse case, including not informing the
> caller whether a straight and/or reverse match was successful.
>
> The helper functions need to be told two indexes: One to index the given
> operand types array, and the other to index the template one. The caller
> must attempt a further straight match only if the function reported a
> straight match (and respectively for reverse matches).
>
> gas/
> 2018-07-13 Jan Beulich <jbeulich@suse.com>
>
> * config/tc-i386.c (match_reg_size): Split second parameter
> into two.
> (match_simd_size): Likewise.
> (match_mem_size): Likewise.
> (MATCH_STRAIGHT, MATCH_REVERSE): Define.
> (operand_size_match): Change return type. New local variable
> "match". Always check for reverse match when opcode_modifier.d
> is set.
> (match_template) New local variable "size_match". Skip further
> matching if operand_size_match() did not report a respective
> match.
> * testsuite/gas/i386/inval.s: Add control register reads/writes.
> * testsuite/gas/i386/inval.l: Adjust expectations.
OK.
Thanks.
--
H.J.
More information about the Binutils
mailing list