PATCH: PR gas/5534: "XXX PTR" isn't checked properly in Intelsyntax

H.J. Lu
Mon Jan 14 12:27:00 GMT 2008

On Fri, Jan 11, 2008 at 10:42:22AM +0000, Jan Beulich wrote:
> >>> "H.J. Lu" <> 11.01.08 01:03 >>>
> >On Fri, Jan 04, 2008 at 06:28:20AM -0800, H.J. Lu wrote:
> >> On Fri, Jan 04, 2008 at 08:09:44AM +0000, Jan Beulich wrote:
> >> > While I agree on the subject, I slightly disagree on the approach you took: The added flags shouldn't go on the instructions, but
> >on their operands (otherwise you'll likely end up creating more special case code namely for movzx/movsx, but perhaps also
> >elsewhere): Just like for registers, memory operands should properly specify what sizes are acceptable (basically, operand type
> >and operand size should probably be decoupled). Jan
> >> 
> >> Another problem is suffix.  I don't like using "suffix" for both
> >> mnemonic suffix in AT&T/Intel modes and operand size in Intel mode.
> >> I like your suggestion. We now have enough bits on operand to do it.
> >> But it is a major work and it can't be done one instruction at a time.
> >> 
> >
> >Here is the initial patch. Any comments?
> I first thought I understand what Unspecified means, but since it's being
> used on movzx/movsx as well as instructions where the respective
> operand's size cannot be derived from another operand, I don't think I
> really understand the concept.

Unspecified means size can be unspecified. AnySize means any size
is ok. Here is the updated patch. Now it reports error on all lines
in intelbad.s.


2008-01-11  H.J. Lu  <>

	PR gas/5534
	* gas/i386/i386.s: Add tests for fnstsw and fstsw.
	* gas/i386/inval.s: Likewise. 
	* gas/i386/x86_64.s: Likewise.

	* gas/i386/intel.s: Use word instead of dword on ss.

	* gas/i386/x86-64-inval.s: Add tests for fnstsw, fstsw, in
	and out.

	* gas/i386/prefix.s: Remove invalid fstsw.

	* gas/i386/inval.l: Updated.
	* gas/i386/intelbad.l: Likewise.
	* gas/i386/i386.d: Likewise.
	* gas/i386/x86_64.d: Likewise.
	* gas/i386/x86-64-inval.l: Likewise.
	* gas/i386/prefix.d: Updated.


2008-01-11  H.J. Lu  <>

	PR gas/5534
	* config/tc-i386.c (_i386_insn): Update comment.
	(operand_type_match): Also clear unspecified.
	(operand_type_register_match): Likewise.
	(parse_operands): Initialize unspecified.
	(i386_intel_operand): Likewise.
	(match_template): Check memory and accumulator operand size.
	(i386_att_operand): Clear unspecified on register operand.
	(intel_e11): Likewise.
	(intel_e09): Set operand size and clean unspecified for


2008-01-11  H.J. Lu  <>

	PR gas/5534
	* i386-gen.c (operand_type_init): Add Dword to
	(opcode_modifiers): Remove CheckSize, Byte, Word, Dword,
	Qword and Xmmword.
	(operand_types): Add Byte, Word, Dword, Fword, Qword, Tbyte,
	Xmmword, Unspecified and Anysize.
	(set_bitfield): Make Mmword an alias of Qword.  Make Oword
	an alias of Xmmword.

	* i386-opc.h (CheckSize): Removed.
	(Byte): Updated.
	(Word): Likewise.
	(Dword): Likewise.
	(Qword): Likewise.
	(Xmmword): Likewise.
	(FWait): Updated.
	(OTMax): Likewise.
	(i386_opcode_modifier): Remove checksize, byte, word, dword,
	qword and xmmword.
	(Fword): New.
	(TBYTE): Likewise.
	(Unspecified): Likewise.
	(Anysize): Likewise.
	(i386_operand_type): Add byte, word, dword, fword, qword,
	tbyte xmmword, unspecified and anysize.

	* i386-opc.tbl: Updated to use Byte, Word, Dword, Fword, Qword,
	Tbyte, Xmmword, Unspecified and Anysize.

	* i386-reg.tbl: Add size for accumulator.

	* i386-init.h: Regenerated.
	* i386-tbl.h: Likewise.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: binutils-size-2.diff.bz2
Type: application/x-bzip2
Size: 33225 bytes
Desc: not available
URL: <>

More information about the Binutils mailing list