This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[RFA] h8-sim: all IMM16s should be zero-extended
- From: Michael Snyder <msnyder at redhat dot com>
- To: kazu at cs dot umass dot edu
- Cc: gdb-patches at sources dot redhat dot com, rsandifo at redhat dot com, dvenkat at noida dot hcltech dot com
- Date: Wed, 02 Jul 2003 12:27:39 -0700
- Subject: [RFA] h8-sim: all IMM16s should be zero-extended
- Organization: Red Hat, Inc.
According to the docs (and I believe this was also the prior
simulator behavior), immediates should always be zero-extended.
2003-07-02 Michael Snyder <msnyder@redhat.com>
* compile.c (decode): IMM16 is always zero-extended.
Index: compile.c
===================================================================
RCS file: /cvs/cvsfiles/devo/sim/h8sx/compile.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -p -r1.84 -r1.85
*** compile.c 2003/06/19 04:18:52 1.84
--- compile.c 2003/07/02 19:09:27 1.85
*************** decode (SIM_DESC sd, int addr, unsigned
*** 818,824 ****
(looking_for & SIZE) == L_16U)
{
cst[opnum] = (data[len / 2] << 8) + data[len / 2 + 1];
! if ((looking_for & SIZE) != L_16U)
cst[opnum] = (short) cst[opnum]; /* Sign extend. */
}
else if (looking_for & ABSJMP)
--- 818,826 ----
(looking_for & SIZE) == L_16U)
{
cst[opnum] = (data[len / 2] << 8) + data[len / 2 + 1];
! /* Immediates are always unsigned. */
! if ((looking_for & SIZE) != L_16U &&
! (looking_for & MODE) != IMM)
cst[opnum] = (short) cst[opnum]; /* Sign extend. */
}
else if (looking_for & ABSJMP)