[ARM] signed zero

Matthew Gretton-Dann matthew.gretton-dann@arm.com
Tue May 24 11:09:00 GMT 2011


(Note: I am not a maintainer so can't give commit approval).

On Mon, 2011-05-23 at 15:04 +0100, Nathan Sidwell wrote:
> The ARM ISA encodes offsets in sign/magnitude representation, so there are two 
> representations of zero.  The ISA specifies how the assembler should select the 
> right one, and the disassembler should explicitly show -0.  For +0, it should 
> elide the offset in certain circumstances.

The assembler part of the patch looks okay to me.

Can you state the rules you are using to decide whether to elide +0?  

Looking at the source code and tests I think I agree with most of the
times you elide +0.  However, you seem to elide the offset when doing a
literal load (for instance ldr r0, [pc, #0] is being disassembled as ldr
r0, [pc]).  In this case I think the offset should be shown, and this is
also what the ARMARM does (see section A8.6.59 for example).



Matthew Gretton-Dann
Principal Engineer - PDSW Tools

More information about the Binutils mailing list