aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Meissner <gnu@the-meissners.org>1997-05-09 19:48:52 +0000
committerMichael Meissner <gnu@the-meissners.org>1997-05-09 19:48:52 +0000
commitaaa7b252607ba49e67cb3329a1dea77418f3d1a1 (patch)
tree53cc97676e6b9e92cc588348278aeb29513c930e
parent9efd3f74128b8c6179269e366227db74c6b7d504 (diff)
downloadgdb-aaa7b252607ba49e67cb3329a1dea77418f3d1a1.zip
gdb-aaa7b252607ba49e67cb3329a1dea77418f3d1a1.tar.gz
gdb-aaa7b252607ba49e67cb3329a1dea77418f3d1a1.tar.bz2
Make cmp produce the correct results
-rw-r--r--sim/tic80/ChangeLog5
-rw-r--r--sim/tic80/insns33
2 files changed, 20 insertions, 18 deletions
diff --git a/sim/tic80/ChangeLog b/sim/tic80/ChangeLog
index 1b1a167..aeaa431 100644
--- a/sim/tic80/ChangeLog
+++ b/sim/tic80/ChangeLog
@@ -1,3 +1,8 @@
+Fri May 9 15:47:36 1997 Mike Meissner <meissner@cygnus.com>
+
+ * insns (cmp_vals,do_cmp): Produce the correct bits as specified
+ by the architecture.
+
Fri May 9 09:55:33 1997 Andrew Cagney <cagney@b1.cygnus.com>
* alu.h (long_immediate): Adjust the CIA delay-pointer as well as
diff --git a/sim/tic80/insns b/sim/tic80/insns
index c1a4467..f7edef1 100644
--- a/sim/tic80/insns
+++ b/sim/tic80/insns
@@ -295,27 +295,24 @@ void::function::do_cmnd:signed32 source
// cmp
unsigned32::function::cmp_vals:signed32 s1, unsigned32 u1, signed32 s2, unsigned32 u2
unsigned32 field = 0;
- if (s1 == s2) field |= BIT32 (0);
- if (s1 != s2) field |= BIT32 (1);
- if (s1 > s2) field |= BIT32 (2);
- if (s1 <= s2) field |= BIT32 (3);
- if (s1 < s2) field |= BIT32 (4);
- if (s1 >= s2) field |= BIT32 (5);
- if (u1 > u2) field |= BIT32 (6);
- if (u1 <= u2) field |= BIT32 (7);
- if (u1 < u2) field |= BIT32 (8);
- if (u1 >= u2) field |= BIT32 (9);
+ if (s1 == s2) field |= 0x001;
+ if (s1 != s2) field |= 0x002;
+ if (s1 > s2) field |= 0x004;
+ if (s1 <= s2) field |= 0x008;
+ if (s1 < s2) field |= 0x010;
+ if (s1 >= s2) field |= 0x020;
+ if (u1 > u2) field |= 0x040;
+ if (u1 <= u2) field |= 0x080;
+ if (u1 < u2) field |= 0x100;
+ if (u1 >= u2) field |= 0x200;
return field;
void::function::do_cmp:unsigned32 *rDest, unsigned32 Source1, unsigned32 Source2
unsigned32 field = 0;
- field |= INSERTED32 (cmp_vals (_SD, Source2, Source1, Source2, Source2),
- 29, 20);
- field |= INSERTED32 (cmp_vals (_SD, (signed16)Source1, (unsigned16)Source1,
- (signed16)Source2, (unsigned16)Source2),
- 19, 10);
- field |= INSERTED32 (cmp_vals (_SD, (signed8)Source1, (unsigned8)Source1,
- (signed8)Source2, (unsigned8)Source2),
- 9, 0);
+ field |= cmp_vals (_SD, Source1, Source1, Source2, Source2) << 20;
+ field |= cmp_vals (_SD, (signed16)Source1, (unsigned16)Source1,
+ (signed16)Source2, (unsigned16)Source2) << 10;
+ field |= cmp_vals (_SD, (signed8)Source1, (unsigned8)Source1,
+ (signed8)Source2, (unsigned8)Source2);
TRACE_ALU3 (MY_INDEX, field, Source1, Source2);
*rDest = field;
31.Dest,26.Source2,21.0b1010000,14.SignedImmediate::::cmp i