From patchwork Tue Dec 10 15:23:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848753 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384479wrn; Tue, 10 Dec 2024 07:26:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVEB49Aa+fbgZxje8YZXQkhMX6YK7mDKuVJZjhqgGvjJf82iJi79WlpIuKXg8PTMJatmuRmFA==@linaro.org X-Google-Smtp-Source: AGHT+IHcgh0ulvD7yM5S9MaggSY32xwwQ1dJhAn3C36Zsku2o76Tq+86O9v92caTvDWGkjLc1tQJ X-Received: by 2002:ad4:5be5:0:b0:6d8:99cf:d2e3 with SMTP id 6a1803df08f44-6d91e33af74mr87464236d6.22.1733844392695; Tue, 10 Dec 2024 07:26:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844392; cv=none; d=google.com; s=arc-20240605; b=CPRMo8prwxBy4yoUuoC2ouogi9r13UYskXuEX6q9dPsuyEh6vjylou7sKUh7CX8OBw ZKsZvetD/QWoUt9H04FWE+S6c/W2dsMX4eZ994EckgVgPnSzzRBUY3dFNhY0YK+28gLj QTAYLMXGOb6KaMtVBnRd37BMr1wlnjZLUE/VUFfTUNJ5QVUD/thkOTfEHZ0uUnUYmxEe 6da9OdEwI9QTB6JkszPeBjTGpF6xmQaJZnbEF4fmp/B8b8/k0i/jrSIBwGFvaYZuQGeA I5hE68AT3AjcfA4vmM53rs6s774PmPMwMW5yLvbM2qtoVWSzdHoE1qCwMAMMc7kCqOlz RGzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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=2d60TSxsDICwowDfmunBt9iG+mRRxpu7LB3Cj2n+HL4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=QWufalw/Jj9w9cOAkAyeOF0KAPsQOR6rWYlLyFnfhm91EiyrKsOafWNBTUXYnA1d8U hHrRWFpW7kse6XaFVt7mhOt1qpN7mRwJXCPSkg/CkkPtPlTUD/E18DKNAahFD88AgbwF m7Tta9x1N0UxgKBtVu4CIWANM1VfWN46eId6nbOqRio4zcnX9CMAeg9hCuSxKK5Honeb WAFhZJkMPTaGCeSm82JWeV77zgIcoE4t1dngPDAnDP051YPzXbC3XYeVFp9Drm59O7DW HFEQqvI2MDLHEYCfAa1D6NkorsUwdc3ysSdQWk4tvFcy6x5eLjh1vDAqoFAHS4ol8Ymp scKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AtT//ihA"; 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; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d8dac0984fsi146985036d6.302.2024.12.10.07.26.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:26:32 -0800 (PST) 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="AtT//ihA"; 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; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tL265-0004GV-Ag; Tue, 10 Dec 2024 10:24:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tL263-0004Fd-PG for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:23 -0500 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL262-0008KA-Av for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:23 -0500 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3eb551be83cso640350b6e.2 for ; Tue, 10 Dec 2024 07:24:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844261; x=1734449061; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=2d60TSxsDICwowDfmunBt9iG+mRRxpu7LB3Cj2n+HL4=; b=AtT//ihAuDr+uzAJ6f6xC7tVtMcm0ip5xzMNLBzjlQm8mo1EpmV/GvyEG5SwLjUGci LwKCVIpYp+xrYlsNxINGyUuVBXiDf54yzX8GcZIvoPM63Fl7zdlPACRebeE9z38WeraC Msi8XdeWop0FIQtIrwo44BBvX/G4I0kEKh4qqmfH0G1QtoW7sW5BInAXwXCIU49LvJGw PG/C4/8vMOnoKYNoVpyJ5Sf87gwS5QQC+SHunORK7H6XU9TtmkAtlq+mvF7xKkg4WPF+ PaO+B8NCsKkQ+qRQwagxU+NOJ060gVwlZ1OZoUTdhIqtRIDjZn+KRsxpxRjvk7YCcN6C cwkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844261; x=1734449061; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2d60TSxsDICwowDfmunBt9iG+mRRxpu7LB3Cj2n+HL4=; b=sc9tq9/+Dr/RmwfoclRAra4zjVTjSjKvcPGKMWQc97c4al+QoXcVlGYsJ1A126zIk6 5Ac7bqr/6jSoNbDjpIJA4t/7odlM3VEwUy56UdwD56R5qaOfxUsodcdJDUJxrih7u+2n /5QVAmQpmpgzO2DWUw8BXlhSbV3GJzOWWd8Hi0ZCNa7Z+WHhfxVThMkCkogarUC/BDJH U5og7Koxd6/1yH7VugbsS/yb4YmwFRhJAuk0SMHQRSxBBgIghq2IgiOfw2FkhrnYxT6z ASU9XhSwJXlAUDTN3Djo+RP6sF58YJ/nCF00LLhJBYeogCSX5W1Z8o6904DOdeHJNb+a 6V/A== X-Gm-Message-State: AOJu0YyMYeVQqmrGh6pzylz3tmjWZffs3sxuGE8lvg0BLHSHEoceSerT uNWlULjF23GmRvAb4lvq6BMLtQactIcNHXCDtl3Zi6rOf4VQcwOiS/VgS5KEWIzeh6wREtr/05s PYaX6/RZt X-Gm-Gg: ASbGncsTvAoadJ62UsjBJPHT/GsfbNU+gfRRMhE/TzAtm+Q6Nb+inzxikKXZxZ9XaCj +ix/huM+B1H1M9K/FuXqTdnsMuxcWSmFEETyeN1G9MzHPOMleYjwTHMZkuw3+5yEwn4e/6tmxa8 syEQezp5pzFGCANJV2fS+gyJdr8Dz7dLwDfukvCrgizohJHny0LZzZI+RddgAf9ehBxINWr+cyS XJ2YWV8mERdf8taaMFmJGIDWqNV3+ZDb1UWw+xNb0uVUdtImzcj3T1CBI1LVA== X-Received: by 2002:a05:6808:1316:b0:3eb:575e:3eaf with SMTP id 5614622812f47-3eb66e13ea1mr4002235b6e.19.1733844261059; Tue, 10 Dec 2024 07:24:21 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 10/46] tcg/optimize: Use fold_masks_z in fold_ctpop Date: Tue, 10 Dec 2024 09:23:25 -0600 Message-ID: <20241210152401.1823648-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210152401.1823648-1-richard.henderson@linaro.org> References: <20241210152401.1823648-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::22b; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22b.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.29 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-bounces+patch=linaro.org@nongnu.org Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c97ec10989..424ed7674d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1598,22 +1598,23 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op) static bool fold_ctpop(OptContext *ctx, TCGOp *op) { + uint64_t z_mask; + if (fold_const1(ctx, op)) { return true; } switch (ctx->type) { case TCG_TYPE_I32: - ctx->z_mask = 32 | 31; + z_mask = 32 | 31; break; case TCG_TYPE_I64: - ctx->z_mask = 64 | 63; + z_mask = 64 | 63; break; default: g_assert_not_reached(); } - ctx->s_mask = smask_from_zmask(ctx->z_mask); - return false; + return fold_masks_z(ctx, op, z_mask); } static bool fold_deposit(OptContext *ctx, TCGOp *op)