From nobody Tue Nov 4 21:33:04 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1530818519136777.1778387909001; Thu, 5 Jul 2018 12:21:59 -0700 (PDT) Received: from localhost ([::1]:54526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb9pF-0002dq-GV for importer@patchew.org; Thu, 05 Jul 2018 15:21:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41195) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb9my-0001D5-Hx for qemu-devel@nongnu.org; Thu, 05 Jul 2018 15:19:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fb9mw-0004AC-NU for qemu-devel@nongnu.org; Thu, 05 Jul 2018 15:19:36 -0400 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]:34184) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fb9mw-00049e-IH for qemu-devel@nongnu.org; Thu, 05 Jul 2018 15:19:34 -0400 Received: by mail-pl0-x244.google.com with SMTP id z9-v6so1690254plo.1 for ; Thu, 05 Jul 2018 12:19:34 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-112-211.tukw.qwest.net. [97.126.112.211]) by smtp.gmail.com with ESMTPSA id g23-v6sm9460451pgv.26.2018.07.05.12.19.32 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Jul 2018 12:19:32 -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; bh=rVSVMUsOqs7aZBRUUwBK7RWnd/172r06afx+Rl+nql0=; b=kdnaVpuqojcbzUakmRv+4ZXk/wcqeqKbo7hVBloDzb9Kv2XaR4uXRa77UQuka6HTmY 6TPW13xEV7M0uaCuCdH386HVLT2ZKjdcvv/tfEJ6E21wNPb2VqnVMOrThL8QjL3Alkyp yz2JocqWR1pY3FAN6hryTCuH0Pge20rdOfOtE= 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; bh=rVSVMUsOqs7aZBRUUwBK7RWnd/172r06afx+Rl+nql0=; b=S0JCgkR6k2EWBk+9nqikIMi2afgAqUCP+a7FQoM04OCoB5SWBeNaJgxAa9VDosI7e9 823wFOJQ1sLvm/5y39XdWn/e0fdkp43IkBjZLN7HLMeDPXOpr1XKPe010/1XGCftL11H JR3VCH86ZKi0WmWMfX+HKwWknQEU01i6QKuMzWHa5ooiXUrlbRUZNvgLTMEm1N9X1cge 0vCGIWtpkEF3YomQ43839pK/mhvCI+jVGs9VdIHtmbpxeL8PUpPI9jgIgG6Uv4T0jSXH yZ0ihKg9Tvyr5+9BEQ/WBLNHcoZ2lKw3h6g8rfzZsf21b1v8+EE3mkp4awd2hh9Z/Lu3 3dKQ== X-Gm-Message-State: APt69E0sACSz4EzQr1P6e6uy1zbTTHXjHt7/Nugkg3CbluG7aPqHeLCr vOuE/W9Q7HDcDFD/DWwKObWMTiWp+ug= X-Google-Smtp-Source: AAOMgpcUZkCYapN7TfbaccWM74qlU8zt8G9iI0P4Vu3TaQ/oCx2CWWlXE/HegVJ+AtrJRZjBuV/FbA== X-Received: by 2002:a17:902:622:: with SMTP id 31-v6mr7379462plg.135.1530818373390; Thu, 05 Jul 2018 12:19:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 5 Jul 2018 12:19:28 -0700 Message-Id: <20180705191929.30773-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180705191929.30773-1-richard.henderson@linaro.org> References: <20180705191929.30773-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::244 Subject: [Qemu-devel] [PATCH 1/2] tcg: Restrict check_size_impl to multiples of the line size 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: peter.maydell@linaro.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Normally this is automatic in the size restrictions that are placed on vector sizes coming from the implementation. However, for the legitimate size tuple [oprsz=3D8, maxsz=3D32], we need to clear the final 24 bytes of the vector register. Without this check, do_dup selects TCG_TYPE_V128 and clears only 16 bytes. Signed-off-by: Richard Henderson Reviewed-by: Alex Benn=C3=A9e Tested-by: Alex Benn=C3=A9e --- tcg/tcg-op-gvec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tcg/tcg-op-gvec.c b/tcg/tcg-op-gvec.c index 22db1590d5..61c25f5784 100644 --- a/tcg/tcg-op-gvec.c +++ b/tcg/tcg-op-gvec.c @@ -287,8 +287,11 @@ void tcg_gen_gvec_4_ptr(uint32_t dofs, uint32_t aofs, = uint32_t bofs, in units of LNSZ. This limits the expansion of inline code. */ static inline bool check_size_impl(uint32_t oprsz, uint32_t lnsz) { - uint32_t lnct =3D oprsz / lnsz; - return lnct >=3D 1 && lnct <=3D MAX_UNROLL; + if (oprsz % lnsz =3D=3D 0) { + uint32_t lnct =3D oprsz / lnsz; + return lnct >=3D 1 && lnct <=3D MAX_UNROLL; + } + return false; } =20 static void expand_clr(uint32_t dofs, uint32_t maxsz); --=20 2.17.1