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: d10v: don't silently turn @-r# into @-sp


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

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