All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PULL v2 8/8] target/s390x: Fix risbg handling
Date: Mon, 17 Jul 2017 11:24:46 -1000	[thread overview]
Message-ID: <20170717212446.15268-9-rth@twiddle.net> (raw)
In-Reply-To: <20170717212446.15268-1-rth@twiddle.net>

The rotation is to the left, but extract shifts to the right.
The computation of the extract parameters needs adjusting.

For the entry condition, simplify

	64 - rot + len <= 64
	-rot + len <= 0
	len <= rot

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Reported-by: David Hildenbrand <david@redhat.com>
Suggested-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 target/s390x/translate.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/s390x/translate.c b/target/s390x/translate.c
index b46f4c8..1dffcee 100644
--- a/target/s390x/translate.c
+++ b/target/s390x/translate.c
@@ -3479,8 +3479,8 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o)
     }
 
     /* In some cases we can implement this with extract.  */
-    if (imask == 0 && pos == 0 && len > 0 && rot + len <= 64) {
-        tcg_gen_extract_i64(o->out, o->in2, rot, len);
+    if (imask == 0 && pos == 0 && len > 0 && len <= rot) {
+        tcg_gen_extract_i64(o->out, o->in2, 64 - rot, len);
         return NO_EXIT;
     }
 
-- 
2.9.4

  parent reply	other threads:[~2017-07-17 21:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 21:24 [Qemu-devel] [PULL v2 0/8] target/s390x tcg improvements Richard Henderson
2017-07-17 21:24 ` [Qemu-devel] [PULL v2 1/8] target/s390x: Implement CSST Richard Henderson
2017-07-26 11:27   ` Paolo Bonzini
2017-07-17 21:24 ` [Qemu-devel] [PULL v2 2/8] target/s390x: Implement CONVERT UNICODE insns Richard Henderson
2017-07-17 21:24 ` [Qemu-devel] [PULL v2 3/8] target/s390x: Tidy SRST Richard Henderson
2017-07-17 21:24 ` [Qemu-devel] [PULL v2 4/8] target/s390x: Implement SRSTU Richard Henderson
2017-07-17 21:24 ` [Qemu-devel] [PULL v2 5/8] target/s390x: Implement TRTR Richard Henderson
2017-07-17 21:24 ` [Qemu-devel] [PULL v2 6/8] target/s390x: Mark ETF3 and ETF3_ENH facilities as available Richard Henderson
2017-07-17 21:24 ` [Qemu-devel] [PULL v2 7/8] target/s390x: Allow to enable "idtes" feature for TCG Richard Henderson
2017-07-17 21:24 ` Richard Henderson [this message]
2017-07-18 17:29 ` [Qemu-devel] [PULL v2 0/8] target/s390x tcg improvements Peter Maydell

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=20170717212446.15268-9-rth@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 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.