From patchwork Tue Dec 24 20:04:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853221 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081621wrq; Tue, 24 Dec 2024 12:07:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVpGRRPagekgIM9TyOx2cMNSTnv67/kUI9OptNgXHO3RLIb5BBGGYlTAy4KyQUxVcci3/Aw7w==@linaro.org X-Google-Smtp-Source: AGHT+IEs/S3WSSbw1sfwn2tpiO26z4U9cceqEAaW0Q4tXTyOGJM9HcuWjRxT5yGS+RjuKbP+X2K8 X-Received: by 2002:a05:620a:628d:b0:7b7:106a:19b8 with SMTP id af79cd13be357-7b9ba773fc1mr2900403785a.20.1735070868159; Tue, 24 Dec 2024 12:07:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070868; cv=none; d=google.com; s=arc-20240605; b=XBo3bTRECu2k18vZWD4CXYP1BhsAIjjnvR6HrPMhlaCkOIYEIo0L3LTdH8xvoJY158 DZXsGBp5sLLY09QKkOkvOz1O8apTepGjU3engIXdimdwlAllOCOIEHgDREXOPQ9Ns05m CFZKYoH9GPeECnxX/mPgPQvBLK1LdFDItuSCTl8TzvFq/NSdj9iMHSmeYg9eXlIG/+9/ W6ZMM/y5L+W9pQccpoB6v7JSocUj2fyDbuYCn1hXqVlEMzNZOfXdubtMaFIYAe34Mwg2 DSkRLSJzLDuEflv1H51KErI+0UGcBX9KmXfG215G5xwunKC9cnKm7PzwEZ5c6FiBuxar jWSw== 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:cc:to :from:dkim-signature; bh=wktipe244FoeFQSExHME3WY9VZ8Aio+GMnAonDh7r1s=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=FzB0NaiuvhgFna+3xycrAObb06IX4TYcQUYXkhGO4C99ghw6kN1vVL+lyUpk+RCEjq NaM3aDFHPgh1CN6+9guD0Ixl6LgvpztAglky3glM9B3Bqy0IY+Lu4KCehOWATJZqC/oz +5Ok+cuk/YuePY5xibgW0hxUkThMuNlOL+39yDMmCVd1JiTWE/+ur5vHLs3klzQ7jX2r OewyGLN+x+L5DKKhyErykKwX3ds0qtz1WyCINWKTX748qiaGv6207jfGInul9Vw+cYMp SQ3KAIRxPXRD6FSdjb93J/iO7m1fBhmq9vK3tTEcaq5o9Ssbth1uK2M3P2WREzfJB45X nRzg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BnOro3oG; 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 af79cd13be357-7b9ac53e1d5si1408551285a.612.2024.12.24.12.07.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:07:48 -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=BnOro3oG; 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 1tQBAn-0003ly-QC; Tue, 24 Dec 2024 15:06:35 -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 1tQBA6-0002q1-Si for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:51 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA5-0002b8-8Q for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:50 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-2161eb94cceso39841595ad.2 for ; Tue, 24 Dec 2024 12:05:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070748; x=1735675548; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wktipe244FoeFQSExHME3WY9VZ8Aio+GMnAonDh7r1s=; b=BnOro3oGB/Td4mAwGj0+5N29eIiGPm7Hudg9feDOWU4skGkuEX1SzDGrKD7pY1Fg0/ eRLqX+Bg8OMVStcLqn7kw9xlcRZOcc8bAH1Yy79EP9KIcd1bg1Z63PYADUHGm94PBuzS aUxqqDGyWKlMENtCt6OFxqzBvPMbU777fVPvhwq23pU/qZf8fHZnrqxT/i0mBZ7j4w2i +NdWe/rAssPvk2w5+ye9uP2vG33Rt1tPPMpGYs704fP7EKG89HPX3a6CgCZcwTTM5te3 dQvzcmJGFIR2BSWVessEHgnWiQlfd0Uc6unwXYSVPOycwPSM/2biabI+eQyXK/y7WpPb 0vLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070748; x=1735675548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wktipe244FoeFQSExHME3WY9VZ8Aio+GMnAonDh7r1s=; b=YV9SdUR+wvs0nwa4yAPOwUw4MJOlBJVHFIDJapbZ0WoxJQuuiLpGfR8tSeU2Ihz39K Xd0U2DqmKDutFTPY5+qRY+wJiVW509Oo+qdtKoSnuTQOsVdDt+JpIqMGVOsX+/mDtA9K 54H2BjwT+HJfGqkj004ZMj26nEEUCl8frndy5DW41zlR/814DjOVxVrNewYMBKP+gG/e mFCYpgLMxhVg60+SjVKHjqqJiCUwCOkM8SUeRGmzDl+SSkUVPOY4GthXXp3oH+LiSRDf zkglCt/Nxm6NSJ2Zsu5bha4ZW5DlmziKSGSyQJGC0CR+3fM8YSKWPQlhTfCukQXHUzLU rwlQ== X-Gm-Message-State: AOJu0YwWVVke2Za1/eul70N2BTBcSfrhz0oD3mAnbIvHCp8vkgMueLCn xwll/Du7zh832q/BKhQbK7Ya/IVdPP6L5zFyLwqqwY5Y3IgQjAsFtQ7OHw1e+XDj08MfSp1CGbG hxG0= X-Gm-Gg: ASbGncv6JY7UzsyenMAOUrl3DgSXLcwZd47OKhQDkb3IreX4dCEwtKzUY4MH7RFJm0o 1Y7iBXs7hYZtVEliBlV0Gqdb1jTdlehYlyuGFVKW1DEAc24JnJL7Xbgv7kXHNtvcg+U74N7u0xy dYYKUK7M11Hq80IjLSU8RcF/ffBfaO73TAODdidsou4J1DOqfoi7HNLuUCucN2mw+Ur8hz68hUC lENcoCmRShsJkA/8UziexhHseeVHqXBWfKaZMhHDY0wqnQFWBBU+f9eSzk9hxukFMHs+EUJBzPs Qvc642himYfOMttYoAfBwhMx5g== X-Received: by 2002:a05:6a00:cd6:b0:729:a31:892d with SMTP id d2e1a72fcca58-72abdd9603cmr28693846b3a.8.1735070747929; Tue, 24 Dec 2024 12:05:47 -0800 (PST) Received: from stoup.. (syn-156-019-246-023.biz.spectrum.com. [156.19.246.23]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72aad8fb895sm10027159b3a.162.2024.12.24.12.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 27/72] tcg/optimize: Use fold_masks_s in fold_nand Date: Tue, 24 Dec 2024 12:04:36 -0800 Message-ID: <20241224200521.310066-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241224200521.310066-1-richard.henderson@linaro.org> References: <20241224200521.310066-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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 Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier 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 10d1376f62..7fe5bd6012 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2028,14 +2028,16 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *op) static bool fold_nand(OptContext *ctx, TCGOp *op) { + uint64_t s_mask; + if (fold_const2_commutative(ctx, op) || fold_xi_to_not(ctx, op, -1)) { 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_s(ctx, op, s_mask); } static bool fold_neg_no_const(OptContext *ctx, TCGOp *op)