From nobody Tue Feb 10 01:33:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1626183788; cv=none; d=zohomail.com; s=zohoarc; b=mQMPWiUsq6zT5UZOPI0hoO9z02NxoOBSG8dHrpGOriWAbfZBxDFWfptCvgyXo7sBcvnRuICtwkM4ruol7sYrY57rs0t4Ypumlab/tgnLV/Dmd6qzDRgoLhOMJiPr3mPJv2OpND7xyj+7AQ7BoI97vzXYua4Nfibih+99/3Nvc0Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1626183788; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Bon4R+GO/Kh6lXfctlExnNFuhwRkWgeWXsUtfA3/MIY=; b=EG1phKHm+cMNDntB8eEHoWOjN8eWABwHNLKbY4zZB+uOqWDIf3L4qjGahvkODU+ktr9z39/cY1Bh4hxPZXa2Eblo+umasZzvhhESqOcX5DXQ7As5F1dXpXHmgY+lfizo2PDq1tnQAprASWcSrIabltlysm0iOT6MqmsYpHRE4Gc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1626183788372537.0828894884801; Tue, 13 Jul 2021 06:43:08 -0700 (PDT) Received: from localhost ([::1]:37694 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3Igl-00012g-A6 for importer@patchew.org; Tue, 13 Jul 2021 09:43:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53916) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3IbR-0008HU-7t for qemu-devel@nongnu.org; Tue, 13 Jul 2021 09:37:37 -0400 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:45604) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3IbM-0003bK-LH for qemu-devel@nongnu.org; Tue, 13 Jul 2021 09:37:36 -0400 Received: by mail-wr1-x436.google.com with SMTP id t5so16680061wrw.12 for ; Tue, 13 Jul 2021 06:37:32 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j6sm9827443wrm.97.2021.07.13.06.37.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Jul 2021 06:37:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Bon4R+GO/Kh6lXfctlExnNFuhwRkWgeWXsUtfA3/MIY=; b=IMFRlO/2qfyAWzfeywhLG8VbndFXEw4ttLF85sFynSGtY5DjuwCw2a1iX44y7udzyH mUNO/YHeLf9Sk61jdG9dvaOZXivbzq7bFFuL0pATMJZw0poeiF7Trcc1486K51dSshms khqqabq0ykM8VioFckReDqhRhavCAG6USC8n5/fhHIW5/xY1oavQnj84sfcrSnkW7lLm T6CQc55/niaISZ8ybmGfxKblBCj60hV3EugtOt1YcyqfAAxYNFZFLsln0brBTJ+G+72P qz7JQtidTIr036mZVDrY7g3ZrXN/UEFIax9jdzVHIsSE/0TCUE5moEAnmxMZzorIq+1o bTGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Bon4R+GO/Kh6lXfctlExnNFuhwRkWgeWXsUtfA3/MIY=; b=Pue67OGjM1Vj7W/6ZbXjpret3s/Ah98ShzRV1s2txHHKHlpt2kVlgucEvkwDZ3CR/x inn8zwlij7auW1XpTHmiQlDGlvV2YMENmtRaDpIzT09V2Nvx+9xnRrJK0s6hcvlKyyXE /S05ZOvBZJplXICJLQcnunATLifZxSKfnR6jEsjVutXpyjdzMpkdkzfGCd0SmsUWPJ78 nTMqRRVthE+s1DvwKPN3x8mgJMkwm1Ho84dET/NHzrkPF6Crbn1VXc2PjniK+VJlCq8G jxwDioWT+QOzHPZCgqTVAQuvkRrdIRUsa+Y4/yxK7oDtBUEqfOn+huYkSKGoTik49jeT 2Z3A== X-Gm-Message-State: AOAM531X5qGq6lzLRDTYWzwdLgefH/W/rsXnz6vDJ6UElW5Gzz/+ZzOd n/tMpM+jz9v/e1UXhDjh7Lga9A== X-Google-Smtp-Source: ABdhPJyWXGoBZgEw4iYFEjiNITrcYPYyIGWI6P4Fyfs7LjZD0ryso50Ryq54UuyyG0qYXleCAWgktQ== X-Received: by 2002:adf:f90d:: with SMTP id b13mr5917402wrr.336.1626183451487; Tue, 13 Jul 2021 06:37:31 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-6.2 03/34] target/arm: Fix MVE VSLI by 0 and VSRI by
Date: Tue, 13 Jul 2021 14:36:55 +0100 Message-Id: <20210713133726.26842-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210713133726.26842-1-peter.maydell@linaro.org> References: <20210713133726.26842-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1626183789984100001 Content-Type: text/plain; charset="utf-8" In the MVE shift-and-insert insns, we special case VSLI by 0 and VSRI by
, both of which mean "no shift". However we incorrectly implemented these as "don't update the destination", which works only if Qd =3D=3D Qm. When Qd !=3D Qm this kind of shift must update Qd, honouring the predicate mask. Signed-off-by: Peter Maydell --- target/arm/mve_helper.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/target/arm/mve_helper.c b/target/arm/mve_helper.c index db5d6220854..16a701933b8 100644 --- a/target/arm/mve_helper.c +++ b/target/arm/mve_helper.c @@ -1276,19 +1276,23 @@ DO_2SHIFT_S(vrshli_s, DO_VRSHLS) void *vm, uint32_t shift) \ { \ uint64_t *d =3D vd, *m =3D vm; = \ - uint16_t mask; \ + uint16_t mask =3D mve_element_mask(env); \ uint64_t shiftmask; \ unsigned e; \ if (shift =3D=3D 0 || shift =3D=3D ESIZE * 8) { = \ /* \ * Only VSLI can shift by 0; only VSRI can shift by
. \ * The generic logic would give the right answer for 0 but \ - * fails for
. \ + * fails for
. In both cases, we must not shift the \ + * input but just copy it to the destination, honouring \ + * the predicate mask. \ */ \ + for (e =3D 0; e < 16 / 8; e++, mask >>=3D 8) { = \ + mergemask(&d[H8(e)], m[H8(e)], mask); \ + } \ goto done; \ } \ assert(shift < ESIZE * 8); \ - mask =3D mve_element_mask(env); \ /* ESIZE / 2 gives the MO_* value if ESIZE is in [1,2,4] */ \ shiftmask =3D dup_const(ESIZE / 2, MASKFN(ESIZE * 8, shift)); \ for (e =3D 0; e < 16 / 8; e++, mask >>=3D 8) { = \ --=20 2.20.1