* rx.c (decode_opcode): For "MVFC PC,", use the address of the
authorDJ Delorie <dj@redhat.com>
Tue, 14 Dec 2010 23:12:20 +0000 (23:12 +0000)
committerDJ Delorie <dj@redhat.com>
Tue, 14 Dec 2010 23:12:20 +0000 (23:12 +0000)
opcode, not the address following the opcode.

sim/rx/ChangeLog
sim/rx/rx.c

index 16678f862426e93ea0636e468fe8ee3b84974088..c0b4b5dda64621d1a83a797758a4813f19652411 100644 (file)
@@ -1,3 +1,8 @@
+2010-12-14  DJ Delorie  <dj@redhat.com>
+
+       * rx.c (decode_opcode): For "MVFC PC,", use the address of the
+       opcode, not the address following the opcode.
+
 2010-11-11  DJ Delorie  <dj@redhat.com>
 
        * rx.c (lsb_count): New.
index 881dc66fa2c9de961f2d4e8b93d21ffdb482d9ae..5fb11d9f8c7fe1cda905d6b629a995b734231da3 100644 (file)
@@ -1379,6 +1379,14 @@ decode_opcode ()
     case RXO_mov:
       v = GS ();
 
+      if (opcode->op[1].type == RX_Operand_Register
+         && opcode->op[1].reg == 17 /* PC */)
+       {
+         /* Special case.  We want the address of the insn, not the
+            address of the next insn.  */
+         v = opcode_pc;
+       }
+
       if (opcode->op[0].type == RX_Operand_Register
          && opcode->op[0].reg == 16 /* PSW */)
        {