From patchwork Tue Dec 24 20:04:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 853222 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp4081625wrq; Tue, 24 Dec 2024 12:07:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU++HEvTI0uXLwEx+5JFmDBpA2szj7yPrQ/lFKHMHaaLJYA/1AJG72qPFA+sZf31X885afdWw==@linaro.org X-Google-Smtp-Source: AGHT+IFzxI8wL1to/4Xn5wAYvvpPNF9+8/If39gQ17Syho/TVOkegBSDpJhqtzAagIdq/y5CQ+Ju X-Received: by 2002:a05:622a:19a9:b0:467:5559:39f4 with SMTP id d75a77b69052e-46a4a9c1d8fmr362125791cf.56.1735070868657; 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=CIOa9Qo7vr1fHPGa9Ki0VXpkPZMzTftDVB6oTGGczMv2CIjR5IUf9KyvaptF2+rIq8 3uOlbnSMnXxzvd2uzyy6TotG/7NhJDDf/eBWQob6v8mkO4WA4bhynWk42syVbk8pZWvV 9o/sMsD5jPnjylgBP/fNIRaIcIFt75xgRtYXfUbM1ygfO6qkKqfeBnB5Layo37CtKTky YZEkPAeSydnurpGBBrs/Ga/sfaPpFp38Ce6qEKjJoO6OseTFq8rvOD/ILfm1sjhAh4N9 w9xp3KU0PMnE5JmpJhoE7W56fvR3U6Wg6heL0eyU6JAb6QoDPYNuGlkl3GDuFPxKWlT3 wUIQ== 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=QpM1VqzEizRAO5S933D2pTQEw1V6cPopLqjkgjzXZkM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=IW/qW4pAxbEMEVXmkUHF1w/kTYmH2yPkoYvcM/yNwluDbtJAA/roLAAvxeJtutenYA X9uhXQnMOgOuKCbksszeueUKHl9UzoX4VRwkDHHqtdw/M1B040/mFT0Ccaf1sJmOsKlp JFvcF3zjEhWLjmB8E7eocEVeX1B5FmeH8hd46zscc2pvETmvgPMWUXuncJzJ0bXxKaeS E/+/6FqYPJlOsBf5KIBT0tasFvA1StL3CQKBooSKGEG9Tsi5usbIJKubvGpaJ7XaLsBn YBCigUn+s69L6KOOfqcHEVOAaKErEwBM8/Hm2SJc8hwzhKtsMgccn6/YEDfiEUmH3/x3 4mGA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="YEBRN/Al"; 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-46a3e6ad760si148861291cf.210.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="YEBRN/Al"; 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 1tQBAb-0003YU-LW; Tue, 24 Dec 2024 15:06:21 -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 1tQBA3-0002ok-1T for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:47 -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 1tQBA0-0002a0-S6 for qemu-devel@nongnu.org; Tue, 24 Dec 2024 15:05:46 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-216426b0865so55668565ad.0 for ; Tue, 24 Dec 2024 12:05:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1735070742; x=1735675542; 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=QpM1VqzEizRAO5S933D2pTQEw1V6cPopLqjkgjzXZkM=; b=YEBRN/AlCXpPLkL6xDfw2zQmd/eSk+cbYpFBLQt68HcmYAW7dP04ozrawc/0Xqo8nl 7WWZdo4/n4stHTQdApxOxvVXJtvvU3i0o55Io/Odz4iAbuLSvqi9akvd/9rZVgsiqFMh xx/t7Upd3Li0HnDbGgt/Yhkr8yE80jL5zq518mfZWPKlKUdUQ/QP6S29/3eciL4Z9HMV Vv+YR0rtbzX0gToIcvjDmYu/O+qKdft21D7BFuNVnf9lGrlKksByBW9Ird8Dqafe4Vfw 0p5sWpsXocmPTaso3Ambt2xQwqGS2ZI4affDNY97lap/DgGfDK5g2dE/I05ihllnlC4u 0jLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735070742; x=1735675542; 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=QpM1VqzEizRAO5S933D2pTQEw1V6cPopLqjkgjzXZkM=; b=pV/P1Vmwxq31kO1wB3zTZEyYHW/enG63jzvlJXUjexzeZVGO319v0wj4Zf3nAw4mCb gQQN3Qt8ezfBMQvEgGafafkjKiNuBOspQePAwTePRckb7Tv++qef1qbyFLIdRThPUrpm iX/UYAsSzJ3xqRIHysv5PS4wcPS+5Z5beucUyTcwkECZL43XNW6Mp8R5nO2XfqWtYCK7 FnMjmSnFgyjV8N4APEYJVywMW5WpQOs0toDZc19BM3fdwJPPxQjHQ9JvkuAWY0et+mDm GiSXkEpogbrgLwJuvw5V8FgBDh0NcXwEe4JfANWngWoalD0Zoi6BFkWbK+M8ggVLwP5V ka3w== X-Gm-Message-State: AOJu0YxlOwEuJEPA24ZrWOyeNOa+4pI1ojSS7hky86gC+ysgVEXBTm2y zqPHHCsg4b3fyXQ9Otm5DnHc6M2nUdd/flnXnpFYje1OQzLp5f6ozcQ5vvUnYZhJBkt/JD3b2Us PC7E= X-Gm-Gg: ASbGnctTUJ2OhzFUGHDO44T6osXLqf5y+Gf0LptPSZiKnO7G6RpRc+cpJJ+u0xwERjv PhN3fGY4KnDP+XEW868tbz6z8UUjLeUsxesc0fZsZGvT/rCfE2HQ4BzPRCE66mFc7V7xBKLtYc4 fc2INMv9syA+LKg9vTTSYr/G3AnL6UYUZmIBHiPCcvQG/F0Gt/KnCZwisAdsxZACMjZTY3TThBc YocoxvyCW+uSBwJsZZqb2aHP3vSRsUymJNcFN0rlF0JHP2B0r+I0oYvAAKIYsdA5O0kuJDBGC0X RR+QVcznNjHfrAmNDpn6ioDzIg== X-Received: by 2002:a05:6a00:4ac5:b0:725:f18a:da52 with SMTP id d2e1a72fcca58-72abdd3c1d4mr27143519b3a.4.1735070742443; Tue, 24 Dec 2024 12:05:42 -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.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Dec 2024 12:05:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PULL 21/72] tcg/optimize: Use fold_masks_z in fold_extract Date: Tue, 24 Dec 2024 12:04:30 -0800 Message-ID: <20241224200521.310066-22-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 | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index f948cc48c9..8111c120af 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1739,25 +1739,22 @@ static bool fold_eqv(OptContext *ctx, TCGOp *op) static bool fold_extract(OptContext *ctx, TCGOp *op) { uint64_t z_mask_old, z_mask; + TempOptInfo *t1 = arg_info(op->args[1]); int pos = op->args[2]; int len = op->args[3]; - if (arg_is_const(op->args[1])) { - uint64_t t; - - t = arg_info(op->args[1])->val; - t = extract64(t, pos, len); - return tcg_opt_gen_movi(ctx, op, op->args[0], t); + if (ti_is_const(t1)) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + extract64(ti_const_val(t1), pos, len)); } - z_mask_old = arg_info(op->args[1])->z_mask; + z_mask_old = t1->z_mask; z_mask = extract64(z_mask_old, pos, len); if (pos == 0 && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { return true; } - ctx->z_mask = z_mask; - return fold_masks(ctx, op); + return fold_masks_z(ctx, op, z_mask); } static bool fold_extract2(OptContext *ctx, TCGOp *op)