Fix subu immed - was incorrectly using unsigned.
authorAndrew Cagney <cagney@redhat.com>
Thu, 29 May 1997 07:25:20 +0000 (07:25 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 29 May 1997 07:25:20 +0000 (07:25 +0000)
sim/tic80/ChangeLog
sim/tic80/alu.h
sim/tic80/insns

index d0c56c061552f218e39be2df275a04f449b2cb63..62aecf21799587878a969cb224057911572bb3de 100644 (file)
@@ -1,3 +1,9 @@
+Thu May 29 12:09:13 1997  Andrew Cagney  <cagney@b2.cygnus.com>
+
+       * alu.h (IMEM_IMMED): New macro, fetch 32bit immediate operand N.
+
+       * insns (subu i): Immediate is signed not unsigned.
+
 Tue May 27 13:22:13 1997  Andrew Cagney  <cagney@b1.cygnus.com>
 
        * sim-calls.c (sim_read): Pass NULL cpu to sim_core_read_buffer.
index 3f13759e61bda403439cf1fcead3a851f515e0ed..ce40a0160fb5888885d77d08885b00d8923542c3 100644 (file)
@@ -41,6 +41,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #define IMEM(CIA) \
 (sim_core_read_aligned_4(STATE_CPU (sd, 0), CIA, sim_core_execute_map, (CIA).ip))
 
+#define IMEM_IMMED(CIA, N) \
+(sim_core_read_aligned_4 (STATE_CPU (sd, 0), CIA, sim_core_execute_map, (CIA).ip + 4 * (N)))
+
 #define MEM(SIGN, EA, NR_BYTES) \
 ((SIGN##_##NR_BYTES) sim_core_read_unaligned_##NR_BYTES (STATE_CPU (sd, 0), cia, \
                                                          sim_core_read_map, \
index ad71d216b9730c25cf79a9bc2c517fa83aaaf964..a3aceaea505eef1c5124bae5e27fff01c5849cea 100644 (file)
@@ -988,7 +988,7 @@ void::function::do_subu:unsigned32 *rDest, unsigned32 Source1, signed32 Source2
        TRACE_ALU3 (MY_INDEX, result, Source1, Source2);
        *rDest = result;
 // NOTE - the book has 15.1 which conflicts with subu.
-31.Dest,26.Source2,21.0b101101,15.1,14.UnsignedImmediate::::subu i
+31.Dest,26.Source2,21.0b101101,15.1,14.SignedImmediate::::subu i
        do_subu (_SD, rDest, vSource1, vSource2);
 31.Dest,26.Source2,21.0b11101101,13.1,12.0,11./,4.Source1::::subu r
        do_subu (_SD, rDest, vSource1, vSource2);