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]

[v850 sim] bsh vs carry,zero


Yet another minor tweak to match the manual and hardware.

2006-04-12  DJ Delorie  <dj@redhat.com>

	* v850.igen (bsh): Fix carry and zero flag logic.

Index: v850.igen
===================================================================
RCS file: /cvs/src/src/sim/v850/v850.igen,v
retrieving revision 1.7
diff -p -U3 -r1.7 v850.igen
--- v850.igen	5 Sep 2003 17:46:52 -0000	1.7
+++ v850.igen	13 Apr 2006 03:28:21 -0000
@@ -171,9 +171,9 @@ rrrrr,11111100000 + wwwww,01101000010:XI
 
   GR[reg3] = value;
   PSW &= ~(PSW_Z | PSW_S | PSW_CY | PSW_OV);
-  if (value == 0) PSW |= PSW_Z;
+  if ((value & 0xffff) == 0) PSW |= PSW_Z;
   if (value & 0x80000000) PSW |= PSW_S;
-  if (((value & 0xff) == 0) || (value & 0x00ff) == 0) PSW |= PSW_CY;
+  if (((value & 0xff) == 0) || ((value & 0xff00) == 0)) PSW |= PSW_CY;
 
   TRACE_ALU_RESULT (GR[reg3]);
 }


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