[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] tcg shift ops and magnitudes larger than register size
From: |
Edgar E. Iglesias |
Subject: |
Re: [Qemu-devel] tcg shift ops and magnitudes larger than register size |
Date: |
Thu, 13 Jan 2011 09:56:35 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
On Wed, Jan 12, 2011 at 08:13:45PM -0500, Mike Frysinger wrote:
> are there any rules with the tcg sar/shl/shr ops and their magnitudes
> ? such as "magnitudes cannot be larger than the register size" ?
Yes, the result is undefined in those cases.
> i have a 32bit register with the value of 0x1230002 and when i attempt
> to do a sari with a value >=32, it gives me 0x918001 (a single shift
> right has been done). i would have expected the value to be 0 (as
> that is what my architecture does).
You need to handle it in the translator. CRIS has similar semantics
as your arch. See target-cris/translate.c:t_gen_lsl() for one way
of doing it. There might be better ways though.
Cheers