This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] x86: allow suffix-less sign-extending movsb, movsw, and movsl
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jonas Maebe <jonas-devlists at watlock dot be>
- Cc: Jan Beulich <JBeulich at suse dot com>, Binutils <binutils at sourceware dot org>
- Date: Fri, 1 Jul 2016 07:35:29 -0700
- Subject: Re: [PATCH] x86: allow suffix-less sign-extending movsb, movsw, and movsl
- Authentication-results: sourceware.org; auth=none
- References: <577655C002000078000FA593 at prv-mh dot provo dot novell dot com> <CAMe9rOodb0Grq+soDSJq4aZfneTEkmJy8_M-quUBn6FJyK_=6w at mail dot gmail dot com> <57768C3F02000078000FA6B0 at prv-mh dot provo dot novell dot com> <20160701154345 dot Horde dot cBkeSkisJlFXdnORG8cFS7A at mail dot elis dot ugent dot be> <577693C902000078000FA6FB at prv-mh dot provo dot novell dot com> <20160701162450 dot Horde dot hClcNkisJlFXdn0ysfmHqqA at mail dot elis dot ugent dot be>
On Fri, Jul 1, 2016 at 7:24 AM, Jonas Maebe <jonas-devlists@watlock.be> wrote:
>
> Jan Beulich wrote on Fri, 01 Jul 2016:
>
>>>>> On 01.07.16 at 15:43, <jonas-devlists@watlock.be> wrote:
>>
>>
>>> I think that is a really bad idea. movsb, movsw and movsl are existing
>>> mnemonics for completely different opcodes (as in "rep movsb"). It
>>> also seems to be against the spirit of AT&T syntax, which normally
>>> requires you to explicitly specify all operand sizes fully with the
>>> mnemonic in all cases, even if the assembler could in theory deduce
>>> them from the operands.
>>
>>
>> Where's that written down please?
>
>
> In all honsesty, it's how I had always understood AT&T syntax to be, and the
> inline assembler parser in our compiler (which I did not write) also
> requires it. I had absolutely no idea until a few days ago there were AT&T
> syntax assembler parsers that allow you to omit size suffixes.
>
> Looking for a reference, the most official/complete one I could find is
> http://docs.oracle.com/cd/E19253-01/817-5477/817-5477.pdf . And that one
> indeed states "If a mnemonic is specified with no type suffix, the operand
> type defaults to long".
>
>> As said in the movz patch
>> description yesterday, movz{b,w} and movs{b,w,l} really are
>> the odd ones - everything else gets accepted without suffixes when
>> they're deducible from operands.
>
>
> Referring again to the above document, it says about movsb/movsw: "movsb is
> not movsb{wlq}" and "movsw
> is not movsw{lq}" (on p. 37). Those are the only mnemonics that are singled
> out in this way.
>
> So in the end, I guess the movzb/movzw change is fine, but this one is not.
> It's in inherent inconsistency related to the ability of leaving away the
> size suffixes in combination with the chosen mnemonics, it seems. That in
> turn reinforces my opinion (which is clearly just that, rather than a
> universal rule) that you should always use size suffixes with AT&T syntax.
>
I agree.
--
H.J.
- References:
- [PATCH] x86: allow suffix-less sign-extending movsb, movsw, and movsl
- Re: [PATCH] x86: allow suffix-less sign-extending movsb, movsw, and movsl
- Re: [PATCH] x86: allow suffix-less sign-extending movsb, movsw, and movsl
- Re: [PATCH] x86: allow suffix-less sign-extending movsb, movsw, and movsl
- Re: [PATCH] x86: allow suffix-less sign-extending movsb, movsw, and movsl
- Re: [PATCH] x86: allow suffix-less sign-extending movsb, movsw, and movsl