This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Glitches in gas/objdump handling of i386 STR, SLDT, SMSW instructions
- To: Zack Weinberg <zack at codesourcery dot com>
- Subject: Re: Glitches in gas/objdump handling of i386 STR, SLDT, SMSW instructions
- From: Alan Modra <amodra at bigpond dot net dot au>
- Date: Mon, 12 Nov 2001 11:35:47 +1030
- Cc: binutils at sources dot redhat dot com
- References: <20011111161911.A2608@codesourcery.com>
On Sun, Nov 11, 2001 at 04:19:11PM -0800, Zack Weinberg wrote:
>
> First and most seriously: gas incorrectly thinks STR is invalid except
> with a 16-bit operand. In reality, STR works like most i386
> word/long/quad instructions: the operand size prefixes apply. To
Hmm, that's true when the destination is a register. It's not true for
a memory destination according to my reference; You only get 16 bits
in memory regardless of operand size.
> * include/opcode/i386.h: Change "str" instruction to
> wlq_Suf|Modrm, WordReg|WordMem.
> * opcodes/i386-dis.c: Change "sldt", "str", and "smsw" entries
> to "sldtQ", "strQ", "smswQ" respectively; all with Ev operand
> category instead of Ew.
Thanks, please apply. Note that strictly speaking, sldt, smsw and str
should probably all be ShortMem rather than WordMem. There's absolutely
no difference in gas behaviour because all the *Mem's are the same, but
it's nice to document what the instruction really does. Well, what the
Intel reference claims the instruction does... ;-)
Alan