From patchwork Sun Jan 28 17:50:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 767245 Delivered-To: patch@linaro.org Received: by 2002:adf:ee41:0:b0:33a:e5bd:fedd with SMTP id w1csp559584wro; Sun, 28 Jan 2024 09:55:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IEoRRMpgtSHpEd3GqpDQAef4iCySwTE9EPIXNLLoA/lCVm94DLZoPhH92fEhShIdTbodqmo X-Received: by 2002:a05:6214:202c:b0:681:8edc:69af with SMTP id 12-20020a056214202c00b006818edc69afmr4626439qvf.65.1706464547115; Sun, 28 Jan 2024 09:55:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1706464547; cv=none; d=google.com; s=arc-20160816; b=MoaqZjRvvYwJc+eJkSVmZmLb/PYLRrxZU9olr0ZUjEfryZNXl2QrVA7xaeMGbnK82w NXxSdUBU5lEU2QC/59WiM2XG4kzXjIihwpGizjSx1Bo9SUJ5H2TvVGz7vSvFHvOZrEKK qlK2TMLXoVlk9PSWXKHC06B8hPnYUpWaTDHTF4N0xhECy7RipPdLD/qOfSqIh0m+Oksy h/Krx67E3MQClbxiy7fcQUkN1AiEAplTd/j7VwvbCYjei07vawW8SRFuD89cwwG8oHMy GRrco+KAoG00loCAo8s2JG4DQJ5mSnPDOf8rycYQPZKAfg2lZuLY/IksMjih9ba0vJNy ieNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=an/ghQ/I1RR1mz9Ex+u+dpgwnUINFtp0mGV+acEtGOY=; fh=5+mYOV5+1R3+sD5uEH6Cv4Pbpb7gBGqATVRLHDdux9c=; b=OX+IxByYsE2wgbXmYLnu3cfJ9l7UstpZiCvTA3S5tEdc8cu50FO+Ne64MIAfbts5M5 hldbSHblJ3yY1dS3+f7z/EQKhhgM67/7XQwOAI6eMVQ6NujIcH2Rix9SLffjmGKV7/F8 g7IJXtJZ0Ie9swtze/GmJh+XxwGkTNQhZLfLz9KMFR6SLhLUUFsmluY41J4Df11zVLA/ TZhVsyUyR5LpQ8ysqI5dI0cQ8E6ugbF+wB1Oxfc3NxOQbTv5ono/onZRpn7jMZSN7w2e CYyr05OjyKouBtf1MH2RwEhO156gETovIQCXTHkTRjYcUUBKOuUm3xO5K49W2eLpv2JF Oh5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id jm6-20020ad45ec6000000b0068c4609942bsi1901347qvb.561.2024.01.28.09.55.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Jan 2024 09:55:47 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rU9Jv-0004t4-Np; Sun, 28 Jan 2024 12:51:51 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rU9Ix-0002lf-8c; Sun, 28 Jan 2024 12:50:55 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rU9Iv-0000mX-GL; Sun, 28 Jan 2024 12:50:51 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 2D62848106; Sun, 28 Jan 2024 20:51:29 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id B8A746D522; Sun, 28 Jan 2024 20:50:37 +0300 (MSK) Received: (nullmailer pid 812410 invoked by uid 1000); Sun, 28 Jan 2024 17:50:35 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Richard Henderson , Michael Tokarev , Thomas Huth Subject: [Stable-8.2.1 57/71] tcg/s390x: Fix encoding of VRIc, VRSa, VRSc insns Date: Sun, 28 Jan 2024 20:50:20 +0300 Message-Id: <20240128175035.812352-3-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Richard Henderson While the format names the second vector register 'v3', it is still in the second position (bits 12-15) and the argument to RXB must match. Example error: - e7 00 00 10 2a 33 verllf %v16,%v0,16 + e7 00 00 10 2c 33 verllf %v16,%v16,16 Cc: qemu-stable@nongnu.org Reported-by: Michael Tokarev Fixes: 22cb37b4172 ("tcg/s390x: Implement vector shift operations") Fixes: 79cada8693d ("tcg/s390x: Implement tcg_out_dup*_vec") Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2054 Reviewed-by: Thomas Huth Tested-by: Michael Tokarev Message-Id: <20240117213646.159697-2-richard.henderson@linaro.org> Signed-off-by: Richard Henderson (cherry picked from commit c1ddc18f37108498f45d57afd6bf33a23b703648) Signed-off-by: Michael Tokarev diff --git a/tcg/s390x/tcg-target.c.inc b/tcg/s390x/tcg-target.c.inc index fbee43d3b0..7f6b84aa2c 100644 --- a/tcg/s390x/tcg-target.c.inc +++ b/tcg/s390x/tcg-target.c.inc @@ -683,7 +683,7 @@ static void tcg_out_insn_VRIc(TCGContext *s, S390Opcode op, tcg_debug_assert(is_vector_reg(v3)); tcg_out16(s, (op & 0xff00) | ((v1 & 0xf) << 4) | (v3 & 0xf)); tcg_out16(s, i2); - tcg_out16(s, (op & 0x00ff) | RXB(v1, 0, v3, 0) | (m4 << 12)); + tcg_out16(s, (op & 0x00ff) | RXB(v1, v3, 0, 0) | (m4 << 12)); } static void tcg_out_insn_VRRa(TCGContext *s, S390Opcode op, @@ -738,7 +738,7 @@ static void tcg_out_insn_VRSa(TCGContext *s, S390Opcode op, TCGReg v1, tcg_debug_assert(is_vector_reg(v3)); tcg_out16(s, (op & 0xff00) | ((v1 & 0xf) << 4) | (v3 & 0xf)); tcg_out16(s, b2 << 12 | d2); - tcg_out16(s, (op & 0x00ff) | RXB(v1, 0, v3, 0) | (m4 << 12)); + tcg_out16(s, (op & 0x00ff) | RXB(v1, v3, 0, 0) | (m4 << 12)); } static void tcg_out_insn_VRSb(TCGContext *s, S390Opcode op, TCGReg v1, @@ -762,7 +762,7 @@ static void tcg_out_insn_VRSc(TCGContext *s, S390Opcode op, TCGReg r1, tcg_debug_assert(is_vector_reg(v3)); tcg_out16(s, (op & 0xff00) | (r1 << 4) | (v3 & 0xf)); tcg_out16(s, b2 << 12 | d2); - tcg_out16(s, (op & 0x00ff) | RXB(0, 0, v3, 0) | (m4 << 12)); + tcg_out16(s, (op & 0x00ff) | RXB(0, v3, 0, 0) | (m4 << 12)); } static void tcg_out_insn_VRX(TCGContext *s, S390Opcode op, TCGReg v1,