From: Michael Meissner Date: Fri, 9 May 1997 19:48:52 +0000 (+0000) Subject: Make cmp produce the correct results X-Git-Tag: gdb-4_18~5551 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aaa7b252607ba49e67cb3329a1dea77418f3d1a1;p=external%2Fbinutils.git Make cmp produce the correct results --- 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 + + * insns (cmp_vals,do_cmp): Produce the correct bits as specified + by the architecture. + Fri May 9 09:55:33 1997 Andrew Cagney * 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