From patchwork Tue Dec 10 15:23:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848778 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387336wrn; Tue, 10 Dec 2024 07:31:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUBrJjo+0vGq1xB7vfhGQf5+5QKfcnehwmQZ/L6kxG5jqRYtGJBunCPUFbMq7wba29rlGab/Q==@linaro.org X-Google-Smtp-Source: AGHT+IE3sYCs0WmessFv7DDsbvVM64RWXfIV7YbNAA1VvJYFcX6Mcthh924jrVeJXzJSTKooFyld X-Received: by 2002:a05:622a:11c7:b0:467:867b:ff57 with SMTP id d75a77b69052e-467867c04f1mr10652961cf.44.1733844691259; Tue, 10 Dec 2024 07:31:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844691; cv=none; d=google.com; s=arc-20240605; b=G0oNXJWWy/FWEe99+wxg8Fyy4yfNIS1HTE+eMwrVLJt2Gi72O+cljCnsrjTTKAP0m0 ZX/U+lKasfeTajYnMCunVWhKlc09mxxX5vnkvw6FoB8jXQcMVYzVlHHY46Pi5RKmnAPk j4G/QlbkEYxpCHhX3n7UEWtUr2/+O+IOea5nWCVv+2KDdEB/UhC8ZbxlM0OKuaP1v9+k akTCCqOLSA5TLn8uMW9FRctH90VXF9O26OT+/UIGSHqnCx6iJsi51AADmId12hfhuj4n rARaJjjEqufnCcy4f7jub/nxKzDZRIUashjl36eldrqWYk8PP9vfGnQDYrOfqBovvaUQ 5fyw== 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=Gk2JP6ZZJS4eu6oOzldT8vCgXwvZiyxtE0PFUuuyddU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Ukt7Gdycy89zXVIDpowz7ogn4DHVBfd3JuiWnLMnhABoKAIqQKQ8ilwxfPPtw6LZa2 VFU6AVdC1J/mAjxTm2QmtfppBiBbEoztspYgf6BSQNqwhSAyo+yzOf1weqCyEbne8Oov r15EMgHesj9cwLYuPyttvLher+Rv2y3O40DnDgtGKcyYMo3HVjrOl93T+GL9cOcfAuck sSo5wqpGsW5yug8BWItNLI8tSvlvOtNkbMImclBVkcTgUYZCQJCpJUs0xKkjn5ENjjDQ PGMFyUqU1LReEkRJFjNelKCrV+wgxKcz7Zk6TQX3y3iDwTowBdzbPGtpewPvtEnWjxsA GNYg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ys8tE3br; 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 d75a77b69052e-467296e7880si164042331cf.161.2024.12.10.07.31.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:31:31 -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=ys8tE3br; 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 1tL26M-0004Ir-F5; Tue, 10 Dec 2024 10:24:46 -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 1tL269-0004Gu-Ai for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:29 -0500 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL267-0008Kq-DB for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:28 -0500 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3eb5ac06111so1062918b6e.2 for ; Tue, 10 Dec 2024 07:24:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844266; x=1734449066; 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=Gk2JP6ZZJS4eu6oOzldT8vCgXwvZiyxtE0PFUuuyddU=; b=ys8tE3brnlgtGbo50w8zmaMk1jObmh7b+1aoeXGqOYObg2+eDBUDAn180vJH9/kRAu p2tnUToUPxA9MkSddYY4fTwYqjAnXKloKxwKpRs23rEqyg/2DMT0gbmsNCfmfMNXDxzA Dj4ZO0zipAc/j0EoTSsV7wR0WKEwS9TquI7wtaLjSWEmPRw/BLPLwWVOv2i6tkFsI5EX 31pLAbCEl/lHjbTAW3ftPr6JVFHkgI43U3E++W8sP8l1HxlZWjb3XXsZcDhBTSDZ/F1z huoyCDyIm09x8b42QAZCou7yr0QZRc+bLuIXExRLFeX35Empfr+lds3bz7aONJ+UG6Gn 80wg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844266; x=1734449066; 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=Gk2JP6ZZJS4eu6oOzldT8vCgXwvZiyxtE0PFUuuyddU=; b=gFl6FBNZdPhBRzf/IssqpxM5IKNQktLIWtCCVy+lDkZiX8z/wFgOUvWV6DEu/4BzNz 88gb6RtBvkXJgW/DQjG2sNaQbT9+PyqDn8I0Nad40QXpeEskCbNrxITOUfogYIa/cKj9 wwnTdd+dHRKcu1laqwFHtbOoC5OIhVVoHR7wTgnEMhG/oURxO3ltgPZU3iYNs5Ey8Wel rPtFT1zzbGIeoAyLdwcnceMSLI/NRW+YAzvj9n1vXYLi0+BSQsgeJBk4gysUG7EpvnmB G2RcDoi5eB6gCXEGTpqX+FfXIe4uPWCKJbkoJBsWwKv7Rfw5ZBfv1HKRIj6/UsiFZMJn flfg== X-Gm-Message-State: AOJu0YydVLYaoLINGWwHkl5B/nCdsqW43tHI+bfSq2T0a/M1ydAqi4l1 TnOkT/Pit2Mi0+iYp4xQqxhrYcSfLLuiA2NogSLrEdyqjR/yuZmvkuTqScf8YnB1e/LOwMmGdfn v6M8y4gYm X-Gm-Gg: ASbGnctkuwPbrOQvCcJavRGvAdpBV6CY4XYJeBR9QcaUiAl+SXbyfJLBQ/NVEFVhEvI JExUsqq8hLkDSRbVflznqlaJwFEuyV7L5gAMkCYnkpa2aMwiHSQH6OsLB4qw5GQ7QrY2AnM7J+T 07F3J7wY78AkcZGbtFNM/r54b4P8XvKZJrxmSrlm16U9Cv0dTSeJW75Dv0gaffP/0EiJv6X3nKe i1l4cEY0ZLdczdg/TKCNRDj5loBaeIyELo6cPnqvK4AAijexXB95hsW9ywX1A== X-Received: by 2002:a05:6808:1493:b0:3ea:443e:d1cd with SMTP id 5614622812f47-3eb66f09b78mr3408831b6e.34.1733844266444; Tue, 10 Dec 2024 07:24:26 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 14/46] tcg/optimize: Use fold_masks_zs in fold_eqv Date: Tue, 10 Dec 2024 09:23:29 -0600 Message-ID: <20241210152401.1823648-15-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::22c; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22c.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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index e6dc9f2e28..5f3a824a07 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1701,15 +1701,17 @@ static bool fold_dup2(OptContext *ctx, TCGOp *op) static bool fold_eqv(OptContext *ctx, TCGOp *op) { + uint64_t s_mask; + if (fold_const2_commutative(ctx, op) || fold_xi_to_x(ctx, op, -1) || fold_xi_to_not(ctx, op, 0)) { return true; } - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_zs(ctx, op, -1, s_mask); } static bool fold_extract(OptContext *ctx, TCGOp *op)