From patchwork Tue Dec 10 15:23:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848773 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp386365wrn; Tue, 10 Dec 2024 07:30:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWaP8Hftp8vh8Ynx5jaCRZZ/owSGV+QF2JXr4NiSY7mxJ2AuWtH/ucYILRxIRVt0nS7g2aQDw==@linaro.org X-Google-Smtp-Source: AGHT+IGQK2JQXizYzz+W82VrWnK3QZIG+WWFPFOhBIwn2v9z6aDWNiWK2NTSy213c7vhmtZSGLzk X-Received: by 2002:a05:6122:478e:b0:50c:4707:df0 with SMTP id 71dfb90a1353d-5188837a2eamr5417740e0c.5.1733844608822; Tue, 10 Dec 2024 07:30:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844608; cv=none; d=google.com; s=arc-20240605; b=Ob7pibwt2TcYQbXJbsHtTchjlPdg6Jasj1b9CWyOIAA0UNBnPe2O5AsdzszDKpmXa0 GsmWBeHjpmnm3wFuIss7U8FPd+oQ08Ba3faVxPj9L0eBQXd7V3NLmMONjm0HKJgF/dhX flcnTKvK0nK09s5Mye4BjJwg6fGnrMDIvopaABU9vF0TQZzuf3D1s6r81uL01+E1OBFW HlTy6ph1cy3s7fB6FQ52lyT9x+1d4N15broQuiuAloiqYVtcE5tz2heseo37mTEDnh0C 4UBWmDFdsg3ek2Y+IlyXR53BGeOxtvg8p+SvInC03E8kdFLh7n6v5Dkas7rbecFBHAzb jMrg== 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=Nd8zzXVe2AyFlBxa8S9FpLDGt59eCBt05NGc//xJzXA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=O+2CEocmv21xQfIPBJgLWH1xQ1Pva1XDRNDAHOGpGyrfcuD6p5C6wPWARmlleIGQfK jj22LKbmqAlLz2OPwKvcw7fW5M5wyzBySqwZRp90oJwwwK34fZEhfSXWeEmotLYnJH1X bL0f8rpO4Im6TeyIFGrvnwu2nY+3AOiwjNuzRYjsfHGBsBwoZBtXv8mpZ83GMzQFvM40 6ShRK7Wd/qKROgC+FU9XqIAnV9Cg29/kFrZm72HQ/cv85QW5ZRCYqWD5IS2Pr0ch5Qeo guxTWIc3rIwkQZjH+BjU68LHaD+KV2BghK7Q7dX5v6h0WyHC+Vmf+k8ZtS4ynd5m3sdD RYFw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Mcso2Tnh; 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 71dfb90a1353d-51625a7d7f9si1676858e0c.254.2024.12.10.07.30.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:30:08 -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=Mcso2Tnh; 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 1tL26U-0004Qe-5F; Tue, 10 Dec 2024 10:24:50 -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 1tL26O-0004Ji-7H for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:46 -0500 Received: from mail-oi1-x231.google.com ([2607:f8b0:4864:20::231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26K-0008My-TB for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:43 -0500 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3eb5ac06111so1063009b6e.2 for ; Tue, 10 Dec 2024 07:24:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844277; x=1734449077; 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=Nd8zzXVe2AyFlBxa8S9FpLDGt59eCBt05NGc//xJzXA=; b=Mcso2TnhOhPxO4UiKj8j82OqYlN0VYqLqtOqTtcJTNOZokDnKVi63Ch5sSNET6GKSF ChnW5DodrTDWeRGzmXWUAtvVtDrgwECWRcsog8yH1MgoAvD1kOxwq6QiQeSKOEXIqhvI hNlO8RCAMoalRS/co7efb2iB+Y6yzKuF+8kDBu5XfsprWDrEVinS27btuz7xq16sMUgK PEarHhEH5DMY1hQlkqwSDqVfJdmi3sSAjs4YkA1Thg2phbGjFIMtIAF8aFqRcGQZhRtP 55uB5p0NOSTzp+6Vnc8OYfY6Ql26fNzkt0K+Y3TkBNFNgeS8iMyfy8ogDBCbZZvsie9q 3qSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844277; x=1734449077; 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=Nd8zzXVe2AyFlBxa8S9FpLDGt59eCBt05NGc//xJzXA=; b=XTRNo4Jnp7Jj4DlEbvdp+k5tJ9toO6sLYMLGvwph351gEn4gSHEBFC0EFjXLrMTrA0 isnvjU4t9V56SOUzmUFxsICqBor3oU1VPylzReSbmsBlJ1fe7xVYvViksgHmSc5tdXeP f6MG9+HiwoDyLwYJW7a9NaIGSLc3HmNnoffQoUQHBFva9jcblf8Ln0BdSxYqtQpdbReS b0+qP8oIbfE7SKGuB7o4ET4/XqUbWUuBbA6mkz/oscXNwsubEM4+We3QHqZO9mdT4lCY u5Q6AZ/u/1ir8s3TE8RqGOhso8Wwwxb/itp5T2tjbwVN2ENBy9ZlB2mobdlPyUuFqGbm wIdA== X-Gm-Message-State: AOJu0YzTyb74YSHvRYA+2MFwiKgN4TMwugbWK4kTHUjVntytwnxdbqjq AUQJNQ/nF3v43vfpEb958wlI5q3q1WD26hCA42LYpPdyoMP7Nx9ietNDokqLL3jMWIbEgyLTs2C wgBAs+JDT X-Gm-Gg: ASbGncvL0fdI0D4TgUbygn9Axy/zIat1NWdvsu3O9ryV0Q0+I05+LWiTdTKw8WLKVvb fwbmLYpyobx7EImhs0tRS5Ta/9AtL43V7CH1bhl8Y4SNxfoG9+e1TpP88QGwmMQtTe++H99no7q 3KjypDQgojk1v7+JIeWfsB1SBoDegbbhYt8e+3vacKk8vh/hURdmfImFk0E5nwptRsdWofs+1D1 7Q46UBZNdSVkBcWRg4ftEyhiv7AbVVrHoUC4QE98mTzrz4ux/sUCu51rdFBQw== X-Received: by 2002:a05:6808:1825:b0:3eb:5dcc:67aa with SMTP id 5614622812f47-3eb66db43e2mr2761777b6e.2.1733844276778; Tue, 10 Dec 2024 07:24:36 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 22/46] tcg/optimize: Use fold_masks_z in fold_neg_no_const Date: Tue, 10 Dec 2024 09:23:37 -0600 Message-ID: <20241210152401.1823648-23-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::231; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x231.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, 2 insertions(+), 7 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 924ee165ba..cc3dc91d3f 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2027,14 +2027,9 @@ static bool fold_neg_no_const(OptContext *ctx, TCGOp *op) { /* Set to 1 all bits to the left of the rightmost. */ uint64_t z_mask = arg_info(op->args[1])->z_mask; - ctx->z_mask = -(z_mask & -z_mask); + z_mask = -(z_mask & -z_mask); - /* - * Because of fold_sub_to_neg, we want to always return true, - * via finish_folding. - */ - finish_folding(ctx, op); - return true; + return fold_masks_z(ctx, op, z_mask); } static bool fold_neg(OptContext *ctx, TCGOp *op)