Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: kazu@cs.umass.edu
Cc: gdb-patches@sources.redhat.com, rsandifo@redhat.com,
	dvenkat@noida.hcltech.com
Subject: [RFA] h8-sim: all IMM16s should be zero-extended
Date: Wed, 02 Jul 2003 19:28:00 -0000	[thread overview]
Message-ID: <3F03322B.5050107@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 126 bytes --]

According to the docs (and I believe this was also the prior
simulator behavior), immediates should always be zero-extended.


[-- Attachment #2: 1.84 --]
[-- Type: text/plain, Size: 1081 bytes --]

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)

             reply	other threads:[~2003-07-02 19:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-02 19:28 Michael Snyder [this message]
2003-07-02 20:33 ` Kazu Hirata
2003-07-18  0:08   ` Michael Snyder
2003-07-03 22:00 ` Kazu Hirata

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F03322B.5050107@redhat.com \
    --to=msnyder@redhat.com \
    --cc=dvenkat@noida.hcltech.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kazu@cs.umass.edu \
    --cc=rsandifo@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox