qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Mike Frysinger <vapier.adi@gmail.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] tcg shift ops and magnitudes larger than register size
Date: Thu, 13 Jan 2011 09:56:35 +0100	[thread overview]
Message-ID: <20110113085635.GA7296@edde.se.axis.com> (raw)
In-Reply-To: <AANLkTimaSKzA7QzW1C9y2-LSZgoCaJPZ2tiXN6vdpHJp@mail.gmail.com>

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

  reply	other threads:[~2011-01-13  8:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-13  1:13 [Qemu-devel] tcg shift ops and magnitudes larger than register size Mike Frysinger
2011-01-13  8:56 ` Edgar E. Iglesias [this message]
2011-01-14 23:26   ` Stuart Brady
2011-01-15 21:00     ` Edgar E. Iglesias

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=20110113085635.GA7296@edde.se.axis.com \
    --to=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=vapier.adi@gmail.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;
as well as URLs for NNTP newsgroup(s).