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]

[RFA] sh-sim: fix PRND


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;",

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