This is the mail archive of the 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: [Patch, moxie] Change branch target offset encodings

On Fri, Sep 7, 2012 at 9:19 PM, Anthony Green <> 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.


Anthony Green

2012-09-14  Anthony Green  <>

	* 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),

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