This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] sh-sim: fix PRND
- From: Michael Snyder <msnyder at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: ezannoni <ezannoni at sources dot redhat dot com>
- Date: Wed, 09 Jul 2003 16:51:24 -0700
- Subject: [RFA] sh-sim: fix PRND
- Organization: Red Hat, Inc.
The docs say that the lower 16 bits will be cleared to zero.
2003-07-09 Michael Snyder <msnyder@redhat.com>
* gencode.c (prnd): Clear LSW of result to zeros.
Index: gencode.c
===================================================================
RCS file: /cvs/src/src/sim/sh/gencode.c,v
retrieving revision 1.8
diff -p -r1.8 gencode.c
*** gencode.c 4 Jul 2003 00:03:52 -0000 1.8
--- gencode.c 9 Jul 2003 23:48:02 -0000
*************** op ppi_tab[] =
*** 1478,1484 ****
"int Sx = DSP_R (x);",
"int Sx_grd = GET_DSP_GRD (x);",
"",
! "res = Sx + 0x8000;",
"carry = (unsigned) res < (unsigned) Sx;",
"res_grd = Sx_grd + carry;",
"COMPUTE_OVERFLOW;",
--- 1478,1484 ----
"int Sx = DSP_R (x);",
"int Sx_grd = GET_DSP_GRD (x);",
"",
! "res = (Sx + 0x8000) & 0xffff0000;",
"carry = (unsigned) res < (unsigned) Sx;",
"res_grd = Sx_grd + carry;",
"COMPUTE_OVERFLOW;",
*************** op ppi_tab[] =
*** 1511,1517 ****
"int Sy = DSP_R (y);",
"int Sy_grd = SIGN32 (Sy);",
"",
! "res = Sy + 0x8000;",
"carry = (unsigned) res < (unsigned) Sy;",
"res_grd = Sy_grd + carry;",
"COMPUTE_OVERFLOW;",
--- 1511,1517 ----
"int Sy = DSP_R (y);",
"int Sy_grd = SIGN32 (Sy);",
"",
! "res = (Sy + 0x8000) & 0xffff0000;",
"carry = (unsigned) res < (unsigned) Sy;",
"res_grd = Sy_grd + carry;",
"COMPUTE_OVERFLOW;",