This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] x86: fix operand size checking
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Beulich <JBeulich at suse dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Sat, 14 Jul 2018 06:07:28 -0700
- Subject: Re: [PATCH] x86: fix operand size checking
- References: <5B48B4E202000078001D3D45@prv1-mh.provo.novell.com>
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.