Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] h8-sim: all IMM16s should be zero-extended
@ 2003-07-02 19:28 Michael Snyder
  2003-07-02 20:33 ` Kazu Hirata
  2003-07-03 22:00 ` Kazu Hirata
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Snyder @ 2003-07-02 19:28 UTC (permalink / raw)
  To: kazu; +Cc: gdb-patches, rsandifo, dvenkat

[-- 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)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] h8-sim: all IMM16s should be zero-extended
  2003-07-02 19:28 [RFA] h8-sim: all IMM16s should be zero-extended Michael Snyder
@ 2003-07-02 20:33 ` Kazu Hirata
  2003-07-18  0:08   ` Michael Snyder
  2003-07-03 22:00 ` Kazu Hirata
  1 sibling, 1 reply; 4+ messages in thread
From: Kazu Hirata @ 2003-07-02 20:33 UTC (permalink / raw)
  To: msnyder; +Cc: gdb-patches, rsandifo, dvenkat

Hi Michael,

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

This is cool and probably solves the problem I posted at

http://sources.redhat.com/ml/gdb-patches/2003-06/msg00751.html

Thanks!

Kazu Hirata


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] h8-sim: all IMM16s should be zero-extended
  2003-07-02 19:28 [RFA] h8-sim: all IMM16s should be zero-extended Michael Snyder
  2003-07-02 20:33 ` Kazu Hirata
@ 2003-07-03 22:00 ` Kazu Hirata
  1 sibling, 0 replies; 4+ messages in thread
From: Kazu Hirata @ 2003-07-03 22:00 UTC (permalink / raw)
  To: msnyder; +Cc: gdb-patches, rsandifo, dvenkat

Hi Michael,

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

This fixes the failure of gcc.c-torture/execute/20020307-1.c.  Thanks!

Kazu Hirata


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [RFA] h8-sim: all IMM16s should be zero-extended
  2003-07-02 20:33 ` Kazu Hirata
@ 2003-07-18  0:08   ` Michael Snyder
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Snyder @ 2003-07-18  0:08 UTC (permalink / raw)
  To: Kazu Hirata; +Cc: gdb-patches, rsandifo, dvenkat

Kazu Hirata wrote:
> Hi Michael,
> 
> 
>>According to the docs (and I believe this was also the prior
>>simulator behavior), immediates should always be zero-extended.
> 
> 
> This is cool and probably solves the problem I posted at
> 
> http://sources.redhat.com/ml/gdb-patches/2003-06/msg00751.html
> 
> Thanks!
> 
> Kazu Hirata
> 


committed.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-07-18  0:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-02 19:28 [RFA] h8-sim: all IMM16s should be zero-extended Michael Snyder
2003-07-02 20:33 ` Kazu Hirata
2003-07-18  0:08   ` Michael Snyder
2003-07-03 22:00 ` Kazu Hirata

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox