This is the mail archive of the binutils@sources.redhat.com 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] x86: suppress emission of zero displacements inmemoryoperands


This stripping is intentional; I'm running into this in many cases where structure offsets are generated (i.e. through a C translation), and the zero offset gets needlessly retained. The point is that you anyway can't force the assembler to everything, like use a 32-bit displacement when an 8-bit one (or even none) suffices. If that's already impossible, then adding this additional thing is no issue at all in my opinion. Jan

>>> "Dave Korn" <dave.korn@artimi.com> 06.05.05 15:56:52 >>>
----Original Message----
>From: Jan Beulich
>Sent: 06 May 2005 13:04

> When explicitly specified, gas encoded a pointless zero displacement in
> memory addressing forms. Since this is not normally desired and was most
> likely just an oversight, this patch adds an adjustment to eliminate the
> displacement in that case.

  I'm not sure if I've fully understood the intent of this patch, but I
think you're saying that if someone writes

        mov %eax,0(%edi)

the assembler will emit

   4 0003 8907          mov %eax,(%edi)

and not

   2 0000 894700        mov %eax,0(%edi)

yes?  Nothing the user _explicitly_ specifies should ever be discarded IMO.
What if someone wants to write self-modifying code that stores varying
offsets into that field?


    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....



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