qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] qemu/target-sh4 op.c
@ 2007-04-26 23:50 Thiemo Seufer
  0 siblings, 0 replies; 3+ messages in thread
From: Thiemo Seufer @ 2007-04-26 23:50 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Thiemo Seufer <ths>	07/04/26 23:50:46

Modified files:
	target-sh4     : op.c 

Log message:
	Fix inc8 and dec8 operations, by Magnus Damm.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/target-sh4/op.c?cvsroot=qemu&r1=1.3&r2=1.4

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

* [Qemu-devel] qemu/target-sh4 op.c
@ 2007-05-13 16:35 Thiemo Seufer
  2008-01-13 14:53 ` [Qemu-devel] BUG: qemu-sh4 - shar does logical not arithmetic right shift Dave Denholm
  0 siblings, 1 reply; 3+ messages in thread
From: Thiemo Seufer @ 2007-05-13 16:35 UTC (permalink / raw)
  To: qemu-devel

CVSROOT:	/sources/qemu
Module name:	qemu
Changes by:	Thiemo Seufer <ths>	07/05/13 16:35:36

Modified files:
	target-sh4     : op.c 

Log message:
	Remove unnecessary pointer magic in shift operations, by Magnus Damm.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemu/target-sh4/op.c?cvsroot=qemu&r1=1.4&r2=1.5

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

* [Qemu-devel] BUG: qemu-sh4 - shar does logical not arithmetic right shift
  2007-05-13 16:35 [Qemu-devel] qemu/target-sh4 op.c Thiemo Seufer
@ 2008-01-13 14:53 ` Dave Denholm
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Denholm @ 2008-01-13 14:53 UTC (permalink / raw)
  To: qemu-devel

Thiemo Seufer <ths@networkno.de> writes:

(in May 2007)

> CVSROOT:	/sources/qemu
> Module name:	qemu
> Changes by:	Thiemo Seufer <ths>	07/05/13 16:35:36
>
> Modified files:
> 	target-sh4     : op.c 
>
> Log message:
> 	Remove unnecessary pointer magic in shift operations, by Magnus Damm.
>
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/qemu/target-sh4/op.c?cvsroot=qemu&r1=1.4&r2=1.5
>

Hi,
   I'm just playing with qemu-sh4, and found that 'shar' seems to be doing
a logical right shift, rather than an arithmetic right shift.

I think that pointer magic was necessary after all.

In the current version of target-sh4/op.c, op_shar_Rn() and op_shlr_Rn() are identical,
which is surely wrong.

void OPPROTO op_shar_Rn(void)
{
    cond_t(env->gregs[PARAM1] & 1);
    env->gregs[PARAM1] >>= 1;
    RETURN();
}

void OPPROTO op_shlr_Rn(void)
{
    cond_t(env->gregs[PARAM1] & 1);
    env->gregs[PARAM1] >>= 1;
    RETURN();
}

The behaviour is consistent with  env->gregs[] being an array of unsigned ints,
(I'm not familiar with qemu details...) and so to get an arithmetic shift, some
kind of cast is necessary.

dd
-- 
Dave Denholm              <ddenholm@esmertec.com>       http://www.esmertec.com

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

end of thread, other threads:[~2008-01-13 14:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-13 16:35 [Qemu-devel] qemu/target-sh4 op.c Thiemo Seufer
2008-01-13 14:53 ` [Qemu-devel] BUG: qemu-sh4 - shar does logical not arithmetic right shift Dave Denholm
  -- strict thread matches above, loose matches on Subject: below --
2007-04-26 23:50 [Qemu-devel] qemu/target-sh4 op.c Thiemo Seufer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).