This is the mail archive of the binutils@sourceware.org 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]
Other format: [Raw text]

Re: [PATCH 05/10] x86: add tests to cover defaulting of operand sizes for ambiguous insns


On 06.08.2019 22:57,  H.J. Lu  wrote:
On Tue, Aug 6, 2019 at 12:56 PM H.J. Lu <hjl.tools@gmail.com> wrote:

On Tue, Aug 6, 2019 at 7:26 AM Jan Beulich <jbeulich@suse.com> wrote:

I don't see anything wrong since these are just tests.

Prior to changing the logic in the assembler install tests to make sure
the present defaulting of operand sizes won't get broken. There are a
few potential anomalies pointed out by this:
- arithmetic insns (add, sub, etc) allow defaulting when their immediate
    fits in (signed) 8 bits, but they fail to assemble with larger values,

The default destination is 32-bit with some 32-bit immediate operands
encoded as 8-bit.

- mov, other than arithmetic insns, doesn't allow any defaulting,
- movsx/movzx default to byte sources (in AT&T mode), and their special
    casing needs to be adjusted first

Does AT&T syntax support movsx/movzx mnemonic?

To answer my question, there are

movsx, 2, 0xfbe, None, 2, Cpu386,
Modrm|No_wSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|ATTSyntax, {
Reg8|Unspecified|BaseIndex, Reg16|Reg32|Reg64 }
movsx, 2, 0xfbf, None, 2, Cpu386,
Modrm|No_bSuf|No_lSuf|No_sSuf|No_qSuf|No_ldSuf|ATTSyntax, {
Reg16|Unspecified|BaseIndex, Reg32|Reg64 }
movsx, 2, 0x63, None, 1, Cpu64,
Modrm|No_bSuf|No_wSuf|No_sSuf|No_qSuf|No_ldSuf|Rex64|ATTSyntax, {
Reg32|Unspecified|BaseIndex, Reg64 }

Without suffix, memory size is 8 bit.

Which is going to remain this way, in sufficiently unambiguous cases
even with a warning - see the later patch.

Jan


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