From nobody Thu Dec 18 19:36:24 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; 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 1531144869138607.4618323285894; Mon, 9 Jul 2018 07:01:09 -0700 (PDT) Received: from localhost ([::1]:42234 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcWit-0004MO-Q2 for importer@patchew.org; Mon, 09 Jul 2018 10:01:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fcWcl-0007gG-Nc for qemu-devel@nongnu.org; Mon, 09 Jul 2018 09:54:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fcWcl-00052u-1A for qemu-devel@nongnu.org; Mon, 09 Jul 2018 09:54:43 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:43342) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fcWck-00052E-Qk for qemu-devel@nongnu.org; Mon, 09 Jul 2018 09:54:42 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.89) (envelope-from ) id 1fcWcj-0000jd-R4 for qemu-devel@nongnu.org; Mon, 09 Jul 2018 14:54:41 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 9 Jul 2018 14:54:31 +0100 Message-Id: <20180709135435.836-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180709135435.836-1-peter.maydell@linaro.org> References: <20180709135435.836-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PULL 07/11] 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 From: Richard Henderson 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 Message-id: 20180705191929.30773-2-richard.henderson@linaro.org Signed-off-by: Peter Maydell --- 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 22db1590d5d..61c25f57841 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