This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH/RFA] h8300-elf-sim: shift and carry flag
- From: Michael Snyder <msnyder at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 07 Apr 2003 23:18:28 -0700
- Subject: [PATCH/RFA] h8300-elf-sim: shift and carry flag
- Organization: Red Hat, Inc.
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) \
{ \