This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: d10v: don't silently turn @-r# into @-sp
- From: Alexandre Oliva <aoliva at redhat dot com>
- To: Nick Clifton <nickc at cambridge dot redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: 04 Dec 2001 08:42:10 -0200
- Subject: Re: d10v: don't silently turn @-r# into @-sp
- Organization: GCC Team, Red Hat
- References: <orwv09tsjv.fsf@free.redhat.lsd.ic.unicamp.br><m3vgftzd0l.fsf@north-pole.nickc.cambridge.redhat.com><orpu5xj04z.fsf@free.redhat.lsd.ic.unicamp.br><m31yicwrbs.fsf@north-pole.nickc.cambridge.redhat.com>
On Dec 3, 2001, Nick Clifton <nickc@cambridge.redhat.com> wrote:
> Hi Alexandre,
>> Oops. Unfortunately, this broke disassembly of sp. It would come
>> out as r262159, because we wouldn't find sp and num would then be
>> printed with the OPERAND_GPR bit set. Perhaps num should be masked
>> with the REGISTER_MASK before being printed?
> This would probably be a good idea.
Here it is. I've verified that it builds, but I don't see how to
actually test it, since it seems to me that all registers are properly
matched. Ok to install anyway?
Index: opcodes/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* d10v-dis.c (print_operand): Apply REGISTER_MASK to `num' of
unmatched register.
Index: opcodes/d10v-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/d10v-dis.c,v
retrieving revision 1.7
diff -u -p -r1.7 d10v-dis.c
--- opcodes/d10v-dis.c 2001/12/04 10:08:19 1.7
+++ opcodes/d10v-dis.c 2001/12/04 10:41:12
@@ -145,7 +145,7 @@ print_operand (oper, insn, op, memaddr,
(*info->fprintf_func) (info->stream, "cr");
else if (oper->flags & OPERAND_REG)
(*info->fprintf_func) (info->stream, "r");
- (*info->fprintf_func) (info->stream, "%d", num);
+ (*info->fprintf_func) (info->stream, "%d", num & REGISTER_MASK);
}
}
else
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me