From patchwork Mon Jul 10 20:45:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 9833787 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A7CE60350 for ; Mon, 10 Jul 2017 20:51:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ABB62843B for ; Mon, 10 Jul 2017 20:51:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F1241FEBA; Mon, 10 Jul 2017 20:51:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF2A928458 for ; Mon, 10 Jul 2017 20:51:48 +0000 (UTC) Received: from localhost ([::1]:43004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUfel-0006dZ-Sr for patchwork-qemu-devel@patchwork.kernel.org; Mon, 10 Jul 2017 16:51:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35240) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dUfa2-0002nP-B1 for qemu-devel@nongnu.org; Mon, 10 Jul 2017 16:46:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dUfZz-0005BE-7o for qemu-devel@nongnu.org; Mon, 10 Jul 2017 16:46:54 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:36719) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dUfZz-0005B8-3E for qemu-devel@nongnu.org; Mon, 10 Jul 2017 16:46:51 -0400 Received: by mail-qk0-f195.google.com with SMTP id v143so14389601qkb.3 for ; Mon, 10 Jul 2017 13:46:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=/ZuI6AVHpN5j3uPZTTsBMuTiSrHbQuJe1P1pFaW3Da8=; b=Db9Vrljs6TUYYZElb2w9IyZ5+98c4zNKuvCkNxvuMIB2xudFONkvjPcTXFm1GKYMKn YTJcfn+vfX0vybcQ8XipnicBHY9j73Ly13VYhu1PDO2JRVC3WwgSriFkwY6qjbJ0MAsr aIDVYYJnPhCaeIravTNwFCSW1x3L6jqGaTQx12oVMAgCUNLNU2F+gvu3k9Zj/yuUjdIs I6rS5KIEW39KNVh3F4YGDjeVGI7Wf4WtKnoMlo5O/ITBDBBqRtJn2mDE8dKEievBZqTl UDsT4V0aaYX6jEO8JSIvrzgX1LpZmqE+4rIUYe7zhxrHw9KteKkAV5xIGNTDPgLuO05F K/pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=/ZuI6AVHpN5j3uPZTTsBMuTiSrHbQuJe1P1pFaW3Da8=; b=Pzwx0zmmxPUfnFq0pPYYNjGmS2UIPmZwEJJL1lxFFA1laJKXq9S8MAM8xLkGADxgOb xcTC0cxn+1cIIXWn4w+yN2YkVNZbWAw+Jv9mv0dYdaPWSKqp6BvxqqKQ98TMk/oDNgVL u1iWsQcv00hWO+ZMwTr4l32qJh3eQ33+B8wbPTQ51ZrjMg2tB/Z88nmfF3lG69zoO01Q SO4HTJXrx8Eda0tVDJNzNbHNX0FAKz4EbYhYg+mjyJlo2Ka4GYzm++cTyxSQN8dwyzcT RV4hlqcnFqZxA5z643B9na3cwMJRm1X/hU2L19aQSAI42cFzFZ64ujDeoKy8KQ8avU6h 1eXA== X-Gm-Message-State: AIVw1109yjSVBdbKlr7oOyUwVkSOzx9h0fgF+VoQ6y5i/kdIjNdy1M6A WtzXdlyjPRoXPvGBx70= X-Received: by 10.55.142.67 with SMTP id q64mr6100610qkd.99.1499719550147; Mon, 10 Jul 2017 13:45:50 -0700 (PDT) Received: from bigtime.twiddle.net.com (rrcs-173-197-98-123.west.biz.rr.com. [173.197.98.123]) by smtp.gmail.com with ESMTPSA id v47sm9961143qtb.11.2017.07.10.13.45.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Jul 2017 13:45:49 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Mon, 10 Jul 2017 10:45:21 -1000 Message-Id: <20170710204521.2058-9-rth@twiddle.net> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170710204521.2058-1-rth@twiddle.net> References: <20170710204521.2058-1-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.220.195 Subject: [Qemu-devel] [PATCH v3 8/8] target/s390x: Fix risbg handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aurelien@aurel32.net, david@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 Reported-by: David Hildenbrand Suggested-by: Aurelien Jarno Signed-off-by: Richard Henderson --- 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 f94ba7c..0c609bd 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -3471,8 +3471,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; }