aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2010-12-14 23:39:03 +0000
committerDJ Delorie <dj@redhat.com>2010-12-14 23:39:03 +0000
commit45eb4d476d8a060b843597192379433bbfa8ab3b (patch)
treee648a93145f65c958c7c6970d8eccbaa2c527142 /sim
parent29cfc22f891b09394ff485fe18c2e2f0c3c80b0f (diff)
downloadbinutils-45eb4d476d8a060b843597192379433bbfa8ab3b.zip
binutils-45eb4d476d8a060b843597192379433bbfa8ab3b.tar.gz
binutils-45eb4d476d8a060b843597192379433bbfa8ab3b.tar.bz2
(decode_opcode): RXO_branchrel is relative to the opcode's PC, not
the address following the opcode.
Diffstat (limited to 'sim')
-rw-r--r--sim/rx/ChangeLog2
-rw-r--r--sim/rx/rx.c4
2 files changed, 4 insertions, 2 deletions
diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog
index c0b4b5d..1f9866a 100644
--- a/sim/rx/ChangeLog
+++ b/sim/rx/ChangeLog
@@ -2,6 +2,8 @@
* rx.c (decode_opcode): For "MVFC PC,", use the address of the
opcode, not the address following the opcode.
+ (decode_opcode): RXO_branchrel is relative to the opcode's PC, not
+ the address following the opcode.
2010-11-11 DJ Delorie <dj@redhat.com>
diff --git a/sim/rx/rx.c b/sim/rx/rx.c
index 5fb11d9..dd9bb8e 100644
--- a/sim/rx/rx.c
+++ b/sim/rx/rx.c
@@ -1087,10 +1087,10 @@ decode_opcode ()
break;
case RXO_branchrel:
- if (GS())
+ if (opcode->op[1].type == RX_Operand_None || GS())
{
int delta = GD();
- regs.r_pc += delta;
+ regs.r_pc = opcode_pc + delta;
#ifdef CYCLE_ACCURATE
/* Note: specs say 3, chip says 2. */
if (delta >= 0 && delta < 16