This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: PATCH: Fix i386 disassembler with index == 0x4 in SIB (Re: objdump bug-report)
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: "Allan B. Cruse" <cruse at cs dot usfca dot edu>,binutils at sources dot redhat dot com, gcc at gcc dot gnu dot org,GNU C Library <libc-alpha at sources dot redhat dot com>
- Date: Fri, 14 Jan 2005 11:29:18 +1030
- Subject: Re: PATCH: Fix i386 disassembler with index == 0x4 in SIB (Re: objdump bug-report)
- References: <20050111210753.0C8CB219E0@nexus.cs.usfca.edu> <20050112191052.GA12463@lucon.org> <20050113034440.GG30985@bubble.modra.org> <20050113170849.GA30644@lucon.org> <20050114000528.GA3408@bubble.modra.org> <20050114002659.GA4491@lucon.org>
On Thu, Jan 13, 2005 at 04:26:59PM -0800, H. J. Lu wrote:
> If it is an optimization, there shouldn't be a warning.
No, whether we warn or not is an entirely separate matter to whether we
optimize.
> I think it
> may be useful to turn "leal 0xf(%eax,1), %eax" into "8d 44 20 0f"
> Gcc/ld use
>
> leal foo(%reg), %eax; call ___tls_get_addr; nop
>
> today for TLS optimization. With the change, we can use
>
> leal foo(%reg,1), %eax; call ___tls_get_addr;
Hmm. So that you generate a larger instruction on purpose? Wanted for
the space needed with some of the tls transformations, I expect.
OK, that is a valid reason to support encoding of the instruction
that way. You still should warn for scale factors other than 1,
because it's easy to forget the comma in (,%reg,2) where you really
do want the register to be scaled.
> Then it should display
>
> 8b 04 23 mov (%ebx,1),%eax
Agreed.
--
Alan Modra
IBM OzLabs - Linux Technology Centre