Received: from eggs.gnu.org ([2001:4830:134:3::10]:48911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvcHo-0003Tv-J1 for qemu-devel@nongnu.org; Sat, 15 Oct 2016 23:38:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvcHn-0005uX-SR for qemu-devel@nongnu.org; Sat, 15 Oct 2016 23:38:56 -0400 Received: from mail-qt0-x242.google.com ([2607:f8b0:400d:c0d::242]:34659) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bvcHn-0005uK-Na for qemu-devel@nongnu.org; Sat, 15 Oct 2016 23:38:55 -0400 Received: by mail-qt0-x242.google.com with SMTP id f6so5092128qtd.1 for ; Sat, 15 Oct 2016 20:38:55 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Sat, 15 Oct 2016 20:37:50 -0700 Message-Id: <1476589070-5792-16-git-send-email-rth@twiddle.net> In-Reply-To: <1476589070-5792-1-git-send-email-rth@twiddle.net> References: <1476589070-5792-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 15/15] target-s390: Use tcg_gen_extract_i64 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexander Graf Use the new primitive for RISBG. Cc: Alexander Graf Signed-off-by: Richard Henderson --- target-s390x/translate.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/target-s390x/translate.c b/target-s390x/translate.c index 02bc705..477238d 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -3134,20 +3134,26 @@ static ExitStatus op_risbg(DisasContext *s, DisasOps *o) } } - /* In some cases we can implement this with deposit, which can be more - efficient on some hosts. */ - if (~mask == imask && i3 <= i4) { + len = i4 - i3 + 1; + pos = 63 - i4; + rot = i5 & 63; + + /* 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); + return NO_EXIT; + } + + /* In some cases we can implement this with deposit. */ + if (~mask == imask && len > 0) { if (s->fields->op2 == 0x5d) { - i3 += 32, i4 += 32; + pos += 32; } /* Note that we rotate the bits to be inserted to the lsb, not to the position as described in the PoO. */ - len = i4 - i3 + 1; - pos = 63 - i4; - rot = (i5 - pos) & 63; + rot = (rot - pos) & 63; } else { - pos = len = -1; - rot = i5 & 63; + pos = -1; } /* Rotate the input as necessary. */ -- 2.7.4