From patchwork Thu Jul 5 19:19:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 141228 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp2298586ljj; Thu, 5 Jul 2018 12:22:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpegxgPdnM0sxvbuNG4uollG0kfzu7m0LkqB+tNgq2Tf5hQmzq5UfYmCZwAxw7jZo8ZmsnhY X-Received: by 2002:a37:c249:: with SMTP id j9-v6mr6224348qkm.157.1530818539905; Thu, 05 Jul 2018 12:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530818539; cv=none; d=google.com; s=arc-20160816; b=uZpDLJeXYuttzJ5+z6IGYEk5wBXnIiiXZbL+TgqKcbQeLym9LUA+nxxY6jFuYwiFm4 JPmnalVPR5PYPSV7M/FFwsynGHisRxzQ7Dt+29so1yIGhAjkOfCqN8CrrszYWKpJaqa1 Dhy228RwGlxEQ+5s3G829TwerFOtN6UoNfZZM73zSKMEmzT4B/tbI/Y5GM8OQt4FG55L 4Yvnsf9sxVa/IuJE2uLMP4LyCBBOS9wq7714eBW9i0K1DtT4bSik5PHxpXGRMmrjrgn3 zgX81g9ANUsL3IqG2dI1GoAkDgTvlKjUxZK8egjNnucnRMhVV3K84MVEXI4BknD133/v 4Pew== 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:subject:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=rVSVMUsOqs7aZBRUUwBK7RWnd/172r06afx+Rl+nql0=; b=IxWcd1R45dSqHs4sHVWXrHJZmvWOdqoBw3slhGXz26m3ZNw32JXHdssxl61JjXhwir oE8Hgh1GQ+cbNWIoeUl+bb9C/UqBJ8g/coSAVdS7dZ8L1m8yN6Pka7qTaXqQIxci/ebc 4fR5jSAHSgUEhC3Fcvlh8GJ78IYpTlJ3lAv3Mp2Hql2qyoBBcwNo97IAnH4e10RzPbP1 WxLrTJihPF98Ew5jtYQ1MxM3F71TbBJcczSOl3JaMLcoMD3zjdSh4OYv6mW0fYEYGfD6 kQTfc/58KVMv7m+nL7aYB0TrB1jTw5ZTeOpLIVdx5PZDnkJoV1UGdgJtDp0CNU1KSour Oixg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kdnaVpuq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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:4830:134:3::11]) by mx.google.com with ESMTPS id o8-v6si6415489qte.197.2018.07.05.12.22.19 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 05 Jul 2018 12:22:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kdnaVpuq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:54526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fb9pb-0002dq-E3 for patch@linaro.org; Thu, 05 Jul 2018 15:22:19 -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) 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-Received: by 2002:a17:902:622:: with SMTP id 31-v6mr7379462plg.135.1530818373390; Thu, 05 Jul 2018 12:19:33 -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) 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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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=8, maxsz=32], 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 --- tcg/tcg-op-gvec.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.17.1 Reviewed-by: Alex Bennée Tested-by: Alex Bennée 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 = oprsz / lnsz; - return lnct >= 1 && lnct <= MAX_UNROLL; + if (oprsz % lnsz == 0) { + uint32_t lnct = oprsz / lnsz; + return lnct >= 1 && lnct <= MAX_UNROLL; + } + return false; } static void expand_clr(uint32_t dofs, uint32_t maxsz);