This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Commit: MN10300 SIM: Fix bug in emulation of SUB Rm,Rn,Rd insn


Hi Guys,

  I am applying the patch below as an obvious fix.  It corrects the
  calculation of the carry flag in the MN10300 simulator's emulation of
  the SUB Rm,Rn,Rd instruction.

Cheers
  Nick
    
sim/mn10300/ChangeLog
2011-06-20  Nick Clifton  <nickc@redhat.com>

	* am33.igen (sub Rm,Rn,Rd): Fix computation of carry flag.

Index: sim/mn10300/am33.igen
===================================================================
RCS file: /cvs/src/src/sim/mn10300/am33.igen,v
retrieving revision 1.9
diff -u -3 -p -r1.9 am33.igen
--- sim/mn10300/am33.igen	26 Jun 2004 22:18:18 -0000	1.9
+++ sim/mn10300/am33.igen	20 Jun 2011 16:48:27 -0000
@@ -2573,7 +2573,7 @@
 
   z = (difference == 0);
   n = (difference & 0x80000000);
-  c = (source1 > source1);
+  c = (source1 > source2);
   v = ((source1 & 0x80000000) == (source2 & 0x80000000)
        && (source1 & 0x80000000) != (difference & 0x80000000));
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]