This is the mail archive of the gdb-patches@sources.redhat.com 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]

[PATCH/RFA] h8300-elf-sim: shift and carry flag


This corrects an error in computing the carry flag for right shift
(both arithmatic and logical).  The mask wants to be unsigned, because
(signed) 0x80000000 >> 1 is 0xc0000000.
2003-04-07  Michael Snyder  <msnyder at redhat dot com>

	* compile.c (OSHIFTS): hm mask for computing carry flag
	must be unsigned, so that shifting it will not extend it.

Index: compile.c
===================================================================
RCS file: /cvs/cvsfiles/devo/sim/h8300/compile.c,v
retrieving revision 1.70
diff -p -r1.70 compile.c
*** compile.c	2003/03/27 22:01:29	1.70
--- compile.c	2003/04/08 06:14:07
*************** case O (name, SW):				\
*** 940,946 ****
  case O (name, SL):				\
  {						\
    int t;					\
!   int hm = 0x80000000; 				\
    rd = GET_L_REG (code->src.reg);		\
    if ((GET_MEMORY_B (pc + 1) & 0x40) == 0)	\
      {						\
--- 941,947 ----
  case O (name, SL):				\
  {						\
    int t;					\
!   unsigned int hm = 0x80000000; 		\
    rd = GET_L_REG (code->src.reg);		\
    if ((GET_MEMORY_B (pc + 1) & 0x40) == 0)	\
      {						\

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