From patchwork Tue Dec 24 20:04:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853231 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081912wrq; Tue, 24 Dec 2024 12:08:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVZ+FrMcIuMQzKSPKyRcv7g205joqylmuC0NYDDJ6KKlr+sD00W1UGig25bLCLrobvTOu7yfw==@linaro.org X-Google-Smtp-Source: AGHT+IFe0pwyXq5quRwO7GoGZ4B3zRVNL4gEnmRdTtHKPGYoI/T+CfHq7ayEksepqs7jlJrdQkh4 X-Received: by 2002:a05:620a:1995:b0:7b6:d7be:2e4 with SMTP id af79cd13be357-7b9aaad5e09mr3054889685a.26.1735070924871; Tue, 24 Dec 2024 12:08:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1735070924; cv=none; d=google.com; s=arc-20240605; b=drW1ZRWKGZ2EI4b/aYgVv9smDA8tVK4nfopa7FGmE295G7toj/7uOPwqbo1rjAoSaQ g0rkWH1RcNYT4VJec8LAi7nNrrv6/PUvmpQeUTVhM0I0T446xnCgqT4PWMbSrk3zkLe5 1sBTq6jiimR4sfprUTdVXXwedQf2OctwLoH6bDAb2kR8oN2wfOGPuroQJwfgP+kxCk0b uaxgRL0zF0M+aVB29Ko7thu7g4t7OAIhtxTLyohrDXNImAxUA+2j1A8xIFWCN8EQpxlW UH+Cg0A/xTKkby7IqLp6dpSOqdotLc25fZDUoItSpZooGPIksZZlfvMDADw2b3xuCNQ5 pZwg== 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=RorC+bNoeysLqpLQ03oC4wLhRH1BlwQyizXHc+0rwk8=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=DmNbKXj2Z7k3oTBzhUvKllm/MjF/0n6zVQ73caYBda+Zeywinu3qzKayPfwTzCgIm9 I1pnP3T0AtWOLJoqbOITX8S6qzRvPxT9aJpMd1TS4q0gNtbdgHHihdrCF73Zd+WiZI0z BtMP8/OBN+tLaXqJDZOf1sID7LscND7PZbSVeck7WPlrfKHotUAkag5nHRZ9dircnYVE vMvoHS8T5/slwcm35etoMccDv1zWoDBsP2zbBah1LJmibCVswelBpjeNI8qJ5aWgXZSs fe0jNYwzjfUU3/puc3m/Uxwd3yZ9mei7BrApmNUNZchk2oQtaH02vkKN+SSAFAZbmLN1 6fvg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UIgayo6O; 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-7b9ac47a3e2si1451140885a.217.2024.12.24.12.08.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Dec 2024 12:08:44 -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=UIgayo6O; 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 1tQBAx-0004CX-Nr; Tue, 24 Dec 2024 15:06:43 -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 1tQBAB-0002u3-KW for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:56 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQBA9-0002c1-Pz for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:55 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2162c0f6a39so64870885ad.0 for ; Tue, 24 Dec 2024 12:05:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070752; x=1735675552; 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=RorC+bNoeysLqpLQ03oC4wLhRH1BlwQyizXHc+0rwk8=; b=UIgayo6OoaZ0+wtR4EIj1hnV8r1YZ04K8KkVNP+rkzErNcB3Lf7WWEFyzUZYT1aFzb F5OdkE3ZmlT6Dv6ADlpdcmxarVsnsrYw871lGzD81bozwOkOfmYDBbfxVhc52R4k199A Ka88K02fo1FfcKg3TLLEqupf2jGb//IIpViwNWqEhHgxJ/oN1f8bUytrJIJ1CMRJbFNd MET1h4LsPIwjAM+HtI4WcbQxbQoDTNixRT5MZSnuMRoI+g/JBXIy9Zkek6OFEw+af2kS /goYHbB1Gr94KGjXrrGDJKg/cTe1Re3kJ+HLhW6YaXgR2sVqq+Mt+EzAJ+vlclNNH5oG h1VQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070752; x=1735675552; 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=RorC+bNoeysLqpLQ03oC4wLhRH1BlwQyizXHc+0rwk8=; b=W/DQNwL13ChyhHAeiNjvUvEygSXsvE5oquyjCdrb+rdrIiO2sh4yxZ7Y1rmPm/9M1i ifkApQgFOo1iKhVXxYXYiKl5fGuJ4/tv3OBk1gl2YBvY5+w0C67QYEP91jGqm/1hjA4J VpyaiBGMTfIE2QP+rzgDT36VBhNOKIJIebw+1iRZ/Bq6HqffrfZunJw2dxUvGhIr4SbS IlgVOoD2+YRBgSm7vHOJhkqAwUSLXlrL0OZH6XGMfYUfDSOwT1ONFj1lwiwC+lXCo8FF IcjIjmGctgLQeg5kyU1RUFaxRASWCCZttFAXHkvAg34MJ0UFXiqS8cIMrkHp8c+o8EVs bOcw== X-Gm-Message-State: AOJu0YwMZiCe7q6YwTufzssDLm47qvC/4Fh7hsn6lPBrGQXvHZQx8LHZ Auw0Zwt/u+S2/6EdlcaJ3eGi8YijK9eBiVHLUEEgX8yAaKhz5e9FMA6Ea+P+YS6d0BkYuFXsrUl 7l0Y= X-Gm-Gg: ASbGncvspHigelU6DEmBpWyPeT2Syqxn7cvoDgcOVm3LtUKpQvVyEiEDLOoQ57ABANx J58Ig0X0nl1vuSH6eR1HvEPeOGUwQqMPChBrW+NKZZvi26+P4mcSkttlyuMp1GbvZVyfpTC9XvY ppIwnHCgBcNC9/dibsHrZ7t+d0VYZuXY0SmUei3XvCmSqnYdHwjGFm+NyiYMNSe+xXDrhp/mEC2 aORGzG/MiTCGbRysW3DMvJN35/Vurx0736qVpvJey4IRjxrO/wRn01DM2r6J1eGh/rVA0n2F7Jk Xb+6eBoiBNDzupdUZC0w2gqnSQ== X-Received: by 2002:a05:6a20:914d:b0:1e2:5c9:6831 with SMTP id adf61e73a8af0-1e5e1f57c6bmr24704790637.14.1735070751644; Tue, 24 Dec 2024 12:05:51 -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.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 31/72] tcg/optimize: Use fold_masks_zs in fold_or Date: Tue, 24 Dec 2024 12:04:40 -0800 Message-ID: <20241224200521.310066-32-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::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.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. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 4ede218bfc..e284d79fb1 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2078,17 +2078,20 @@ static bool fold_not(OptContext *ctx, TCGOp *op) static bool fold_or(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + TempOptInfo *t1, *t2; + if (fold_const2_commutative(ctx, op) || fold_xi_to_x(ctx, op, 0) || fold_xx_to_x(ctx, op)) { return true; } - ctx->z_mask = arg_info(op->args[1])->z_mask - | arg_info(op->args[2])->z_mask; - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks(ctx, op); + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + z_mask = t1->z_mask | t2->z_mask; + s_mask = t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_orc(OptContext *ctx, TCGOp *op)