From patchwork Thu Jul 29 11:14:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 488661 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp2064230jas; Thu, 29 Jul 2021 04:17:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwT6ARMS+z7iuo3g1A/Q8+UvfM1KYZkXxjfilSh7/IiThRVTT8dn6izBUiOyJ+VZt+MOTUQ X-Received: by 2002:a02:7093:: with SMTP id f141mr4023486jac.24.1627557446563; Thu, 29 Jul 2021 04:17:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627557446; cv=none; d=google.com; s=arc-20160816; b=xODRU5zLjHsSdvhJ4PgwY6GTQH1ODJ5f4JBp27QgL8sqW55QN57EpgY9qkGTmHhc7d Gr6B9i0Vsn/n21XITi/I4JTf1mKVJGP9KNF3d/wth3MRaGBWrgz5nMSz35lwWOrQsvzF O/DXSqWIZlZ+eF0tZbXPD1a/FpZmFBh4mn4tV6AR6d8IluqhTq/yd6JkGMB/IejY8Agt WtzhhzmB3kkBErAaPUSSRtpF26IMKrs6wrvPvw9TVhyzSvabn/EGs5hcY059rq64f/D7 wMAVjmXT3K/VC1q87FX9LmKvqcUE3YJKPH7oh6lC3kbQmeBEKivtGeI5Q33N6+tVvlwM lqvg== 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:to:from :dkim-signature; bh=GGF4FybEKy96gYcYMu+JcP8KcGdVIAGNRtBK4g3nQ2Y=; b=yu+gGKIKrGmuxR2bOhSO+L305sOVXytdSGLNo56IktsqUsCwntpdNCzjcYaLqrBavb KGIZNI84YN5LjKwVZDQpYvbWSFSWXEqMXhyDt7CElqEA+JPfrPVNDoehNod5bZYlujQ0 BngX5SgzXYB1mk9Fl0qzPxewYF3fK4iPm7dfxMmyYTxNH0tD4mfgXkPPT1AdLYLhsmlJ 1tVmgp8+BZaJJWVL9nXKQfek0cZ8tIc9zGCsQN0Lr4B3+8nzPYQzCZo7Pf0+ACiKcb98 t9XIOMjYDKoo4XFdHrgOURGVrzRQRjDkmSzB7rQhQIsb5jswtVHjOdrU+IHmn8610V8n vyTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CDDI2YZ3; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n24si3167162ioz.5.2021.07.29.04.17.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 29 Jul 2021 04:17:26 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=CDDI2YZ3; 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"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46548 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m942Y-00004y-0W for patch@linaro.org; Thu, 29 Jul 2021 07:17:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39632) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m940a-0008SQ-EY for qemu-devel@nongnu.org; Thu, 29 Jul 2021 07:15:24 -0400 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]:44552) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m940U-0000vR-Im for qemu-devel@nongnu.org; Thu, 29 Jul 2021 07:15:22 -0400 Received: by mail-wm1-x329.google.com with SMTP id d131-20020a1c1d890000b02902516717f562so3766473wmd.3 for ; Thu, 29 Jul 2021 04:15:18 -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=GGF4FybEKy96gYcYMu+JcP8KcGdVIAGNRtBK4g3nQ2Y=; b=CDDI2YZ3ES72TH9b5xS0B5e8W9Cg1RLQ98gNketTfJN72pYLOY/giiTD+xjj2kQnG6 d3r/u1uQJRmY0HbVH0iIGLTt2mfXsa1aIeUUSTQ2Ub17R2Cgr/i71CQYIRK5I0SK2kXN YMhzkUujolcy8/uaLcpl3YxA2vkghvHqX9JVfYXQ7MRp/Un5Rq0R6IuBR/V0Z8Yr5gpN mYGEZL7W7Er9zHDMjXpNMyf8ADZapEfiCpwuIrXTR5did2uP4s8pL2vhauU64OqHVgXS zZldVBvs0mOiRcAXzNhirIIWK+jh4QEa65jS49e3PUg/zNvGjJSKlhcvDucbSD6lXMIr q23A== 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=GGF4FybEKy96gYcYMu+JcP8KcGdVIAGNRtBK4g3nQ2Y=; b=uXYFA1pOQ7LfGSb5npTKK+aPeEJeoTMX6Ku0FPBTJ5EeHUnKsjJmPPMJtX7OyCD+Yl MDakN793V55HHg9NQgTTgVGJu2qWSiVJl+cCvpTfOnSmMP6txtTe0yo0VF+xlGFsEwyv 1Rg1RIE6iTZ6UGnge6kaIqNC0v/ig6xxpqP2N6BYz1ZGA3atD5JQAnR/YUDMooszebBW 8pWbikEhx/CBf04W49XkaplIGyB3KVSVPSOZr2CV4FsayfKMmVCrNA3DLt7RlJTpZenG r29vbelqge39JJ4hScReHaDf6KiuB+qTQ/tJLhvkphIZoL5mElVhf2Wyx+vXycSbvOCR jPtA== X-Gm-Message-State: AOAM533eoB8GmrOmoXz7IN/rdN7LFdf+RriTGQxfzb4ECqSMPWMii/S0 bndUSatfPKAczpV8fptw7+a0MA== X-Received: by 2002:a05:600c:4c96:: with SMTP id g22mr13543761wmp.70.1627557317253; Thu, 29 Jul 2021 04:15:17 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id j140sm3037829wmj.37.2021.07.29.04.15.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 04:15:16 -0700 (PDT) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH for-6.2 03/53] target/arm: Fix MVE VSLI by 0 and VSRI by
Date: Thu, 29 Jul 2021 12:14:22 +0100 Message-Id: <20210729111512.16541-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210729111512.16541-1-peter.maydell@linaro.org> References: <20210729111512.16541-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" In the MVE shift-and-insert insns, we special case VSLI by 0 and VSRI by
. VSRI by
means "don't update the destination", which is what we've implemented. However VSLI by 0 is "set destination to the input", so we don't want to use the same special-casing that we do for VSRI by
. Since the generic logic gives the right answer for a shift by 0, just use that. Signed-off-by: Peter Maydell --- target/arm/mve_helper.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) -- 2.20.1 Reviewed-by: Richard Henderson diff --git a/target/arm/mve_helper.c b/target/arm/mve_helper.c index db5d6220854..f14fa914b68 100644 --- a/target/arm/mve_helper.c +++ b/target/arm/mve_helper.c @@ -1279,11 +1279,12 @@ DO_2SHIFT_S(vrshli_s, DO_VRSHLS) uint16_t mask; \ uint64_t shiftmask; \ unsigned e; \ - if (shift == 0 || shift == ESIZE * 8) { \ + if (shift == 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
. \ + * Only VSRI can shift by
; it should mean "don't \ + * update the destination". The generic logic can't handle \ + * this because it would try to shift by an out-of-range \ + * amount, so special case it here. \ */ \ goto done; \ } \