This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [ARM] signed zero
- From: Matthew Gretton-Dann <matthew dot gretton-dann at arm dot com>
- To: Nathan Sidwell <nathan at codesourcery dot com>
- Cc: binutils <binutils at sourceware dot org>
- Date: Tue, 24 May 2011 12:08:45 +0100
- Subject: Re: [ARM] signed zero
- References: <4DDA696F.40607@codesourcery.com>
Nathan,
(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).
Thanks,
Matt
--
Matthew Gretton-Dann
Principal Engineer - PDSW Tools
ARM Ltd