From patchwork Thu May 7 17:23:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 186309 Delivered-To: patch@linaro.org Received: by 2002:a92:8d81:0:0:0:0:0 with SMTP id w1csp3377869ill; Thu, 7 May 2020 10:27:18 -0700 (PDT) X-Google-Smtp-Source: APiQypIh1e8s2VEoeOQYO5E8ELcMhOg9+gOSQejlBXd4dkHbMBlzUuZ4I5+XpCFkN6XGsfrAwnul X-Received: by 2002:ac8:312e:: with SMTP id g43mr15111945qtb.256.1588872438764; Thu, 07 May 2020 10:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588872438; cv=none; d=google.com; s=arc-20160816; b=ocITtxsC3S/G+EP9c23DwEwMFdKnGZ9I8KiUaq0F+IUff5Q+u0n9xHpda3cPPshZtz grkfaZrVYvlSOCjJG5ig6XGWAm6lZRASeLbKSk0SuhQhO8cDjKJiiCR054BKYWkg1zIe rMIiFN6QAMiZF0XMSRZ7SobF+sff05+rrvPjxNQqFtwakebLNadVQemBWD8z5l8526A8 OWMc39tUtOV5plijYwt0hsItCHmWa4NUMvie0ZnLFvYqeUK35bCp+JGIqYAwhUMIyCCS KYIY+D5KBddlbjE5cK3frqOFcxeAIB5QTbBTc2DkvSsGkkFNBEwnKiTDoJHnyuH10tkS swVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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=JDlFiCjVr5xHxciN5joXRaUK1WSJQwdyA4WuZ989PgM=; b=R/XWXsBqrTYiPldx8A+RzCCUvUQFUMkgPKjSEElp6sRyyLfd6auzvzvkIEKNkGT+PS mLJT7a/IEjI+/9484iUnppMz1b0HltsNCiyHF50Jc7jq0R3/DOB1mc9ld+yTbhmLrhs+ 1W8HYBP9JTVhtwsevZ5dvbI6SyZL/AwCbLa+hu6XmPPAl47iFstVv6S9LwyqdMTNff/f 0qPebykvp/hJZnKWWzOSQtbbE701C9hWNJ8H7uXrTMzZm4xPdrhD8sC/m6XOc9QwzNQu AK6N/e155haC7MRJ2023Id/q8DEUEod/Ads9jNLQXeGiEI4v0/+b0DP404HM0BZI+X/T p2pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jPamNmxO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:470:142::17]) by mx.google.com with ESMTPS id f7si3475038qte.51.2020.05.07.10.27.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 May 2020 10:27:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) client-ip=2001:470:142::17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=jPamNmxO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:470:142::17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:35870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWkIo-0007Ib-5v for patch@linaro.org; Thu, 07 May 2020 13:27:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56804) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWkFe-0002ZO-ES for qemu-devel@nongnu.org; Thu, 07 May 2020 13:24:02 -0400 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]:51337) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jWkFd-0005h5-I2 for qemu-devel@nongnu.org; Thu, 07 May 2020 13:24:02 -0400 Received: by mail-pj1-x1044.google.com with SMTP id mq3so2932815pjb.1 for ; Thu, 07 May 2020 10:24:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JDlFiCjVr5xHxciN5joXRaUK1WSJQwdyA4WuZ989PgM=; b=jPamNmxOcXpYg9gdWJg1gmYijQWrOlp48jjB8HSlbYTN9B1K6rQHL2FRECq1sINIeX /JWTsTF3FRthwOHIKW9Pqwj4g2Nly+U2peT5C3GzJHnAEQ7WWST1Ozf/Nar6SF5bR9aR /JsTjIUoAxrmlT62X+cdIHzWeiSNSa7F6fLxWWKhcWttP8fYR7Oh0y9UI1INvloMIPZw BreWkQVLBwVh7m0Dc9/fEZroupZ7dIbczqwJVEnpiYrGGCkRgYKKshWM89NDa4vTo6E7 HAYij2bPCvq84JAtuN4/He+YGbX+s5yI7opgzZxrjVAIf6TUoSIqS2kHA6ZLONTrXyG+ q1Vg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=JDlFiCjVr5xHxciN5joXRaUK1WSJQwdyA4WuZ989PgM=; b=TQv7Fcx3cHckUYcjZ//U//YX296j+GoGIcgvxN9MI4sx1bMPJzeCAd8PmOudMWHBY1 rf56w5LDZA7G1hcYEflMYeI0Un6BLdERXTA61yUMKw5NlEb54e1OK5yg0eM+Ro0tYcr9 mPtoP0LtlruLMLmhQq+Rl8TJ5j9oiEKUBkTgNs0blohuc4e3q/ekDUFlMzp/lBsEVCxC IXzZ9vpfUl9T8fMuinVEnJC0VRloC7E7e+1/f42TAh0/Cy+z8nhvnhk+WAbUb4NLuCqY L+DEoClacSpwj8GLmoOkvjunZWPrLs6A2SLrYki+2FmsuLD8LRay0/ShkleClyxC2zRD RyZw== X-Gm-Message-State: AGi0Puaeo/u0GRzeAtqFrudACYZ0IEPwM3KiocFEGKNiIbWETo82CIIr a2c2fsjSa2hn8POahoUNyGX8PoXyy6c= X-Received: by 2002:a17:90a:8815:: with SMTP id s21mr1244170pjn.154.1588872239509; Thu, 07 May 2020 10:23:59 -0700 (PDT) Received: from localhost.localdomain (174-21-149-226.tukw.qwest.net. [174.21.149.226]) by smtp.gmail.com with ESMTPSA id 19sm312228pjl.52.2020.05.07.10.23.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 10:23:58 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 4/4] target/arm: Fix tcg_gen_gvec_dup_imm vs DUP (indexed) Date: Thu, 7 May 2020 10:23:52 -0700 Message-Id: <20200507172352.15418-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200507172352.15418-1-richard.henderson@linaro.org> References: <20200507172352.15418-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1044; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1044.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN 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: , Cc: Laurent Desnogues , peter.maydell@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" DUP (indexed) can duplicate 128-bit elements, so using esz unconditionally can assert in tcg_gen_gvec_dup_imm. Fixes: 8711e71f9cbb Reported-by: Laurent Desnogues Signed-off-by: Richard Henderson --- target/arm/translate-sve.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.20.1 Reviewed-by: Laurent Desnogues Tested-by: Laurent Desnogues diff --git a/target/arm/translate-sve.c b/target/arm/translate-sve.c index c8649283be..83614e9e70 100644 --- a/target/arm/translate-sve.c +++ b/target/arm/translate-sve.c @@ -2044,7 +2044,11 @@ static bool trans_DUP_x(DisasContext *s, arg_DUP_x *a) unsigned nofs = vec_reg_offset(s, a->rn, index, esz); tcg_gen_gvec_dup_mem(esz, dofs, nofs, vsz, vsz); } else { - tcg_gen_gvec_dup_imm(esz, dofs, vsz, vsz, 0); + /* + * While dup_mem handles 128-bit elements, dup_imm does not. + * Thankfully element size doesn't matter for splatting zero. + */ + tcg_gen_gvec_dup_imm(MO_64, dofs, vsz, vsz, 0); } } return true;