[Patch, moxie] Change branch target offset encodings

Anthony Green green@moxielogic.com
Fri Sep 14 10:49:00 GMT 2012


On Fri, Sep 7, 2012 at 9:19 PM, Anthony Green <green@moxielogic.com> wrote:
> Now that there's a hardware implementation of moxie, it was noticed
> that the logic could be simplified by encoding PC relative branch
> offsets relative to the address of the instruction following the
> branch instead of relative to the branch instruction itself.  I'm
> checking this change in.

And here's the forgotten disassembler patch that I am about to check in.

Thanks,

Anthony Green


2012-09-14  Anthony Green  <green@moxielogic.com>

	* moxie-dis.c (print_insn_moxie): Branch targets are relative to
	the address after the branch instruction.


Index: opcodes/moxie-dis.c
===================================================================
RCS file: /cvs/src/src/opcodes/moxie-dis.c,v
retrieving revision 1.5
diff -u -p -r1.5 moxie-dis.c
--- opcodes/moxie-dis.c	13 Sep 2012 22:24:49 -0000	1.5
+++ opcodes/moxie-dis.c	14 Sep 2012 10:45:54 -0000
@@ -205,7 +205,7 @@ print_insn_moxie (bfd_vma addr, struct d
 	{
 	case MOXIE_F3_PCREL:
 	  fpr (stream, "%s\t", opcode->name);
-	  info->print_address_func ((bfd_vma) (addr + INST2OFFSET(iword)),
+	  info->print_address_func ((bfd_vma) (addr + INST2OFFSET(iword) + 2),
 				    info);
 	  break;
 	default:



More information about the Binutils mailing list