From: Richard Henderson <rth@twiddle.net>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] target-i386: guest variable shift by 0 provokes shift by -1
Date: Tue, 18 Mar 2014 08:19:03 -0700 [thread overview]
Message-ID: <532863E7.8060606@twiddle.net> (raw)
In-Reply-To: <CAFEAcA-aE6HqMx64Uw=NWXdj+OP94MS7ys2gF0xxJ+HGodY0yg@mail.gmail.com>
On 03/18/2014 08:01 AM, Peter Maydell wrote:
> Unless all our host architectures have undefined-result
> behaviour for variable shifts by out of range values
> then we can't make the TCG op semantics do that.
> (They probably can; the only counterexample I know
> of is the 8086, where the variable-shift cycle count
> was proportional to the value of the shift, so feeding
> it -1 would effectively cause it to hang.)
ARM is our only host architecture that does not mask the input to the width of
the operand. That one, of course, masks with 255 and produces zero for shifts
larger than the width of the operand.
There are several host architectures for which we do not have backends that
e.g. always mask with 63, even for the 32-bit shifts.
r~
next prev parent reply other threads:[~2014-03-18 15:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-18 12:33 [Qemu-devel] target-i386: guest variable shift by 0 provokes shift by -1 Peter Maydell
2014-03-18 14:20 ` Richard Henderson
2014-03-18 14:25 ` Peter Maydell
2014-03-18 14:39 ` Richard Henderson
2014-03-18 14:47 ` Peter Maydell
2014-03-18 14:52 ` Peter Maydell
2014-03-18 14:56 ` Richard Henderson
2014-03-18 15:01 ` Peter Maydell
2014-03-18 15:19 ` Richard Henderson [this message]
2014-03-18 16:34 ` Paolo Bonzini
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=532863E7.8060606@twiddle.net \
--to=rth@twiddle.net \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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).