[PATCH 05/10] x86: add tests to cover defaulting of operand sizes for ambiguous insns
Tue Aug 6 20:58:00 GMT 2019
On Tue, Aug 6, 2019 at 12:56 PM H.J. Lu <email@example.com> wrote:
> On Tue, Aug 6, 2019 at 7:26 AM Jan Beulich <firstname.lastname@example.org> 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,
Reg8|Unspecified|BaseIndex, Reg16|Reg32|Reg64 }
movsx, 2, 0xfbf, None, 2, Cpu386,
Reg16|Unspecified|BaseIndex, Reg32|Reg64 }
movsx, 2, 0x63, None, 1, Cpu64,
Reg32|Unspecified|BaseIndex, Reg64 }
Without suffix, memory size is 8 bit.
> > - bt and friends allow defaulting, while shl and friends don't,
> > - ambiguous AVX and AVX512 insns don't allow defaulting.
> > This should ultimately all become consistent (perhaps with the exception
> > some of the SIMD insns); respective tests will be added to the test
> > cases here as the issues get addressed.
> AT&T syntax isn't very consistent. Improve its consistency is OK as long
> as it is compatible with existing assembly codes.
> > gas/
> > 2019-08-XX Jan Beulich <email@example.com>
> > * testsuite/gas/i386/noreg16.d, testsuite/gas/i386/noreg16.s,
> > testsuite/gas/i386/noreg32.d, testsuite/gas/i386/noreg32.s,
> > testsuite/gas/i386/noreg64.d, testsuite/gas/i386/noreg64.s: New.
> > * testsuite/gas/i386/i386.exp: Run new tests.
> OK with clarification of commit message.
More information about the Binutils