This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: [patches] Re: x86-64 gas part II


> On Wed, 20 Dec 2000, Jan Hubicka wrote:
> 
> > + {"rex",    0, 0x40, X, Cpu64,  NoSuf|IsPrefix,        { 0, 0, 0} },
> > + {"rexz",   0, 0x41, X, Cpu64,  NoSuf|IsPrefix,        { 0, 0, 0} },
> 
> Do these "rex" prefixes actually appear in instructions?  ie. Does it make
> sense to accept a line like " rex mov ..."?  If not, then these prefixes
> shouldn't be in the table.
The rex prefix is used for different purposes - it have 4 bytes to play with - 
one is used to overwrite the operand size 32->64bit and the rest 3 are used
for register extensions.

There are tought some other uses for rex prefix, such as sysret instruction,
that changes it's behaviour when rex prefix is present.
So from my point of view, it behaves like other i386 prefixes, especially like
data/address size overwrite ones.

In most cases you should not write them explicitly (as for data size prefixes
too), but there are cases where this should come handy, especially if AMD
defines new extension in similar way as they did for sysret, or you want
to do something hackish - such as using them to alter instruction length.

Thats why I added them to the instruction table - they are defined as prefix,
behave similary as other prefixes, so I think they should appear in the table
at least just for completteness.

Or am I mistaken?
> 
> > + /* In the 64bit mode the short form mov immediate is redefined to have
> > +    64bit displacement value.  */
> > + {"movq",   2,	0x88, X, Cpu64,	 q_Suf|D|W|Modrm|Size64,{ Reg64, Reg64|AnyMem, 0 } },
> 
> "movq" and q_Suf will allow "movqq" to match here, after trimming off
> the suffix.  I suspect that wasn't your intention.
OK, NoSuf should be probably correct :)

Honza
> 
> -- 
> Linuxcare.  Support for the Revolution.
> 
> 
> 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]