All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <rth@twiddle.net>
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 17:34:35 +0100	[thread overview]
Message-ID: <5328759B.5010406@redhat.com> (raw)
In-Reply-To: <CAFEAcA-aE6HqMx64Uw=NWXdj+OP94MS7ys2gF0xxJ+HGodY0yg@mail.gmail.com>

Il 18/03/2014 16:01, Peter Maydell ha scritto:
> By whether the backend or the frontend has trivial
> access to the value to be able to avoid doing bad
> things if it's out of range. If either do, they can
> do a translate-time check to avoid issues. If neither
> does then we need the host CPU architecture to be
> OK with the out of range value, or we need to insert
> an explicit mask op in the backend (which is likely
> to be a duplicate of an explicit mask op already
> inserted at the frontend to get the frontend-target
> mandated behaviour for out of range ops).

Isn't that exactly what SPARC does?  But the optimizer should be able to 
remove a redundant AND (not sure it is able to optimize & 255 & 31 to a 
single instruction, but it certainly can remove the second AND in "& 31 
& 255").

Paolo

      parent reply	other threads:[~2014-03-18 16:34 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
2014-03-18 16:34             ` Paolo Bonzini [this message]

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=5328759B.5010406@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.