From patchwork Tue Dec 10 15:23:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848765 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp385062wrn; Tue, 10 Dec 2024 07:27:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCULSVC3K9lIPou8ZvhUWgoKzTdlq1NmJLz/CwyyyknISd0Gy7GuLk0Hf8VLS/Mv9Ic6NWW5Yg==@linaro.org X-Google-Smtp-Source: AGHT+IEsPmjb63Cd1KDVornNLLIHFij3rZe+lUzkGJ6CqcAcdnF+sV6ydGQykUpqevh+BSPxs3wz X-Received: by 2002:a05:622a:189d:b0:467:5c9f:f8ef with SMTP id d75a77b69052e-4675c9ffb7cmr153376131cf.6.1733844462128; Tue, 10 Dec 2024 07:27:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844462; cv=none; d=google.com; s=arc-20240605; b=i6cfTTWLOFK7JPevY5+n8yQHvJy52iZRltUyina30htujZbt1YAWNV94D3h+5tERuT woQZII+6JyjZviWOhW2zjo+W6yQHyLZpNnzVTG6GjdqsaXBbCuVD7GGUR96eWtY2V9NJ KrkJuJ0Nv0n+gHFN6dN0JMXKiNkVawLUsWlrW6ZQv00o76yd8pAaZSghYC6OTnVb3Gs0 Sf9AsOnpWMGA51PDdGGgV9Y40KfaudQjVA67MtlgAR+CuwwzoxQu98OBk+vKc6AP+fmT pmVwxw1q1kFmTIxaoM+51rlWAn5sv0vvqgAmMjm3U+CICiXgN0Xv/W/rEMTwyc3o81B9 Jh2Q== 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=MUsrrfhTagXqeJoeB4xz4rpIOAAqw8YmwMVIuKY4rN0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ZmC6emga9SydLysbYJYaASHvHfpYqYVDMox5II0UlRY1pZvhr+ZUimMDhrC9OsYtDl Op9jDkVGVqbEyln+Y0Sy+8eJz09DeIf6phqe3Zo7rIjP8k+iAvSRpqG+Ej/XNws2CEM2 tNn5OwTvvStcOw+KJQSUJDHhL5u1s0YdmZlsGVCdncTJ1oJy0O9eC3o9iEiP7QP2nQ9k UYOqLh+loU1m2JRHyv40dWzVkFbM7IX9V/4SAsYg+M3gRn0Ry45WUJAhNfA2ms6iztvH J///HVGImuCbWq3KRPmQiMsWaMhfQWxkI1lL2exRTZ0hR21ONYklmd5Qp+Lvs1JkQmlQ evVA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=v5zu+QUD; 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-4672983f8f7si750181cf.611.2024.12.10.07.27.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:27:42 -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=v5zu+QUD; 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 1tL25u-0004Bz-Fs; Tue, 10 Dec 2024 10:24:14 -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 1tL25t-0004Bd-0N for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:13 -0500 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL25r-0008IQ-Cy for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:12 -0500 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3ea36b05654so2929532b6e.1 for ; Tue, 10 Dec 2024 07:24:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844250; x=1734449050; 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=MUsrrfhTagXqeJoeB4xz4rpIOAAqw8YmwMVIuKY4rN0=; b=v5zu+QUDCS5UGqxFHAIHZQ4HU042V5V6k/cjX9McOEp9z/pLcuzPie+6rbt/DvsFvc IHibHPZAcD4fkSI203Zm5bmrG6DfmwIFAwjDlUeKY1OVgzXySms0jf6yqMvFwf2BafFF y6cqjptMHmEk//pt4Uph4VaFd/NdiGZ/ZSC5Dy8x15yikHJ/KNvT0+HaXb3IDQAfmJmx EOummd0p4ZjJsYlkkKjCzZL5SttTym8GpvTxrwCBu5l7+OyVeGmxNfR+eq2fc/Y/5A4s hgM698cYdPPPmUueQqsd0Ui6ZzbX8TNwjQSfQllSCmiS7yWVIob/DryiQ0ovlKdBm3Cn 1N3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844250; x=1734449050; 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=MUsrrfhTagXqeJoeB4xz4rpIOAAqw8YmwMVIuKY4rN0=; b=vjia+4+EJgZiz6X8NMnpPaROmnZbGgfW7S8QFgT3GqLsim1mwWon1A0Q04o4TCyTYf 5H89CEeee5MzcizZJllpR5dKqexqdxNMpQmjGY5EW5NvX5GJB+BLoI1e/V6QGCw1endi +WiXlrFToN944mOelxksndi9S3ypvuxFtW48hhqVqFUg9CQdZSYUUrfZpslJ4MbUoPmu AcpEQ+wIMbat1b4xp4is2kNlI3qWMCgt+aft3DpTEA+WbZDV0zrIoMvKLrtqYjQtITdx U8kT8L7MdijVBeRy+nuE5rc4TebWZLNMcc5RoBFp11uwES0tSzImfidPcWSmZB7xC2Ur iSwg== X-Gm-Message-State: AOJu0Yz9fQmzXegs+O736BGo/pQCPLiinpfP9TJQy7nVaM8Ggd5MggnG BIZnDe44UO6Bjgb5f3+7YV2Wwl0O7CFMrzDLmN0AYSN0Pky29OZ6sC8baL98Gt8dp5UDk7/bLLy WbWsg+6at X-Gm-Gg: ASbGncsmXdjHBiteA3MH/1TBRZD3l2nS2+CZywgXfuJA8Z6Z7ELEp0vOC7Bc+DNCxzr qNEL8RorjpUK/xejsMt+l4usJ4nbwacTj5W21fHxjVOts0IElcyRtxNKZaBtgbSZ3AykvPdXYUe cj7tPjhpTjIdsA7ukL1Ez8yPuYTucNTNrLOBMfgLbkicI95w2q7KDKWzP9NWkuLgqYA5thU0e3R O3OoQVaXwZ/dMatJj71RDKkeegZgtb/r2BtUXxYbRBjfbbDKv04kXR15Tyjkw== X-Received: by 2002:a05:6808:3a0a:b0:3e7:b2b4:ee7a with SMTP id 5614622812f47-3eb19df842dmr11783633b6e.26.1733844249835; Tue, 10 Dec 2024 07:24:09 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 01/46] tcg/optimize: Split out finish_bb, finish_ebb Date: Tue, 10 Dec 2024 09:23:16 -0600 Message-ID: <20241210152401.1823648-2-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::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 Call them directly from the opcode switch statement in tcg_optimize, rather than in finish_folding based on opcode flags. Adjust folding of conditional branches to match. Signed-off-by: Richard Henderson --- tcg/optimize.c | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index e9ef16b3c6..20c918e83b 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -964,24 +964,25 @@ static void copy_propagate(OptContext *ctx, TCGOp *op, } } +static void finish_bb(OptContext *ctx) +{ + /* We only optimize memory barriers across basic blocks. */ + ctx->prev_mb = NULL; +} + +static void finish_ebb(OptContext *ctx) +{ + /* We only optimize across extended basic blocks. */ + memset(&ctx->temps_used, 0, sizeof(ctx->temps_used)); + remove_mem_copy_all(ctx); + finish_bb(ctx); +} + static void finish_folding(OptContext *ctx, TCGOp *op) { const TCGOpDef *def = &tcg_op_defs[op->opc]; int i, nb_oargs; - /* - * We only optimize extended basic blocks. If the opcode ends a BB - * and is not a conditional branch, reset all temp data. - */ - if (def->flags & TCG_OPF_BB_END) { - ctx->prev_mb = NULL; - if (!(def->flags & TCG_OPF_COND_BRANCH)) { - memset(&ctx->temps_used, 0, sizeof(ctx->temps_used)); - remove_mem_copy_all(ctx); - } - return; - } - nb_oargs = def->nb_oargs; for (i = 0; i < nb_oargs; i++) { TCGTemp *ts = arg_temp(op->args[i]); @@ -1351,8 +1352,11 @@ static bool fold_brcond(OptContext *ctx, TCGOp *op) if (i > 0) { op->opc = INDEX_op_br; op->args[0] = op->args[3]; + finish_ebb(ctx); + } else { + finish_bb(ctx); } - return false; + return true; } static bool fold_brcond2(OptContext *ctx, TCGOp *op) @@ -1443,9 +1447,12 @@ static bool fold_brcond2(OptContext *ctx, TCGOp *op) } op->opc = INDEX_op_br; op->args[0] = label; - break; + finish_ebb(ctx); + return true; } - return false; + + finish_bb(ctx); + return true; } static bool fold_bswap(OptContext *ctx, TCGOp *op) @@ -3037,6 +3044,14 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64_VEC(xor): done = fold_xor(&ctx, op); break; + case INDEX_op_set_label: + case INDEX_op_br: + case INDEX_op_exit_tb: + case INDEX_op_goto_tb: + case INDEX_op_goto_ptr: + finish_ebb(&ctx); + done = true; + break; default: break; } From patchwork Tue Dec 10 15:23:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848768 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp386032wrn; Tue, 10 Dec 2024 07:29:35 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU9P6AhQ/IWXXR/rSlh3Wy/pN2qkgbKXasCpnCF8Q5Szj0V9i7rpp6VSEWLPdpXBarVUHVWdA==@linaro.org X-Google-Smtp-Source: AGHT+IEzJ2FwBUFPxv1KOvTjMpxcL692IJhzufF5mFRL320vYUB2mJ9yFlga+rxlVcHfAGbULtOA X-Received: by 2002:a05:620a:4101:b0:7b6:d710:228c with SMTP id af79cd13be357-7b6d71026e1mr1183212085a.31.1733844575302; Tue, 10 Dec 2024 07:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844575; cv=none; d=google.com; s=arc-20240605; b=FgyPupP1Xua+CScLEH6vcL7pcExkI4vs/zxiGtj15N4A+oE5pVzJQ+62O8IyEgE41+ itDSieOd/boupEtgYp0/hUpVHv7/hN3B7u61eZz6FBrPanAWhfM0uIjUoE8WJ4ImnKYQ M39KxAVPKqJSPNFsWA0gpfXH/WdOQ4bjJhzQa+40aayZohvLH5zkZYnEMVWags9yndfp 1BS17Q5Va3a3ls7321JSPU4N/oHE9Xl1fim4yi/mql4p5dpP7NUkoocUHvDHn0sUGC3A arVBTCue6FVamIn5DsJWWPQ6NQO5YoaBB2wC9vYNtjGGi4O3z7sLm/wxHvijjDElPJT8 cFkw== 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=KR0lekQhiKivBMDP67KsxynVb4xquNEZz8S0WP9LF84=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=jqPlwQIyltl6euTwZ+ysK75LnKJhfpMh+7T/HemwZivm8DXn3htSZEBxsYZu0ym7Rc sh6gvSAmzO7+48omEdeFLZ4ZRwJw8WdwCsZ4UgaT9GJlxKkhp+XYjK/p90yG0DxVpg9k 4oapBayk5GTB9LP8zMcvVRtH3z2lhxymRgntWZS8MXtZS+0uXloQvpqgmOTr5R07Uh2C wU9bGHjsA6d1/zasnytDrxy+DVuvgWXoV8xd5a+U+niWrNgBBEYCMVc0mTTH3LY1tg8M jd16TMmU/5KMoJvVhS4D6swjOE3mwMRIMMJxGFp81F2FagUQEJWhtr3wD4VOr2ar4RlF tFFQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SwuK7/QE"; 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-7b6e836e8acsi85855685a.10.2024.12.10.07.29.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:29:35 -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="SwuK7/QE"; 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 1tL25v-0004Cj-Ii; Tue, 10 Dec 2024 10:24:16 -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 1tL25u-0004Br-1y for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:14 -0500 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL25s-0008IZ-GY for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:13 -0500 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3eb45232717so1257886b6e.3 for ; Tue, 10 Dec 2024 07:24:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844251; x=1734449051; 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=KR0lekQhiKivBMDP67KsxynVb4xquNEZz8S0WP9LF84=; b=SwuK7/QELQ2OiZkKdkvE0OdFFFCHkJ55XlwHp+mCgBAsnZN4NdtVJpbnDvcHH+3N4J maA2dWIBDiDJfzLQFy2GpOQn9rcCK7+InKRQnQyLDnQm5xnPcIEhNRPa8I2QJ4+p+Jx4 /jQ4ebE64PXp/+mJNnAU0/WSNTIMJbJlwEfHl9c0jMHxEDDu51ejBClBOIfew0vG8pP9 SdcEFu1WIP9O6BB1EVb3ooZEmnqAbx6wErwsZ8NqENAlu8Jp+yyrUTL2EL6Tod0Dy+vP 9C+6tDAxLMGSThKSTslbV/DUPuLZI+Bh7X8Lmvlmu3HyVPL46xLJBcsUCUVSWjmEqs3P apfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844251; x=1734449051; 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=KR0lekQhiKivBMDP67KsxynVb4xquNEZz8S0WP9LF84=; b=L1Y64mSI3wq5Vj7Il3ubZVLiJ3XT5b5bk5WfbROE6kGQ997lS9tPnJMYnGbUAssFn1 D/eZ19bzqCygk2mHPEcw5/DitKcdFIpg1aVDOJlKbCl1uwYP7bKfXHFjleRyrBPb0EtQ yOehFPlsuLFHRXyZPVQILOOBCr4GgSmuC0aX/kmw1Jiqr9PpfEqwj9reQFbjF6JDDfGS cS1PSrGtmm0ujtb6yx+CFVGTzWRcdxzgFWhc8A4uVRe20ZmCVkb53GOaD5LDzmNrLUpV bUUsJLb8OlQSMIcnE58cTN4P52ZBNTOGQIWnbEEqq6tsMegnDAq8mo9+FAU20pdb6CUV VmcQ== X-Gm-Message-State: AOJu0Yx/ztdKn0x6RJFQRquq683FeWxiGotxhwg/z2Corppe+v+4nrWz olIweoDt3rkhXwt5+3u+zFF6ANM97h1tcOOzWKSbFBTwjw1Uw8uQQ2L9Hw6/S0dkZ+4aCIU5sIt r3v6La0ne X-Gm-Gg: ASbGncu6SBSwTt3K55jasGu/bhDpa8upWi8buiKhfduFWlkZ4U7QvAiM3nxZrmyCiXE Q8i4HyDtNrX9kf/gCN9dGtidPqdfSw+9i6pv+73F1fvn7z0uhQbWQRd/4s8RoYTozMxR3T3Jvvz GwHk3YAbWN34a9ekJp9XrlS5fCxVQSycVYUN8USukAyzhoIG1ApQ7GBamtAf+UzFigod84k0++P 2CUyir3LI48vOE4U0CkJB6v8qUxAEiW7p9BIGsc6BYl1uHVCvSv3P75AadtMA== X-Received: by 2002:a05:6808:10c1:b0:3eb:71d7:246b with SMTP id 5614622812f47-3eb71d725b5mr1455984b6e.39.1733844251092; Tue, 10 Dec 2024 07:24:11 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 02/46] tcg/optimize: Copy mask writeback to fold_masks Date: Tue, 10 Dec 2024 09:23:17 -0600 Message-ID: <20241210152401.1823648-3-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::22b; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22b.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 Use of fold_masks should be restricted to those opcodes that can reliably make use of it -- those with a single output, and from higher-level folders that set up the masks. Prepare for conversion of each folder in turn. Signed-off-by: Richard Henderson --- tcg/optimize.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 20c918e83b..1a9e3258e3 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1050,6 +1050,11 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) uint64_t a_mask = ctx->a_mask; uint64_t z_mask = ctx->z_mask; uint64_t s_mask = ctx->s_mask; + const TCGOpDef *def = &tcg_op_defs[op->opc]; + TCGTemp *ts; + + /* Only single-output opcodes are supported here. */ + tcg_debug_assert(def->nb_oargs == 1); /* * 32-bit ops generate 32-bit results, which for the purpose of @@ -1062,8 +1067,6 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) a_mask = (int32_t)a_mask; z_mask = (int32_t)z_mask; s_mask |= MAKE_64BIT_MASK(32, 32); - ctx->z_mask = z_mask; - ctx->s_mask = s_mask; } if (z_mask == 0) { @@ -1072,7 +1075,12 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) if (a_mask == 0) { return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); } - return false; + + ts = arg_temp(op->args[0]); + reset_ts(ctx, ts); + ts_info(ts)->z_mask = z_mask; + ts_info(ts)->s_mask = s_mask; + return true; } /* From patchwork Tue Dec 10 15:23:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848766 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp385243wrn; Tue, 10 Dec 2024 07:28:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWnUijtni5AhZ/C2TOgNaqOiI6/JnBYap7gtmzjvFDW+ZuF5s0T3JxuxkrQ1x6lbdO3DGTp+A==@linaro.org X-Google-Smtp-Source: AGHT+IFIta1SeHDy4gCxtwLwL7YaYTErwXuFO6lYLjKdhsxOt1V72L3LhAmy2pDeHX4wWEpbiHNU X-Received: by 2002:a05:620a:471e:b0:7b6:d34e:b21a with SMTP id af79cd13be357-7b6d34eb68amr1559773985a.37.1733844483257; Tue, 10 Dec 2024 07:28:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844483; cv=none; d=google.com; s=arc-20240605; b=aFrHbcgitMd9RNZmqsCqAJEdr2G6JN34CZeZ0To7xwFiuFEwQAqnyPfAzurj+53jvC 7hYaT2hC4QyrYpGBPwqvhk9ziUQCbnrLUPpaBldMLO4caE7u4KvzjKGSKUS+h2J6gEnz hqLn/SAPOTR4VAmcebeOons0CIOr9Fr5OSvCf+svTbfqp107A5/7B/KsDJWOP2RmST6l K/FpquQpNCb3Z1tBPNBii+yxrqOeO0RM9nK11LGS4DCbezmuuVueyW/ljqOH8pBmbEoG N5wlsUNJcBcUu1nslObpgoLjEwNbbAjKViV8amjdvb7jd74KS6folh7JQ66Ld9ISoeFq q0fQ== 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=7cFEO+uMgJmacMAFlsXy/XFjA9D7UAzv+GZ8zUt5SUg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=d4WyqhEdit6BDijbzHmQpM2fdjVmpJgRAiuCUoSWtCuxnG0OXVm5sT6NYoit5+SdT0 m7qlKKL1bLUPcUAdin+o0wLVfznP5DPro1VsZ0pXipwAvfNmvvN26EjYTjt6pfJSxIHO J1N7EvFNjwDVk6K8At3quTVvEo7rzQzn8XHUMdyuo5sv4nw8Ftj7fIgrbR/5ciF/l2wF EBGYb4C3LzKg75J1RbjIu07Xm1tY5CQnShCKNStq8Z2LYhVGXQtbDgqX37aSMFgPch+M m9y8tOKkYAEVce6vdFNyIDaFlleDNMGS6qZMuYxoSC4+PGFoGZ9yZbIZYF+w+qapqIVS yomQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=huZHnsRq; 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-7b6d54d40d0si608055385a.577.2024.12.10.07.28.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:28:03 -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=huZHnsRq; 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 1tL25x-0004DB-4R; Tue, 10 Dec 2024 10:24:17 -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 1tL25v-0004Cb-BM for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:15 -0500 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL25t-0008Ip-Nd for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:15 -0500 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3ea36b05654so2929558b6e.1 for ; Tue, 10 Dec 2024 07:24:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844252; x=1734449052; 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=7cFEO+uMgJmacMAFlsXy/XFjA9D7UAzv+GZ8zUt5SUg=; b=huZHnsRq2es70IJecbzvp0bfwOxIumqixI6pBvBMcnfKBXvQtfo/TyPAb0Cz4TkQlg /zCnMLnzrzSy0FlVGzLyQuXa3BrKgyt/n45HrwboG0DI4u8GgP49Q3AfAYjoKRPc43jy 6YT9Zq47kTjKKVAG5UMY2Zmc269r3923HKdVYcJB0lTeMsZbS8k0Jm1KOmQAVCeYXj2V WlL3L+2RcghVp3PLnnM7O0jVLQyqbsF2GZEluZB+xIKrEOvqxKLiduBhQL6zbos2QkrT x2faFQsebMwosWKJ7R5e/rMgJoz1PPrbUcTceBOKALF6lKlwk3DeZ/5fIT7CNIaQ+s8B uN4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844252; x=1734449052; 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=7cFEO+uMgJmacMAFlsXy/XFjA9D7UAzv+GZ8zUt5SUg=; b=A1IMftXB393DbEYQdJz4vaEZxK2dH4/g9Ie1HV8BCKXxl4aliWq7ET6JPlkJOuezbM q0y/MyG07rXU3d+a6fW8IDV6UMgc5B+Dbx9H7xuoSu14HbTYHhxBbHuB0VZsSVXSxuvy 658OaeYEd6opiAh1PhBUDieYd3N7atTycqcolbrHAmTn1rDnSmxK0aEL47/HcXSoHiFr GXfPxzjJb8yAKKEM+qPNxUNj1L1amVELy9qvmXH8rjvcoxZazyLxOFCAoBLRrgdQRVjD MEMFjc1/WVMuXviFyGqWVEwHHSY8f6vj/v3b3uqM+1RLE1qvSNSMjoIM7AsBZkcNM3/d rkvQ== X-Gm-Message-State: AOJu0YxcPtaB2Ci+3Dkwaxwkj6urm+8567tUeCHQAJ5gjnYHxhnivrrs Rpyd1oH7GR9cWYSOrFYZ0T6S8BHh7GMWvgUK2bGR4y/04k5XbxTSViLpzHnwhmjZO39c/olcxWc kRvU/Hrjb X-Gm-Gg: ASbGnctTpFTV0KSAyrGfa3Ig0WOT2FpN35/uDJ1lEqSPZj0+bas0nkqFl8MXTtVAhkY Z8Ovpe03Lozwf4EUKAgwutOYQAeIqHb7A/my6wfXJmJpERort1kLJsn2zGpMDLOdqQp/Col3uwU ItRtwJbXpIaPphTnSCmWZqYrgU6oB/PQ97XS4rs2rJEKiN4w2cjTxNqQO/Xz3oTcEiL0Dzhl5n5 GpKh0qAyRkM256CpjVKGQlv9x9YI/Mw70Ul4+YKNDh2zxMEEd2VZlHXdEKSeg== X-Received: by 2002:a05:6808:2186:b0:3e7:644e:3cab with SMTP id 5614622812f47-3eb19c1692dmr9371951b6e.7.1733844252646; Tue, 10 Dec 2024 07:24:12 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 03/46] tcg/optimize: Add fold_masks_zsa, fold_masks_zs, fold_masks_z Date: Tue, 10 Dec 2024 09:23:18 -0600 Message-ID: <20241210152401.1823648-4-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::235; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x235.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 Add additional routines to pass masks directly, rather than storing them into OptContext. To be used in upcoming patches. Signed-off-by: Richard Henderson --- tcg/optimize.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 1a9e3258e3..6644d24da6 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1045,11 +1045,9 @@ static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) return fold_const2(ctx, op); } -static bool fold_masks(OptContext *ctx, TCGOp *op) +static bool fold_masks_zsa(OptContext *ctx, TCGOp *op, uint64_t z_mask, + uint64_t s_mask, uint64_t a_mask) { - uint64_t a_mask = ctx->a_mask; - uint64_t z_mask = ctx->z_mask; - uint64_t s_mask = ctx->s_mask; const TCGOpDef *def = &tcg_op_defs[op->opc]; TCGTemp *ts; @@ -1083,6 +1081,24 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) return true; } +__attribute__((unused)) +static bool fold_masks_zs(OptContext *ctx, TCGOp *op, + uint64_t z_mask, uint64_t s_mask) +{ + return fold_masks_zsa(ctx, op, z_mask, s_mask, -1); +} + +__attribute__((unused)) +static bool fold_masks_z(OptContext *ctx, TCGOp *op, uint64_t z_mask) +{ + return fold_masks_zsa(ctx, op, z_mask, smask_from_zmask(z_mask), -1); +} + +static bool fold_masks(OptContext *ctx, TCGOp *op) +{ + return fold_masks_zsa(ctx, op, ctx->z_mask, ctx->s_mask, ctx->a_mask); +} + /* * Convert @op to NOT, if NOT is supported by the host. * Return true f the conversion is successful, which will still From patchwork Tue Dec 10 15:23:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848790 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp389765wrn; Tue, 10 Dec 2024 07:35:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVtLPaaU4wfpdDmGQ0NvvBkMbyTIuLT7aQkbBubVjcljlhaED8hS3NGiDKBriX00bWQw9ALbA==@linaro.org X-Google-Smtp-Source: AGHT+IEaGL55EUsXLUUEXgwuT42UcDVbTtEzOrzFh1BBKVULHw0mDo0l60gj6YcRmPssAyTbn9Zu X-Received: by 2002:ac8:5809:0:b0:464:c8f2:e553 with SMTP id d75a77b69052e-46771ff36c4mr78994781cf.42.1733844940428; Tue, 10 Dec 2024 07:35:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844940; cv=none; d=google.com; s=arc-20240605; b=AaFIeePRhYeZ87/TUn/Nm3opl5Rj9HwJ+115t7Lk2DI1TFFQ+FPTyv2U/G8DNd/3d/ Fsb01bcehsKKKV/JI8ai2sq9O+815l0sKitTlhziYuiiDzKRAS0TAoI11JMad0n7gGGX i5bvH11+ev07mSc82SZwnvJgUPqBhZZ4wcgmitjTJ7rVgPgnWO6IUNU7YDkHnA0g7k1T ZM0PGUCoqHX4p0Gq0Mho2tmLfxWcVsQYd1r0TWGNYXNuVuuLLPpfuNC91sAtbFeNAN3R YsrSEwuPyRjbvGvVk+InJ3nN0oUagJaaonR8Qla0cC5TLe12dgX5N94i4vM/ikOFuKB3 jD/g== 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=Bxi1HjyNLNTXe0raGBUFhP9XEIHnBSHW3k19d8NP0Xg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=BqSxWKENltGOzmixbBqNZIe+c2NKgJPlLgIghvmFKe5Kx8aZS4m0G87Yhr7lW5mf6N wBxRGr9YRB75xdYB4FZhEqZYW4CHMPb6uRCbjZYB4mjevSg6khLJUC35yvghtrdUDfC7 Xg617cX5ZvFLBxuKrn2DEE+HFrImjizvf0d5+NzJGxlqJfJgUwcGg8UH9aJ9GnzdcD85 LpGXMRs5SARjw0Kxd3Hr2/ZECx/FgbiUiyQbgrgv/ZchfQ7afy3Vl9fapk7gjEUeg2Lf hHHFDQxH4Pe1DXC86kVl0T/PVFILr2HNxHcVMZucanJ12cjSZd03OZiD2aeac5HudRed ogVw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wMM+1Qy2; 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-467506a770bsi84993881cf.14.2024.12.10.07.35.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:35:40 -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=wMM+1Qy2; 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 1tL25y-0004Db-97; Tue, 10 Dec 2024 10:24:18 -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 1tL25w-0004D0-Mb for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:16 -0500 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL25v-0008Iz-6F for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:16 -0500 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3eb441c2f28so648695b6e.2 for ; Tue, 10 Dec 2024 07:24:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844253; x=1734449053; 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=Bxi1HjyNLNTXe0raGBUFhP9XEIHnBSHW3k19d8NP0Xg=; b=wMM+1Qy2YVulpvusYa/xh49sk7K2T4dWtFpQsbudhg2jLfWiSCNoQabgr2CEoOdypN cIr53m+a511+ChH9Hu8V52/Wt5+UxP26Pl+wxENocFM3vaYu9fNkdgOZvMTGyAURB/HS scdIXhX5IQCCn0qUXT9vJvm7ZnaKFry3Tn58F8tubIAWnrW2EqQtHNCaoNMEk4OZ/OxQ zSxyXsI3NGN6XTLH3Xy5RcDkyLSuYM0ExrNnqwj5VPRfeqSTbP/EO2hjMuovg4vE7sQu kbmeGI0pOwYMNiSuyG9kzLcDvEbHYRzLAaGHk+KBlzfVPOi75RIpOb3aI2I1h1Oww+id o/9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844253; x=1734449053; 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=Bxi1HjyNLNTXe0raGBUFhP9XEIHnBSHW3k19d8NP0Xg=; b=KuqqGKW+dLKv1zWZpdIWqbg28pEOKje/ISbstT9ajs1YGnGhT0aS/Yn60vzvQ/abq9 9UUFDz8ZkDvF5+zk4Xaclevq/rYHzijxcjlpCkkGMnTPbj7JtVWOalQ0+mZc7tbXVX2A Z53FS64BElr0iTcSk0bbC4tq4RQ3ti0LsEmZhQj71BGFctRTHgevelCcSFjBWwOzxrOb 2Jv2YXyuHU0m4VXAzZlkulXsptOqSWy/ZuzAlEnXh4I22NHzX31U5DF0PNqdFNZSDKND GI60l/3lsNkNHtNT+G69g8/5+Ajx5Ycy2Zt++k1o3SLbHW/mdVI1vJE4ofY5r/oJw1rE 9mwQ== X-Gm-Message-State: AOJu0YwnFWSg01yZReQBnNXXynI2Fba2NWFhY38og77YSdvu2x9ixoiT 5ksHVeLdUp5cbkrj+91n3skPZwGJOhcTLGIsgQFPbWty7Bv12HZBHyg/uiYOKt0yHOIw3stYuMn b1UZ0JNJ5 X-Gm-Gg: ASbGncvdddAuAxsKqwjSPqE0FLzFapne6zVCZUoHJuH0E6adI0Wm0uY3Z9DlWS45Vc0 FMEdNa4QF2khu/66OvC1b1fddJsGgYREh0EBg19mkuZEUc9o+oNmWc4CwmbSkH386ivM2yDmSHJ AVoQPFGEBvhcJowAAtZk24gBu0yoVUsJV2f1mYv5JkCvsTYMEOs/Kp8nrjBmfe+EW/UehhnBfsz dk0HGOA9zNMoydvrx4Qp9CYXfkycj1O0m5l/ekzGg5rRHNCkIRB8oOiFwAgOA== X-Received: by 2002:a05:6808:bc5:b0:3eb:5fbf:1b98 with SMTP id 5614622812f47-3eb66dea1e3mr3785401b6e.10.1733844253649; Tue, 10 Dec 2024 07:24:13 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 04/46] tcg/optimize: Use finish_folding in fold_add, fold_add_vec Date: Tue, 10 Dec 2024 09:23:19 -0600 Message-ID: <20241210152401.1823648-5-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::22e; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22e.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 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 6644d24da6..3f2f351bae 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -978,7 +978,7 @@ static void finish_ebb(OptContext *ctx) finish_bb(ctx); } -static void finish_folding(OptContext *ctx, TCGOp *op) +static bool finish_folding(OptContext *ctx, TCGOp *op) { const TCGOpDef *def = &tcg_op_defs[op->opc]; int i, nb_oargs; @@ -996,6 +996,7 @@ static void finish_folding(OptContext *ctx, TCGOp *op) ts_info(ts)->s_mask = ctx->s_mask; } } + return true; } /* @@ -1214,7 +1215,7 @@ static bool fold_add(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 0)) { return true; } - return false; + return finish_folding(ctx, op); } /* We cannot as yet do_constant_folding with vectors. */ @@ -1224,7 +1225,7 @@ static bool fold_add_vec(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 0)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add) From patchwork Tue Dec 10 15:23:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848776 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387028wrn; Tue, 10 Dec 2024 07:31:04 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUoSeAxsLpZHE7nC/Jyy2IDErSfBtIWPCP2yvoFp5NjjYbcPL7XtvVmQj/9G6Pj7qHjrWhuKA==@linaro.org X-Google-Smtp-Source: AGHT+IF+E8T8wvogaE+a6CYSeMza+RSkQFJ/kZ13FZTW6pXM0mlCtSj+UCjLctdxV9dNb9EiuSHH X-Received: by 2002:a05:6122:4690:b0:518:773b:39f with SMTP id 71dfb90a1353d-518773b0536mr8233508e0c.4.1733844664342; Tue, 10 Dec 2024 07:31:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844664; cv=none; d=google.com; s=arc-20240605; b=GWxR2imbp913CAOUjNBlMZvV0xZwMbcLYAlL7+XI5yLk4OF4HpQh+psrCvlM5SEFDF Fx79/KHfI02P56eAvkb6ci3tXcJZgABURe05OQx6JjZFw2eq9rxepUfo7ZuvfU7HqwA0 NGh/EBjpDButnrR96jG99VEzEyhQvMuCml+1+UTjVqPTZ6/gU/GRhvNND+GliMZQbF/C H+ReO1IavTdLp8buk829lB4IWyoCzh5HTk/hRHtzuaHzGuIlPNxU6dTOriKD919Telhr cSqm97KHFtbJBsQn0AbuWMQrRUeB5kamAOZQROF0V7AhDhUtcDolV8ExvWQVW2iYjaol I6Eg== 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=zteI/mVwHb+YGRr0rE7ImI3elSxZb745PrjOakIAO0Y=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=gUsKinq+X1TAfoPKuBdv7b84Y+YmojkozMtit0qtB4cSGbZ9+i3SMBd3rVEbgyk5Ut 1pndVL8fI5XMGikBHDnsj8HFgt6IcFZaHO4/KvP2QcHg2Rs415vzj+JK7SoTmwKkv1GP hw6nlWJMlWq1MF4JokBNmICcOHEOEJCntEJIewKIA6ALm2uBYXkzztm13TCWcQltIKHf /UTLI/pXY86Fp1WeUjVcm7KlK1ZMGhZEfO6OVRZgTahaZFiPeL7sJTaFJgB5Jbarqofo msOJu/Gmn/K2sY5rnOAVugBSiWdxKNk92b5FmJKb0yRq0mB1c0L3YDSBNk+qeAfVB2NN 47Ig==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tDafcme4; 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-51606d17891si1939750e0c.189.2024.12.10.07.31.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:31:04 -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=tDafcme4; 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 1tL25z-0004E1-AB; Tue, 10 Dec 2024 10:24:19 -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 1tL25x-0004DF-G7 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:17 -0500 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL25w-0008JE-3f for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:17 -0500 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3eb34c20667so1371653b6e.0 for ; Tue, 10 Dec 2024 07:24:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844255; x=1734449055; 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=zteI/mVwHb+YGRr0rE7ImI3elSxZb745PrjOakIAO0Y=; b=tDafcme4R5JJp41LhMPGdX9TXyZzTSDDl/3uMJ6qmAFIloWFiF/H5IxCAAXgkm7s0Y XhUaS3g1b4z0haoJLAxGnOniV81nU1y/3sIkNrM0Fyy80MamjLF/q03igxmL2M63pU54 OlPgtipYrU1KKpSm5cCi9HnAOdbgwSgKpzByvBkzbuE1et4jDvsXZ+rI1uvAUZEk4w/z VPvyPagylWuCtXLYpaiCkCv3dGlgODMDHk6v2n1kQCL/+WKU8JrN+CURVm2PKp0M8kn7 dYcAPrWqhEGS3mnbvXQ6MAmMG30KQIgLYew0K1Lop30kOqrEgQoBI3l7R82pzIvxWfyo QyVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844255; x=1734449055; 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=zteI/mVwHb+YGRr0rE7ImI3elSxZb745PrjOakIAO0Y=; b=MUD1gZd3FWO+MiFvRH/adl+8Ay9/+PoBmF8tYt5/fOH+XIOO2hmJ4qc/sIJXHFq3jH FILZDAFrG+hMs2/z3raCVPlUQikBXf9UarK486xW4Sud/6Y93+0MA8+c70Znt2Be90IL +0A1imvtK8xDJNqf1WXUqCOs1FsOVDycSbM+hFjKaqQv9MnwHNM8Bq4QoQoIB/nFxzZQ ZlHVNrFKcWCArST2h2iomv9TnlVqQLJmcS+kUPgR5JuDVo2qB2ZYPsHfa77+MIONLp/+ 3gv0iZ9QFwOuf+DzUilVGfvZFG8v4pD2kfma0zvQ3uYeNtlrCOL9mtiTwWMhbwIQqyZB gm5A== X-Gm-Message-State: AOJu0Yzf9LGpaoKU8nromcyFi7+cOvcMePrw8lI2iC9lwQ6K7EcTaN/H HUZJlymwRt7v/99u7BKjlAMzsrdPtDRV4ac9QeBrIHrkeLaFCtrvcJPN9zR7rxANqxHH3H9xoIJ 9S+ONxNWw X-Gm-Gg: ASbGncs702NpE3R6oB/k9ekc6Jj8NKddyFUT931ySox5dxDc4nTR0joKpCImEVlHuqp Ud7YGXXFQnstEHJAxVFj+QG6HVFiryRQWYDgFVdk0DsfpCuEac0BpFg9vcyGgcdHpWGwd2VmbFm 2Jxn7mT0bw1nZphJAloDvLgAXX95DVdUgZnaaG6uqQUP7mr+nD/MeLFKbbKIFxvnQHxfN2mGCiz Rzfzup9ANh8Q8o2vSpRHGg3zu+JyYvwfJW3rTOTI/MYWup7Q66t8EhUEiZOlA== X-Received: by 2002:a05:6808:148d:b0:3eb:4681:a895 with SMTP id 5614622812f47-3eb4681acb2mr6984733b6e.7.1733844254877; Tue, 10 Dec 2024 07:24:14 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 05/46] tcg/optimize: Use finish_folding in fold_addsub2 Date: Tue, 10 Dec 2024 09:23:20 -0600 Message-ID: <20241210152401.1823648-6-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::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 3f2f351bae..135b14974f 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1292,7 +1292,7 @@ static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add) op->args[4] = arg_new_constant(ctx, bl); op->args[5] = arg_new_constant(ctx, bh); } - return false; + return finish_folding(ctx, op); } static bool fold_add2(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848746 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp383583wrn; Tue, 10 Dec 2024 07:24:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWvofU6o+rGbwD660rg+8hw3zUEpKhLW8WZ94QmdQDZx/iPvkqWCeTah/O7eM8hvzkCVFwkNg==@linaro.org X-Google-Smtp-Source: AGHT+IFKbIGaifWq+IBo766z+7kix0xx6MeWdK/Tnx96ifKQmzn6xpQqWRWNC3iSuadntDNIbArR X-Received: by 2002:a05:622a:14c:b0:466:b1a2:c03a with SMTP id d75a77b69052e-46734f702ffmr285394871cf.37.1733844291820; Tue, 10 Dec 2024 07:24:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844291; cv=none; d=google.com; s=arc-20240605; b=kpa8aBy1fPGkHvxiQ21gesFbmYxLdR+0/HyUr1OHp0tXcB558dB0vRPspcAhjPUcT8 4F2g1gUlaH+VaqkdiSyUPtdB9+xEXIL9NRMwJ0uCs7tlIUY6FjZYpRT20sBBvC6rICHW bVi891DNOM0MlgWbSfLR8bHagJ5lxzx1WQHYb41iyj3S6scdtS7EusDJlpfPsx/J74Q7 0wZTh03dw+c1f47raZlKLaDQpAGuqQdjpgwV40OjpeuPMwsJwB1nI9n2fUNA0YSYXZCZ f30W9Cfw8DMTYyzM43bCsdIhCcRZAFeIKv+KaXhhjP8uoogIQr8ofela/DrQp3b2waIj bLTw== 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=lgQ/ULVZFjj6+VNKWnPAdQtqhmA1FRoKCyM4IRm+CCM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=RsA+5UaHbtclImguZZFqgF8zlyzVXe2zxGFEENf4WCw9zO7s6y818SMSiEUnaCu/ZY aAPLbFeY2jN6cTafOia9jPgY9FDsw4d+05WXIPjVmGOFYPikabvl8x+oWfAc+obzbyrK neefEhY3p1JjvaqQM9PGn4Kzrj9ZY3jN+kLg65Z6xYH/S2tFd8ugi7Rpla0m12oWq/FJ B3vTAA8v5BFGXY3iofQelwBQLhIBaWHhFF8e/8ZXJzmjznCtZxIEfXXRBdA1zcCDYfRh nur+I2lSrjiHJv38/6nzuuQD7qcizBinxWHTk/SPI7UNj4/ddy6+pavT4sM4SWk5AQ2o 26Sw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qhg6f8ir; 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-46787377cf6si705871cf.105.2024.12.10.07.24.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:24:51 -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=Qhg6f8ir; 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 1tL260-0004EV-PV; Tue, 10 Dec 2024 10:24:20 -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 1tL25y-0004Dt-Mk for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:18 -0500 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL25x-0008JO-5O for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:18 -0500 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3eb7934a948so173422b6e.2 for ; Tue, 10 Dec 2024 07:24:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844256; x=1734449056; 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=lgQ/ULVZFjj6+VNKWnPAdQtqhmA1FRoKCyM4IRm+CCM=; b=Qhg6f8irf4BE345L/4Ib7wgA4bYiBrwrfuhKsMrmOUs3JC7gyWeki7w1Ns+v3wxz5L b3MNiMgVO10LzDEM+vk90N/4eOtG/GOZCGeeamn5bf9uWRW61lHE/6YRIPdVC8XKe6EW 2MCtLujLWrp+bjtQwsRaj5LgNo+Z9NZ/waq3gzFeh/W+ECSKlPpxuuaHz0Ir2rU/FHMS N7fWXx+MgwMOUF62NOWu88gZrGPHWAPj6IvEg47wQox41LbrHnuVX+jLeCpq81aTt7Ax C7T5XvwuTlx6uLgKNC8MwzchZsUIeNXoxkjtyEoY2ABy1MJaSUmdfhovuJdCZyoHclq5 nzRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844256; x=1734449056; 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=lgQ/ULVZFjj6+VNKWnPAdQtqhmA1FRoKCyM4IRm+CCM=; b=NbQ4dI19uvFGu1wW/QkGX0Z0FI0u3WW219coEyg+ZfkeK6PHwOuoVShCHR7VG2ciAo v1lfspKgtNDOevAUZ7Zxtd7ZGgQy6ucHAntekMildQewn+hlm91N+67pEeUSFNR9QLfm uO0LlNFAS1oNLSoW879Yy+PnfZVZ/kuF1cUoM95O+1voIUnc8b6dEACiFiRI0b8Z10FQ MZr+T1CeY4UmYPI6eE6MKAQUq9Sx4gK8kn/VpNSMJdcpMNBFifdBeupLweAg9ZYz7HD1 5wcjgIT50Fvo7fEAw1MLBLZ2vatPssP0PF9Eeq4m/Puk3CqsQz9DccFJw/g2XTfoJYvL w2wQ== X-Gm-Message-State: AOJu0YzEkpUAJKi37gwrN9kjGZ+PFol71MTnX4iOJ0JychLxTLwUewOK zzc7rRuOjdpFSOHK+K+OD0Vf2qkWi0Oj3FYOO7OrThP6lFiD/LGShebKpv8jzwbyTLSKxCB8TI9 kKH3dnHdt X-Gm-Gg: ASbGncs4hKukS2Jk3RktkIsB8Z+JjU6NwSY/0wXr8Nq4a0CMOI0bx8/ziL6r3xnXqCB IzOralO/FXztnPwkdv0nZN74IAXKefYZqUfmmc6Copfr2TWKXHj13942Ay6eiz7tQ4lDET4AW3I JPvcvbl9AxaL7O4Lny5mFzmY0s9LrD01IihiZHbncQ1+RRuwApXxdMHfglCcqdxZ55UfFAALowJ c8yFS8Zuws7u1D+k98Ccm1FaizdLwv9R3djy45NF3Tvl498fd1aGAodXpTHyA== X-Received: by 2002:a05:6808:10d0:b0:3eb:6af4:e644 with SMTP id 5614622812f47-3eb6af56c9fmr2522077b6e.16.1733844256092; Tue, 10 Dec 2024 07:24:16 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 06/46] tcg/optimize: Use fold_masks_zsa in fold_and Date: Tue, 10 Dec 2024 09:23:21 -0600 Message-ID: <20241210152401.1823648-7-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::236; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x236.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. Signed-off-by: Richard Henderson --- tcg/optimize.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 135b14974f..000ac0f810 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1306,7 +1306,7 @@ static bool fold_add2(OptContext *ctx, TCGOp *op) static bool fold_and(OptContext *ctx, TCGOp *op) { - uint64_t z1, z2; + uint64_t z1, z2, z_mask, s_mask, a_mask = -1; if (fold_const2_commutative(ctx, op) || fold_xi_to_i(ctx, op, 0) || @@ -1317,24 +1317,24 @@ static bool fold_and(OptContext *ctx, TCGOp *op) z1 = arg_info(op->args[1])->z_mask; z2 = arg_info(op->args[2])->z_mask; - ctx->z_mask = z1 & z2; + z_mask = z1 & z2; /* * Sign repetitions are perforce all identical, whether they are 1 or 0. * Bitwise operations preserve the relative quantity of the repetitions. */ - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; /* * Known-zeros does not imply known-ones. Therefore unless * arg2 is constant, we can't infer affected bits from it. */ if (arg_is_const(op->args[2])) { - ctx->a_mask = z1 & ~z2; + a_mask = z1 & ~z2; } - return fold_masks(ctx, op); + return fold_masks_zsa(ctx, op, z_mask, s_mask, a_mask); } static bool fold_andc(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848774 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp386389wrn; Tue, 10 Dec 2024 07:30:11 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVURsVYd2pFGHPQ4vWlmWw3pz4A+jNfOp/FXddyxHTtGFtNcB+ERnGq8n1ZSBUvd/P2Vo5zzA==@linaro.org X-Google-Smtp-Source: AGHT+IFEqsMYU4kYmr9cYzm3W4BTV02CkTtwWQdw6mkScINwq9ZSRhPSf5Fj3ymnM/1gSzHFNdwx X-Received: by 2002:a05:620a:1a1f:b0:7b6:cfa3:c685 with SMTP id af79cd13be357-7b6dce5aa7emr755728385a.23.1733844611336; Tue, 10 Dec 2024 07:30:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844611; cv=none; d=google.com; s=arc-20240605; b=BUoPI/kyNpJZRgooIcPIRIIgjd6YpJs1maaLP2yGxuHQpONYVW7y/X2wm+hSgJBHzY q9b5YCm0tlN2vf+BXfsWMDVTooqQXqOA3yQ7Gct3p2xjbC7psFszFhwtYjMOH9vgF6vo osnZ4i61xW4Yms8yIdnM1DievclaBri7xRg7LxOBWOq+qLa6k/loBiKQEZYklsu4Vxo2 WYVUTz5qpPGSLqBZcRsDO0r/KUoSplOWn8Y7wf963F5wXaqX4xn/b730rV6WDouXVC4H E8yxQu1lny6xuHVdwkNkK5bN6dIwLfz2kluf3JgBxyxzVpOnLfTsoNs1dUF0EVAayT7a a2Eg== 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=SXs3m28ycLQmx8xtZpOjbDlN5Q+uFA8LPLB8ut2EK6k=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=lTtwmeCUYfhWC2I/cwrwmMgt1C447V/hkkwHc7M3zuBemRK6v4YerT/ea2d0G0o5Ga /7tWdjwzXwJ32p/lBw5FiicEWh6JDFunotF4wkIKBXWx+J1W51ioAroDCrvN4PtIAgKC fNzrrIhUWFxI+LkATqqYSk9/6R2pcUqcOHQN6FJCYORrDNSwSCynrIh5vpDL1y6BgxYB Vc1xBPlDmmRwh+WqtOV4tutlJ23UcGf6Jsux4bohgpdkmMGe7bZ0f4+ljHAC7vxrGNwd 1Z2IMibA7YS0VWqk6ZY2Wxil4uViYGfl4NgrfSoTfqmEIWuC4cOytBiVCbSVG/fklONa aQ7A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pOpecITT; 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-7b6d28b679fsi623559885a.18.2024.12.10.07.30.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:30:11 -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=pOpecITT; 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 1tL261-0004FA-MQ; Tue, 10 Dec 2024 10:24: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 1tL25z-0004EG-Q5 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:19 -0500 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL25y-0008Jd-EL for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:19 -0500 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3eb6dc3e850so279455b6e.3 for ; Tue, 10 Dec 2024 07:24:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844257; x=1734449057; 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=SXs3m28ycLQmx8xtZpOjbDlN5Q+uFA8LPLB8ut2EK6k=; b=pOpecITT4smQ8bcNCSYUy+5/pMdpqy4O7EQXA/hmUxZzRrWJdVIwgBSrt+77VRJWrb u2WDF8rYOs2DH+zLzUj+h5cspKmmlAwZv83fyx8eSf937b/cY87yVJV5p4a/J9M+HO/4 e7583Pwy8VSXJ0wYvlNDCtP0Yv33S15lJJANh9Xmctw1s5Tvrh/8KmWLjbpFJscAT9uX UV1alZsjKQuOEILhF0BnB5GrV3Qz2wAfCwjCzw1yzRrpLYPDylgb/TicVKG70zRNpd7z EHgW1l0+4TGluAnECkMhggGGf4hNuCN+S4vevgCObkK2DYJSDkSXHJd/taW9gj1j+zqw otEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844257; x=1734449057; 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=SXs3m28ycLQmx8xtZpOjbDlN5Q+uFA8LPLB8ut2EK6k=; b=aPTn8mkTxGFSC36VF41xDE8OzfYTg31qEqqqbMRzc+RRMK1EmN2xoyqoN9TNDK0rmn YHDLYhlgJ9tSQXv2BDA7AVi3Ths+59RLt7NtJnAL+PRz4rT9bs8hbffKqz0JRR/VKOyH CoRYQU6D32rlOJFFHHkUamoKSHXHuSiRN5uv55w5K7gBy8WQ8Z0HeXriWwe4cxjQZgNW SP+bOKw1AAqJtgx3JjIJ1vb6SVd/UKaX/N88XxKZQSES/nqlOlFGd+ONl9xkSj1/vqbC DH+BVkTcd5jX+VZXLyyiUM/cwJ06ZXeVGyyKdvbB6B0qU7CXWvJtAlksBlG9sfMmFg4l 12vA== X-Gm-Message-State: AOJu0YySM5OGqCDN04F/vnI1zyDQUeOdS4fN8FTs9xfOSyOUbZ07vrv1 RlYK0Dnj7+erIM9V5lsKWeB/KNp4Oc23HoEC4BX+3cG4tajRg6OXXLxvI+PXjLHvu+tWQfFHItB 3qXtw0USE X-Gm-Gg: ASbGncsT0TREBp6SLXnZcmSqrBEjdcf7BBbu2VKOYQTr9di9Cb68TXoeWXOWHxmo6ft ZzozJ1zuR7v1UoHv/gnEtUqz8TSYsfIR24JIvGoVqP19YID0zCp/wJIpbS0sN08vbFAFK4rqJqz bMYW0Kd2yXmJtgad8lG14zZBUzEQu2W0bEY4QNohz9fzzg1NTwJ6oIRmutipjfmOzgUAz/NEZj9 g1YdEjnd+LF6BCg8MShR0iXwp8LcpUOpro27anSGfTg7R8Jh8rY5p7YztFwdQ== X-Received: by 2002:a05:6808:bc5:b0:3eb:5fbf:1b98 with SMTP id 5614622812f47-3eb66dea1e3mr3785561b6e.10.1733844257365; Tue, 10 Dec 2024 07:24:17 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 07/46] tcg/optimize: Use fold_masks_zsa in fold_andc Date: Tue, 10 Dec 2024 09:23:22 -0600 Message-ID: <20241210152401.1823648-8-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::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 000ac0f810..285407ce05 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1339,7 +1339,7 @@ static bool fold_and(OptContext *ctx, TCGOp *op) static bool fold_andc(OptContext *ctx, TCGOp *op) { - uint64_t z1; + uint64_t z_mask, s_mask, a_mask = -1; if (fold_const2(ctx, op) || fold_xx_to_i(ctx, op, 0) || @@ -1348,7 +1348,7 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) return true; } - z1 = arg_info(op->args[1])->z_mask; + z_mask = arg_info(op->args[1])->z_mask; /* * Known-zeros does not imply known-ones. Therefore unless @@ -1356,14 +1356,13 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) */ if (arg_is_const(op->args[2])) { uint64_t z2 = ~arg_info(op->args[2])->z_mask; - ctx->a_mask = z1 & ~z2; - z1 &= z2; + a_mask = z_mask & ~z2; + z_mask &= z2; } - ctx->z_mask = z1; - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks(ctx, op); + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_zsa(ctx, op, z_mask, s_mask, a_mask); } static bool fold_brcond(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848755 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384518wrn; Tue, 10 Dec 2024 07:26:37 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUunM0uDInf4gvM4mchKJ2qhY45eYAeIjtcBLPz2FkeDOugpUjb53q5hfuce5Ap4vot23SgRw==@linaro.org X-Google-Smtp-Source: AGHT+IE/9jtfjfQhvpsjkPfJcgaQQDfdQBngXevWqlVMK6p6Bffsxbgrym1/7vhXVa9LjIhW+0cB X-Received: by 2002:a05:620a:440b:b0:7b6:d4a2:f123 with SMTP id af79cd13be357-7b6dcdcd7b3mr624023285a.2.1733844397383; Tue, 10 Dec 2024 07:26:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844397; cv=none; d=google.com; s=arc-20240605; b=eC9eW1bbb83AYHLYQHRGFT99EHQFfRXbu3sSqLFCUjlIMkxq7JqVB8gdeb8jzm69rg PU0eo0BCb5N2hdBxly0q90emcn8NxpHYeXgLTeWkUYjw+G9hCfpj/OAnlX5mw+0rjs5e u1iTmSYZKIhiDksX6zCphwoewlhje4wuonfVWx6anPyJ2lQrvHXZa9p8ayfSJ8aG6Zmy 6A9FwQIk6I8Kf3dzCdGcArBeUhDpDl1Fj8nNqTO5HOvGqNAYGlJSR7htBI9icwEOoVv1 TvjLEeuEmxwo525CncKXbBv+pMBEab5NYswKtOv1sVWE1ZenbqpIi+x7NHMxwGK8r3e4 i14A== 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=DUjGCZ5mCdzrBbJa2b2l0l6Tf6jf+A6xYUuc6RIjhKk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=bDd2VTE0jON0DhNLsx+CKz84lG2PI4HPWHWstXgoe900XXjA2Fl0C+Gq7iiN6InuNw 7WO4Wr62HhzFuc6pacOTodMZN8Hx+wKu6sErLVI26lFSQpU/zllYLlMQLH33gRukuJqq AQ4eARDbpVXR4YlGzWrB5m2CJPxav7Yai4kEiNrWnN57pOAtT5Whrgj9uptdEd9Wxd9r cVexJWkznQBYQ2uv5wdQhH8b8LvR6W0lRKUZbmsL8raqaJq8rAZ8bcMH0FM6+GB2YxYq wipTCvPm+Jny57AKZPDtW+LeD06YCHGhuxv/om4eN9jnvV34Cb9I+nX3uXv404ja91c2 h/SA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="fCyD/EoR"; 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-7b6e5d04d50si104199285a.59.2024.12.10.07.26.37 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:26:37 -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="fCyD/EoR"; 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 1tL262-0004FM-PS; Tue, 10 Dec 2024 10:24:22 -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 1tL261-0004Em-3C for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:21 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL25z-0008Jo-M3 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:20 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3eb441c2f28so648719b6e.2 for ; Tue, 10 Dec 2024 07:24:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844258; x=1734449058; 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=DUjGCZ5mCdzrBbJa2b2l0l6Tf6jf+A6xYUuc6RIjhKk=; b=fCyD/EoRR7L97EzEY0B47sZyNJAyxqFubaGDa0uog7Ji7ON9cFtPPEf/R3uZsdbiBu OvvF192hGh/coOS1dekPtR4Bsaqr+XriQCjU2qbv5RxiPe4eF89guAvjL7qGdKeTVTg1 ooSeOMbX23gl3ReTpPUaJkzd8WxTzH1VfwpREzwEcYjimCuU5Z1P54Gu/sbY6Wka+gao /F8XJuSfEuaJAZjTDHLRD0BYVmt/Pdu1vinYWU2ZBh4Q6AaNSwfUxjt456enCb8ZqbIP 6aMqNirgz3cD+x7WZeJ6TcT8a7dHXs7zvnmxU/ZzVAbeln9Yo44VztRSYMaKxzs8YrMD 3pUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844258; x=1734449058; 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=DUjGCZ5mCdzrBbJa2b2l0l6Tf6jf+A6xYUuc6RIjhKk=; b=LfKz6FIJCxpaCwLV/ZezPn3JFc4gJg7KEERwEC206eC3RvO1Rhho7Eb6mahQLNBOfB lS+Vb6k04Ht998IErzvBmHA1Vdg/dGJugyhwfUbi2zalvdJyHH0c4RRsOezh56gjKYdx e1Ka8KNXvEtSCs8vx4ICmhVpab92U85hwo7AMxK1tDQUg4ZspKmcr2RHv7kp+awOI8oo CnJ3ZSD09duGCymDe72uvFbuBeNX8q4FlYqPyOpYRAfKpE3YFkMr0dTquIeMsQTwhcRb d2KRFFpBgEywSvgp71PpXVcKgYOvcMD3Y96BG1v2MkFTocNxmZFpKME7yflRrYQP4ykZ 68wQ== X-Gm-Message-State: AOJu0YxOQi2rLfjgx/czPZj3Gn420ub5ZUB/oNKoYvvESg1LFTT1EGd7 AkckzWRusVXDbEPinXK6BaoSUTjVnk8HQ0QC6iTdmdTQG6OxQvwrCJETnbtK1+pw+lNk5cpGFaI ilXAb+pJW X-Gm-Gg: ASbGncv+3Lu/osI0wcFwXAoYVjRJIbIrK13agL3WllQCG6CEVocswGFk7z3zRwdHdTM f2Z+m8WNGhJaCc2xfcPMzrAphv4mp4KXp4LyIrj9lMHvrun0eGS9XsCpcnf+dklC5xzPOcz8wVP lJKsjGmpqVep6xuQQwMSaBDlYouR8B3EiWrKd2hkCGC1VKZrE2G0VUfuEpmF8GszLN9wM3Lqxil YWAx4qobs4v8Qam7lWbBTwkF52hviXTI28gJtWbzpqLaje8TcP/YVU61Im0Fw== X-Received: by 2002:a05:6808:3b4:b0:3eb:7973:111a with SMTP id 5614622812f47-3eb797311efmr754187b6e.40.1733844258478; Tue, 10 Dec 2024 07:24:18 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 08/46] tcg/optimize: Use fold_masks_zs in fold_bswap Date: Tue, 10 Dec 2024 09:23:23 -0600 Message-ID: <20241210152401.1823648-9-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::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 285407ce05..3363ebd48c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1082,7 +1082,6 @@ static bool fold_masks_zsa(OptContext *ctx, TCGOp *op, uint64_t z_mask, return true; } -__attribute__((unused)) static bool fold_masks_zs(OptContext *ctx, TCGOp *op, uint64_t z_mask, uint64_t s_mask) { @@ -1528,10 +1527,8 @@ static bool fold_bswap(OptContext *ctx, TCGOp *op) s_mask = 0; break; } - ctx->z_mask = z_mask; - ctx->s_mask = s_mask; - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_call(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848777 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387316wrn; Tue, 10 Dec 2024 07:31:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVIelus9uTxaDbCKSIwKWpAtBU8cRkQuBUw7Lx421yfd4BvSJVF3Q6LT+2N5xaG2dU+gIN1Dw==@linaro.org X-Google-Smtp-Source: AGHT+IEv18pA5byytonybVuiGc2sAY+lE9O0zHer6+rk6elRBsK5rsy0tkMtpESvMTYaXmfcqS1C X-Received: by 2002:a05:6214:20e8:b0:6d8:7cdf:a4ed with SMTP id 6a1803df08f44-6d91e470516mr79998826d6.49.1733844688836; Tue, 10 Dec 2024 07:31:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844688; cv=none; d=google.com; s=arc-20240605; b=hlkyhVVm/vYc42Z4VqGs47wmt6AyjO9NC5e8hR32qfRd7Xx1/DnBPzNDEFFc0ojgae 6+MXnaSplBlx9EG9AdEKTkmMv4qziQOEvjcgIRLSVCdT9x2D7Ayud6qNk3YHADYKSMBk Nkb8B3TX8K7wcdhRkZDRQYtbZzxkhXqEDnXYKZeXLb3Ac9ByyhvslpDJXWJlZgpaNtYc kGdVTysmC0BaCIOkcDoiwVl/sxP9SOgG9qe1EfgXpuUkwkFMHIan5DhxrjD/ETz84EUE xsxbdruz5flBbp8W/Lwp+PyBP9A7wYNh2Ix2npgv0mP2S2QMa3qxINTSVtl3Qx7SJc3k Q1fw== 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=4YBmpSdInFRyiSQAIBGpD3jWrB1OjvXqUyp17I9peK8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=CbdcKDM7EFAppCBQk/q6+HzDPbXm7sUbH/aj8cdBTYbp9cehNCtX+KDT1cX9BjhMk6 LX/eSpqU5HBsabGMp/OhCUVncP8IQYtOamhoQBnIPZm+/uuFBzfL5hrkSGVhJXxjumPG yxD/NgC7vzcjK7tDDwkYDTKHQUwXV2wNEgi9CFBrvAd/MAmKtqhWOAp5Oyg1oPurucT7 OzlHBA3vj+6LHO2YV4B5uyKFY0Un7lXpQwrkh+rQIp5BaVhF3pTF0J8I1DYwpbPya286 J6pZRN81hrZ+Ymxozc0Ndonm3YQxyVbAjYKC4hHGcYvpMQeMRgBWrv7sMBcbkk/QK+bR DxJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NfocZI5C; 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-7b6cbad7afdsi339663185a.672.2024.12.10.07.31.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:31:28 -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=NfocZI5C; 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 1tL264-0004Fo-Bf; Tue, 10 Dec 2024 10:24:24 -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 1tL262-0004FD-9Q for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:22 -0500 Received: from mail-oi1-x233.google.com ([2607:f8b0:4864:20::233]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL260-0008Jy-PL for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:21 -0500 Received: by mail-oi1-x233.google.com with SMTP id 5614622812f47-3eb5ac06111so1062855b6e.2 for ; Tue, 10 Dec 2024 07:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844260; x=1734449060; 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=4YBmpSdInFRyiSQAIBGpD3jWrB1OjvXqUyp17I9peK8=; b=NfocZI5CtR13hW0edQ6piERUB9mCSI9aOWdAs9Jys3bpLHf9UyRpoEB1fHnez68fSs pdVRrcTRvdD+IJuHY8iMRF7Enwqy534LUmAn3ZYACgbD+b50q7yx2yeOZFB4do9pHAsl P3fnb3dYTGgJb1v7ilHoPgjZ6tpCo/yslQUypGRdQNi21o6gwqqipwj/fNxL7MSZ0qq/ bg1EIWp722NbehXrg1FNbdQ/kX3v34ra/2RogAWhZTLN5mbTyOwLdNTyI4yQ7SwDJtqn JYY/uwxCnvSODk49g68kfPtdDXUeALknm+K6CQBC8vizIKupmCDx2+5IRqEal4JjFeHE Mzpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844260; x=1734449060; 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=4YBmpSdInFRyiSQAIBGpD3jWrB1OjvXqUyp17I9peK8=; b=iRgXqrY9WrgDYy1eXXq35offZD9wo2p47EJD9zUxajHs7AriVJLTxVFOn1FoyEgIRp IpbFR2mA2I0XLVWeQwN74TtQG8f7V5yuHldVIExO51nMwix9QFOeW3n53kRyK5MQ3Y2C PG626Sj833CLNX475T/Qy0FZek7WTFuKcwU098/cIvSdXHgW8YnIqCq2Ui69nDINnAzM wpFOLOs3bLRMH3ZBVU80RJeTQXCSnc+nU/jof3e6QcDVQ3MosqoGOHaAk6p1gqFPI8QM V6BNxuZtouuzEfdGnt6w3NdQA8j2dmwNYzHg/j1yJNfGvUfOdM9EkB1qAI51Ylb6tN+u xI9g== X-Gm-Message-State: AOJu0YwLZS8fEFuigO4E2WKayDoNsu2CEfOOqHzQpKhoJ27PirYNK4Gf abxHaZvtuHrctFgRz1wxHhBRRep5t/bTCS744Rs3aqwYhD/KMK8+8aV5kii//xIP/yNfvOLYnIu isOXzjgOL X-Gm-Gg: ASbGncstPiaZPZADIhXm8VxXdYF3ywXuR6jrgHtPIsxpXRjAROMZRDxK/OXPj/7dRvN jU+IwfO2B1UlVoqSf/kjj3jk9bKb0JlR3WvU/axIuO2baUpqMXCL8pST7FZC9VqCfhBUcH28b2F jgGi51tiRJdSBhS4tfywiYUoEVrnrEbrVCS1pv6ls2lrtz+DyUQHru+EQbCv7AozmoDn0L1yRgL gONiGg3nKGdEEhea2t5XHJHznLN8Uz8rH2Ry5D7VPbM9TfBoAdQFRTSu+nlwA== X-Received: by 2002:a05:6808:192a:b0:3e6:402:d228 with SMTP id 5614622812f47-3eb66de9f97mr4103839b6e.13.1733844259694; Tue, 10 Dec 2024 07:24:19 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/46] tcg/optimize: Use fold_masks_z in fold_count_zeros Date: Tue, 10 Dec 2024 09:23:24 -0600 Message-ID: <20241210152401.1823648-10-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::233; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x233.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 | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 3363ebd48c..c97ec10989 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1088,7 +1088,6 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, return fold_masks_zsa(ctx, op, z_mask, s_mask, -1); } -__attribute__((unused)) static bool fold_masks_z(OptContext *ctx, TCGOp *op, uint64_t z_mask) { return fold_masks_zsa(ctx, op, z_mask, smask_from_zmask(z_mask), -1); @@ -1592,9 +1591,9 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op) default: g_assert_not_reached(); } - ctx->z_mask = arg_info(op->args[2])->z_mask | z_mask; - ctx->s_mask = smask_from_zmask(ctx->z_mask); - return false; + z_mask |= arg_info(op->args[2])->z_mask; + + return fold_masks_z(ctx, op, z_mask); } static bool fold_ctpop(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848753 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384479wrn; Tue, 10 Dec 2024 07:26:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVEB49Aa+fbgZxje8YZXQkhMX6YK7mDKuVJZjhqgGvjJf82iJi79WlpIuKXg8PTMJatmuRmFA==@linaro.org X-Google-Smtp-Source: AGHT+IHcgh0ulvD7yM5S9MaggSY32xwwQ1dJhAn3C36Zsku2o76Tq+86O9v92caTvDWGkjLc1tQJ X-Received: by 2002:ad4:5be5:0:b0:6d8:99cf:d2e3 with SMTP id 6a1803df08f44-6d91e33af74mr87464236d6.22.1733844392695; Tue, 10 Dec 2024 07:26:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844392; cv=none; d=google.com; s=arc-20240605; b=CPRMo8prwxBy4yoUuoC2ouogi9r13UYskXuEX6q9dPsuyEh6vjylou7sKUh7CX8OBw ZKsZvetD/QWoUt9H04FWE+S6c/W2dsMX4eZ994EckgVgPnSzzRBUY3dFNhY0YK+28gLj QTAYLMXGOb6KaMtVBnRd37BMr1wlnjZLUE/VUFfTUNJ5QVUD/thkOTfEHZ0uUnUYmxEe 6da9OdEwI9QTB6JkszPeBjTGpF6xmQaJZnbEF4fmp/B8b8/k0i/jrSIBwGFvaYZuQGeA I5hE68AT3AjcfA4vmM53rs6s774PmPMwMW5yLvbM2qtoVWSzdHoE1qCwMAMMc7kCqOlz RGzQ== 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=2d60TSxsDICwowDfmunBt9iG+mRRxpu7LB3Cj2n+HL4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=QWufalw/Jj9w9cOAkAyeOF0KAPsQOR6rWYlLyFnfhm91EiyrKsOafWNBTUXYnA1d8U hHrRWFpW7kse6XaFVt7mhOt1qpN7mRwJXCPSkg/CkkPtPlTUD/E18DKNAahFD88AgbwF m7Tta9x1N0UxgKBtVu4CIWANM1VfWN46eId6nbOqRio4zcnX9CMAeg9hCuSxKK5Honeb WAFhZJkMPTaGCeSm82JWeV77zgIcoE4t1dngPDAnDP051YPzXbC3XYeVFp9Drm59O7DW HFEQqvI2MDLHEYCfAa1D6NkorsUwdc3ysSdQWk4tvFcy6x5eLjh1vDAqoFAHS4ol8Ymp scKQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AtT//ihA"; 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 6a1803df08f44-6d8dac0984fsi146985036d6.302.2024.12.10.07.26.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:26:32 -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="AtT//ihA"; 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 1tL265-0004GV-Ag; Tue, 10 Dec 2024 10:24:25 -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 1tL263-0004Fd-PG for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:23 -0500 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL262-0008KA-Av for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:23 -0500 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3eb551be83cso640350b6e.2 for ; Tue, 10 Dec 2024 07:24:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844261; x=1734449061; 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=2d60TSxsDICwowDfmunBt9iG+mRRxpu7LB3Cj2n+HL4=; b=AtT//ihAuDr+uzAJ6f6xC7tVtMcm0ip5xzMNLBzjlQm8mo1EpmV/GvyEG5SwLjUGci LwKCVIpYp+xrYlsNxINGyUuVBXiDf54yzX8GcZIvoPM63Fl7zdlPACRebeE9z38WeraC Msi8XdeWop0FIQtIrwo44BBvX/G4I0kEKh4qqmfH0G1QtoW7sW5BInAXwXCIU49LvJGw PG/C4/8vMOnoKYNoVpyJ5Sf87gwS5QQC+SHunORK7H6XU9TtmkAtlq+mvF7xKkg4WPF+ PaO+B8NCsKkQ+qRQwagxU+NOJ060gVwlZ1OZoUTdhIqtRIDjZn+KRsxpxRjvk7YCcN6C cwkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844261; x=1734449061; 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=2d60TSxsDICwowDfmunBt9iG+mRRxpu7LB3Cj2n+HL4=; b=sc9tq9/+Dr/RmwfoclRAra4zjVTjSjKvcPGKMWQc97c4al+QoXcVlGYsJ1A126zIk6 5Ac7bqr/6jSoNbDjpIJA4t/7odlM3VEwUy56UdwD56R5qaOfxUsodcdJDUJxrih7u+2n /5QVAmQpmpgzO2DWUw8BXlhSbV3GJzOWWd8Hi0ZCNa7Z+WHhfxVThMkCkogarUC/BDJH U5og7Koxd6/1yH7VugbsS/yb4YmwFRhJAuk0SMHQRSxBBgIghq2IgiOfw2FkhrnYxT6z ASU9XhSwJXlAUDTN3Djo+RP6sF58YJ/nCF00LLhJBYeogCSX5W1Z8o6904DOdeHJNb+a 6V/A== X-Gm-Message-State: AOJu0YyMYeVQqmrGh6pzylz3tmjWZffs3sxuGE8lvg0BLHSHEoceSerT uNWlULjF23GmRvAb4lvq6BMLtQactIcNHXCDtl3Zi6rOf4VQcwOiS/VgS5KEWIzeh6wREtr/05s PYaX6/RZt X-Gm-Gg: ASbGncsTvAoadJ62UsjBJPHT/GsfbNU+gfRRMhE/TzAtm+Q6Nb+inzxikKXZxZ9XaCj +ix/huM+B1H1M9K/FuXqTdnsMuxcWSmFEETyeN1G9MzHPOMleYjwTHMZkuw3+5yEwn4e/6tmxa8 syEQezp5pzFGCANJV2fS+gyJdr8Dz7dLwDfukvCrgizohJHny0LZzZI+RddgAf9ehBxINWr+cyS XJ2YWV8mERdf8taaMFmJGIDWqNV3+ZDb1UWw+xNb0uVUdtImzcj3T1CBI1LVA== X-Received: by 2002:a05:6808:1316:b0:3eb:575e:3eaf with SMTP id 5614622812f47-3eb66e13ea1mr4002235b6e.19.1733844261059; Tue, 10 Dec 2024 07:24:21 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 10/46] tcg/optimize: Use fold_masks_z in fold_ctpop Date: Tue, 10 Dec 2024 09:23:25 -0600 Message-ID: <20241210152401.1823648-11-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::22b; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22b.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, 5 insertions(+), 4 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c97ec10989..424ed7674d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1598,22 +1598,23 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op) static bool fold_ctpop(OptContext *ctx, TCGOp *op) { + uint64_t z_mask; + if (fold_const1(ctx, op)) { return true; } switch (ctx->type) { case TCG_TYPE_I32: - ctx->z_mask = 32 | 31; + z_mask = 32 | 31; break; case TCG_TYPE_I64: - ctx->z_mask = 64 | 63; + z_mask = 64 | 63; break; default: g_assert_not_reached(); } - ctx->s_mask = smask_from_zmask(ctx->z_mask); - return false; + return fold_masks_z(ctx, op, z_mask); } static bool fold_deposit(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848769 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp386167wrn; Tue, 10 Dec 2024 07:29:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUHAOS90XF3MUpST4qdFtiL8VR7oIO0Oc99V7B2AKh8YlBOsgqc2ZPz1Z98TAeMIXu89Nb51Q==@linaro.org X-Google-Smtp-Source: AGHT+IGyX2xlKme9tDCIkmZWDuZadYFnwS0QPqs/O2fDpw5xHK7vS8fFcSuGB/9Zvb4vFDt55qC4 X-Received: by 2002:ac8:5a11:0:b0:466:b1d8:96e8 with SMTP id d75a77b69052e-46734d4ab5emr299210201cf.33.1733844592384; Tue, 10 Dec 2024 07:29:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844592; cv=none; d=google.com; s=arc-20240605; b=WxksKnDxa0nOlKsTAc59RGNQ5OhLm6AwUHWSTM8ZMBGCjmPEfqzETRXNN7ekO8Lqr5 t82NRxD3rAWpNglnA5ltej3ns0yXTsostAHwaK4BjOvK/6mnSq1umFRbtl5ZfacxVped v7DGI77+1UqoO3syzVDIgCyhoYHIurohlV3n9fLfKCdfkXFW8TwhaLi1eZRtcA0+k3eU pWWvMH9rIpRSZcovfIMr9/ZVs9UEUZm0ziMQPTMhsQjqQgCAqpYbn8Rocc5FJiek0Bdc FMKadneHUUPBXoWlOjJie66dD/xpa59X1PXKLBp1ti03PPK/ACd1irDOszJYW2ZFskCl qQpQ== 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=jxlQMNQObfmK2RVW7iMpz96pfHl/dvmXgPnDGNhRgT4=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=XeCWGWOf2ltoMhuqolcw4nFpWSP9jaLOrn8x+W7+P9WeB+nu1bEFg1zSIfbFEy3GlY FGf0jFhSNkA66h4tf/JMy3zspsg1r5ZKWzY3RWd7AgKv8SH6YE+IZwt98x/pUR7RJCgl gWItOEM8zdeSFEo98BV1tcd5bJ8bkv2uQB2TIinF+4V0apMbuKusF0nbHuFbe1lrXbve /MEx3tnzHHbghizACTa7jVjplzQYpHZQgWCWD67LcWAnP/o8P1Ce5iXgKpIWActP6yr/ 0TBU3LZCJeKGatSla46LvazZYRjFtdua3XkmKrC//B7nVr58Ouvt1GdFtF2WQ29+Y/Mm Jh+A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aCA2sAHs; 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-4674328e4b8si95505481cf.204.2024.12.10.07.29.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:29:52 -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=aCA2sAHs; 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 1tL26E-0004IF-9X; Tue, 10 Dec 2024 10:24:34 -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 1tL267-0004Gq-Sw for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:29 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL263-0008KN-Ix for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:27 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3eb4da24f3bso1156722b6e.1 for ; Tue, 10 Dec 2024 07:24:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844262; x=1734449062; 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=jxlQMNQObfmK2RVW7iMpz96pfHl/dvmXgPnDGNhRgT4=; b=aCA2sAHsbZ5q0E6FYr7IAJVS/5BCaGawdrBUN5Lj8Fc2+4fUrCXgHEIL8RWelF2lxE lGY8rdsu4aEeOMnSCpyoUG6MgIh+ydy8WQ9PNXUBUiH9mTOwL/CmwmjWotgAfOhk+/b3 rnkbt6rEhHbYpHVTpg2dBYfYJ5ngc/UdpGMPbef6tD03H5mBGVRpEjhVBhgF38hTLAg3 2edJ2FiTs6VbqdqnFw5YKEcgQfvZzXAsrz056jWg8uW3mKBhyYrq+4yBEYU2IiznQtFV PS/uLMBQVSYDtRxZRAJJwcBcQPh1ViiV/N2oijnFt4JInDPDgmt4ataMpfH8eqngOMeK bIAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844262; x=1734449062; 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=jxlQMNQObfmK2RVW7iMpz96pfHl/dvmXgPnDGNhRgT4=; b=Y53uBYeNUAYPQwJbjPkqc02AQaQeZpEcGiA0vGkGRCIAsI9Bp67gps4e2LAYLFU8SF 2EvnK539UXMG5xS6rcUj8/cFhfFe5bKWeK1KIBIvlgFgA7Gnxq9dc1DTENlZXAKOJXbE F/LgTGo0lrMOwjQalVTttgeRhvMly83ZI02VgAJllsGMTnrls7D23QME02hQy9EdykRU suiPZgOYrJ/ITOApqwmhm1vWdivxqLL7qO6VhVV7C+J5XcfiN+pYlNQ4EiDycZfVXmO8 pWFY1yQrOkf0IMy8sSufv9MV6ngfUvXJgdhYdqJnDDTjuWJtSyE/Nrh+k85q9/L7HwaY HQbQ== X-Gm-Message-State: AOJu0YxpnzKrz5tFUII0tIVBCJQ68B+VPlQEuPOfrDwV79jB0yGMIo/b KL4Ad/eZFjWnDk0GC5LP9uQXsrQwyfDBaZeFhrQZF3/fdPqHsKflxHnvqWlhUgw/g8RLgEMdY1F AJ5IqWFUK X-Gm-Gg: ASbGncv5AA5k/zc0HBdj0KoR5nqFk30JB3g/O/xtL4sfh1kPTEf4JgKvboXQqtPtDur Ee6OcVBCsB/Jpddmr/ekX/ooOpuK1p6D8Sa3UZ+FcBzwyEf8acCboCx/Ipr3d60aKSUeonycKTZ 0OhB0TWw4/f27HUcZYFcXCpuJVC9mTWGqStyZpkPLYzLEXxeBbXJUdEsQiZ96Ni2weJ0OS+1FOp DHErp/i6DRSI7ZeUCe6swUL0TrRDEmsWtmKAygXAU69+LAjmQB6kuaL40MhvQ== X-Received: by 2002:a05:6808:10cd:b0:3ea:5d19:63c8 with SMTP id 5614622812f47-3eb19c16723mr13291299b6e.6.1733844262474; Tue, 10 Dec 2024 07:24:22 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 11/46] tcg/optimize: Use fold_and and fold_masks_z in fold_deposit Date: Tue, 10 Dec 2024 09:23:26 -0600 Message-ID: <20241210152401.1823648-12-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::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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 When we fold to and, use fold_and, which sets s_mask and a_mask more intelligently than we do for the rest of deposit. Signed-off-by: Richard Henderson --- tcg/optimize.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 424ed7674d..4d5fa04199 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1620,6 +1620,7 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) static bool fold_deposit(OptContext *ctx, TCGOp *op) { TCGOpcode and_opc; + uint64_t z_mask; if (arg_is_const(op->args[1]) && arg_is_const(op->args[2])) { uint64_t t1 = arg_info(op->args[1])->val; @@ -1647,8 +1648,7 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) op->opc = and_opc; op->args[1] = op->args[2]; op->args[2] = arg_new_constant(ctx, mask); - ctx->z_mask = mask & arg_info(op->args[1])->z_mask; - return false; + return fold_and(ctx, op); } /* Inserting zero into a value. */ @@ -1657,14 +1657,12 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) op->opc = and_opc; op->args[2] = arg_new_constant(ctx, mask); - ctx->z_mask = mask & arg_info(op->args[1])->z_mask; - return false; + return fold_and(ctx, op); } - ctx->z_mask = deposit64(arg_info(op->args[1])->z_mask, - op->args[3], op->args[4], - arg_info(op->args[2])->z_mask); - return false; + z_mask = deposit64(arg_info(op->args[1])->z_mask, op->args[3], op->args[4], + arg_info(op->args[2])->z_mask); + return fold_masks_z(ctx, op, z_mask); } static bool fold_divide(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848763 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384991wrn; Tue, 10 Dec 2024 07:27:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU72j3C5eIZk127IxwTrnT6farfo4sOetO2gK4QXQMvzt2ke5Dzp2w+So5CGwK8SeEyJi4P9Q==@linaro.org X-Google-Smtp-Source: AGHT+IG4diy4AvJugqPGMoNM741TVjy5sKt+FDk4dP2Va+12yQIBC8RpHX2B9iT1En+nb4rX6fJu X-Received: by 2002:a05:6214:5189:b0:6d8:a1fe:72a2 with SMTP id 6a1803df08f44-6d8e723a069mr287162056d6.44.1733844453218; Tue, 10 Dec 2024 07:27:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844453; cv=none; d=google.com; s=arc-20240605; b=HUf/TyqamEf5eIF07u4ZLbr1hQOO584XZpNs/5dOc4GzGg13kqRtszjnD4A6/FeVZ4 U2ax6bFu2qUZ9rifnJj6GcL0Dj4bPytLRxYC0XzxgwZc7RbZG54h0RLiRsto4kmt5SkM Cz1Rri8O0zW6Bx64hnMYFTi5NB2CmzPL968U/DA5jZF8OVmte6SDn5kJQUcxGumDACmV Eo2CMV532wu/M2q0ojxUPxiQ4aSJJdNqatGGqk0i9npvQ6xMD2kD1zO/nCRBhrAb6O/g Jh59fo4X/pOiuaYY2LutxKmCXZgWog2Qe0OSsVvq4sBnmmRLKZ0ezQuymckv0P74Jqf7 Eh4A== 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=Xf9OSLHuvBYP8zHVPPI3O86G2u6X8TGqiPN+TqMxWGU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=YtXgQz9r+4FZjdcA2B5+t1A/djFo3I1Gqy7dGhJQUzhQlpR325q+zt6RRLgEIIF19r utAhIVPo+ZOWc19faYdK+LkNdjrH0rLmDMYSDbw6v72eUfqa/w5mWwduf0j8JKODWHkj TUFGenTv/89yxN/6kMoiLBO42YA78vIkJLsnLht4S/QLSg3rsZZZitIeBnbakPUAOegU 64ZnTVP655Hjb1i5mpaPBuSrFCmqg41pisGTEHRhG+GxaRiQfQp+DHIFCA9d3/F5GoqX oiDB5zuNjNWvI2BIVFXIp+13wpIq1ZxjLH0ohHedYFun0+1LO0HTJap5GX1fsWb3VVrr R1dg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="G/mgGN65"; 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 6a1803df08f44-6d8da69ead0si139293076d6.134.2024.12.10.07.27.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:27:33 -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="G/mgGN65"; 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 1tL26A-0004HA-Rf; Tue, 10 Dec 2024 10:24:30 -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 1tL266-0004Gf-JD for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:26 -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 1tL265-0008Ka-62 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:26 -0500 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3ea36b05654so2929649b6e.1 for ; Tue, 10 Dec 2024 07:24:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844264; x=1734449064; 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=Xf9OSLHuvBYP8zHVPPI3O86G2u6X8TGqiPN+TqMxWGU=; b=G/mgGN65uJiC9D38dd332p2nHL4IPNVEo3Ujdj85fCiAM2S7LZJkJUs4FmXdRzfZbL HH85VFifcRvtbU5zEgW/+FUDa55BFSoWNiqNeIRNl+AyYX4aAKyz8GEiIRAoTJGvpaNx r04uueTDtt9Zy3UcVmogIIWtXWQ3FzHnSB0X/0UT8UbTrIlBSktJM5jzFWgRBC5YSQKs UQqe8vHsZRqSbDxjASKP2CchcUsjw6uCm6ikiVMIpTKnlTTpwqJxgjt5UsrAxDIaiF8S O0jeIMzS/ek8PQzRr+eSfZPEymYDthaxs6bzc12Oe5Z12JOktT8034waKkzp/9bvVWEX u/TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844264; x=1734449064; 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=Xf9OSLHuvBYP8zHVPPI3O86G2u6X8TGqiPN+TqMxWGU=; b=PU5VSpUrvy/CpnM5VLaY0pTgEv+LRZ+w6GdG9ca/WSh7glfTF9SQuyNjuLuZjYmL4P 0kh7gOAM/LqViJVnl4M33BuF83Ygrn4WgH1yMpikKT0lbDXXPL074iczARNFOIjcr5GY OjNKXEEMebEw/vBSn3UQoRjtu6IAjT4i95ByGdsxlVN3aP1Lk/TB6nE8Rzd4/IYjeKhF t/BE6FhvrBkv08lrJjGUQEg28Fr07ePTRn3CFVLEQUDChHcz0QYxvSNwuaGFZHe54f/x JIjNHrIIXh8uQjzEw64BKvRqUjmHgt7lzz6I2n1qTVQI5MxkHgFJzYNFAmSZjrnIzybT iemw== X-Gm-Message-State: AOJu0YxtbDjAgtLZGgaOqxsKgREewugghHFJlI+xJEa0MpJJ62Nv9FdI OjEtTuF0xmy7lIisF8uQX/LFko/vb3XQh1HqbQr93YfAMdpUz0P/SAB36V1zxTlxB0+MrBQAh/Z TotTyEjJq X-Gm-Gg: ASbGncsDkTTuoZ44OqowNZu+sC8zXWk87dHHkqrg4VEwxOSNOvLUtyBDLLic6hNA0Pu OlcUpkUpD9PC2XKJUG8a/fGNtzBzSQYO0RvZtrKjr4MHDgLQ6rIr26Y6zkmZ1GWrnlkm0Z5oVHN l8LB0dUWU1GPMXD4CuG3o1JnjV1unWc4tNb1vwT0TDbx3wZLvfQsLiukGywzta2pkmW8MsKjUAD bhJIrRMyQyxRNS4iogoMa9iOGuDm5LkxeOjJjSdF2f59CgK65r8feDyredVvw== X-Received: by 2002:a05:6808:e85:b0:3ea:4cab:3a13 with SMTP id 5614622812f47-3eb19df7588mr10656545b6e.29.1733844263772; Tue, 10 Dec 2024 07:24:23 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 12/46] tcg/optimize: Use finish_folding in fold_divide Date: Tue, 10 Dec 2024 09:23:27 -0600 Message-ID: <20241210152401.1823648-13-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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 4d5fa04199..59f510b49a 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1671,7 +1671,7 @@ static bool fold_divide(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 1)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_dup(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848758 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384634wrn; Tue, 10 Dec 2024 07:26:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUMdkeLOoh1CW087JQScLNoZlCqeuA8+j4Qs1V8o8O0X17oXg+CUaTYOGyGU1YzXG6xvFqDEA==@linaro.org X-Google-Smtp-Source: AGHT+IFqjWBBEGlmcQn8ehntdMMvE89xi6Ri5UZ1OygFO8tmw8fEX0iKudjoQHEENWFmcenJisWM X-Received: by 2002:a05:6214:dcb:b0:6d8:aa04:9a60 with SMTP id 6a1803df08f44-6d8e70d673emr285258326d6.7.1733844410802; Tue, 10 Dec 2024 07:26:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844410; cv=none; d=google.com; s=arc-20240605; b=cK1znMrb007ZzmBR1STqA34wDUGYKdtyrrTY38cANJo8tNbNzus8ga4Gv25EGMlhd6 hgYBdrfNdULBPhx2XyRCyzCRfCp9PdoeMtit2wstLUD0tVpB69PK6sFQ6A/eIuDzs50J 0Q1wnO5tDU71huWGPYxSEThYICNSzhl3xUDjl9JLidcWjXTb4tEM23kMdfAdIB3hPqAk krQIFX39522F0h1E8yk81ZvaFGzJg9OqSMNSHAPZlnmfEXKRCl2+cR7u8QeD8UJ97rAO qAV/+13sk6e+WK8s7shj5K4pL/n82g3fsZL9IRNNPiMoXgwdApUPgjJh09pOaH36he3+ fulQ== 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=32IXJah6/fuv30HVrLXGx11Ws+Rbap8gqRIF0VsTssU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=IWlHcr/sAzdZiKKkVqr3y5Mzl72F5M4LPAfE/63W/8UwdPXhWW3Zs3KcgoPds8Cedy Ba17yj8PsZGrHLyL/BSclNxCktA6soFVrzaAb5V//Dtb6P0aYTkAQvrnQer4czOkrAIB XI2mZ2kq6Aax6OLvogIKfe/x4hVhgwAW3e0U7du2IGJEKeiQ7znUklR9UEQNt+1dr2VI n92fCrweo2XjXJlQQqWn2B9oWdUppwC7lJibpeQTuBaAJTy3Utkk8WAMdluyEQ4bk1HU 2qIKDy2AJl851xj9YNx48MXkx0eV1UL2PX4E7Qxi0SO9TMS1YKLqmb90gWtiCL24wbem jr7Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KWFbJCVt; 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 6a1803df08f44-6d8f0ebb929si108756556d6.307.2024.12.10.07.26.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:26:50 -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=KWFbJCVt; 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 1tL26T-0004Pw-IN; Tue, 10 Dec 2024 10:24:49 -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 1tL26B-0004He-1Z for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:32 -0500 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL266-0008Kg-2O for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:30 -0500 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3ea36b05654so2929660b6e.1 for ; Tue, 10 Dec 2024 07:24:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844265; x=1734449065; 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=32IXJah6/fuv30HVrLXGx11Ws+Rbap8gqRIF0VsTssU=; b=KWFbJCVtF4uwxUHT8/+GIROpYXiLZEa8lgrkP4BbTR3AfNVaByHYeqMC0qjQ/G7Hzr HRKuoM1g1cnX6rfEBwyspTD7yIfYQJz8uwXNbJXv4xUSdlAnOOpfOKa61LMb8ZP6zCV1 8K/jz0BK/YpxCJcVOfLMVjCj22MNV1PHlNwJEq7Fn2yMT0ZtXnwRDQ6om/mJwTptopWK OcF6HKFPhvCT3hKfM8cl5tTj8wAC3ubyai8tB9ZFcQm+u9H4JHEGzI4WwcVtgKBF0/Ol AGQDDPmuYruZsuh4a0vZWOEOvNlJiI7Ks41m8FQzmKdpTSrA7u//F/g3gofiUO2AACEi wy1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844265; x=1734449065; 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=32IXJah6/fuv30HVrLXGx11Ws+Rbap8gqRIF0VsTssU=; b=rY+ycZpI6tDNCFyVDQfa+HoBs7lo/nQCsCykdMbWgxplkRbYOTAk8Eoa1OQ9nDbbpu 82GcvHWyolzsT4OqQQgw3jnTD4UO9t81qgjObwn/OsRl4OIfmjP7AQ9q80BwviPDJHnL Lx7qn3w/1NihdFg+oc+F9/uv1i8yWipHSm7PIZK7Cb80HJFrKqbqeyUHX0/Tyteu4LtW 8KrC0ZJAQl1Ml5kRMzxMMq/mwCDkG8uYdyeQL/FF1dU/jt+kTgj3pIGb2dmkUk7Ea7Lx 1Gn/bPjWTTjXJGmD3IsGjwZe9HkCv8IALx6NLlp5SsjAdx0hp8kq3ZB1ZKBN1AUMRyxm 61Cw== X-Gm-Message-State: AOJu0YyAPXE+AhcOf0FpdOmsZK/NJZHevAGSuiVlmdu54MhB2ePUKFBX 23GfdeKOD4YzZGwI+8ZzNQOFY+syO6Ic5ZO3rBbPPzM4+gCEGVEONA7lcG+bJiEln5o6nuIQN+5 a5htDhJ5d X-Gm-Gg: ASbGnctdXoZWBSDVUdn/XFvibW95UsfLK9fIsrmezfeB6IPIklMYm5ANR0SER+/0vyi zYZEY0ya8j+eHNiRY/Sui5ZmH7PzJkGH4r2oFtK0JOKt3Q1xfkpqDyu2++1z4rqrzrZYd+kwwRE EAXRu3IR0mjmrdNC2oLdG0rwOab/pECJNnvl+7A2Fx+didXpzUC1j7ptcVImcUj2nu7mHlzrphn FDWXHXu4Dc9NqKfs0Mxb9dhxVjuoGBihNFSFpFuuJ6HTS7lIZNF5aQnr/rPHA== X-Received: by 2002:a05:6808:1701:b0:3ea:4be7:254b with SMTP id 5614622812f47-3eb19df8475mr12068007b6e.28.1733844265079; Tue, 10 Dec 2024 07:24:25 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 13/46] tcg/optimize: Use finish_folding in fold_dup, fold_dup2 Date: Tue, 10 Dec 2024 09:23:28 -0600 Message-ID: <20241210152401.1823648-14-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::22e; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22e.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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 59f510b49a..e6dc9f2e28 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1681,7 +1681,7 @@ static bool fold_dup(OptContext *ctx, TCGOp *op) t = dup_const(TCGOP_VECE(op), t); return tcg_opt_gen_movi(ctx, op, op->args[0], t); } - return false; + return finish_folding(ctx, op); } static bool fold_dup2(OptContext *ctx, TCGOp *op) @@ -1696,7 +1696,7 @@ static bool fold_dup2(OptContext *ctx, TCGOp *op) op->opc = INDEX_op_dup_vec; TCGOP_VECE(op) = MO_32; } - return false; + return finish_folding(ctx, op); } static bool fold_eqv(OptContext *ctx, TCGOp *op) 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) From patchwork Tue Dec 10 15:23: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: 848748 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp383662wrn; Tue, 10 Dec 2024 07:25:01 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXBVc15zrgQDvI2xv0aTAuvjU//uhOmb/0vmwuzC+g2yrFLkEExRGxk+dS//H/acPPqz5uC5A==@linaro.org X-Google-Smtp-Source: AGHT+IGyL70CeX3Ue/5JrPDx/fsJmHP36wexPBuGt9YV9Y0Me38filaI9LlZiGlHqEQyHYlrW6qU X-Received: by 2002:a05:622a:349:b0:467:677a:74d with SMTP id d75a77b69052e-467677a0922mr86711541cf.25.1733844301591; Tue, 10 Dec 2024 07:25:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844301; cv=none; d=google.com; s=arc-20240605; b=lg/VMpaiHA/F3BQRBHCgM5br7uXe86R6HdvioAvoCHc8UtKnI5T37zgflv11hTOUIQ lPeFXHTiGxmDdFAxTnKWZTXNl3j+EZbHJTnqhRYc55AH3Q042LEq1FSIKTDQEYihbcuk SwrBQPiKcXijP6c7DoV74ENdV06POUVqCbTYxZclcrrB2ZU3FUFnnxztCVr+MAi+P3wi NvuzzM0WoTC3xbXGZEmkrtEB//yM5Eloxc/VlmA8njh+i7jRfm8gPhfGzutSJ37f1p+r Eb9qcSrPo08P3Dhmgn5VV8PBEi2ViUe+A9Y4IdW6eO8JirBGUd8MYrDo9NQoeZGt7fFx iAfw== 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=XYCGoc8876to2IEiv5A3VnrVbfuHFvGEsqz5PWCPMH0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=duOq3zAOP20MpJm8zDMOyQFIDNTQiBz+eycstCyw93pa7WgoiBKkfpzZndBmfZwsdO IS8vBYNl3Tuwxva49eyDRF4cDKt4jv1lfaNFS5hUXAxMwTgQlBZ3gWZuKxFfbHbVKF5m rfEEmTinuPNnhe1T2CwbHwNETOQcCqHh0NWXuKCA0ItVlL6SMa6TFWHOIEXEQWuKGpZ9 jgFh2IC2wjRIonXw4SD8xYyNIiSCyIx/q4vw0gbsCBc9kHrPbkbKwSkpdVXo0DBDEnbr 8cVkiATBjJkmBV7SiqxBGhEFHg9usj7O7JBzThKbe6jwV4YuUXbrmMaaQP2gnsiwUPI1 crtQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xZeG1VTN; 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-4672986e18csi164557651cf.699.2024.12.10.07.25.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:25:01 -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=xZeG1VTN; 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 1tL26R-0004Km-32; Tue, 10 Dec 2024 10:24:47 -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 1tL26A-0004HG-DW for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:30 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL269-0008L1-3r for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:30 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3eb7e725aa0so97102b6e.0 for ; Tue, 10 Dec 2024 07:24:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844267; x=1734449067; 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=XYCGoc8876to2IEiv5A3VnrVbfuHFvGEsqz5PWCPMH0=; b=xZeG1VTN/ggEsI+uGWH/QTU+LTbxn4JcH6oHNPejDI8nLvLM2W+J6b2RreGpGPrnhL G+VFBhapgvHWNhblviKQgeMy0qFoGxnUOf6ZqfOGN6T8djeZg0Kku6n2KLyG8MUZYkP9 CrnlfSyzP5ycIBR7qXdzPbvb//UcUNGbRs78enVJhT41SIf6UHgCdzq5Zg2nI+P/IVMt xFmaORbfzaVm03yjsWzMQYnBFAl3UezMEmy7nbINCcXvNG/4qugfB7EIhMvwPCsD4GuC PHGEADzOxphhYb0t3+vPcVwoJygttp3YysjJRTdq2f0krdtz/qiIePuF6UjWkEYCL00l Wkrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844267; x=1734449067; 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=XYCGoc8876to2IEiv5A3VnrVbfuHFvGEsqz5PWCPMH0=; b=PqtBMs+w1kvBeyvQxt0f0E1CPeTM+CT0+LG2mFfzigoCDgcYlMRUw9MkZew8mm9a8m GeXmo9Tw+1ZU28Cbk4RaZ4ZnQV7rCJDRYlFFoVyN9Z0Wl2thGNHqdiCtsOC6eskCAEPn 1Xv9D49zGFt/aFr1eh4LCSednm1/Bqy13CoP+Sm4RnkiqpT9gsvgm2IhREF96I5CnrGP q21YXiCtD/HQjlkXY4MkvrGfY+KzamnIfG3igc0zQUawX1IkiMvdrvVWaPLO8O1yzr4h Q6l9/a0HOsYih+r1qQ3e6LNKlkwXKmwjje6RS1oUwe6ilLJHInz7DXuoPiV2oPtFDg1n xmow== X-Gm-Message-State: AOJu0YxPoejYf1Bo+w58BshXau4mvevC8WZoSHpHZmLb1wxMKQt1rF3A fBq1q1ekKxBV9jsuM7jslXXzRtaLMkQCR2S6eHKPGmzxEMl51EB5GxUMgbD+tvczVl+TjOg5Md6 NOna+4WDD X-Gm-Gg: ASbGncv13Zs00Ccbhnz91g8oqo2nehS9fu2ROCIA4qA5DrFK2VQFBVdkAuRgkw6TVi5 08/Q1jSyhGDt8s9tefNbLrP4/yPdjOBaXgQnZDYr3NUX2vHii2IhoAFv+0rDt4XLm4MpPZZ2jAw bUJu7RJz7ylYulMgVfiFjHjGMiAdu1ro/tDFyDTiCEHlD9qaCZQHnVsj3IFvUdQ0Q9CtraxfpHD 89LR6NpoSuld1vEmsIb73D4G4TT/LLfdlgvhqxH98BD7Ccmtvfjfv6PdeeeJw== X-Received: by 2002:a05:6808:220b:b0:3eb:749c:f151 with SMTP id 5614622812f47-3eb749cf312mr1274547b6e.1.1733844267655; Tue, 10 Dec 2024 07:24:27 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 15/46] tcg/optimize: Use fold_masks_zsa in fold_extract Date: Tue, 10 Dec 2024 09:23:30 -0600 Message-ID: <20241210152401.1823648-16-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::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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, 4 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 5f3a824a07..955151f4cf 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1716,7 +1716,7 @@ static bool fold_eqv(OptContext *ctx, TCGOp *op) static bool fold_extract(OptContext *ctx, TCGOp *op) { - uint64_t z_mask_old, z_mask; + uint64_t z_mask_old, z_mask, s_mask, a_mask = -1; int pos = op->args[2]; int len = op->args[3]; @@ -1731,12 +1731,11 @@ static bool fold_extract(OptContext *ctx, TCGOp *op) z_mask_old = arg_info(op->args[1])->z_mask; z_mask = extract64(z_mask_old, pos, len); if (pos == 0) { - ctx->a_mask = z_mask_old ^ z_mask; + a_mask = z_mask_old ^ z_mask; } - ctx->z_mask = z_mask; - ctx->s_mask = smask_from_zmask(z_mask); + s_mask = smask_from_zmask(z_mask); - return fold_masks(ctx, op); + return fold_masks_zsa(ctx, op, z_mask, s_mask, a_mask); } static bool fold_extract2(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848770 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp386217wrn; Tue, 10 Dec 2024 07:29:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXT4lOGEZ1i8Ms0BUY7ridIG2KHC8nsB8Uoi/LnB70XA1pUN+J6ipihvHrakKc7qTjBt9eaAA==@linaro.org X-Google-Smtp-Source: AGHT+IHTrfRlcSFqPlILXCH6/Fuvk3RCUvv9ylBZPZiv7dy1DJhLHdQUK9JVUBE/SwRo9qByo36g X-Received: by 2002:a05:6214:490:b0:6d4:22fc:ce3e with SMTP id 6a1803df08f44-6d8e71dad68mr259494566d6.44.1733844596923; Tue, 10 Dec 2024 07:29:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844596; cv=none; d=google.com; s=arc-20240605; b=CjiCV0AzMOHpE98DRzFhg9kNUOazDN2EMSpufgFBwih8SSK2lTF2pk9aHtFFeWm+tg osCpSHGZDhW2POq6A/iZZSLt7Vk66MvDLQ5605Puxn0I1+44UrqlrJjlb0gIEBWVEtio ciok1AKF+ts1BTcx0cN/cCBahVA0N6N0eNyOxIfn5Ta/dShBkE1Z4bTDbYXIY3TXAEt4 vGkvTd1PPF4ZPAFDzS9dgZ8Nsg0/TaKNk6RhyaqR/dv9G9TXv7oV8QgQzah7Cc7GkyJR ooT0U6uYFWz5iRzXA2NwBtER7I8DzoEKKhFsOmtkvXgKV8ZsgT/Z44bM+GQ0PVzlRcOP +4TQ== 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=mv5I27XDUr/tfBisfmpYfU0bdTaxze+ILHd73sKmTag=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ROdwEbRZqtko5msgqu2dFyFxbBLUKPk/BN7aUvRZNSOFGNLEHc5ivKhdXyj4f7qVhF pDLwht3iAWREqcV8N0bO4X/6xnJsy9XQYB6Acb+N0y5TVsKJr8DLJFM7COwhBu++291B +wh7GR8FYnDIEqD0Pmn74daZhMr5SZx8AvMR/PpAFWYm3YJnzYH6Rzd+2cctebhhYiGA 3LdBKe64Y6zBB+CoCSJQo2SQnSZmd87PhAUL6Sr5uXG/7E9E1Ey4Br5lpL7Zf9U7P6wL XH5Wf2/xuw7gI0xOtdbRxRdE8yFrxQEiVNBHd1txeKXnObtbe5fKrKG6YCWW/6+qGHmh VZ2Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YlxofX+I; 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 6a1803df08f44-6d8dac460casi156611666d6.519.2024.12.10.07.29.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:29:56 -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=YlxofX+I; 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 1tL26S-0004Of-HG; Tue, 10 Dec 2024 10:24:48 -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 1tL26B-0004Hf-4y for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:32 -0500 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL269-0008L9-Qt for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:30 -0500 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3eb45232717so1258062b6e.3 for ; Tue, 10 Dec 2024 07:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844269; x=1734449069; 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=mv5I27XDUr/tfBisfmpYfU0bdTaxze+ILHd73sKmTag=; b=YlxofX+I0oVK554RHoLxBVnnbTeQD7jOsvriG7fRg0i64QbqQdezbj725VfTjMByvf JywSIAKrVv4z6JaajLrM5QURXgQAYrqXMKrrB3fI6ICxYlR/AkaxpqTu3oZE6ITyUiqf mX9p402FI2I3CP80BXWzmNiIWVUUlUJkSiCmgXXyCoUNr9nGO59SAAs9Q1nIVS04t5GF 3YwpGKYBuQju02ZbBI4KyvTUSWNSwTo8FuEYcdjytg1vA8tvYv0XAwW9yKn2VBzhIUcg 8NRt5f+t+KouBZosar3VkP86TJFF1f/wMul1GtoEafJkjou9WMUexpWp2giET/09tf0v LEAg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844269; x=1734449069; 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=mv5I27XDUr/tfBisfmpYfU0bdTaxze+ILHd73sKmTag=; b=JUXfUi9DIQIazs9DH9I5BdbEtJi1RuLWVlmUfRCrP3hIJ6IyhQvjVPVeH2oTVGSu8P YFaruYCsoOQOr35xmo35YTB1R9MtX+VBEi+31b2ZJ69mqB4gXVAOFX4HsNJAE8EU4d5T NNNHauVTNQRCaW9ToeW7T9ptKWyPGl+LdVsg9UOp7lKdqaO0i7+h+wQ4D3Dma6UffXfW +8yol8/cSWj0SIxkf0wr5AES6OjRq8+9Je+S8woCnDl2qehIBKGLQ2uySpU3NscVYViJ yR3NgYG5GbOw9Wea1p97U6mr47Ys2F5Ak75n0nQFs5HZHb175VumtbALeXrc2fFAFqhb XV+w== X-Gm-Message-State: AOJu0YzIOUcthg+xMljtu8VNdVUBaZVRCBSVTSKlYx6/MfS7VcLBxyXd YPiVB+2c/kuk3Iun6wqTRG0lnab5d9WmrsebWn3+DHqDZAXnHtKcfr91CqaOR4HK/lrhMnsk//R ZM+Flc42V X-Gm-Gg: ASbGncs+5mr5gwMAXjQdDamFyB0dJolbILj/nlcycL90MRBB8tscEwGYHE3yFXHrmcT SmrFZpdn1nS+1kmK1KeDVXdR6wmnIxRLFvnj3yqRoAO+rTi7HUgt873m86iO719E1E1ZKPfezz7 4boDVP4kSvJli2kAafrqDD3UDnUhGBVj6+h09IXrTJVEmgxoGRDg/zwzMlxgEjZp7Pr44mIKuXu stsUix1sm91i3T7E3nZH9ILbg6tk4NDQd+SlP3bBbS1FtiA9AtEP37UrNi9YQ== X-Received: by 2002:a05:6808:14d6:b0:3eb:75b2:1e1d with SMTP id 5614622812f47-3eb75b21f28mr1206598b6e.12.1733844268900; Tue, 10 Dec 2024 07:24:28 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 16/46] tcg/optimize: Use finish_folding in fold_extract2 Date: Tue, 10 Dec 2024 09:23:31 -0600 Message-ID: <20241210152401.1823648-17-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::236; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x236.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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 955151f4cf..a0ccf7f3f2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1754,7 +1754,7 @@ static bool fold_extract2(OptContext *ctx, TCGOp *op) } return tcg_opt_gen_movi(ctx, op, op->args[0], v1 | v2); } - return false; + return finish_folding(ctx, op); } static bool fold_exts(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848751 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384105wrn; Tue, 10 Dec 2024 07:25:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXVVXZ8zzP11seGhcJL9w5/ETr4IaZCqCrLmUqlyABoRxhdhLvETmLMqa0aHSw170IspkPeCg==@linaro.org X-Google-Smtp-Source: AGHT+IHlqL64BR7KpK38hKf5yuhHZHD3YqfkhgzM9QskRf5d5vpvhvkUSRuAXVod7Op4BL7Etcto X-Received: by 2002:a05:620a:2619:b0:7b6:d754:207f with SMTP id af79cd13be357-7b6d75422bbmr1042261985a.50.1733844352011; Tue, 10 Dec 2024 07:25:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844351; cv=none; d=google.com; s=arc-20240605; b=FRseDHijmA3GLKKS03jf+0PFLL8nRy2tMIGGgmMGBX5ZRUOqDb+CWyKCkk4PN4VClR MWE8A5OpRIW8P41CgA7zKAPA6EGEWReobIHuheLbicEsi0QBHxCNzmrDhlyd+CLPnHET 67fTe/sNDbMstPHZ5BcHu5nAEBYpl9nckvaS7MB2o/lKkrXTkK5oo0ZUiZde9XrgpLPH fVo+z1G8kA3jJ707xqWPaMQF0KQhR0buXYNofFIqRdpPsuGT8MOC/d55bOQKucfNHh5W 0NcVTtN22zcoukfcp7CYTe8Yaqu2YQ7d6pbbWV42hSDocTBWysC0B8UlLvHkmtUy0yuF VbgQ== 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=vcSRQjdo00q9esWbI416Hw22GSckeQq1ZoR9QY+R/6U=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=WJ0l/QWxz1jX2esNKF1wbma+Z+sDVrtO28WqJ7/mHNWjWLe5G/Vdnt1k5veiuTduK6 S1z0LL/5i1v150QzzW49OETqrLa/JCJN0P8ZMMi5CWgWewJ5aS0BDyTxLlmswFj6Ddq+ HDoRvnFPCNXmpZysj/T0d5CzLhRN1k6W3cfMBdz7CiHEsDR6g4YlrGDYgTXvTx69BIMr Ibbz/2z9EICSkKCSPtjtckBZjHPRAzrJk2aeyH6As/NgAVST7RJ9JhDsuUyTwJw8PHhW j7zlw3PWAcO9PUZfQijfAsuhyAFhGZC6TuU4hgJRdPtPa+EPcVKO31u6w5CG8MbK8S6f jKXw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VhwMXKVR; 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-7b6d915f9efsi454900485a.137.2024.12.10.07.25.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:25:51 -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=VhwMXKVR; 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 1tL26R-0004Kv-C4; Tue, 10 Dec 2024 10:24:47 -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 1tL26C-0004Hi-NG for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:32 -0500 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26B-0008LK-1v for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:32 -0500 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3eb45232717so1258075b6e.3 for ; Tue, 10 Dec 2024 07:24:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844270; x=1734449070; 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=vcSRQjdo00q9esWbI416Hw22GSckeQq1ZoR9QY+R/6U=; b=VhwMXKVR/P7vkMSS/4yrHx79U7pGgS2053xn3Nf9qc+0cUQZIgtoGh77uL64dDdXzl FBhYZOit0sgw3MHsU9BCDZmiW+xv85SbsR3dv9b9efJQDGb1yEzCeeQHvPDKkGBiTg28 WlWAR6mkU2E9U/SItmVUNNsiuWEi9gZk5VrAbUJuvd8h45T7qO4DwX1hSX8SFr/e2g0m JAfXd1F7MlI6reOxaqtpCn8uf00AOAI+OKu1pDtOIPC/LvkmCVW+xu/cX8UzTPuYUS8Y SHjHdx8DTuDBcsFZWJUxuj9mDTOuHzjOR7IMBbbGDcJjIfbLmk+IC1MvsYe/lgMzdYEF oMQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844270; x=1734449070; 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=vcSRQjdo00q9esWbI416Hw22GSckeQq1ZoR9QY+R/6U=; b=X+1DDGhK7lVACCnO7MuTjJPkH0m2soErb4SD+Wj5J9z44tc31V+RLfIRuA1HPWn5Hf Nwmav6F4ylapexDNywJhLAmO5PkhZeRHZc2pk5esM/f59J/Fwp1Qh28HMSAncMa3YH/h 1wb06RLEyymuHx2fcHD9kHrW+L4yYx1o8RiPYTUc+Qcg7Ub2QQ4NZDTvH85SMZe+WgKZ GPti7YBlJdsjC4xvD3+x6k8sqku1Gq/BWHB+0xGUQGAcPBE3fN8Es2KNoD+kLS+PO/Kf J4jKxctfrjGz9O+iTGe5QV1e5qSCtgFqNiP4EbrUpSYSZoareAZIjONG4NemRRgjsTwl JMbg== X-Gm-Message-State: AOJu0YxN5ACJNvdzjK63h8FUtJA8z2k/vbPOrQyzNRylLa+H+wTj31lF WmdGCZjGqENFdvqg3O1xhQXxd0x6puHfmRN/J4s0TSZ7Ze2NVYsIFTRgC6yrnaRWOOygz+Py/V4 h+zGgB9nF X-Gm-Gg: ASbGncs8G2NNidoeJxCsXVSP+mh6hSSCPB9tAwW5HuZ4BFEjkCVM6QjvcFb7ipCevwh AlWLpS1/TY9uC21PMxta6NjZL6UmMNlYTe7GFfX3OyktM9QX/F7xww3JfxnYWuzCurlf3RqHwSq geVwATs4uvzWEHPQ4CPY4jN+yu+xhT4VuH5aVRQziAKB3eicpeWILQq7IhxoXW84kbKzea9V1lZ tVgIaFqJeZca4fFGAtFKpgG6E7nFedFvfUolg5YyVUCJfwBbgFhQfElj4fvew== X-Received: by 2002:a05:6808:1dc1:b0:3eb:4b4c:80d8 with SMTP id 5614622812f47-3eb4b4c8b38mr5286666b6e.0.1733844269891; Tue, 10 Dec 2024 07:24:29 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:29 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 17/46] tcg/optimize: Use fold_masks_zsa in fold_exts Date: Tue, 10 Dec 2024 09:23:32 -0600 Message-ID: <20241210152401.1823648-18-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::22a; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22a.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, 3 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index a0ccf7f3f2..5d10e704a7 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1759,7 +1759,7 @@ static bool fold_extract2(OptContext *ctx, TCGOp *op) static bool fold_exts(OptContext *ctx, TCGOp *op) { - uint64_t s_mask_old, s_mask, z_mask, sign; + uint64_t s_mask_old, s_mask, z_mask, a_mask = -1, sign; bool type_change = false; if (fold_const1(ctx, op)) { @@ -1795,13 +1795,11 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) } s_mask |= sign << 1; - ctx->z_mask = z_mask; - ctx->s_mask = s_mask; if (!type_change) { - ctx->a_mask = s_mask & ~s_mask_old; + a_mask = s_mask & ~s_mask_old; } - return fold_masks(ctx, op); + return fold_masks_zsa(ctx, op, z_mask, s_mask, a_mask); } static bool fold_extu(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848756 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384534wrn; Tue, 10 Dec 2024 07:26:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWHeREUg9nghDUVsdEBWPxmfBQhKaarccqQoNd9MtCgdKjlxegqkndrnFeux4rrXrGxCNScoQ==@linaro.org X-Google-Smtp-Source: AGHT+IGkEUL2Q3f8bgyxeSp+089yRIeiuOqyEPrp+R7UQPmGoViSox5DatX9vke7MiCrETyw1KqW X-Received: by 2002:ac8:59c5:0:b0:466:a06f:ae0a with SMTP id d75a77b69052e-46771f5b0bamr90481251cf.32.1733844398836; Tue, 10 Dec 2024 07:26:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844398; cv=none; d=google.com; s=arc-20240605; b=Uqw5HqcfDjxAS+eCP7U8EjvJqJVAJEq51evZ+wIMMlR77uHtp7PsBtLW67wSbK1nV1 nrT6z2RSwtEvuNbMZpAE1HsQgnW/IyV2h2Rcd9dZR3SEQB6NuLDu4kEpa6C6vfABtKAt Jw8DRc9oFxpRonfVU2nb7unEVvKvzDKf06gclTIbvP88KdGwk+CeAOi+DOfYk0+qRJbT B/MzRV5SH2ZHDKU+Tv9FSN9DEt3Ex1hInD7axkP8nRP7jgNOZmxhHnepZ4erbOVNdYEA AB46xQO25akdRqHxioqz/0Nod30VYpVly7whHmwq/2vgHus1/eVpkN0mgYVOcPVK41RM U4uQ== 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=9xu0jLwH/Odo5uQpJNpb0qIENhC/6AEk3y7UkW2u1Sw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=GtBZkM3V9FjYfhrN90AakkTsgKLYC8Y4PI/EgxWZOn12wHiNAlDTzLUy+zeI5YGUb+ 5CIzabCHmkmF1+p8kyM0di5KF5+NU8MRdqrueDE7A4MVy1BgQvQ17aL3LhORph51zohw bgy5+JMj1fpSmt7+ATdPZOEfxvwvBAHOvW7WHckd8xnNE213Th949Hp5kc30zeLddj/+ tfYfgSi+ZuiXi/mj86LYCSV9+LgaShNCLOVELO6Z0KPNAspO2D4RpgX7c/re5f7MO109 G0c8Y0a2UnGrH3qflYWM/MiYstd1V0dywqn6T/SLRd+mNjR/SI0oJxeknunt0H0R71Y+ uDEg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z0yuZDwo; 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-46759fb77dbsi79040341cf.451.2024.12.10.07.26.38 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:26:38 -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=Z0yuZDwo; 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 1tL26R-0004Kd-1R; Tue, 10 Dec 2024 10:24:47 -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 1tL26D-0004IJ-SZ for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:34 -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 1tL26C-0008Lf-FE for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:33 -0500 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3eb790888c6so136009b6e.2 for ; Tue, 10 Dec 2024 07:24:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844271; x=1734449071; 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=9xu0jLwH/Odo5uQpJNpb0qIENhC/6AEk3y7UkW2u1Sw=; b=Z0yuZDwomSdWfW0lfGNP2uBHegQLGLc80uhFaP28mknjUSNVA3nhww0hQnrHpwi3Dd ojDnYFz+vIQn2Y0LA/hDUY6aQpEOVvxOcPxbhdTWNDLpuu+U5bQQ9jv6Gj4wxxpUWmOH jUg7MVXHftoy/CxNajhFopKldELya5SkG6MtYw/mVlOsZPGV5+rRwtGaeSmkCX+YrQB7 JDRV423265EsYG0Nl/yRnQtfMmYQo/ZLja1Cpho43i5/teQmXokqSZ6Kgn0ZuiNRwQlC diBP0Eyo+DoudZm1bxeIxrdIJzIwSY3ZVgMKAhTOf1+CsBBqtldKN/Lfbw+53B3lFn+X vvQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844271; x=1734449071; 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=9xu0jLwH/Odo5uQpJNpb0qIENhC/6AEk3y7UkW2u1Sw=; b=QAuUmL6c2asVNmI92sjVulxf5aLjsl53ifR76afqtwn3MdXqI3q8r/8WY9R/SIZlHw AkZwscr8C3tYZ7ojRnxOiB1KHgVyVr6LaqG9npPbOha0T7wMgiT+Om3DoaGF3fqH+K0r HZjAyOK6pY8fwRcymq/xHlASKTnOQ3tbTMQ7W0CuolKCWEQy3/nLlWcOxFxXI8H9XpQl YtqyC7TytKIz9jwDcq5WFFDV5/bqRKaLhV4IvrEMhTTP/TNO3uND+5Q0qhpUeYUu2HMT Dr5ew3BFVB0mvk/ccU0k+4N7E0byJJKMJnLINNdhumJPddz9EhtIJBLEeITa3WTtABM+ KTYQ== X-Gm-Message-State: AOJu0YxL3p0ZfqHBgcIM2gY84SeH584sTAktwg0ObeS6oNrgVnXXb9O1 p+ohvvn1ntQ6IiRXNF1yCYAJrm/lLEuBvF4h3YR2t3NmU4A12p4cIy5oaH92y4EPReJD6fUjrQU SHAyUbG4C X-Gm-Gg: ASbGncuitiqe7QfPnGJyQjXwIwzDd4vx8SUwcHpJchggwFCu+5PLDpvPT+uRxVeIzqK JgWJAMbvpnRpRzyyNg6RkJsDnIryHzrMcAXNR5iwpIuhgmn6E1+IRVLda//IbeqnI9RG51vQ6xq UbtkliDTt1M+A4ncEXLTz79fiG917B2lFMA3MTx4jfmuqhvsSs7T+ljLbKH0/vTiXaS8hi7eAOF gjuba72ROqtF5+HZIHDa4fUEd8vM22+zADGkKpyfwdi+DJJO2+tMiZuT0D83w== X-Received: by 2002:a05:6808:344c:b0:3eb:5c27:f756 with SMTP id 5614622812f47-3eb66e372fdmr3054364b6e.24.1733844271462; Tue, 10 Dec 2024 07:24:31 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 18/46] tcg/optimize: Use fold_masks_zsa in fold_extu Date: Tue, 10 Dec 2024 09:23:33 -0600 Message-ID: <20241210152401.1823648-19-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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 5d10e704a7..260e3ea072 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1804,7 +1804,7 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) static bool fold_extu(OptContext *ctx, TCGOp *op) { - uint64_t z_mask_old, z_mask; + uint64_t z_mask_old, z_mask, s_mask, a_mask = -1; bool type_change = false; if (fold_const1(ctx, op)) { @@ -1835,12 +1835,12 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } - ctx->z_mask = z_mask; - ctx->s_mask = smask_from_zmask(z_mask); + s_mask = smask_from_zmask(z_mask); if (!type_change) { - ctx->a_mask = z_mask_old ^ z_mask; + a_mask = z_mask_old ^ z_mask; } - return fold_masks(ctx, op); + + return fold_masks_zsa(ctx, op, z_mask, s_mask, a_mask); } static bool fold_mb(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848764 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp385054wrn; Tue, 10 Dec 2024 07:27:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVSVb0cgum5LtD2OKMk6ULOPTr1vxJsKDiOvvwpLbsI8i8WBqATomQ9FTORgFwKdd9cSSSDVQ==@linaro.org X-Google-Smtp-Source: AGHT+IGqS1XbedEk3ibaJdxE1tg0SWSLpvYD1pE45iw/Yzqie1lTSIfc86Ainphg+LCynu0AHqXz X-Received: by 2002:a05:6214:20a8:b0:6d8:963e:b4c3 with SMTP id 6a1803df08f44-6d8e711572bmr242641616d6.11.1733844460798; Tue, 10 Dec 2024 07:27:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844460; cv=none; d=google.com; s=arc-20240605; b=PPS14lfBL3e9QF5ET2uMRPe1Xvi4Y6yrECeM3mF1Q7FnJBmYVpsarceWa9mOw0aR7f 2qcVt+mVUICDRHbgRcvmByl2INc6devfoaazYhi2EDJlT6HTFT6DP13NR4/6ORLdLcGV Q+efBuhQLaRWBwMoUiKBpM/ympjvK4gY1jgm2QOyZDHHlmUbyCoxiApe2DVt9O36A6G+ MNm5uea3YNCfJ+eJ5vl0kFyOzZ9x0VC7fkIyC06R0s4cB36Ob3kvKsXjzVvo93EKvn2U Umfof153b2oONlSRIiMCPsID8FMf3iIVKb3DuyISvVZoFndQKojXDnbk+65t+R3+yTUR /ikQ== 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=MseSTAJQd2JO+Oxcl8SX4JBGUGp4lJvsrlQBqePNo2o=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=D3+TvhURcf4En2u9VNHmavkPkEJ3FJa5abXQmRc14vVrCm42DqKVNgcTj4obasN5hv 86ZkPYFHrUule9lP8FLoJ9O5dni4Nors90n9mY3515KEsAEVk0xLUv2RIBluc+C4P/iF RRaDBRtL+193c/BwqYe4/qDVPqR24oa7BwDlTRDFJNAAofehqm4x0wEseu5VyeOknicH q+Km9K98yEc1h+Xe3wuxLLJ/RvvZrMmXWZFHP1ljE5QqoawKNp2vR1XfUVcfXbC47aCJ /vcWeqpCfb2ODEzVUlKhY7BiUTtbRkJUv21K5vThxv/XqX9mF6PN/uo+u0pAvjlCfPBh JjBw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bYAju5hs; 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 6a1803df08f44-6d8da67f0c1si146331906d6.95.2024.12.10.07.27.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:27:40 -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=bYAju5hs; 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 1tL26S-0004Ov-LW; Tue, 10 Dec 2024 10:24:48 -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 1tL26G-0004Ip-32 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:36 -0500 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26E-0008MC-28 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:35 -0500 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3ea36b05654so2929729b6e.1 for ; Tue, 10 Dec 2024 07:24:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844273; x=1734449073; 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=MseSTAJQd2JO+Oxcl8SX4JBGUGp4lJvsrlQBqePNo2o=; b=bYAju5hsSbp5cRMKwLgZ0M+8TuG9BL3wcuPiFmU5jwSr10TwaczF5+AZ3PeODtwkDp QMu8LaUeJsqM1X3637fiwEKzzTJRbeP4JHfHpEtc3tH4YHso8rQwAkJQKmlxsoWKC2Xg XivKpBDmDHSW/vTtIHC6Kc+sigDz1dmRg/pI8g18RLksCVnRvip4cYEdvYx/uOfJ31y3 WoxGReNaef3QpGsWByvxtCHH/RpWA4k/XMWwCUm/MPWS9hxxRpqONHKnOc++x4wZc8Go 3Ngkn6EqzGrqRpVvHyKA4Se6sIdi04nIhZnrKaWLayKB1fMtJ8S1qajDWlY0+HgEPdbT QIRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844273; x=1734449073; 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=MseSTAJQd2JO+Oxcl8SX4JBGUGp4lJvsrlQBqePNo2o=; b=psVpczkI1vH0FLmgXyQCo+tkL4nZI7JINJf+rZwa2Rf6QHVs982doostEwUl24NXTm LLYpb22TiAzIt02jRDdI67Ar+NOOgjENusC2qC7X6oIhkf4Vj+FPHD6kEribNl8Hak9l FICfDiYy2eVjoDN1yDF+NFMDKBahuayZ08znoMe2PbyO5WLlxJS0x0/KukgbFusc3i5E yF158I0Qg9bjKybegHsW3112vs5VzvhISK05qTztDwvHSno7JCX6kGz5vwTCVr7WapxP v5xVfM3tVUIbw6KkcAlQrC7+jQpJ9UrGFp910CdmfbUJaryoRzNcYOcnaP/ES7RxCi6e 4hDw== X-Gm-Message-State: AOJu0YwtzZonY80llUPI0bYATMVV/FCuX/LHZ7nQ75K4WJvJUpxaeNRz 9DyeZskBVFi22xPHnYjJsh/gmAZiJXmNxHdVezpCotJLVRDBtmSTexszwTG6dbJl4tXne3duR8+ d43tWkmfq X-Gm-Gg: ASbGncszgw6ehZenhrzf8MjGpBWDbZmqSmDyTtFqYSUrokolYZDOJ0fYb0rHrHaRDX2 Jto6OkzTU89varVVts5Xas5yPKVj3V8WBcFvRZoPCznX79L6/TiRB48zZEnzAk2+sug86EFCip5 jujG1BJcgKyIv1jY8MSvRYIV6GC6ZhD28EeSYlX6GtpLeXdhGtyxhSqggUlnQFCKbihzs3bi6Ll 5io/3Vjr1azsMkJWOxsvgKoCxK5wlogqcrastn4vEct2GYgqImDw3Ddftatzw== X-Received: by 2002:a05:6808:1701:b0:3ea:4be7:254b with SMTP id 5614622812f47-3eb19df8475mr12068337b6e.28.1733844272929; Tue, 10 Dec 2024 07:24:32 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 19/46] tcg/optimize: Use fold_masks_zs in fold_movcond Date: Tue, 10 Dec 2024 09:23:34 -0600 Message-ID: <20241210152401.1823648-20-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::236; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x236.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 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 260e3ea072..6d2d55f053 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1874,6 +1874,7 @@ static bool fold_mov(OptContext *ctx, TCGOp *op) static bool fold_movcond(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; int i; /* If true and false values are the same, eliminate the cmp. */ @@ -1895,10 +1896,10 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op) return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[4 - i]); } - ctx->z_mask = arg_info(op->args[3])->z_mask - | arg_info(op->args[4])->z_mask; - ctx->s_mask = arg_info(op->args[3])->s_mask - & arg_info(op->args[4])->s_mask; + z_mask = arg_info(op->args[3])->z_mask + | arg_info(op->args[4])->z_mask; + s_mask = arg_info(op->args[3])->s_mask + & arg_info(op->args[4])->s_mask; if (arg_is_const(op->args[3]) && arg_is_const(op->args[4])) { uint64_t tv = arg_info(op->args[3])->val; @@ -1941,7 +1942,7 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op) } } } - return false; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_mul(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848767 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp385991wrn; Tue, 10 Dec 2024 07:29:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVizhPbIzghzbymAsbPah7LPQbJSIpfCrY0XD7g4ue5uZ46e34HhbjnI32FD/4hM3/fW/FEPQ==@linaro.org X-Google-Smtp-Source: AGHT+IHQJkKDYfauWfIVV9ytEqMi0JBZdcHrFkhYlkf2aJ9FRHinCrTyHlzDEIF6oz3neN0jShRY X-Received: by 2002:a05:620a:271e:b0:7b6:d252:b4db with SMTP id af79cd13be357-7b6dce8950bmr726304985a.44.1733844569681; Tue, 10 Dec 2024 07:29:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844569; cv=none; d=google.com; s=arc-20240605; b=iUfsEdcuIR7XE3mEl/BF+ctMZmUnQdo72X8VJyjnJWf4Fse2po5EDPLWLJclKnm16u X8A5fLL+5NYTabtM6vvfRFAXFWWNVB/VzDcAAAACoQT/dGMhagdEEZlEeHTNkhhLBAT+ lRgoHEnQeFTDBHV9PX+XgscMP3KSU4MqxAWXGEKl5oPBYXE+jKWZYRI9j6FNOhLJSoH5 uniJvsisRGWHUwrqMrlCwMuUDbDFfaxyYsyrSqD9hyHhYNKmvBshdaZuL74HZrLRdSRn 4KQPIK2ZJaD71G4IeAv6+TzQdgt6UQI4k1o1hM1HrNaKJ1taxh2BW46iyk5nAYr3P1dt w91w== 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=ddv1A+UA3jhxGq4Ts2W1/w/Q/jka2wneect7JrRWJKw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=AjJ4ICB+y/CjxPwahDnWLgSSZEpIorw2vqSCmGRUc6UPqdjI/alyBypxaaeOJyhmuZ 0wc2Q6D2Lgl9X4Hto+yhUpu8qTVCDfxnOliX2QaPK8NmYggR/eXrQaK8I397zta3ckPJ XPLWk8xK/7BJw6f3ldviir6AJ7NdT1NYSjVZeNdw7IBVYRATIxlEN+hQQZamZvY/a0Ff /ACixymSv3a4aqQ7gViAFNj3kNBnthNVl8GJNwH9x56R4jTlHR223fR9GCDOqAXyEepY UrmyOBaIZIkY7dOOBLOZskGw4wsjY44IoNWYOkLZ0qKLZ1KFGA+BXaLCv4jACv3QkLPI D90Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FlFbqG71; 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-7b6db1a8c0asi348636885a.161.2024.12.10.07.29.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:29:29 -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=FlFbqG71; 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-0004SD-LG; 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 1tL26H-0004J0-4x for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:40 -0500 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26F-0008MS-Ri for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:36 -0500 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3eb687d96e9so650058b6e.2 for ; Tue, 10 Dec 2024 07:24:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844274; x=1734449074; 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=ddv1A+UA3jhxGq4Ts2W1/w/Q/jka2wneect7JrRWJKw=; b=FlFbqG71IoS05/IPV52kUMRiipDDjXPRT7YlZGcfIg3DBqh+XDLVoF7X7Z6OSH2cM+ gRgYUHoFyLomxRyAweByPzxZOHeAFJQ0ov8zBNun3OnyudoEP3nZF5iFPlK1HZW9qlWa OLwIJgwl1Y9dQUFkvPoA0cCryq1gPPnT+iAWH1/m2v0enlx4r9RWP/JhL+ptMC6FqF5d hVNcvvFGr6dtGvInv/5iVndepIyf70Fk5zoBpeawyUq8dnNQJKzcA5wF+UGdQhJLkjdV wz8fL/dSD+DbmWrJPxxMOkFU5dGzIk2q+a9w6BNPVMP0TBmApYHnsek/A+ASD2ECoZr1 Nwvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844274; x=1734449074; 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=ddv1A+UA3jhxGq4Ts2W1/w/Q/jka2wneect7JrRWJKw=; b=rJ08b3Qp1pHOHXJn1k0G4LA19WRgC8x0kHuLMdCTwUmDSJbhh6BanYCDeDJPe9Ohqo hnGUpLEvhaoQgK5Wc3gnCBnOIN2FNce52ygn+FMl8ToNblY/hL27golc8zqDT3NCWScK 3SNBdazcsOnJvh4XAmhEOp5Scak4+kERyfyOo4vLNQ02pge9RRYFqgO+bo4MkohbmcZB mQ7A4WNsLOjdoaMDvMCyX2m0wGE6CKMRAyNg0R/MssSR4SrOjzy61br515p3G6xd1zUl vtUyPUGdSLE2trdJ+ET0mm6LmUDa5LLP7rRQ+7T8H5LhwZYuT8ydRI3fDccAPU7duB5f ntCA== X-Gm-Message-State: AOJu0YzyIQP3wkWRHLsWV6U3+ROR7i+XAoi6+wwybyObOsNI6SdGq3j4 oVF0BsUIUve1cj4igP6AGNeNvbK5Cs/v/BUIkHXpbVyy8PnhmrUsl/BXbxYQX/Mw1FWIzxsxT1z BAM45nUAc X-Gm-Gg: ASbGncuPZfLmtIeZe2AKhEuB5zwoNKdzwBC1ebK4u2H/eUQFcJPOE6JME477unOoDYx OhU9NpZ45nF4lB6gKmoelBDOlhHIL4oAObmaCe///90pimesdCsvCqS0OD/LYI35JAcroRXIWca h1UW/WXeKa1tJt1hsNa2TZkpb9Nr6Qqazrn90Jm+biXzHqAreIUbDsUgLl0j8atxrMiL6oo0aEx 2tbp+OUhqezF0bE3UKwExEBWp3StUWAddtjV71dYU3UVdhpgUvhsF63DnvZng== X-Received: by 2002:a05:6808:2388:b0:3eb:394b:83f5 with SMTP id 5614622812f47-3eb66e0801dmr2837757b6e.16.1733844274153; Tue, 10 Dec 2024 07:24:34 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 20/46] tcg/optimize: Use finish_folding in fold_mul* Date: Tue, 10 Dec 2024 09:23:35 -0600 Message-ID: <20241210152401.1823648-21-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::236; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x236.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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 6d2d55f053..111969c2e3 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1952,7 +1952,7 @@ static bool fold_mul(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 1)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_mul_highpart(OptContext *ctx, TCGOp *op) @@ -1961,7 +1961,7 @@ static bool fold_mul_highpart(OptContext *ctx, TCGOp *op) fold_xi_to_i(ctx, op, 0)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_multiply2(OptContext *ctx, TCGOp *op) @@ -2006,7 +2006,7 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *op) tcg_opt_gen_movi(ctx, op2, rh, h); return true; } - return false; + return finish_folding(ctx, op); } static bool fold_nand(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23: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: 848784 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387905wrn; Tue, 10 Dec 2024 07:32:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWwiSjseJuuJ3turyelWdiCiZrKfX/qMHxwcN9iTbHQEz90dF4OnEvgvXW3P/sxyMjrssYD2Q==@linaro.org X-Google-Smtp-Source: AGHT+IGhPyAc53wTzNHLyVhd/jLB+pHPoMSyMfRIjd0EGCt5VK52Vh9wE9FQJtn8rhC+vfkgx/LT X-Received: by 2002:a05:620a:40c3:b0:7b6:deaa:3189 with SMTP id af79cd13be357-7b6deaa33e5mr611531485a.54.1733844747421; Tue, 10 Dec 2024 07:32:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844747; cv=none; d=google.com; s=arc-20240605; b=HCV5SkPcGeMZuWhWBOWLuqQ7zKfbYDCfR6auWvvvz4upSBJcwMQBRc2oS62Fw5zOOI iyCQ8BbJukJgE2PxlnJO4ChSSFVjpozmy8Cz3O5NgGj3E2+gqW4YW84o5Tt4BGIDdrWs ip1FuiEBF6QkvPy3AgEao/eeUtFE1sNFUdNtQstmqSZ8XAkx0+OOamJHSo9aIs+N/j+C iOXCRpqfQwd1H0i+fzOvMFavq376g4kSy5HxP8p7EQjCorEy6EKztomdLIA/mA2aKjYi 4xktH2mnEi8zCitqCQKKbNAhJS/yDS2MF6C27ARuPyXSmpZ9c7bigGZ4DV83Gqqe3QeL nyBg== 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=Y9jt0KFPXZyKiMoWsnkqwHtvAy3ExqCj7/xmYuraDMg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=hxdfaLZWt7ev1JYlgRu5DUAF2QE3t5hYpbDhe+/4xFqhvU8bImh/lmq7fHtKNR5GoI PDhvjdUeJk5qfGsAVU6JylTml5VFMN7C+k/3INWNsJd2m5kWgCfbcJJugcdarhoxENWw KksDt6ezidKyEGvrYFGyO0cY4+WZGJT3n2/L/q9BkKHT9t9Q+kr6sndq2FlQXDueXTtL xyOpoCbZFWiRGd0Qos+0OIYde3h8ysL6DW1bRkJTE7XNq9Ar9hxB7cD/E7/oFViKaHjf 1oReU/jQuz5s+r3xuKiEwTlKcO2gMwXvbm9GSEoz24blg0WtlbnNs+hi4sP9NJq8lUy8 oCwg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zC2WCdkh; 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-7b6b5ad3fc7si1660903685a.641.2024.12.10.07.32.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:32:27 -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=zC2WCdkh; 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 1tL26X-0004aJ-P8; Tue, 10 Dec 2024 10:24:53 -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 1tL26L-0004JB-6R for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:42 -0500 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26G-0008Mg-DZ for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:38 -0500 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3eb6734004dso668689b6e.2 for ; Tue, 10 Dec 2024 07:24:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844275; x=1734449075; 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=Y9jt0KFPXZyKiMoWsnkqwHtvAy3ExqCj7/xmYuraDMg=; b=zC2WCdkhNZ2OOKQvUp8CppY3CycHd6WRVD8u9tp2Ek+iKWZFHknmZIk7/leRc1GWTa 0eewv4AXsRQdlj/IV0FPw9uidaCl/3WxAyHJO841cYNDa7gs4VFL2fWgAXgej8sBgdrg OWPAvsNB5+/qmqEhzlvlVKAt/fY51IZmt3n2iLcBRTk5G3fRIvBgOjjG5fdKUChMtJYJ qm/EHdKp6RPipwF7TeF27yWHVfcgOSrO3dA7QyImE4waZ9LT3yeabaO16Zv0Q5eW7O15 17FUzv2WlBHJPtvDs/3fJ+akTJ9Ium0T/G/ZhLTT5CZsePwVSphhnjB7qC5+QQNEsa1k KoWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844275; x=1734449075; 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=Y9jt0KFPXZyKiMoWsnkqwHtvAy3ExqCj7/xmYuraDMg=; b=NpdV43F4wiAhzb92qEFegbE+aFVXF/h2hS2vv7ktCDTeA/bzoxIeADWLQ8mlypwKwI C4rhWNVmRH9yGvv2fbbM9ICGPGloHFJtrX834g5XQ9jHBuYWPg8Av4tCyVslvfyvVLM8 Q8vKwhpr6Kzpj6Nhw5fbPZD4FrzaHSvSNKrE3+99PQrW1x6AwfDc43KGCR/WPcXrOpAn xOmlu1hvEuPWWz+KRYYf9uB8PkZ5qFY8YvynGzQPgsDKFXDr0U/ZqyAkP0OHw5RbpPy4 HBKIVOa4dMYv5gfHPvNg8aWR7vUh6ADhHCBZ0FvSxcGRBkfjLeQdGPxkjPQTvLpo4F3t Ak3Q== X-Gm-Message-State: AOJu0Yz7xHicdHkSbnJQUwuPFY5T27esWNv/VnfZWKhOhL2NMetrp1E8 Iz++x2yuxBD6Gnu+CE2Vsz4QV6IgtXFtmOTymlQmz5KAuh4UNB7EKZy1W9R2UxdzDBNlcXFQyBx MEEw4QZ1z X-Gm-Gg: ASbGnculC0K0t5KoUzDBj6tUKiLARCMZkIdamTyJWiAcxGPAgARLcMUNvLQt0r0Dk4M vFvjNatvnzbhRkRnjMM6bBjQF5gzPoEyHw7gtLccTedtTZRrA6KgdTGoUjQSjhahDYrz9n68ltu 7BIfjy6vh4Hn4YaDWdviZkLKRAmwYOv3vXxoSrKUZ6yAZMjgW9mAa9NlXe+UPPpP5Dfl9MfJQoP eDBObTyzbHgCu4zOpj0cK7F/X3oMz7xUymrG0I230voc37aYdTchBuKgMLphg== X-Received: by 2002:a05:6808:1992:b0:3eb:74ca:4409 with SMTP id 5614622812f47-3eb74ca44c5mr1330348b6e.6.1733844275412; Tue, 10 Dec 2024 07:24:35 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 21/46] tcg/optimize: Use fold_masks_zs in fold_nand Date: Tue, 10 Dec 2024 09:23:36 -0600 Message-ID: <20241210152401.1823648-22-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::236; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x236.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 111969c2e3..924ee165ba 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2011,14 +2011,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_zs(ctx, op, -1, s_mask); } static bool fold_neg_no_const(OptContext *ctx, TCGOp *op) 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) From patchwork Tue Dec 10 15:23:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848757 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384543wrn; Tue, 10 Dec 2024 07:26:39 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVDaU9ov9z2gApfybsSU4Gy2YQhI2/Y7XRPA/0bmPCOQIFLX2U869tixWIRaK1YBCAW04dnkA==@linaro.org X-Google-Smtp-Source: AGHT+IGuUAUp9FVJq+a4AMEXCW5ScAhyf64ontmw01r+vt8gorpwCYjXkX399y0d6urYiInhJgXC X-Received: by 2002:a05:620a:1922:b0:7b6:d1f6:3dc with SMTP id af79cd13be357-7b6dce09037mr654872285a.18.1733844399518; Tue, 10 Dec 2024 07:26:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844399; cv=none; d=google.com; s=arc-20240605; b=JRuOVMMV0b6uoEwc48RTFgO5EiVSB/41j7RzjX5xT6LvswyyEb5r7giyKfqW4K4wsd 8IBsDlLIZhP4nB5305w8bKEf1lkedsAXj1D71Arn1S9/vNfVSL3zu4rQdvNFmI01ZT9m pzhbFX3DPbRTT0AzDH9pl1CxszEVggy++ikzfSBsJjmftK1WeQWSuA/vtK18uSAksv+D P3v8Xj37NKh7a67XVXt5vn/1J4ZTFcHldGknD+r6KJne9xhv7ixbMIHjmeGQ/PgwiD2O mhg57i74r1CWIjUtzw79DWNS99g2TKGzHVfOCc8tZqLDoCR/MLrkME+3kwzpB1Q6Ucdk vmyA== 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=fDqbz2y4ESqbqsJO0F3l9Ze9RV/p9/mXAODR+b30Yds=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=E6dDNVqpJOc2KBobxKFuO8gHqrGBJeL4DZt/PH/dUQXmZ/brGimmX3ktNek9BjlB01 mvTi/PxhvmqzcN51wxi9A31xULXFqvEugljeQ0UfKE1a5isenHEu2VrfLcHF8pbwBMWb Qeuvfa7UPgobpnfqmK+4Mws4F0gf4pjMSCNPisZcM0ZDJU1oLKv8nN+8KKJ+pcYvcKAZ r2rgNx/RnHhD11DSq9KdricDXhCmhtTaVGFaoHmgX0QLwOikt+FZv7Z9rAuTn0fMwDDW ChtG/DqVtzjw7/nNaH1XvWD1+YRc4HfNWbUBsvpWutLCO2NmuIwWoQILdL+zZg4UeIpL +6Nw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nNqGnzmn; 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-7b6e22e4be1si138494685a.185.2024.12.10.07.26.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:26:39 -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=nNqGnzmn; 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 1tL26W-0004X0-AP; Tue, 10 Dec 2024 10:24:52 -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-0004Jh-68 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:47 -0500 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26K-0008N9-Ui for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:43 -0500 Received: by mail-oi1-x236.google.com with SMTP id 5614622812f47-3ea55a2a38bso2953823b6e.1 for ; Tue, 10 Dec 2024 07:24:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844278; x=1734449078; 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=fDqbz2y4ESqbqsJO0F3l9Ze9RV/p9/mXAODR+b30Yds=; b=nNqGnzmn3qpWT+LGVrlJWVCyZdRuwhHJ9m0SUQjOGymmb+gJKOTFUc8kzUNf5Oj4wA YFJWGzs+LlMFpyp7itKE4Qb63q4GQ33PDG7yrbQBYGNMc6xyZhwWOLmkg4Ug9xMGpuHf PY+ZJVse2ftBSeUKqol01C6gMfhSCLiPwDVXN8TQPP2TC+KxQWJYehTPbVM8gHOESTeX J8Ch6WXym2wvb2tDGewpYJlxFJi3LI+K5rkMthJBe8hosamG5EGrwdhsAxXzLcK5ax0k mlxB7rYf7DjKdAUnfbBf4nTiLittni2wBAG+Q3QllkkuftxDoa/N7AQXRmy9fIltipVr fKcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844278; x=1734449078; 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=fDqbz2y4ESqbqsJO0F3l9Ze9RV/p9/mXAODR+b30Yds=; b=NXjCjgeXyL+TPG9++D53EkpKX6q0lHQorJHfcKyKF5U7DqdD/AA9HIl9cB0dCU45uj Rk8ToGd636O0iT0nr/q7Np7SlNv6qWEpmeI0gKzsMrUXfL5VglmAzTkaJAAodr/Th3ez 2htkkPTv4n54u7DmIqi6W6aodqfCcr9zo2JwvBYdsYb44bDVQelbSPlnrL6lUMNf51zM TWtSmOoCvBbEvViMsXxI5iDOkrZUBDRE+AyzB2QDM99feAGiK3zgTcl4EszBKJfFtS8T IkuZ1d8mLZHC3fej9Ba1OG3mvyjbDfg0SRpIylZv5O1eo1D1magYiLFef70nia+7KQjU Shgw== X-Gm-Message-State: AOJu0YyGmj2B2CI86F3g5zOuh7cgJCkTvKcxjzGlmN1pKuKXV0E3lmvJ Q41gW60SG11HoOjYA1ymnmgH49wVam9oE6x5OvdDZcr6iyOwmQV2L4zsKEI0ANCcLZWz4RscKBT W41pu0B9G X-Gm-Gg: ASbGnct7IQxDLmlZeEtNrVFo6ZK7DHU5pHzspfFGHmjXlSyWJxYxFAiQNheD0cY1qhg MrqwDeE3jr4YsihXVmGOW49NwxwkJ5pmjupUeWTHqQaLROxW38Z/v+bVs9jQGRqqaTsRO8Jyo9r Xg2NkVoeVLEfYiUEOT7GWP9g3rft9K0HJFLTZwG+WuJPRDA8CABjuZ9SgFGP0jxqKhYByimLMU0 ef+M4ZbqIUrXwhb4jwk7MXTQgx1BBkaPoO+1/zGhbA2jzTmnuGYvK0iHU8V5Q== X-Received: by 2002:a05:6808:1825:b0:3e6:60dc:5aee with SMTP id 5614622812f47-3eb66dd9a29mr2879441b6e.3.1733844277745; Tue, 10 Dec 2024 07:24:37 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 23/46] tcg/optimize: Use fold_masks_zs in fold_nor Date: Tue, 10 Dec 2024 09:23:38 -0600 Message-ID: <20241210152401.1823648-24-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::236; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x236.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 cc3dc91d3f..aa5242a380 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2039,14 +2039,16 @@ static bool fold_neg(OptContext *ctx, TCGOp *op) static bool fold_nor(OptContext *ctx, TCGOp *op) { + uint64_t s_mask; + if (fold_const2_commutative(ctx, op) || 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_not(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848760 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384786wrn; Tue, 10 Dec 2024 07:27:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVKh6Gyuc8R1ki569S/X/41sC2ARkl4ZnRuD9Em4Mdt6ziL5gCL9oYOM8m9MX8m3p3hzmEESQ==@linaro.org X-Google-Smtp-Source: AGHT+IEWtwHjcTH3/D2LOTEbNWv6NlWmUT9vi8peY/37zGDReRCRXLtaIWdlgJy5sw1w+V3bF7PR X-Received: by 2002:a05:6214:1c45:b0:6d8:aba8:8393 with SMTP id 6a1803df08f44-6d91e43e65emr91683076d6.44.1733844429219; Tue, 10 Dec 2024 07:27:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844429; cv=none; d=google.com; s=arc-20240605; b=FYhpZqxXOIyiQHvwaESPxMY/Mes4NuDeNsLvzzR9UGlxXxD3niJT4IO26kX8jakFgG M8hrkZAoVJywugVlEjYu/dfSrRBq8EzH4kAYzlij8RsCK9Y3BDrlqVSTf8iDnvpnQWpI bk5otDIKsGqoHZP35M/iP4wBvFzot9yZguzxRZ7fspdGN4Ma63MBT4msSM1OyvaI6dCr dhXl8H0glLzILhmxe1JuprXCJ6+/b8SdhqPSt1x2/WazWitOe9pgnpmTxRZF+Zbhq0xN VXdzrxLqXcNQhELYZWeNYyFoMIIWj7FC9wCK9o6CTPcA/F2Y2EBXPrMJDBfGGKPewk0x CCFA== 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=vaVhD4pwusuN3ySvT55EuegkiqGpEF+hb7CVAo3aOGM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=DodhFoFuE2oyrtdA/xgFjWhNQhwDSV/XrGZbboNM5E6MbrJBP1EfpFY4FUwlD4WFYR GlMSQNPPkq79DyMZ8PpceVvR0f+BUlcPFfDpbMQ89a3N5eKP05gt3JX7OC+zafewNZNO Wp/1eyVkFsjY62dLsGvyC1i3cYyZ5OuND5ce/j17lscP/c5ayKXHJ7dDDR+N68QEpW61 3lx+zCRq+mknWInDMSKrHF3iVPGJfTQq34POMrw5EHxh+DFjv/Dgx7j91tFEv0ddj9vT oHP6I4lswC6Oy8v8YxcUBSu6qItUP8W8D/bvABLrxE5AtPKubDc7SiThHeT4shzjmPgM v7qg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="c/iNKPYi"; 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 6a1803df08f44-6d8dac45b39si139477656d6.533.2024.12.10.07.27.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:27:09 -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="c/iNKPYi"; 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 1tL26W-0004XR-Fj; Tue, 10 Dec 2024 10:24:52 -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 1tL26P-0004Jq-H0 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:46 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26M-0008NG-TJ for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:45 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3eb790888c6so136063b6e.2 for ; Tue, 10 Dec 2024 07:24:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844279; x=1734449079; 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=vaVhD4pwusuN3ySvT55EuegkiqGpEF+hb7CVAo3aOGM=; b=c/iNKPYiSfjlMYdOtSo8lldgR1mfiOGK6ZaFPrxlAgO1M9HF7L7F+8n/6PIqCfeP3W EUncK+FmXmOxPxYlchTSJ+ucIu1bsZUzbcJ9RblGblklNV9Br3doM4UwxbFoGByBP7on a9Z1QrZiZU8C0ZgdU42k0axS+W/QrSCkO99Fn+I6c6qT9EP6t6vPSJ4Uir2GtzBQ6Wpi iBAqi8fe39MrVRsTixMl1qHzrR/nHWB721+N5WUSXDc5e8ya5FLB8zg8tCrzhxPMAKyj 48yTaZ0SNYoDpjZM4dDEH5ySUkSf/LLg113Yg0+D4dbNYLrn+IWnOzjMgTRqJ94Q6VQ+ Lnyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844279; x=1734449079; 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=vaVhD4pwusuN3ySvT55EuegkiqGpEF+hb7CVAo3aOGM=; b=u9QwU8IriSzLqFS1w9PyU5/7slV+Y+wA4511iPEbmbPU4ScshAXEqzpcq+9pOQYvBF fYRGaI9eAItNRl/XLseWLh6akChg7X0eHv8RxnBfclJlcN9Nb5kRDQ1D3cX5qWALHaXz ExsVQnWo4end5bNEGUgYDfPGa1Heoi/90AnbBKkB2nvGCK3fnmA9JKeUfl/4DoEmzvLJ 2aR1Z2jx/Ji5J5LWkCNUET7sgwn5QH1kiI9M1Rt+DyEjU7qaxPKcVJJsOLVCFh7THPB9 Cug6im20GEFYKIaY9zSCL4hbDF3tCZ1BtqUyZ3PkHJqt8qZgmy/bMEP1DVKUsTuaMFPL +Ekg== X-Gm-Message-State: AOJu0YxT4DX6Ag9pX33bM+yZuSvxYc4seKYT53OX/2FgfT9VisXgj1x7 bM5SAJuRuy7qjhzkXf5EoumGaJ5KV0ISHzTE2H/kv2yVD/Lk1B+3y79la84jz60e8QzY8gx/Lr7 qR1fkXvp2 X-Gm-Gg: ASbGnct1kfrVzJi2/hdF5zFYy99ANZMmqO4egteXx1z+7fLT+GVDv4n/NfXFeI5pSw1 LHcQCTLv1MgndedKLyZOI11oLPTUTWqTzQtIL4io6eo3I5dfLzENXiQ/li73dnE/VudUc/AVBJr 9ZY2XvlZdnE5HhFf9d6Axreu9dBs5p+rUhPJqVYvG5i2wivcPheSDGlVhIAFg+R2B0XfM22FrHA JgZt4P7RwcSh4iSCG4E0lNERJV+XwAJQdBpPjPp9Bd/G8GzaleU7VuhZRseMA== X-Received: by 2002:a05:6808:1815:b0:3e6:3a82:f790 with SMTP id 5614622812f47-3eb66dab5dfmr3490885b6e.6.1733844279085; Tue, 10 Dec 2024 07:24:39 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 24/46] tcg/optimize: Use fold_masks_zs in fold_not Date: Tue, 10 Dec 2024 09:23:39 -0600 Message-ID: <20241210152401.1823648-25-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::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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 | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index aa5242a380..ae1386c681 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2056,12 +2056,7 @@ static bool fold_not(OptContext *ctx, TCGOp *op) if (fold_const1(ctx, op)) { return true; } - - ctx->s_mask = arg_info(op->args[1])->s_mask; - - /* Because of fold_to_not, we want to always return true, via finish. */ - finish_folding(ctx, op); - return true; + return fold_masks_zs(ctx, op, -1, arg_info(op->args[1])->s_mask); } static bool fold_or(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23: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: 848783 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387824wrn; Tue, 10 Dec 2024 07:32:17 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXME0AO0AUYFb7oS9mcNQywKQuM0ljwj0HA8Qig0NO+6W5Z0d/wOdkz86nXuznBLmj6hBuo0g==@linaro.org X-Google-Smtp-Source: AGHT+IGwxERVlOKQawh2oBhFcp1wMoPOELyqR7w1cb0SKKIr63IA8p68U4mWUi+oXJR81UftRlY9 X-Received: by 2002:a05:6102:54a6:b0:4af:a98a:bd67 with SMTP id ada2fe7eead31-4afcaa0fffemr16509958137.3.1733844737258; Tue, 10 Dec 2024 07:32:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844737; cv=none; d=google.com; s=arc-20240605; b=YRTSR4WixEyRvTCBVZuRxXlReNahUbMPw9Obqk9+AU0IakPNTwuTnJCVYiMvmY546K 1E1lJN25BpuOVexgSP0Bl7sAbS9D4mhT8/N46XaVCrHxHQxNGktHWtJq+PJQJvBzNFCi Wbj+uhtgx8K1DKG8iGM7GKEAmLIxsZ2KMRZ+iqUDdNUiZ7yvzlafcm7VllM91Fbf7rLy cdl4dzLy1omrEpjK341V3mXNXpN3iMoa1nejGPyEJWFJqCYZECn45DEIIsS1LGQr1RJX hbDwqYSDHNoGNt/4daKvw/cofPagPt9TskhEIM8VVI4HBtgYU6lCTflj7/0/sRHD9obr NIow== 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=sQj1vTe/azWkpGgK1LJA2uc6pw6ILza790vF3QBaK8k=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=KbgkWUOsX77t5dRcrreEHJnTc9nQDKP9FI2yDMTuxm+9udNPJmKNzw4vFJBxGq42qF xCyCyReHlI2OQBlOEH5Uq8YkNp0trFmrZlB3v3SDL6BjBYByMJaU/CXRO8zTi6vxWOhe rSLfBV2WfNKszi1DbFQMBvjmXjU1ajSrXOg4WG0N5LC4L9fITmLsNjzNBm40CarmOoWs NW07EbNkFVQ/V0JDHR/1k7DbTcIhzN5cB5Ir7mIa2r/HL64TK2I6ysI6mqvuNjztwsFc 7zy7nNGLhF8etQQM/qHwEVutrMqijXhPVsfvHDcALvWwgCMOFZSJQS6Nuw4jbSC0Vjav u2Ow==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=LFx8NHs5; 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 ada2fe7eead31-4afe7edc6a4si1399621137.607.2024.12.10.07.32.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:32:17 -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=LFx8NHs5; 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-0004Qz-7Z; 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 1tL26Q-0004Ju-7Q 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 1tL26N-0008NN-BS for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:45 -0500 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3eb45232717so1258170b6e.3 for ; Tue, 10 Dec 2024 07:24:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844280; x=1734449080; 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=sQj1vTe/azWkpGgK1LJA2uc6pw6ILza790vF3QBaK8k=; b=LFx8NHs5s5on0g7x5aKvzT2t5GNL0dudNBU6njGtUZzxyHHX98B5TQihlBFSFiJS/g ZYQu/sHCdr/veRiFi1hUwGJerWR5RsE/eddX5/F6fqj2MJYH3YwR4RZAV89wNN5vflNf VbBaR9aoYC+GhYj1dP7CioHj5Yc/K4jZLNDhxwLFTqiGKPfDR/jP08STc+8qTUS3z9Ay 1B+I+s6j/J70RghoszFfJE9LDWte+tiCt1m9ezyXWfMgAEXp6esqrMoMBp0MN+g6lyD4 C1s355WHUwLcPqkZLbSgAVxFkvwNZ0bijgBErltSAJMC5JhJobG5P3dFFbTzvGiMbuwC TqhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844280; x=1734449080; 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=sQj1vTe/azWkpGgK1LJA2uc6pw6ILza790vF3QBaK8k=; b=oo2FwZvTwLdV3Is5ugfopMNf1ws4Gq3Y0LLbAk8g3lNmIWSmR8y8S5R7VVRs0UPSp/ VhtYa5MpevcZYFhAfyYPkKAPtgAvXQ/6UwOt7JXe1uiF+ygRaSYlKLMc7Mq27lJbM3KT H1RhJX9zJ9aE2zMKuieQDjp+HjObII+NBjwS2QgxkOiOetLxFf4mmrn25rWyFXSd3Q7V 36OwUxDjvjsJ0p5AK3Hkq9iDSTn1nRxkXBTAlOA6xATvbHpCEnPIvMlfe0P1OJhbyjRI DDkLKDIkox8qPvMkHReaGRTIQr8NqHrbcyNnvAQfXSLaPIA61O88r3w2bFjgH+k/b1XX xl8A== X-Gm-Message-State: AOJu0YyAiHLIYzIP5hGQ7OqS5PKJI/2/6LGf3D5Nc6Go0jSdci+6vWLX DryE3DGrxRJaISmhRqo9o/zZSnCLnZbwnEmKZ7mgVqQsqYjSsj3hSGgGWWfn7SR3MEt/YLWETrK wfNbl6bUk X-Gm-Gg: ASbGncuRSLVJvWZWC8SUjjY1TnhLa4e7m/XwysuSGXB4fkTtv8/bE6fMSYRItpbpqkV u7aJEWqcRJ9fz/r23f7tQBZ/a6yM5dNFWwl9DYMDYNARVsEOtTGc1xZVI9RMYjxbNMRyrSll6fT yqB3Vi5LGFtPe3TbS4zPvjBPLL4otKhSVq+o68OQ7QGbLVTSFy3sH087FxPlnamqAmOjcRPCm2q C7T6AS51DIcLrI7wErvZoE2BWbb6KIhAWATSjiDpbkjcIPWm1bsGT4eTKj6wQ== X-Received: by 2002:a05:6808:130c:b0:3eb:6dd3:12bf with SMTP id 5614622812f47-3eb6dd315bfmr1738145b6e.28.1733844280149; Tue, 10 Dec 2024 07:24:40 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 25/46] tcg/optimize: Use fold_masks_zs in fold_or Date: Tue, 10 Dec 2024 09:23:40 -0600 Message-ID: <20241210152401.1823648-26-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 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index ae1386c681..3d852b44e4 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2061,17 +2061,19 @@ static bool fold_not(OptContext *ctx, TCGOp *op) static bool fold_or(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + 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); + z_mask = arg_info(op->args[1])->z_mask + | arg_info(op->args[2])->z_mask; + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_orc(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848759 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384649wrn; Tue, 10 Dec 2024 07:26:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW3aD/WBAE9IFu2Kk1WWe8etdtLqGR9C+oifhypbIiubNeEgfrnbWEktby/7auckganUbTrbQ==@linaro.org X-Google-Smtp-Source: AGHT+IGroPUQ/8VhJlbeoIs2EwRhma/Luhh1GCbOGEtSdlXQyd+iqLHSd+2BCoyIC/3OLgdoXFNB X-Received: by 2002:a05:620a:2b4b:b0:7b6:da2d:73e5 with SMTP id af79cd13be357-7b6da2d7a0cmr1042287585a.27.1733844413287; Tue, 10 Dec 2024 07:26:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844413; cv=none; d=google.com; s=arc-20240605; b=GJjqMkbheOIw4++96PEqygx+aJ30bpTpTtHt+SbGELuSggDnJqgqdWIAFMEs3P47Va gC417K23R91WvJiZX5BYwheV6JuX7XnnAyZ5bDOVFj2CE/f3Qs5u3zp6LawiWWffNy9g hhhe83uVFKjc4APJwh3WyxF7nVSkKhz373hWMAIpRduFenRt53EuiY2NzVg+m1S154m4 Zdf6ZidL9eB/7muqUgWudPLK3UDsMWleJbVPBLzhvwJrIyKq0OUquTJDEZeybkFxtk+i D/p8BxPLzMMpSKL3d2lUVERMtk78yj2DQB2dtKl1Qdw6vIO5rKvcmd3BvtIWindsR3RN 0qOw== 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=a4N9bPFDP7T+aM0K2UyKGwYWn3KJAmJBBMEiibnYB2M=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=OCrX4TZH6yEJeBSTRVCUNSMtApCSdnaaw8AX+nNzyb5b0UXgtTYYXMWe2cOV7GTx50 VRpJN1FCQUnQU9sUTSe+nSwuHZOqaQ4Ij94LbGUWOsfkkCrMt1W+nJ9aUEFkizCZvTQk qjiRSwrFYQmf8bq1VJWsdBBIiQoyEHNlJmbM78Z6c90k8Z5zs+vdG/TAa4aqpntHVruM JVqVCJxm2luIkyuEn0GaoLmzIppusrfyiN9H4lH47T4OT5KmFtmvOzbGXPvn4niSrjIM DzVF1IG56R0xh+dAYzpXfqaDJDhYzVTnCyeHbG0HSEqYjq4O/1ijPvJGbhKRiAfJ3rWl YmeQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YpERKiva; 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-7b6e921170dsi65187985a.322.2024.12.10.07.26.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:26:53 -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=YpERKiva; 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 1tL26Z-0004d0-Dm; Tue, 10 Dec 2024 10:24:55 -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 1tL26Q-0004Jv-7p for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:46 -0500 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26N-0008Na-Bd for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:45 -0500 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3eb7ecc3c54so115794b6e.0 for ; Tue, 10 Dec 2024 07:24:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844281; x=1734449081; 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=a4N9bPFDP7T+aM0K2UyKGwYWn3KJAmJBBMEiibnYB2M=; b=YpERKivaD1595GSpJ3+13xBbuEfubQNfZeGI5c2w8RB7nKgwy7gire3zctbZETB59d SNGKkhmmZxFdTdsG5KtoUVbOHoAVTi63zFzsO+DTbFzfkw1JfuwrOtCmSK3MvM0T4kfT 4LtC8dx6UyqyDIbLSaEOhJ+dStAXKo3pq+U2lPQGHPj2672/pQZQPnaKPPNoqlgDQUxx v6I+dhZASbzWMITF09OHXS5O3OaybyV/Xj/1DvhdkIKzHpV0i1B284tBpWFFpxdW9G/I YivrjgULb3v6dcqSVosJP+TU/nesCf29REO7CGjbLPr1isRKJ8SClaO6taIqAXVM3qj+ 90RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844281; x=1734449081; 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=a4N9bPFDP7T+aM0K2UyKGwYWn3KJAmJBBMEiibnYB2M=; b=RNv+EpOELeQrrMHQslaphpIL74shW6IdAegu5sUJvJ+nmPamA1nc9B5h9WbHQZVi/c xr8iToIwqFLuAZSI36ZuvfVo3oSbXZO83Fvp3ttDjzvHRlhe68QAcNDmbLVaSQwueSpo cVyzJICGrS0NaO/mhEwIBS/EnAlaZ2ubLU2AtK4ozqKw41nuth8RgMmSpQDL8FIFAULg rUxMpXhiO9kaGgjoLId+6dWFZE8vglhMwcGfc57ajV4MKnJ4hsxBxlwM3lWRXCciizV3 QjGL95lCv4sSAozzdHlvZBDUVEZjUQOfXqo0DJiWdaplmM5Ki0wYLbVgKS86ZnvCyq1y B/8Q== X-Gm-Message-State: AOJu0YyiGee5OC1wr9Xwn21ipHBepLLiuzm5/a4Am4dYFL2QQ11Bbiww boeOWZmRHlm5vr1IYarZD/SY/aMypJPbSyiukinT6RtbkT1p505Ctqig8rA8oTA4EJaHr3oVg2o kaiuH+hwQ X-Gm-Gg: ASbGnctvUWoNjdwsseLgIKQKx5/Ch/RopqsUCjaJ58V8qiVPALp1taxH1/gyXLIVDND L/rd8RZAP5r+5PQ8HfJglPQqKMbWV5A5YWl4xvSgyp1b9zD5b3JOK5H1Zo+eja4XueC0+r5xKlD s1od28EfrtYdlfTtEDaoq4oNbZBPQJzt8xab1LYVzwwlWjRucKw9zrm0LMp03Z28Xs4RTRDuQuj FrzEoFmSGGev9PLr/maRBYIyd5oHtlXkjdFwcdOExDy7lMbtJKeqKvn2gqunQ== X-Received: by 2002:a05:6808:498:b0:3eb:3bcc:a9e7 with SMTP id 5614622812f47-3eb3bccdcd0mr6842475b6e.34.1733844281423; Tue, 10 Dec 2024 07:24:41 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 26/46] tcg/optimize: Use fold_masks_zs in fold_orc Date: Tue, 10 Dec 2024 09:23:41 -0600 Message-ID: <20241210152401.1823648-27-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::234; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x234.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 3d852b44e4..76ad02d73b 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2078,6 +2078,8 @@ static bool fold_or(OptContext *ctx, TCGOp *op) static bool fold_orc(OptContext *ctx, TCGOp *op) { + uint64_t s_mask; + if (fold_const2(ctx, op) || fold_xx_to_i(ctx, op, -1) || fold_xi_to_x(ctx, op, -1) || @@ -2085,9 +2087,9 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) 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_qemu_ld(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848785 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387976wrn; Tue, 10 Dec 2024 07:32:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVHKnORkai3Kunpx/ZP8h2RXHaVOUjsVyNJ+/YO0Bz41/uRCY8FJih9CdN5/dd1uFzGvg4rIw==@linaro.org X-Google-Smtp-Source: AGHT+IHjGJeN1MjzFyqEoJeCzh14P0wAo4/8sNWIFTNO0DQwOrnWuR3TgubGMLIr2fjhIsWKRIXI X-Received: by 2002:a05:6214:d8f:b0:6d8:889c:54ed with SMTP id 6a1803df08f44-6d8e7175b25mr261739906d6.26.1733844752418; Tue, 10 Dec 2024 07:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844752; cv=none; d=google.com; s=arc-20240605; b=Y0vwgF7C5pWengeJFP4d89j4Czv3DmpNohgifHV+kYYyaXHmVzuyQ4CKTKVmD5cPKa DBJYnYrEu7OKbBumWOc4MCfrn9hL+l7CnCizjFjlnfg5fI2ZY65ZX81sxJy4LRwdurHs xXcewWBH89ZFt692oWmbafSac6dAxN/pgre79i6ICHZv5tUzJIbFJww8n1p7qIniQHxG 3Z+3phzA9u3jDvRArPxXL3loONDCX8KKAm2vMytaUVLb2szp+0io2fBxQpaYPRczC6kP AC4QfEYIwkyHQrEjSVX72CTU6rc6czoOEg/JkGD9OVWnM6wtOzhEMP/pc/m1d7cOgNRw vqXA== 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=pq5MdM9DhMkAXeYGoQ73cVGbD5KT8phmzZmqweBcPyM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=HUatv7CqZrzapTAZohOdygJrcwwaEmMaQqJvsrMYUUnYsuAEvnctQrOOk9U+DG3W/9 11qzx3pRhjC2Gva9uRsV+2fZ4E6sT4ssnLwgVyDX2JuD0mDGdJrMVuc3X1iirXDR6j1K wqPBu7W4xcmOrVo+Ot07UNVeYo3NU8mGCJIpNMytsu8LMFQ0xxmaMlxbdx9ruRRXqKNd 6Mi5UftaeJgjEjv1uKgCiNnOUydBmfLbHHvkHCIeDVRS5k/v6kp9sHOUBgJmSyqkfx6o wswCl13oijFcbji6HIqRzwTjwbHG6+cPkL7ttlIJmVSG3XdtcYF9ckv9MJgx1Cj3TZWQ Ur+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kH0ILhdp; 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 6a1803df08f44-6d8f4ec9eeasi99736616d6.77.2024.12.10.07.32.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:32:32 -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=kH0ILhdp; 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 1tL26X-0004Zx-Lx; Tue, 10 Dec 2024 10:24:53 -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 1tL26Q-0004KY-Mn for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:46 -0500 Received: from mail-oi1-x234.google.com ([2607:f8b0:4864:20::234]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26N-0008Nj-Lj for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:46 -0500 Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-3eb4b6106c8so1152611b6e.3 for ; Tue, 10 Dec 2024 07:24:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844282; x=1734449082; 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=pq5MdM9DhMkAXeYGoQ73cVGbD5KT8phmzZmqweBcPyM=; b=kH0ILhdp1BxKRgHEEV4lXVNqBU4BU/TNGJmQVSTRu3LxShc2ihrfvdT4/3yNFt+JvL KcFj8Xnw9BADFXCwcWrmx4VxRIQPek2OWFaU5syclMVw7VPSX1yAhaTjxRmMToDO4ay2 OtZjNrZUzQSh3N+QCSC3oMSUkk+R0JR3Ccr0fI/FimKhd19ve2Y7haKkgawbP3tHXind HWGK7o3fBYtHzwTpczTl7C38KEGf0902xnl5JCYnBY4MylUOUc/Txkb5P/IdzSS9rEZd rgQOiKTC/Z/YcbvuoQVgojFMkhJheYIV+12dRECemtfaLnAB1KhB7REGvEOBcPvdmbmg MadA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844282; x=1734449082; 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=pq5MdM9DhMkAXeYGoQ73cVGbD5KT8phmzZmqweBcPyM=; b=Rr+bSBALQoxTLjTUivKCdbZvd07a4BluRrGAfZYhdypvx0hCRr2ftm1fVbSzYX/4GM epVSrjzKRsHsyxIDiWejBNe7DsWdq2emgeo8TSK/56Zz1J4LAtEkrzUM96bd1p7lpYns M60h2iEbu9NnhPN+B/2FzicBSO7nkDbAftEDPJw0w0JdGZPm3AuWmgDDtu17pJraXVvz rB5bJHI+B8yMISkaRCjVDdcIx9URT1WnX/d1IDhTgQqWystcwcYmt0cj/KgsLLxFdL4e VWLDFj+UOWIDMWYgqp6zOAsR2Ind5k0cdaN13gzxiVv7XthPMTDDQwLjd6/8JI4TbJi1 3jhQ== X-Gm-Message-State: AOJu0YwBLW7Qp3yysMLr/UYSXHLdq3lSf/83F8ki4YhqnYvLOZDBcp3W 4u/Zpk+Uogo0+8tFynzzNhLyAp0PaFHpU22rywYcBw8cnoU3hkhCDWE7K85cr6Swu8TCe1Wt5CQ fXzRuG3xE X-Gm-Gg: ASbGncuyGLPfHa+PntXA9n3Lb64eyh5+dzshtu70/EmvOuYjXRlCNoq9tlT3QaRzflk O6Iio/3ARziDQpwLO9ntfgv0Y7ETGm/rHyyCuzpspWmXCvdSihrqPwExj388yqqXRD15ehenD+R 1q6oQLSXhHKcW7eulEaZ0t6gtYOdkQTtoIyFEBSIsSax8sLFjWVkHGKT4MP8EnPKU4/lmZ/9ZhL M4MVTo/Q150NdPLv/BBSt3u78FxsFEPosc6ruGftpDPShhT+9R63jcDtBRQwA== X-Received: by 2002:a05:6808:1805:b0:3eb:5e08:f806 with SMTP id 5614622812f47-3eb5e097668mr4544223b6e.29.1733844282647; Tue, 10 Dec 2024 07:24:42 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 27/46] tcg/optimize: Use fold_masks_zs in fold_qemu_ld Date: Tue, 10 Dec 2024 09:23:42 -0600 Message-ID: <20241210152401.1823648-28-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::234; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x234.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 Be careful not to call fold_masks_zs when the memory operation is wide enough to require multiple outputs, so split into two functions: fold_qemu_ld_1reg and fold_qemu_ld_2reg. Signed-off-by: Richard Henderson --- tcg/optimize.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 76ad02d73b..6f41ef5adb 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2092,24 +2092,33 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) return fold_masks_zs(ctx, op, -1, s_mask); } -static bool fold_qemu_ld(OptContext *ctx, TCGOp *op) +static bool fold_qemu_ld_1reg(OptContext *ctx, TCGOp *op) { const TCGOpDef *def = &tcg_op_defs[op->opc]; MemOpIdx oi = op->args[def->nb_oargs + def->nb_iargs]; MemOp mop = get_memop(oi); int width = 8 * memop_size(mop); + uint64_t z_mask = -1, s_mask = 0; if (width < 64) { - ctx->s_mask = MAKE_64BIT_MASK(width, 64 - width); + s_mask = MAKE_64BIT_MASK(width, 64 - width); if (!(mop & MO_SIGN)) { - ctx->z_mask = MAKE_64BIT_MASK(0, width); - ctx->s_mask <<= 1; + z_mask = MAKE_64BIT_MASK(0, width); + s_mask <<= 1; } } /* Opcodes that touch guest memory stop the mb optimization. */ ctx->prev_mb = NULL; - return false; + + return fold_masks_zs(ctx, op, z_mask, s_mask); +} + +static bool fold_qemu_ld_2reg(OptContext *ctx, TCGOp *op) +{ + /* Opcodes that touch guest memory stop the mb optimization. */ + ctx->prev_mb = NULL; + return finish_folding(ctx, op); } static bool fold_qemu_st(OptContext *ctx, TCGOp *op) @@ -3001,11 +3010,18 @@ void tcg_optimize(TCGContext *s) break; case INDEX_op_qemu_ld_a32_i32: case INDEX_op_qemu_ld_a64_i32: + done = fold_qemu_ld_1reg(&ctx, op); + break; case INDEX_op_qemu_ld_a32_i64: case INDEX_op_qemu_ld_a64_i64: + if (TCG_TARGET_REG_BITS == 64) { + done = fold_qemu_ld_1reg(&ctx, op); + break; + } + QEMU_FALLTHROUGH; case INDEX_op_qemu_ld_a32_i128: case INDEX_op_qemu_ld_a64_i128: - done = fold_qemu_ld(&ctx, op); + done = fold_qemu_ld_2reg(&ctx, op); break; case INDEX_op_qemu_st8_a32_i32: case INDEX_op_qemu_st8_a64_i32: From patchwork Tue Dec 10 15:23:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848761 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384913wrn; Tue, 10 Dec 2024 07:27:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU/2qEExJjinBuS9Y5xQcjk3mwT5529AY+ulsEc5wx4DRWl8/pPM2G+CCWtLzqxAi6yz9dGmA==@linaro.org X-Google-Smtp-Source: AGHT+IEJo9emVRf7YfE2GUSBsM0BOggyaSoSPdQFQHkv3+WjdUBrujM1QLqum2W0hYI3ofse8U+u X-Received: by 2002:ad4:5ae2:0:b0:6d4:287d:b8d6 with SMTP id 6a1803df08f44-6d8e70d5e28mr371030696d6.18.1733844444826; Tue, 10 Dec 2024 07:27:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844444; cv=none; d=google.com; s=arc-20240605; b=jWF6Fs5NEr/T1/a2OvTspMrAQi0/ERsRO7n5zuN05Y5O5tVy97FdLns3+i5ShXXHxo obnCT+kqtoIHBgfJA+DgZg6XAUgicLVDGw5mD9GB6aoi4qRGvanbtOEIoMCRij+6VHBv cKMNUHWyVhrGlT+i8qJ3Sn3l2wzfO9mFrxUD1NxxZnkVMk0rzU0TEjUcEMGPhtYdmezK na4ZuJfK5pMkVNnPPibo7kXwcG4yo/2x0W+4dee3kZiULYvHepFOtvD9zl9MheHEy765 1z79Fc7V8EpxChEl8bVmkfZ5XUIW72eJvi2yaBJX6yY0xiHOa7nCrYpNc/yHMC5Boq69 O0BQ== 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=d4P+9Tt3wIqDLYzY9wcDFZqqW4I3YHsp/F22EZTtKAc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=XKQfrakTInJAYTvoZE0jDBcIuW1PevujmmuQuISOKj0X0XS71Me+mYugWHrF53JaiU Q81XeRyrqmV5Ke44ztpX08PKdkF7I1XSPvIqKzIe71nsKVkQgHfqTQ9pw6n74VP8jk6A 0lDN+lNOuvR9jE3gD4oe4HHonfG8r7WI+B1LLOKIj/ALc8mvpRqExQBT60DRY0ulIzS4 +I74vRfbe6qzSvUO0M32fYgDIAmCkiYym0T+vb4UTQzRGNTauPpS2JXGpXV3LDry7vPu 7qlozlxTEEyk3J6r0AFwmCsvx3pDRcX2WbM2p27ig/M17oKyoDulwhmibaWtdJCJ4eaH iyhg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hljxopk2; 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 6a1803df08f44-6d8dac0b25esi144155246d6.379.2024.12.10.07.27.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:27:24 -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=hljxopk2; 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 1tL26Z-0004cM-2G; Tue, 10 Dec 2024 10:24:55 -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 1tL26R-0004L4-HQ for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:47 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26Q-0008O2-07 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:47 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3eb5a870158so894322b6e.3 for ; Tue, 10 Dec 2024 07:24:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844284; x=1734449084; 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=d4P+9Tt3wIqDLYzY9wcDFZqqW4I3YHsp/F22EZTtKAc=; b=hljxopk2NF856ElMjQhfl0d02t6x2Nyn8ffG4UfDibVG8Jb5B1amX4sUPwCjMHeZyS CPRA5pSgIHR4SOpr5bYRf54R1BCo3d8Nsua0JVyoI+S5tf0VHV0rZICMLFgphY4sjnpU BdoWsglLEDlFS1c1GC7WUe7/rrOR8czJZgnldLHuHc7ejmizvSoWuuWqpSzrsdQSat0x WRA+eR+5wKxlyLh7PoLw2XsU3IOd521JmCpsOp3SJbaUrIdizwrMG7bLGRbWStmS+VOM Em4SK1+9v4t6z3DmXi9c23lz/pKYFhDDYoeIAPEc2NFFtu7qe7wWEOPmHIrsOe7vfJ2X hK7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844284; x=1734449084; 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=d4P+9Tt3wIqDLYzY9wcDFZqqW4I3YHsp/F22EZTtKAc=; b=qh68NlruHjM2g5D5dujvLGBst2s11rpMxZU6Y1pFdW/C43rjqNS9/G4Tuc3XC94k3g 0E8IVBbTVibjZdP+tgovr7Qr3iOhjCGW5jKBio3UtJyhgN/d5BMzKxlCKfa/ALrQ/HOb XF6nxYS5YqafcsmE7LBgIsqnul8cEL5XTdvY/pPvIwxtdKHGMZelvz0Z1YDPvxRrOubz 8/QQrUPp/VgeBVYd/KrGC6y2Yu5h1kU3dGqJxy2l/4O6j+naDPUe619pzLZh897OnWnV M3Dx+LXGB3tProttKcXj+lgwrG9a/zf8cKu/e6sGyiqcest1iNUHjpXrwCor9MAHtm9O fr5A== X-Gm-Message-State: AOJu0Yzr29bAiUVqpYNw303z2Hx0hLP7o5qCTNZ5XhgYIcDmU/VZyOyj N5GGr2/Z02SvRYFSNBaii5djssNSyQvSKyM2pa9s/RlTf5ksuzFLfmz5QuFVpnYkuicIUOAeGnG 5ElFztzYx X-Gm-Gg: ASbGncuVFIqJd4Clcpt+KiG+DHiLYYl7t0DZPoJH4IFJwEwi1sJ2x/XTS/hMABG+FMT 37ucqB3nDdvQKoit6VMtRYd1jSxbUI3QEzdNjKwUpHF/n1clYxs2VbLY2iyxb70RBwqvL4oUMtG RgqqwvCUs5YOYWa/Pa3qwfYXKJl1uiNWWcD9rD7kpEEqxzyedWOFGboo0TgR7LyiyGKjXgirk3J JS3QSo6FWFMyZunfoqF532R6G/VOL3VAwiYeOSSC702qWk26B7EwswBhI3LKw== X-Received: by 2002:a05:6808:13d3:b0:3eb:3d1b:4876 with SMTP id 5614622812f47-3eb3d1b4dffmr7820711b6e.32.1733844284181; Tue, 10 Dec 2024 07:24:44 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 28/46] tcg/optimize: Return true from fold_qemu_st, fold_tcg_st Date: Tue, 10 Dec 2024 09:23:43 -0600 Message-ID: <20241210152401.1823648-29-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::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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 Stores have no output operands, and so need no further work. Signed-off-by: Richard Henderson --- tcg/optimize.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 6f41ef5adb..ee00620ce0 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2125,7 +2125,7 @@ static bool fold_qemu_st(OptContext *ctx, TCGOp *op) { /* Opcodes that touch guest memory stop the mb optimization. */ ctx->prev_mb = NULL; - return false; + return true; } static bool fold_remainder(OptContext *ctx, TCGOp *op) @@ -2694,7 +2694,7 @@ static bool fold_tcg_st(OptContext *ctx, TCGOp *op) if (op->args[1] != tcgv_ptr_arg(tcg_env)) { remove_mem_copy_all(ctx); - return false; + return true; } switch (op->opc) { @@ -2718,7 +2718,7 @@ static bool fold_tcg_st(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } remove_mem_copy_in(ctx, ofs, ofs + lm1); - return false; + return true; } static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) @@ -2728,8 +2728,7 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) TCGType type; if (op->args[1] != tcgv_ptr_arg(tcg_env)) { - fold_tcg_st(ctx, op); - return false; + return fold_tcg_st(ctx, op); } src = arg_temp(op->args[0]); @@ -2751,7 +2750,7 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) last = ofs + tcg_type_size(type) - 1; remove_mem_copy_in(ctx, ofs, last); record_mem_copy(ctx, type, src, ofs, last); - return false; + return true; } static bool fold_xor(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848775 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp386831wrn; Tue, 10 Dec 2024 07:30:50 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV8rgfEbUrznYt2SeGWy09o8mVBkum0W0Bp+Wb+1D81jIGcLsY+LJbtE2CVD3ELdIVQfCKB8A==@linaro.org X-Google-Smtp-Source: AGHT+IEDtO9MqhDtR0fKBFN3WeHKHltr4pmSs7Pv7+1MjGgY4Fbk0uFsLL7f7EcgroBjXObMJyBx X-Received: by 2002:a05:6214:20c3:b0:6d8:861f:add0 with SMTP id 6a1803df08f44-6d8e71726cbmr295001836d6.31.1733844649910; Tue, 10 Dec 2024 07:30:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844649; cv=none; d=google.com; s=arc-20240605; b=LxOUlc9tXt55CKUVCSQCnXgyu8hKRK2Buov8DU0B+Z4oXGzDSj0EW4Jbji2cpcNHak 45r9HhAJUXrL+KQrnJudaq44YGyMZGJQqkCYy5UuUtK3NTMOsAIcjn+BezkWvhWJ2gyT neBFALoMArFJdY8h0XdFbjmA28eYfKnGot3a9TvxBBWLK1U5RceUJH2m/2X6XeOMJ77a hARCtiAz+ezO8ViSld+EMgAPGR1JRti/EMJnrrcqlQAGCJksLj6xC7iKGpgBtaNEjJjz vKRnurUASNRNoL1ILUpkEut/FO0ko0dThCyuwR5s7ekvWPMqBdBE3VNqPLefbQK64OLQ +CAA== 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=04IBAbHCp8s0J2f78g8j58qzcwuLYj4MNA/t29Jadew=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=gGNzs6XeKvhYbEu+Y+pnVsihN/ljJADkXAwuSivNkN7sYuVMyoXZNGakhcr9ZJa+qW 10BfvAF6zAmaXCa3zh7JeHNAcTY/qGTfgM2nJqQmd8mz8E3kU6TqTE2ksKwmN28MGydO TOztlemi2nsqkne3xq4HSfTR6mSFBYJwgNkw15t0UjkAQKnd+Ux3C0PpTnCl26fGLPxU jGlpwRcFmislUDFgRQl5xeR2bQNn6EWc1wYHXqCbChceLT2Dif0AX5LupCGkw36XvmDW fCyTIHw6u1iORq1zFARw/oYgIdjKnik4ay/8SYDI/eFmmYtzruZg9wXruo2uY2lmSz9p J5qw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fBeR+8rl; 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 6a1803df08f44-6d8dac2acf0si145665656d6.497.2024.12.10.07.30.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:30:49 -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=fBeR+8rl; 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 1tL26a-0004fJ-W8; Tue, 10 Dec 2024 10:24:58 -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 1tL26S-0004Oj-Hm for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:48 -0500 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26R-0008OH-3F for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:48 -0500 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3ea696c4dcaso2750947b6e.2 for ; Tue, 10 Dec 2024 07:24:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844285; x=1734449085; 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=04IBAbHCp8s0J2f78g8j58qzcwuLYj4MNA/t29Jadew=; b=fBeR+8rl4S9SFa5bkLl2WNCqbylaOBT3eK0yVMYSLurmrxyozL5yELPBfjjwjHHmf2 Ku4XUNanR0aP2sWmbRxFT46as60n+pUFbn4hJVjYsVDc+FOSSUdhwzaFkq+JtuSY4COf aStotZAsUBl/6BAXoJGnrwZOW/tZ2Znoxl3XfgY/lTRMJJg38xggoeiHDdjzMXElPC2l dEM06sz3wEai1ye51VkrZsfWvZrIsi9d4dH5Yt7Yfd9+pxA6q3gAlCTTasSFXD9VZOaT Zy7mzciY7sOprD9AWYEK32v5dq8NxbOCsxsMBZn9uEItY1khS5IkWjsiwfzZbnwznIHb HaEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844285; x=1734449085; 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=04IBAbHCp8s0J2f78g8j58qzcwuLYj4MNA/t29Jadew=; b=uQQI6YL2cjRA35SsXerfaCtJacXc1/86OaqN9ISfDOhOxMLzlNdu/t4jgr6TB2CKPC 2wJjtGs6DG+Ce4BrBEiLAe1j3wPTO6YboPKFS9qYMhNo/p5e4oKhNhD6iWo3weVLmfSy UdPbM1JKm+D+K5Jx1D4KI34fP2tdh2JwOg9q1vyHMlUGE7iKvBxiV+dQdXh+9VM5rmhm 2S7gJ6ae94kvS9H7zgUHekRU6JZ8BEatgAaSATMvTX5kLFdgGdqLcjtp8BqdN68SxjIw czkpKEe74JXB26DylKl7NWT52knJ/f1PQVwVTmIUGrQwNQIWhbArycG/n+dbPDcfLIG5 Chiw== X-Gm-Message-State: AOJu0YxkMJPPs0bkr42LwuKzCfMcRe2IhVG8Bz+5wztn2BKIf2EIS3an /DaGTRnfZg/tocW7YMAaCX0GMbTO3EjutLnd3FeI7S2xKS/+BN0hjy2dUF+Sgqs6cekvSfjyQYK +9vj3Rylz X-Gm-Gg: ASbGnct3InccTjfVH1yAc0jFXieYyDvugAni2TYTqCqMhV0+uGAf2eiVadZz1FThV0o QVIgoiqbEcgDlB/obHOWhj8xKGTD0p4d70TxWYDWZhsUVEfmifn45bl6XpvZm1j0w9SsPayXfZ2 KZuzhA43sIENrNF06thxVBPOMYTkGgIwzIaa5h8/lL175G2IBAOQb1PXpuce18ctsiaqt4MaOzC F0SPVHLbofvKEQlQWZI/pcsiu5MlK+cq9Gv4te4vUeFAPJqPJiXJymhIlokFw== X-Received: by 2002:a05:6808:1802:b0:3e5:f4f9:3280 with SMTP id 5614622812f47-3eb19c770c5mr13079993b6e.10.1733844285359; Tue, 10 Dec 2024 07:24:45 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 29/46] tcg/optimize: Use finish_folding in fold_remainder Date: Tue, 10 Dec 2024 09:23:44 -0600 Message-ID: <20241210152401.1823648-30-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::229; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x229.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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index ee00620ce0..eac5ef5eec 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2134,7 +2134,7 @@ static bool fold_remainder(OptContext *ctx, TCGOp *op) fold_xx_to_i(ctx, op, 0)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_setcond_zmask(OptContext *ctx, TCGOp *op, bool neg) From patchwork Tue Dec 10 15:23:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848750 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384014wrn; Tue, 10 Dec 2024 07:25:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXmXWrfqGJGXhyNC6at72wgAyMWQWUpxaAh/I5rjC1Fr9Cqc7clfSnp0/c6kze3yOlLaO/VDA==@linaro.org X-Google-Smtp-Source: AGHT+IGZEn/SnYw5Of499JCQqo7py+naDR75Gn2OasSVy2cMfVvu20p5qFHiHC6FPZ8seCEe7xsz X-Received: by 2002:a05:622a:199a:b0:466:9197:b4fb with SMTP id d75a77b69052e-46734f7ec91mr225943171cf.47.1733844341364; Tue, 10 Dec 2024 07:25:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844341; cv=none; d=google.com; s=arc-20240605; b=c+X+xJM/oLfxRfyyz3uchMy/Q/jxVFcx4ysPBTUzYCcEvODAPrs58+SMIP6Kw0Hdz3 9KpIA7qGD5YbUIqGv+Me5hhR0bZFaV/SxFCb12Ad8uHqyLKA/7J0XO6eiLrCprd872ze 4SzIYV7d9R0dT1cqFBYomwdUMC7mOsCZA/bk3syYfZgu2TuNdFBWqc2w6JxJCP4UkSkC famkxeQkQgzNU6O+BzADqAxXsFuPyCC+54CkrPsIow9xpqemhL0Sx5r+oBkyP5tPNo14 hSp39ScCSJa/FGiqBMMmty4uQ1qybHqAcBTZzsjO4jqjWKWI3RmmNi54o7+B4viss/of fMaA== 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=lIaqwHIAjwY7azknBwNtOhCbYad08/pBvrAzkfqNf5k=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=RBVXXMib+qb4jAfCN1Maj9Rdnj7Rd92lX+UYvXrQS0zT2zMuf5yy9z2f16cPYNMqHT T2uZvKf1Y2z650Vvd4eDrNT2utG6T3JghKFeFHpK6kzRXxg12zpFhQfzBk45HcwMRBxx kJh8d4NIPTcdIJxmj0OZLZhH2RzvIYUKmOlA8ogddjk55ICGpzt8V1ci1o3CVh4a0aPV gxurZrR1ZnRfhXDxMe+fPnR2Lq5dU1oRfpR7I11AF7eNQTAWkqOKEPJHQb0J5MJUrITp ANaCt6ep2cDtNUqyaQ382KFBnQOF+OqGDthfPkf2qEiRDYl5wWqNqFOBRjHV/g1LDYXX mDwg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Tgn0h1KY; 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-4672983c2d4si142804061cf.556.2024.12.10.07.25.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:25:41 -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=Tgn0h1KY; 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 1tL26h-0004rN-Lm; Tue, 10 Dec 2024 10:25:03 -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 1tL26T-0004PT-4r for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:49 -0500 Received: from mail-oi1-x22a.google.com ([2607:f8b0:4864:20::22a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26R-0008Ok-JA for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:48 -0500 Received: by mail-oi1-x22a.google.com with SMTP id 5614622812f47-3ea696c4dcaso2750952b6e.2 for ; Tue, 10 Dec 2024 07:24:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844286; x=1734449086; 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=lIaqwHIAjwY7azknBwNtOhCbYad08/pBvrAzkfqNf5k=; b=Tgn0h1KYizpzxPOuYhlxZYT44Jv+FIuANeC7NFgOdk9rfGN1KQqjziZeOvl/i9+rZH e39+0S/jIya8LrnImwhbarY9NlhclB1LKEsyoEVUDU5A8N40x3NBpxWah7BJrEU2HysS AC47LCYkAXzqwrAyH91ea+RLITbft7bopoyvEC6p+hm++FXv/gW1UCvUtyWYF8x34CGi wmzoRJpIhD72EWkQx5A12L4qYyN23jPNDEaiVUSZJEGcI4BFke3uZfH7nuizPjG9wOF0 MzS4bbEwW49DUOpDZ9AjbTSZdmygt1NKqg96jfaD9GB9gBXuLJVKettm2ec+YiC31eo7 3TbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844286; x=1734449086; 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=lIaqwHIAjwY7azknBwNtOhCbYad08/pBvrAzkfqNf5k=; b=qoOwTR9AkuzL1FDXSj4vKBRakET2hgBuoaUpIAT2bZ9hgxsl1wfEQF1K4fHvh9wtKM hzWHWFGj3S/RIzVkEXo9SwL2hfvOYfZDSW6sKoSMEzj7PJR+pUbH1Qu41BNKyG5q8d7B 4gjEqF0PnIkGxEDi56rtoVhWKe+KxcmDykZIT9wUQSMgA0xuVN0CnJ0fP5v3+iGSJ15l 7N/cZmqizpVyVpl1zftGYJRhVJ3vkuIeioIIc6gF3I6yCmgoobgnqghZZ0eKeTIr6Ilc 8ug43c0KWvWm/75nDvsSSvm34aqyZ7E+YKiKLXYF2tzXgcip0TVCujgFxRhlqXPu6e9k FFOA== X-Gm-Message-State: AOJu0YxOk8DNlby/OuGVXX1GbZFLKD07sYVs2bo/xC3EHc6i07ai3n12 tMp+Ns2v4eUSQU3Mtbvm2P/gNzNhPkl3yes3quTRQ0xpyPga+3DRWAzMQthQa8spZyUu30pXy5P vgFoCNqCF X-Gm-Gg: ASbGncsoUuS93BPLNXpRl7VaGT0izlqQCOVI25dnQgLYUQybU5+AEZatmmt9ReTMPj+ YFwUD0u7AerFTqZM2MsnZZWMfiXEMrbEBaidtXdWlYFWo7u1QQaWvjXd8d+r4bxsXtflVyQuvv/ coSzHv3YYPcVqMNt/BT/UGwcsYpPtJnIiGZUr9n+qFFQPwhM9gI92kAwWpExT91jPaw/XPU027z HRbfP7ekDpW+784N4N6sp/O/6NGTgcbDg/CMf/+4uXkiPU39iAH5D45U2HFoQ== X-Received: by 2002:a05:6808:1790:b0:3eb:7399:29d3 with SMTP id 5614622812f47-3eb73992f5fmr806183b6e.43.1733844286379; Tue, 10 Dec 2024 07:24:46 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:46 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 30/46] tcg/optimize: Distinguish simplification in fold_setcond_zmask Date: Tue, 10 Dec 2024 09:23:45 -0600 Message-ID: <20241210152401.1823648-31-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::22a; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22a.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 Change return from bool to int; distinguish between complete folding, simplification, and no change. Signed-off-by: Richard Henderson --- tcg/optimize.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index eac5ef5eec..7b1d437c27 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2137,7 +2137,8 @@ static bool fold_remainder(OptContext *ctx, TCGOp *op) return finish_folding(ctx, op); } -static bool fold_setcond_zmask(OptContext *ctx, TCGOp *op, bool neg) +/* Return 1 if finished, -1 if simplified, 0 if unchanged. */ +static int fold_setcond_zmask(OptContext *ctx, TCGOp *op, bool neg) { uint64_t a_zmask, b_val; TCGCond cond; @@ -2232,11 +2233,10 @@ static bool fold_setcond_zmask(OptContext *ctx, TCGOp *op, bool neg) op->opc = xor_opc; op->args[2] = arg_new_constant(ctx, 1); } - return false; + return -1; } } - - return false; + return 0; } static void fold_setcond_tst_pow2(OptContext *ctx, TCGOp *op, bool neg) @@ -2341,10 +2341,13 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) return tcg_opt_gen_movi(ctx, op, op->args[0], i); } - if (fold_setcond_zmask(ctx, op, false)) { + i = fold_setcond_zmask(ctx, op, false); + if (i > 0) { return true; } - fold_setcond_tst_pow2(ctx, op, false); + if (i == 0) { + fold_setcond_tst_pow2(ctx, op, false); + } ctx->z_mask = 1; ctx->s_mask = smask_from_zmask(1); @@ -2359,10 +2362,13 @@ static bool fold_negsetcond(OptContext *ctx, TCGOp *op) return tcg_opt_gen_movi(ctx, op, op->args[0], -i); } - if (fold_setcond_zmask(ctx, op, true)) { + i = fold_setcond_zmask(ctx, op, true); + if (i > 0) { return true; } - fold_setcond_tst_pow2(ctx, op, true); + if (i == 0) { + fold_setcond_tst_pow2(ctx, op, true); + } /* Value is {0,-1} so all bits are repetitions of the sign. */ ctx->s_mask = -1; From patchwork Tue Dec 10 15:23:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848781 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387719wrn; Tue, 10 Dec 2024 07:32:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWQcP9uswEeScZg89CT6+LrwYMZuve0m7uZbZSJ8BBjL5QcRyQK6T88aJaTv2Qfycp09chGwQ==@linaro.org X-Google-Smtp-Source: AGHT+IEQ0KTaFxuWrLt/C3xtsFGaA1YSSu98i3s2hu+N7laTST1EVcGgnJbDmoAP8L/1awNraHVV X-Received: by 2002:ac8:6909:0:b0:467:61a5:1a85 with SMTP id d75a77b69052e-46761a5226fmr150140121cf.30.1733844725617; Tue, 10 Dec 2024 07:32:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844725; cv=none; d=google.com; s=arc-20240605; b=c0dbEutCQErsG/81d61Q9wdbVOifNX+OgWguuDAk1cPLHItDjeHoJIozW4y4O78sbA 71h4tlzaWkeAHl6TCiR15cbWp91GqBHzAqmmJz1Gjj51vBBTaH4HQz0RjphQAHfm8d9K J48lMWOi+9SYnPEMRGYVmNTb0n8DqOJG4EHa3OvFAxiP5WWo9rUBmyiym+fi/sJFt7EN ZTo3xC3KsAebwN1JvLX1pUSngWJulWnpIZpWgzSbhdwujE0SzMV9NVc0vQdJ/d8O3rtB g5qh+rptuoBvR5aRZNvmlkUwu7ARV1FT9gJhG4/tDzK+Lj/3xMZeLTQ+P9g6PW65DF+N 4xcQ== 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=GRgI4ZZV/EtnyFcPzwtNskYp/Bon/iIPBoBs+FuTAuw=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ZThQUvdGzldpOZjd2aVRXSd34y/WXKcP5u+RcKJEaW04nmFmCHWajQhuaduMMlVMB7 Na3OeoIdZy12ygC09MSSoABhp9qRZDKiOWtXDIuJXSDJhTB2d4rdUv1u65k9ACL7n+1n 4FfdpsV36EJTUJJ45DZOGSwgFBrjguISsbHwBZOYTx87AvRDg/0r2ruLrfOS3Pw3ZpHj J78ldpeCEIsrnbuqIhrcSNgI+P8QTj/yMfDhjUzNHZxttxKNV6hZsKE/qRPvk+ICJRx8 h+acTwjUwgWDB4FlYBOOyyL09lXa6K4woa0lrRy1VkLJr1ts85bbrF7LxnB9E31pqpIV lq9A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jlHEpNdt; 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-467297bb296si169492201cf.260.2024.12.10.07.32.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:32:05 -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=jlHEpNdt; 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-0005Gp-U3; Tue, 10 Dec 2024 10:25:16 -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 1tL26U-0004SN-Kx for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:50 -0500 Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26T-0008P0-3v for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:50 -0500 Received: by mail-oi1-x22f.google.com with SMTP id 5614622812f47-3eb4da24f3bso1156949b6e.1 for ; Tue, 10 Dec 2024 07:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844288; x=1734449088; 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=GRgI4ZZV/EtnyFcPzwtNskYp/Bon/iIPBoBs+FuTAuw=; b=jlHEpNdt3MNTN4A8uK31CShU41j2bUgRKQbTgitKf5CqiOEceh21KAzaHLjQKzVNYv DhN4xAsCA/BfuGh9rdYWQL4fpzZSN4hAQMVTQM+l8KBMlRLr1s3VUQ72+20LSD40IovS Sob8bTg+Nvq6i28y0Ii28LCdrbcqZ90aSY2mhpHWAVpz5PlfcD97wf11zytQloEgrgKJ Rz2WYUSqjpFrgjrPpygwEwi/j5Si1mAEiSom3rYdV0rr3IWM7QKNZ2A1Kx4rhhkHup4u bEAVxHnmsQL54C3X3SMXhLHHCmxgPWnxhIb361269kguKeQQmjmpB13QdwEKWWFhqtW7 16Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844288; x=1734449088; 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=GRgI4ZZV/EtnyFcPzwtNskYp/Bon/iIPBoBs+FuTAuw=; b=QaOrD3XVMtbBriwCdnogefBPU17fnfH6WOwh+snfb35Sq0JUOo+2oRPYIOa/DISOei cYgxHFz7SIMheiHEa/THUznPXK6sxyRV4YUoyBH8OL6ZhVNLfhbf2tV/tXyiS04Hj70w WVeCIxFkl9IfgvXjBaHhsDEWAn48vx5wiF4RAjcdbc30w8Ji/sUlgJvsaCns7AKqidyq DlzUf67IZCQ36/3Q6wVh+jbyifg9pZZKuWxzDsS/uLcA2iiQw+aZuRhDbJ22flY3v6cQ hJzfELnMNsLVJUT2OXs3td+WM4MQYISXZVPDhb1Uj/Nmi3aCZ8HnVz0x6qPs89Wrrhvz Q/6Q== X-Gm-Message-State: AOJu0Yz2l36Jnt4/TeARuYxS53crALbO9JjV1Po1JT2LPhP5cHgz7n4p CjwTx7J1uOpFkfws4+U3p9dX9beTyhNjZY6siwdWxJ+nTFUEWEyVR/z7tr1VYRoSqYw3Q/+PBDi NVvcttZF+ X-Gm-Gg: ASbGncvvrKxSDo2kFFPAps+M9vs8lMSLrdFHNDHHgz76v3YzwnPmtPMF/N4kewA3F7q iqeSu/+lyRolSQlThIRIdB/Q9fz77/YpkTCL33u+6Z0QDtot3Z7JXPrT+l60XF6BKp5NxDHnp+c 3wySFRJn5LoiUJY0BZ4Uwr8jTle3fCCKahl5THexoMnsKSwcqBHw3j2i9+dgwfF7wRMjVBeEoFh 1pGKCWzil4X2qVFfyAQJOL8SDbmpwTk+tt1QZLWaeOtYFmNCAklLE9HvxMWAA== X-Received: by 2002:a05:6808:124b:b0:3ea:5809:2835 with SMTP id 5614622812f47-3eb19ce7e2fmr15319044b6e.21.1733844287849; Tue, 10 Dec 2024 07:24:47 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:47 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 31/46] tcg/optimize: Use fold_masks_z in fold_setcond Date: Tue, 10 Dec 2024 09:23:46 -0600 Message-ID: <20241210152401.1823648-32-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::22f; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22f.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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 7b1d437c27..cfd4c08f11 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2349,9 +2349,7 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) fold_setcond_tst_pow2(ctx, op, false); } - ctx->z_mask = 1; - ctx->s_mask = smask_from_zmask(1); - return false; + return fold_masks_z(ctx, op, 1); } static bool fold_negsetcond(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848771 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp386324wrn; Tue, 10 Dec 2024 07:30:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXikP2Fzx2gSz074Vq/O6en/IaCYtd1tLJj2ac+wRoPT9JzLWpssmgpAt9qc9NTOBR79Dp2Qw==@linaro.org X-Google-Smtp-Source: AGHT+IEUPzGykQUqi3yALV5pDT4RLm8gegepHft/EDwcQF1a/WVoMBhHCb6pBzmgiXWfWF8JXBps X-Received: by 2002:a05:622a:110:b0:467:4b8d:2eea with SMTP id d75a77b69052e-46771feaee2mr82371631cf.34.1733844605247; Tue, 10 Dec 2024 07:30:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844605; cv=none; d=google.com; s=arc-20240605; b=lDRWkW27d18TguHNmc4VDedgrhO0HTNy9JIDoP73wtrfal497RA4KcEmD7ifaicWR5 w2dejgD7nLAtff8GRERNW+N2sb7j1wFxq9nJHyZdAwdAWkoy1gpvc2S7wStBqKHhkaOH //d1HnFr3oQEZzZK67NaUHsKjZje/lc/qjSwwVxx8SqJk+J/ouMhHxiH1ZzcnRS6P6fr 8QzKUm0YDQ2NdbXS97E6nPD3JjkNAzkdoAQTsx45rdAMPvn/jkVCpvoe7r0zmvuY8D3b vE2i11clSDhR6c9qeSsT+bOvF9dtaP3tCuZIeu4brw4+9AdAhyh9zcFfvnLvvFVtnOlM 1Z1w== 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=PsgEEaWYbAAaBs4PCAgZVIYW4c8IauZDyqu8ElASbpc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=bJWP2BfwkxWhBHPZ8D2re6Ij5YUI4ujqK9sPBcLeyVkKqn9EhATMn0S1qT4Rg3SXJZ K5bcl9s7xaOu29h2ExiCEhVx/F0d98LKybC2BVRNNVa2LZWqQmdUvUEo41+GoAyWdJ7j GoTf8hkkWfjQLveFV5h5vdxj8ZOHnwDfRScIn+HAPV1/i99O3xIEsoKhGwaOf754w2Mh Cx+2wSvA72CpR/R29xFBGUzDY6Ya7kMvUlQm5a4QKLJlu/Lr6+ayVmoDv3V/cxd01fA1 SD1imsC0HAxbFneBGxDOX5fGX/qfsGhjosnmIh94QtZEPFp4bWU4mAQNR2TeGa+K7zgi pxSA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fc4fSi0h; 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-4676359af07si55690531cf.314.2024.12.10.07.30.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:30:05 -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=fc4fSi0h; 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 1tL26Y-0004bA-3C; Tue, 10 Dec 2024 10:24:54 -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 1tL26V-0004TL-Dj for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:51 -0500 Received: from mail-oi1-x22e.google.com ([2607:f8b0:4864:20::22e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26T-0008PE-Mw for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:50 -0500 Received: by mail-oi1-x22e.google.com with SMTP id 5614622812f47-3eb66b02e1cso463116b6e.3 for ; Tue, 10 Dec 2024 07:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844288; x=1734449088; 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=PsgEEaWYbAAaBs4PCAgZVIYW4c8IauZDyqu8ElASbpc=; b=fc4fSi0h2GW4kMXFcu7xcjX2oYHaqcmyilm+pARIRRiYpMdtgCPNd47036y3We6s7C 6qctHNv9kva5KYhC54iyHr7IRiABtHSILz2tsEn3LlOrzCPDCAZkM1jyO/5R5p9/NhTo uWgZpJI3Ho+7mmcqCX4u5hacxJ2g4ThwoRWuWThwGOZknNkZwk3TC2xyuApd8sGQCGAr uf7I+rcoq/QKM6f+bXLJMpiZu9Kxx0O0AZMRr14kYaShgQcjxzRFzXq91FgmogYKQFIK U8qaYj4NfRyuv49bcognYHtdWkZfG0CHAG+jFDp2EXxsnz20SmZo24qbyhUztAIppHxi m8Cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844288; x=1734449088; 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=PsgEEaWYbAAaBs4PCAgZVIYW4c8IauZDyqu8ElASbpc=; b=G4kZPp4bd85UFg83KMhD927dlbDKvKNIX1ZLUP7yvwCoid3jrwkaqUUCDfXPHGb8wo 3nmq9mZnTqgYWNDAo6w4Nfkj/lD4U6yY09XC+yKQaND/6UFAs+LNFCKoEJM7UzHDPB1e ZUtjKQs9HoHwlfGb6/zIcfctcLzmehyqa2AwD3dPH2+9ZC0K7gjBWDyL+S/6+3PFGFUM 2XsdexbtXMO+1Z+COMesI3UznuQ1Q7NGmXCmGjp2ht4e9WBsom+zjb5pzAxQPlKrl0iC iBvvgJGIl4P6p+IzYH3ZZF97lX0hq1TrfvYCv3yjk6g4NIsBgvPjyLdf86CehvHmpu8w HXag== X-Gm-Message-State: AOJu0YxKZ4iZShGC1M8qiksTJ67CXKnDR5JQrVkECJdsSQ72IWou76yO TxwJ1MJ/L+7WfVVExbqTRXMKMZxyL8kLC7XwViprBGX+wVJZqr81czECeoRZNLWNgIgPEJdu67c nG9zjUMGM X-Gm-Gg: ASbGncvf2jjOmIeP/ZP19Cj+q5OHRbGKhEwzqPHKGrcIa1lpJfURWROyPhiNRWfMyV1 JnPPX8FbvrRdWDbONb4jPGiXeIHKK5RZzQlx+qvN1iXemwZCxqp2sKvzTr/EuDaGSqgefS9YwrA 84hLvThvS686iyhP4JXMpIcCVJ16btmc8YF8vI3q3I3j83vtLKI2wmGcPpkJAGHce4BhwQvWpIt nBjhPxT5FkWzGVHH7wMbqGkNEx29qiadp1CqU3H25rIk5GzicdtQOckpb913w== X-Received: by 2002:a05:6808:1493:b0:3eb:3dd6:81be with SMTP id 5614622812f47-3eb66b8263amr3576482b6e.0.1733844288608; Tue, 10 Dec 2024 07:24:48 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 32/46] tcg/optimize: Use fold_masks_zs in fold_negsetcond Date: Tue, 10 Dec 2024 09:23:47 -0600 Message-ID: <20241210152401.1823648-33-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::22e; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22e.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 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index cfd4c08f11..0097502425 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2369,8 +2369,7 @@ static bool fold_negsetcond(OptContext *ctx, TCGOp *op) } /* Value is {0,-1} so all bits are repetitions of the sign. */ - ctx->s_mask = -1; - return false; + return fold_masks_zs(ctx, op, -1, -1); } static bool fold_setcond2(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848779 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387355wrn; Tue, 10 Dec 2024 07:31:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX67Ith8V4MChysQrv7uuREnwtw9PAmSlS4dv8D++WvI5WxjwUVR0iizaRXoi2cBSkqHnxbuQ==@linaro.org X-Google-Smtp-Source: AGHT+IEHDBN3hnAgkDlrQC3Gg0fzqs4c2EdTTATz0rTl+6wu0eCQ/XjAMH/b2GGCrFvjkXTgYQKx X-Received: by 2002:ac8:7d8e:0:b0:467:5734:d08b with SMTP id d75a77b69052e-46771f310fdmr75101391cf.31.1733844693160; Tue, 10 Dec 2024 07:31:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844693; cv=none; d=google.com; s=arc-20240605; b=EA51xTiUGnpbKVPcY3+qhs1iZoMRe+FcnfZwOMzANGwOhGPISddJNxKU7QsCj8qRVf sDhtu31CdAQfRhJScPsUKc28GbnrtsdR3Se2ijZxl3f9c4rKPy/lB9rgEEXM48sou/FE oUJ1QbvpFehqS5/oMSisLtKtF/K9BRSwrPv1noSElg+5I+01d6c3NnPYKhDfaUO5kOeu zMfpbVd+QoUhDRePic4H3+JS3vIBDrWwR0cthefkjgkMrnIa16LKU18GBwXZb+OFQhTC Sasq+6+y0ODicoWuH1VAaXW9y3esNNaWsGR/1eAwfnqJSK6aUb8KgSPA1SqH2x03BORP AESg== 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=UbTYBT6M4AjLujOKc33PQnRp59jWU9i7YG2GCTYtKsU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=lK0HYZCaHhfIgNDHIp1D1NZB3miL+KfDybAB8Pra7n/ifKUmhRoL69JF6J9kAjLpyI bZCu6rwOpx4zwdqrEKjPl1Okjs6mcTXqiWZe/8thzSJoXXB/XO28GTkLp0StD2+0i6Qd Qt0MlnLWnaU9GHWR/g9q4saOggJ7dXOv2xOUH2APRskc6qFjwAxmiUTMeTDsNGLFSzDZ VK2eSuXohMeNKTntKHcUbaHoYvmgmK2INQ7/sjcjriSWlZqwu0Du4RGX/DRs6PFAasra u2c5qeWe9Im+FM2qh37qptdKqwkT6cIWJsG4bP+FmxRoSrp01XXYPQ+YElHOIPBx4Ah5 +zgw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GBfrUCus; 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-4675da363c2si64810261cf.234.2024.12.10.07.31.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:31:33 -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=GBfrUCus; 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 1tL26a-0004ey-MS; Tue, 10 Dec 2024 10:24:56 -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 1tL26W-0004YF-Jc for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:52 -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 1tL26V-0008PL-6Z for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:52 -0500 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3eb494c23e8so595304b6e.0 for ; Tue, 10 Dec 2024 07:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844289; x=1734449089; 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=UbTYBT6M4AjLujOKc33PQnRp59jWU9i7YG2GCTYtKsU=; b=GBfrUCusP+CUbTqs96Cc8iylmVwZZAXt9vTaPZJXXdilZULRqeN2cur4mpdkxXh1bm YODE8qUOGjxuoJbOSyfMuSBbyzbKfDWEQuaSKAGpukvdLZBHUJt84xCFBwSQsPlM1Jxe Q+IlQFae3vCAMxYse6o3VxvDBIyI26X2kas2j1DIWPu8/WUIPJFEA8GKoiuAejTl7BKM n34T9XAJe6H3G6726vRaLdtv7ZfSuWQQPPsqLOb6VrYWwIjcqLKQ/z9KTFTeAxYgijyJ ej1Bo+hkXDgC7jR3BUdsx38ybyJp3yeIHqcqYg15r7XVS08zALDI85kZLj5p8xluC/+d 2V1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844289; x=1734449089; 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=UbTYBT6M4AjLujOKc33PQnRp59jWU9i7YG2GCTYtKsU=; b=Bh57SFPo/4zOxV0LfaA7kxrIVVXomptj8aW0fHTnfgmxghn1sk80wtxnzrfkUMpK8Z sfIKQ0im4NgkY/TPL5IVjIuXxz0jpSfAE32UyceNleigiWiMx7QBDFWOVakGo38JYHXD 5K9zd2piumZ+gH5q0GqaT8DvWooXTRjlgrqaB3qkLQKYQhN1bl5RTXWT5550Hscsevc2 OOZwzPjOMJil/G44QTlfSxmbrGA1crpyqZOvxBqkLuCwRGcgxVb1oBTczCHq4WxwHrqH YdIlLN6DevHJ3MyFzOFsVooRFtANLvE1Nq9jZ84J9MswU0Y8g0rn3nLldj6RvKElcLPl qU+w== X-Gm-Message-State: AOJu0YyOo1dPt4ohefBsSJYFXD5DGH7pyRxzm/AjdiO0/ISdcTA1Z1Yk hMt4/vgKTEIemNKABMYvu44Er8PGtgNNo+vuPi4/fOkBr7DMg5H6Ea5Cl+ij7FLkuhqbAiSzypP aSt3nO4F1 X-Gm-Gg: ASbGncu1hQGpg1jhfi3Zm2zrQaKkDBzhV0HIowXuPZ7rENeUidUbZhtIR4QTXhyJ6Ir 26sf8h2v1aD+w0P7MQs5XKATcpndpYfuiuSNb0QVLNzPNCVIWRQvtRJc5nsji06HqWZwLRVGCz+ 3TfDo6mRZayz4iCTBMtVHYGlMIOq4evNuHjZVSh2GA6pPuAL+6GTeG4n6D1Sonrlc900sSE3KnV nw67Arhf8GnpoRi1zya3g4EeEM8P7/1N70jGVQKTz5keF6djcWhZ/nL2+FQAg== X-Received: by 2002:a05:6808:144a:b0:3eb:4681:a892 with SMTP id 5614622812f47-3eb66dd6250mr3460550b6e.5.1733844289657; Tue, 10 Dec 2024 07:24:49 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 33/46] tcg/optimize: Use fold_masks_z in fold_setcond2 Date: Tue, 10 Dec 2024 09:23:48 -0600 Message-ID: <20241210152401.1823648-34-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 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 0097502425..dd6ef3d831 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2450,9 +2450,7 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) return fold_setcond(ctx, op); } - ctx->z_mask = 1; - ctx->s_mask = smask_from_zmask(1); - return false; + return fold_masks_z(ctx, op, 1); do_setcond_const: return tcg_opt_gen_movi(ctx, op, op->args[0], i); From patchwork Tue Dec 10 15:23:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848762 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384960wrn; Tue, 10 Dec 2024 07:27:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW8fvUwYOXbxHsAGMPo6KBBFwqsmvxY4Ch+D1L1Jma79QpGKDyI5zGR8TlZHkGVj7E73A4kdQ==@linaro.org X-Google-Smtp-Source: AGHT+IHozsH1vy3eFxxEzzckpJ+j9V+s6FwC0HJn+nlfLZ9cFDiBkfI2cdT1IspJ3Q5fwWNPABC4 X-Received: by 2002:a05:622a:5a09:b0:467:51d7:e13 with SMTP id d75a77b69052e-4677522814fmr62828441cf.9.1733844450005; Tue, 10 Dec 2024 07:27:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844449; cv=none; d=google.com; s=arc-20240605; b=M6nQeUGs4ORmy2J6dAwwQG9oB1y5Wt8m02tZ21wc3v2YEtNrOw7bwsqZbDFJd5tfL/ 5tDWTVmbIPy89MzbkIx74vhk1BkTCkDN94Vll9Qc8w79543IW06RwJyHa37kkHuxBHwd D3OSHjQ/aP4QvJplnYkC2Y3sEjP94HBLkGE7nH5WS5lvqVH2RPOzidiuoRzRHgxTbCHo TvaR1NDL+cK5oLPM+rr1+bes0CtdUAVkQyaMQlNmoweiLswKRYUtRgwVfuSFFiquykvQ ioBN1pKCj52EZG5Wd2g/CeRXYKyoGUVM523+FjKT0cceJ5G8OsSrg0Nud6FuMTsYTI2f fOZw== 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=cDXczJ1tKAOChu6ukHBYZsWtuVXT9f5SUnK0XOxpfsg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=bBThDe6K2t9/2sAyLRIM1kdVQJ7tbYDcABOH95h8EL9/75HOL6N4+8/x7BrOy9PC9j rSyixwZUUtZHs5DjHQUfBgjnpCHUNK2xTg5Tw7FmSG39j8c18UOquepW56ZZjaL5Xb0X MT/OUOJoL1MWyVOIqG1Av9pTSmdx8J7zljvl0/DPLX84fFdm3uGuRQUdlpGubaUG2FJN aSm1UXNz7DHRAOAkiR1i+fAz/6+02VDPrpf+lKF8rhORKJCgDkMp7kB2NRpCcJvImALU MaHqi2KCZjdTOKMGgDE5X15jGh4ZdVl5q3A471MN3IxVw9dsYL1v5C/rsA6r3mS+NBID 1uzw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XhCA7h6q; 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-46786d3c487si1986811cf.608.2024.12.10.07.27.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:27:29 -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=XhCA7h6q; 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 1tL275-0005Zk-Gk; Tue, 10 Dec 2024 10:25:31 -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 1tL26X-0004aI-NL for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:53 -0500 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26W-0008PZ-3C for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:53 -0500 Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3eb3f7cd3a4so1245897b6e.0 for ; Tue, 10 Dec 2024 07:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844291; x=1734449091; 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=cDXczJ1tKAOChu6ukHBYZsWtuVXT9f5SUnK0XOxpfsg=; b=XhCA7h6qA/Y1AOahB6ko7qmWGbQ8qS02yUngfpBWYyXzJtwO72HCJLTjBT5mrubUV8 j9MuA3OCWhNA3320SdutLvPAEbaukqFNrJ1thBQ/aF/Y8dMuvyu+XY+VmZiAEX9SczTW xmHtdpcwWCjKaMQGGR+C2SPKSVvbAry45LM8i3pJ+WuE3zX9epGgDzrycAzs8b9eNwJD wpKUAq7rDxq2oB4uMHUbPZFC8Ph/yqw+v+UuGUf+5hTM9nTArB4UhewwPVZJfCc/YDrh zRzDDL/1zMC13DSV5krV4sNkMDjdPgMRcqKqUpfZVJeJW7rAOfewkhvUmbVp/CzHelh1 1m5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844291; x=1734449091; 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=cDXczJ1tKAOChu6ukHBYZsWtuVXT9f5SUnK0XOxpfsg=; b=Ggl1T0C/87FJAn2rMvmG60cic9bNMnD3bNIXjar4cWp2yb3FIpCpwiQZqCk5HHN2/w +UUmvKyWkBa8pKYlopSKlsNb/ilAf6If0iBB+ppN20aoTjFColKINT9c/8apu2ar0uZ3 rkAwNmGc3xFLRt1dPUqqmnE7aaz6c9htmTe8eNubgt3UiHgMziXmK1iIpxbGVbC+Ga9Z qAW4fmRkwAMDTJVvTNvtPnADUmsin+hlb9T1yndQXkmerQ2xD5BFZf0VIvMwLaIy2MJL us3W4iOh0TyN87eEfxuE16ep3jVdTPVq7FyHP973sxMe7zBMHjBRFoBhru/sveW3puF7 QJJg== X-Gm-Message-State: AOJu0YxQPLXhe6hPxOT0J/lu+l+VcbSTX8K9chSZx0zA+8mRpKl2QQBY T77t8OozKsxMEw9tCkmIgmHEwU4OqR04Mv6fKPQ9ULI5+kK2H2wWCQe/DivczIAh8k2YXn9cBp0 CCdPVeITn X-Gm-Gg: ASbGncuFCaQmhHKTLWl/AxC/hU2C+OA1NDcwN8Lac7zw0VqEt9Jt7f0lvhYNsttlVOH Pi2gL+X0FlK44T5/WcMcK5rBkh8w++aIfJFPvYPd/jHphtHhNstEsfB7Rd8qTp9aoBBxOgtHg3i ZF8BXBMVGe8pMw+r51a4d/kQ8BW1aIlrtNfdnOilll/5mKaoL5EMmPxVt6KFYcN1jynNFamLMHW XRx6FukGIz9fHT+8PH/h+S6P5wTRAYz1Q6G4qKi24rzuJvjITOAmoru9sG6IA== X-Received: by 2002:a05:6808:1b2b:b0:3e6:22d4:d2c8 with SMTP id 5614622812f47-3eb6b8c19bfmr2326606b6e.12.1733844290871; Tue, 10 Dec 2024 07:24:50 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 34/46] tcg/optimize: Use finish_folding in fold_cmp_vec Date: Tue, 10 Dec 2024 09:23:49 -0600 Message-ID: <20241210152401.1823648-35-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::229; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x229.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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index dd6ef3d831..30446baabd 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2462,7 +2462,7 @@ static bool fold_cmp_vec(OptContext *ctx, TCGOp *op) if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { op->args[3] = tcg_swap_cond(op->args[3]); } - return false; + return finish_folding(ctx, op); } static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848749 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp383967wrn; Tue, 10 Dec 2024 07:25:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWKN7uNeyGyH6HO/kFxp+LGFTQ6qydUxcI7PbEDGvsgmQcvCKHibDbdqItOlQiajd7xk4CRQA==@linaro.org X-Google-Smtp-Source: AGHT+IH1a5GlG0fDVcOVHoEeVNojNaJMmQ8UQX+UzX10BD0XcEJzJv2v7SLtRFPJC1OXS2w9lrxu X-Received: by 2002:ad4:5c49:0:b0:6d8:9660:8877 with SMTP id 6a1803df08f44-6d91e376e95mr103267336d6.18.1733844336136; Tue, 10 Dec 2024 07:25:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844336; cv=none; d=google.com; s=arc-20240605; b=bbbTOie8BkK/jHFHN2kiOwVzCFYdgO3MtnOObR34S4SI6s0TQU9yC+I331xSdfruFk yz6bgN3FUCYoZQGzinvHHiyxJW++3dOwKjryyr9FctVIDRQwQGjzx8AZY+JqIGw8SBjb 3EWjPEodYxkFaxx8IKK78qujKBR+83O2xcX9liouXHvcSvfWxMqpVBAsV5IgzVBinDdo MT97+VkBqFWzl5B0PN3EJVDh5x4E7VwPw3EFxzCK9+SNaJihhD5vsrEEdcwjP7shj12d +GmRVFrxHzrRArc7V9RaDW8VqOSFAfG/fo/ZOsp1M8urvmthq4B8RU9wnkFpfYDmuMcA Z+iw== 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=aaGiHH598Jl9FQV/d2zCwuAFTZLU17IFqMDcPvq6uL8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=JrXVrIh6llmD5KUi6ntXZZStGYfLIOrmaDtYDrAQKhQuCAwnFspLUAcE3YaD9S/7QC Sad2lQo5zZZ/kin9TC2TDiYW26hi8UBmA09n+I5qh1/7aXt+sdTlRTl/jFhAdyPMB5x0 deUjFvDGuQHd2lWKdMOgbWPUbHHVMJNvVn/gE2Pynokuk4ZB8S0UaZldR6Cm68kp3Z9D J5A+kwzKYenUDsP4bVz4nj1TfpeobEDGA6fprjll3A5M5lIgLr0KzTE5tTlNArTd7MRO RNyiEnb6fx901GljeDXHKLkaymFL6DBfc59t8oCC7dn2ctp6/nD5fXdjwcx+rZ3vcJQW VOyQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FzVcsxy8; 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 6a1803df08f44-6d8fcedd5e0si96503476d6.72.2024.12.10.07.25.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:25:36 -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=FzVcsxy8; 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-0004wR-Dq; Tue, 10 Dec 2024 10:25:09 -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 1tL26Y-0004by-Ng for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:54 -0500 Received: from mail-oi1-x230.google.com ([2607:f8b0:4864:20::230]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26X-0008Pj-A2 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:54 -0500 Received: by mail-oi1-x230.google.com with SMTP id 5614622812f47-3ea68fc1a7cso2448301b6e.0 for ; Tue, 10 Dec 2024 07:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844292; x=1734449092; 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=aaGiHH598Jl9FQV/d2zCwuAFTZLU17IFqMDcPvq6uL8=; b=FzVcsxy8JtWzb+YetDI7ycqUKM0SwBoDduwpEwMolupgmcDH2zcinzaSP3COGpy3z0 c/JJby9XE7LKg+qJXzO2hoIpIJ6jo5rl3iXir3madMiQDd7dDVBeqoWcUcS2kjDpiF+N d1ACYMIvqwge+TzGdFqz/VuPNMjIGZYV22uEl3+Wh8hZlsYNgFeOO5vQ7E+QWlY2HIsH xYZxMQcwkp4qpb9P/5mKijrdxReRuzFZp002mAKiB9xJr42sDoLOm/00cAvuEKjrWUfd QtWhUFXVSs9w3cp0q5cjttO61efsoxtrA6Bx8qe2HUvks1o6dqd58sJjnWiSqCj/4noD aYxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844292; x=1734449092; 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=aaGiHH598Jl9FQV/d2zCwuAFTZLU17IFqMDcPvq6uL8=; b=b0MDMxMoWUgFZ3FL0oiMANnvnD2Ea6YiU98eOh0DEKwvyWx5eLb9eTx1Q2aDE0/JQL niWwkZhGfKW1dg+wBN3k9EY9KAXI+8w8ygLKSV0VpLL7VE1BwdMY/u9Ed53V+7HDOu0N CBvlK/scDgyipETqKYg1PmWOJD9eM25IC0d1+nt2mTCrD3ovfADq077I+RD9jiWWW3Dt I6sCyFLE1XEsgMlJlWQ0I3b8do5WahNEsZbWd41VEIJIxSZxOghcTlfiKwYS2xI79kjl PUh4lzb0f7rGpFymBF8pqvRkPXOQJO486IKQMM+60m/YP/ZBaN2MXyZH9Jc4GDcUTJUy p//A== X-Gm-Message-State: AOJu0YwisQXoNlJMdX8awpEPN283oADxjhYMuePzoFePMRfeit0w4to5 jBJLob+Obvh52vOvvDtJo+RdttkqDD57z67NeLZeW3Ac+c5fCJw4RjR9u7x+AkrXzE/k3mXR/z9 QOmcNVXVo X-Gm-Gg: ASbGnctO8CRNJiyG6u/fYEKqLoAWWP9GYbvlLOcitYHC+XgJxUQ8h0v1atpXpOPmdeo Pxne7LRVPKDiOgj/7Y+rPpDCFmzyoIJXyYYeu3zPAWlxJ9jY+vZVXHyoBvpu+MIowcFCc4aeb6x c23Lc+db9pHF6oizFNGSGcqNLS7DiU5+2BiA+i4j5Is+WWpC7UCbUevyW/zDtu1TGDdGrqdmhBN Qwg1rpf5TgaHvZs2r3Ow6btENqwpl9iAJ8dy+XHqt0bDc8YTr6p68LpB9TAvA== X-Received: by 2002:a05:6808:23cf:b0:3e6:2889:585e with SMTP id 5614622812f47-3eb66f6960emr2299528b6e.38.1733844292076; Tue, 10 Dec 2024 07:24:52 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 35/46] tcg/optimize: Use finish_folding in fold_cmpsel_vec Date: Tue, 10 Dec 2024 09:23:50 -0600 Message-ID: <20241210152401.1823648-36-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::230; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x230.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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 30446baabd..c99e6f79d2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2483,7 +2483,7 @@ static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) if (swap_commutative(op->args[0], &op->args[4], &op->args[3])) { op->args[5] = tcg_invert_cond(op->args[5]); } - return false; + return finish_folding(ctx, op); } static bool fold_sextract(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848782 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387785wrn; Tue, 10 Dec 2024 07:32:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWXTqtaer8prz6TIW7gwMMtf3ucrq4v5DVzvTZDYfCE5fuZnoG7BWwHeJmh6M2Sfex7Sq+r8g==@linaro.org X-Google-Smtp-Source: AGHT+IGFhAUDmpNL8wG6+yNzeDtHaWBGi+KguSkbZ073QVCw7tKG3sCvKY0hLS/UM1D5YlZzmos/ X-Received: by 2002:a05:6214:c6e:b0:6d8:96a6:ec1e with SMTP id 6a1803df08f44-6d91e2ffe26mr91669146d6.2.1733844732237; Tue, 10 Dec 2024 07:32:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844732; cv=none; d=google.com; s=arc-20240605; b=M2i9yRwDFe6vqa06PeYeaPTyf7LvE88cHraP/WhjL1qqCRlQq5jUsHo9ygC8t33DWS NhLhH1cI1mgE7YFGbikMgIa4DO04/og25DIREIIFhyrlagjrv0aPq/uvHSCL+IvmSxO6 aGgTT6ZxQvDJx7EdKa69vWxIJdEn5x2ZOrxMwvI9T1LcSMUXtrT3RHd7BbpdPrtHVwYJ b5cSX+2GeSiaga6gaoC3m16l7kXLxDeCpLz1FWa2Ryfqe0Fun5hYAVFNdCCLNZm3MbX+ /R6weWmm3xPndIU/VhVEKfKupoX0P945V/cpce/cQEcJbK7DYjvIUUlMT1qsrH9BuAll +PAQ== 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=e6j+z18e1ipmicFyrrHiUm6WC5c7fg1TYL8oxdMOA9s=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=by4DYzq74iNGVmRXfSteWDlxGTGkEkJ4ZSMgdool3JwAKpOE4cO/79WRJsL+eGHX7m S+kAH+TB0Icjolu8371zHqy2x+6uS57vfq9BUqgSROt8Vvn6TnFloFGT6FJllLTMH6hl TWBuf1myhQygRUOWaKcuWSSfZqXnB+iDQtgmGQi9u6I0SnW09m7HrsnY5PshTWrth8aS ZxNeZZJwqfxlXtecqX1NVcEHA/nscSZBQQWL3GrSK5mFeWMIgMoyo4tpcX7VLIHpoefr J7NPWIHHuf2l9OzN3LMNvkf3Qwc//dD81I7u5GRAxLyH02tjVVQ+T/0RsEukpTclZl4L 7E9Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AnYT/NYU"; 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 6a1803df08f44-6d8dac24d2dsi140338766d6.406.2024.12.10.07.32.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:32:12 -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="AnYT/NYU"; 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 1tL271-0005Xo-6j; Tue, 10 Dec 2024 10:25:26 -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 1tL26Z-0004dx-OM for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:55 -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 1tL26Y-0008Pw-7Y for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:55 -0500 Received: by mail-oi1-x231.google.com with SMTP id 5614622812f47-3eb6b16f1a0so356690b6e.3 for ; Tue, 10 Dec 2024 07:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844293; x=1734449093; 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=e6j+z18e1ipmicFyrrHiUm6WC5c7fg1TYL8oxdMOA9s=; b=AnYT/NYUePJsC2Yvsl3MWfx0Zxn67HTHFydc7qujak6PCUDBzApH0snesptB3C1EQV 87Fo09t8pfF+ItIAbOH9M+7HlUkkNJ4ouF2HaPprON0zzmWt8vg0U3Q9Ai7qGYoUDNjm gUYezcwG//tzgwAkFWziTnq+wStY90VkuVZUV1NOr0rnOsUYYQgn3xEk0kQoHMWbF9Jn ynmrQoNfK9W9weEJmrBM6TtOMA8u9P2Vzdr4Wg8d9TCEg8btYYA+zulKts1EH7DHW9im L8JYqsP7eLKveroTg56k8iFrRTBOvpEwlTs3pifDTcjoKtzpfP/fsWqhtV9PmPjOpQD5 Uv/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844293; x=1734449093; 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=e6j+z18e1ipmicFyrrHiUm6WC5c7fg1TYL8oxdMOA9s=; b=DTHMXaEGIet9KkeLh+WmqKTxRTWTwCdhvpaPvyquQeWZCjSDqvj/IU4dPTjb65uOtG z78PuagODPQylrjVDbRZBjND8gidAwiTx3dkWvKgyNsYIhZKrvutH13/tHV1lOYwAzQX eC4ffyba6AEfM9UyaWxgEo8bmTIf3+EP2Q4U5UhdhWoIXWhN4td5kBZnKO/e4tuc0MNZ Avca3Hn3ylv2L8i7OiFH5uWCRvTYeH511FIH4Otp102SuBJgHST6EAfTWxwqIksazseK LjR1gQGCuAX5aMc7jd8BN+cwzCtvNBBE4qP0e/qIlQOB0luxA+GXu+hVfX2KHFqU5q7A w2vg== X-Gm-Message-State: AOJu0YzcaWfcdvE/kvOlQdYJuEcUKGDl2VkT3x0I+IPqtchFzp0e5Kn+ TkxStGVpzEmDy87pn+L/zN4Mjn9B3T5q5/WqsxbcZzk7RVkM8BQ6p4IgY/uOBpxuVXsJwV8SlOT vnzB8FqrX X-Gm-Gg: ASbGncsQiHeQhic/XyRS7YKzbB/7VafM9KJ6gIIWRkQfgXAEnkSEgzos8CAM6bdZwif SprHvKRLY670woHD1h04ekBFwUjSMFV4rs6la1PZPI6N7h9/TDnvu2GaGwJpvpaw6lsyZRnJonR 25aa08nnOIXyMSQl1/klR93L0SXXbLHwet93VIT/VM0PuvwgFOqLb6aSBND3nTdPTBIQaolKFYZ ZY2ZmYoics7DG0ztPkF0M8eMyvVevmSyEx0Fbkbva7dWpdbpcM/H08wB7FcrA== X-Received: by 2002:a05:6808:1589:b0:3eb:5d13:f688 with SMTP id 5614622812f47-3eb66f0ac45mr2902915b6e.26.1733844293104; Tue, 10 Dec 2024 07:24:53 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 36/46] tcg/optimize: Use fold_masks_zsa in fold_sextract Date: Tue, 10 Dec 2024 09:23:51 -0600 Message-ID: <20241210152401.1823648-37-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 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c99e6f79d2..551f96dfaa 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2488,7 +2488,7 @@ static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) static bool fold_sextract(OptContext *ctx, TCGOp *op) { - uint64_t z_mask, s_mask, s_mask_old; + uint64_t z_mask, s_mask, s_mask_old, a_mask = -1; int pos = op->args[2]; int len = op->args[3]; @@ -2502,18 +2502,16 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) z_mask = arg_info(op->args[1])->z_mask; z_mask = sextract64(z_mask, pos, len); - ctx->z_mask = z_mask; s_mask_old = arg_info(op->args[1])->s_mask; s_mask = sextract64(s_mask_old, pos, len); s_mask |= MAKE_64BIT_MASK(len, 64 - len); - ctx->s_mask = s_mask; if (pos == 0) { - ctx->a_mask = s_mask & ~s_mask_old; + a_mask = s_mask & ~s_mask_old; } - return fold_masks(ctx, op); + return fold_masks_zsa(ctx, op, z_mask, s_mask, a_mask); } static bool fold_shift(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848752 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384426wrn; Tue, 10 Dec 2024 07:26:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUBLdPkSYZhzFvr5p1SvxdKm8kke3vPejlP3L2sjl8waqPQGE+sDrxL7teOQEF0/aSzsERfJQ==@linaro.org X-Google-Smtp-Source: AGHT+IGcytKdvCDSiaAGXOeVOWc2QO7/MyobYNN2xxxbmKO+/jJ/kkQrUZ25DbjdC/1wz14JUeCT X-Received: by 2002:a05:6214:1d0c:b0:6d8:9e16:d07e with SMTP id 6a1803df08f44-6d8e70f00e8mr272279806d6.4.1733844385599; Tue, 10 Dec 2024 07:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844385; cv=none; d=google.com; s=arc-20240605; b=K+0wXleUQ2cUJxf7Nb5HOG8nwuKWMIS1Z3NOtGZUzpxoHn3m2a8N5EPE2wlQ9DAg1j 65Sbh3XvkpOwE3t9v/k01AwTm9YmCgt5CGsr3ie26E0TzvstDflJRT++9903E2ml7+1v rCXQdDcjzNzmtZrAl/9fXSePdO21xJx7uQnbUrf0WWmDD+YsE13wEmrHVUrvAbfB7Xot KVoxT9UPVhI5JUWMIcjCS3ah3Wvy5MdwoqJLYBHPsVsdFc6RjDmvsMiAZcvz649voUHo vMAvsxYNTMvzuc2kKU2uGUrih20qNKqPdcCpmd8Onim8osltSAM1S0WZ8hWA8UnRJytl AqqQ== 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=DObOGllSB70fmbIhwRk8zrVb8ETW7KIGs2THZc+KVkM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=lh4sr5Cu5pERTNa5GltF3BrDWkVkO/SCJ3xtz/b5AkKnJkF/8IMiEH0/HzrHOgfz/2 xYK29IOssUY6cSsWe5x+pInnBC8Ms+zr4mMQ36tpuKuRjYsQx1HgGAlcAwqvkeUYlRCb 2/GQ44rhUCmqKlYxQ5poAdMACuhqJ1Q+sz0YEiq3sVvzuBpnLYmolltYghh7yIpy1r0V hTnuXc3tMEMKT5LMWJY6zkFL9QCrE4a4y9sv7Lfcqr2caHHqgoOY3ZYp8MnX7AZQ25c/ 5I8Z/Aj2dnevazk3W5jzxstw8pgLGcU8/0XNzjsYcn6pQD5c1kP7ZaCd0imCJ8J9jnFf EllA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yxvdqPGF; 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 6a1803df08f44-6d900506089si90408776d6.132.2024.12.10.07.26.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:26:25 -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=yxvdqPGF; 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 1tL27n-0006BI-1P; Tue, 10 Dec 2024 10:26:14 -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 1tL26b-0004l6-G6 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:58 -0500 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26Z-0008QH-RF for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:57 -0500 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3eb7934a948so173810b6e.2 for ; Tue, 10 Dec 2024 07:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844294; x=1734449094; 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=DObOGllSB70fmbIhwRk8zrVb8ETW7KIGs2THZc+KVkM=; b=yxvdqPGFZ5HcF49IKrZO/kIPFb3YWBYceyQxn5jpmu6hjI1aonzSxHrCZ21qdITJYK r1JksP9l01hrOQ5HoA25HexkoHGqPU05+nKh3LEt/qirZIOGER5B5P6HbhYytDmzjBXO UYcNhSgQWj8eDo5CVu8BwsPiwBXeGL2tdr6jsr79v467h6Dr9x/U6kd6RDy9f2tG1aZG I/daeaxYwDKokXruTS2ului9R7aBTxjxp8rsGhpwUj6FJOq+1zcf9vCZAmtQr1W3c1H0 NgtDJ0OE0tnQUZzCY++9kwo6bHCKX65xPRF2UZVcQp8IYyfgJ93H6nvci29a1nfb4dDG Tfsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844294; x=1734449094; 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=DObOGllSB70fmbIhwRk8zrVb8ETW7KIGs2THZc+KVkM=; b=AbyjIRBlisTY3mItto5MFFRkKYeRFgOWpw9s3aLgBzfQ4KrgEs2q/karDz5FWCPnmI xsKyKJVIXxNwo2xS81aeFPTuURzBkEKzU1/rss5EqASVsAcICDOFcfvKHaatz3mDFUdI hmoXMl764yDz8pplh/pP6qdBvSGCwIBzV5mxLjU9tS8ToAAkgBVEgKlKxKq+yHDwjR1B 43B+Bs1u7nI/fhq3Tm2ConIv6l6bCo1QRRcmj5OHiy0pJrCTsWm1AsEJHaudZBpF2qG8 w2kGA8IpyLgtqG1zfGMSLrDZNNH65PujvhIbjiWMpmAMm/h+BoyibRU9UAQ4Yehu4CM1 vkMw== X-Gm-Message-State: AOJu0YzyclLrSEkNtTrVPBsIGq49FO6ykt9ZqDkNj35feNeRhfXPHEwS YRGTnpPCqF9o87/snxFa3kpW8MofxzCBHwzQnS4D/JWW4kKaTaGSQ/NeBbNi/Yu+9RKxQtY4jV+ Q4IESSM6z X-Gm-Gg: ASbGncs39iF9oURNpiXGETmz5SiAv15QboAK5gouQ47VdrzyElgznSiAL++cZ0mbHVL X/b7t8dAPeFACkZiBZQeuFr70d0rcNmlUqYZrHDxqqN2gca7Ixgcevpe5GMRp3CTWHFy66zl6zh 4wEJS44UL+NWrnJylYChtRVj4qaxpcgHfUaWGqOzP/KHE6qteGSQb+OWsAyFHr92llGYDx8rv9y hL4CksXcB1i6rjYNlbcJqQksQ9VfDSTHnUWc+0ORxmhQEN/6fRWYWKa8NsY+Q== X-Received: by 2002:a05:6808:1805:b0:3eb:5e08:f806 with SMTP id 5614622812f47-3eb5e097668mr4544792b6e.29.1733844294527; Tue, 10 Dec 2024 07:24:54 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 37/46] tcg/optimize: Use fold_masks_zs in fold_shift Date: Tue, 10 Dec 2024 09:23:52 -0600 Message-ID: <20241210152401.1823648-38-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::235; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x235.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 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 551f96dfaa..bec5a07288 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2530,12 +2530,12 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) if (arg_is_const(op->args[2])) { int sh = arg_info(op->args[2])->val; - ctx->z_mask = do_constant_folding(op->opc, ctx->type, z_mask, sh); + z_mask = do_constant_folding(op->opc, ctx->type, z_mask, sh); s_mask = do_constant_folding(op->opc, ctx->type, s_mask, sh); - ctx->s_mask = smask_from_smask(s_mask); + s_mask = smask_from_smask(s_mask); - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } switch (op->opc) { @@ -2544,23 +2544,22 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) * Arithmetic right shift will not reduce the number of * input sign repetitions. */ - ctx->s_mask = s_mask; - break; + return fold_masks_zs(ctx, op, -1, s_mask); CASE_OP_32_64(shr): /* * If the sign bit is known zero, then logical right shift - * will not reduced the number of input sign repetitions. + * will not reduce the number of input sign repetitions. */ sign = (s_mask & -s_mask) >> 1; if (sign && !(z_mask & sign)) { - ctx->s_mask = s_mask; + return fold_masks_zs(ctx, op, -1, s_mask); } break; default: break; } - return false; + return finish_folding(ctx, op); } static bool fold_sub_to_neg(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848754 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp384481wrn; Tue, 10 Dec 2024 07:26:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWEEppQ+zytaGSgAW6aVvOg1PuoZ/T087Gz6zQ/VkVeqsRlJJX2Ve31/1RbR8LSD3VLRCZL+Q==@linaro.org X-Google-Smtp-Source: AGHT+IEpd0JqJFpxEwuY9uhs7bzuwmCkHbjgtfXGvGqjXd2EdihW/LChrNteYQ+VRt0ZepMhOPUF X-Received: by 2002:a05:6214:23c5:b0:6d8:94f4:d2aa with SMTP id 6a1803df08f44-6d9212c7c70mr64447266d6.13.1733844392882; Tue, 10 Dec 2024 07:26:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844392; cv=none; d=google.com; s=arc-20240605; b=Fg8tSiV8fSQ/rlGswc7s7T8sQXKV/3WYEHGu9k2NPwyV32VftJ2lwwCbfmuV8vWJ2O Ba9qKqdiv6hRd9pl5V33ddb9ei/TgMLHPkbJzUdGHF60uURRHCoD5k1XVSADzTD9KaTB 3Th7o0lJuRCEb8jRfUoh39kRu01b3UK3OIPuAajf/V2RG2vk9NoqBx/N4qtb7F6rXIhk Q/dnxRQTbolqsMQNDNRJulFtChRwxLgkzr2MI4knTiCvnwYbyJ28Wq3IHMX0N+NtHtyS ZF2dePUQuRk85EupOmgtj4Az4jk1L8IrPFadn6D4N4cK73J46jAawxJ15fAvFUxu6ZKS vByw== 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=puElikFFzv1lK2CkoPetqFbU1n+Bskb4VdjdC5Y/jYk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=PtX1L7p85EkXhlE9QUdhUh5ZnFRBWHaR9Xhj9xBTZtETpIip67z+13/FD5+MfL+z2p Jz1/wouwUTUHmvlF+3a7X3/wuDsRb6JNIobKNiCxw15bfj9IDTjSY99Eg5Dgz5gmA1tT /BC27u3ZiItcIlIs5mixy2cwNolr1HY1wUYl4XMajuaZO2LiULBm5L+ZASg6IT+pN9iy 9I10rRtQHZwurCjuDglHwkzLixdtyM+NTRmuyvCn1Nxyf+9DXlNimSI1CZFlXtH7ZVQx 0nh4cLEL6wknpiZB2QoEGtkjsqnQk/CIF9R3ciKOKsXB7QO4n10uYLboJOBgeAOHyBmH eUBQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="T4YtC8/j"; 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 6a1803df08f44-6d8dac29c0asi16911526d6.491.2024.12.10.07.26.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:26:32 -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="T4YtC8/j"; 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 1tL26r-0004yI-UO; Tue, 10 Dec 2024 10:25:15 -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 1tL26c-0004lP-E4 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:58 -0500 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26a-0008Qd-RJ for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:58 -0500 Received: by mail-oi1-x232.google.com with SMTP id 5614622812f47-3eb3c143727so1239354b6e.1 for ; Tue, 10 Dec 2024 07:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844296; x=1734449096; 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=puElikFFzv1lK2CkoPetqFbU1n+Bskb4VdjdC5Y/jYk=; b=T4YtC8/jEyAHGxS7iGqnX5s/QTMvFk6fH7QFS83DEd6Y4RVvKuz7/xT9uggyJdI5+i 6wgtFEdSdDLAy7yjvM+TmF58XvaYItma3vkZvBDo/rlvRteh4ZJN8fq61Qtf/bd8U0aS ktyvDzruFNXBe4iPproYj7AFEF+LVqbiW+hKo7G30G0o5OXorqSMzo9312oDaV1EhMGf jfucXXlJO0hvO1WbS2bX5DrLGW9j+nuSw2NFJJNzY+nt3MkLWPe5eGHLREL8dENvd0bA KyfpBZflVuCYIZ3DzGXj6aBqH+cpa3NhRpbKGD79WnmPfmHHjXQf5sB577tNB3cUMLZF T9FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844296; x=1734449096; 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=puElikFFzv1lK2CkoPetqFbU1n+Bskb4VdjdC5Y/jYk=; b=grwGW26e53QpDGtvsh2uEuiQ0jetWRu0WIg5WGAZ2yiPZJrZr4MDOjJ/5oI07BK70S dgR8MT6tJP2Xw68gse8unR6g4oUrMyOYVYBRV5oYBHWVSE6lNrfZULkdN0iMW7AnukX3 HnR3uzbK/HA6haeAA3yO5pmeBvVdRJG4u1Aj4wzsE5gOISsoxBGVOpFRaN3I981bKM8D L9xwuw0+DY0E8azdNVstGpqp6R1EHD893CfNuI0op5ALYlWVrKZgJWWbJqAXIfO+/iY3 SI7NWZXNA0tkvhMdcMiBGCjJzrtsQSYmpOvehVNBq6twoweRzZTvZ/f/zLK5wSSs+xDa PD1g== X-Gm-Message-State: AOJu0YxCc59DDuwczOQmvqO3gd2rT3QBjZ4EsAbT0RES7tGtvanq1bVd vpJ3zjq5KVKnJTzBpk1iufyt61DBo5EI8VfYpWG5/7rtcL4Am1yYUnWkfXoynrkwqZhuEJyij4w 8d+4Oed+s X-Gm-Gg: ASbGncvdsJuW+WdbvmISeLaCSOWUbu5knTu0cnaSPCWDiMi/RvvCTZULlbK0/6NCsb+ yKQyPPE9nHILXtgEiqNJAOreQ2QfskrIFOY/Q75FHvcaQz86Jl9v1Zc3st0o6+yt6Qudtmjqs6f kSeMByzgeBEFLGNwas0vNeTj6cezFAvylRd4TSuUoyCc5b8wKDshOAOpkkzgQowrVrHxgo23olP q8UFs0zaobFd4NPMqIViMUBDJ0sUlvRXSdddMPWxYTBtl5CiRIlbci/NfRVUA== X-Received: by 2002:a05:6808:1b2b:b0:3e6:22d4:d2c8 with SMTP id 5614622812f47-3eb6b8c19bfmr2326781b6e.12.1733844295761; Tue, 10 Dec 2024 07:24:55 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 38/46] tcg/optimize: Use finish_folding in fold_sub, fold_sub_vec Date: Tue, 10 Dec 2024 09:23:53 -0600 Message-ID: <20241210152401.1823648-39-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::232; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x232.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 Duplicate fold_sub_vec into fold_sub instead of calling it, now that fold_sub_vec always returns true. Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index bec5a07288..6412d5df37 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2606,12 +2606,15 @@ static bool fold_sub_vec(OptContext *ctx, TCGOp *op) fold_sub_to_neg(ctx, op)) { return true; } - return false; + return finish_folding(ctx, op); } static bool fold_sub(OptContext *ctx, TCGOp *op) { - if (fold_const2(ctx, op) || fold_sub_vec(ctx, op)) { + if (fold_const2(ctx, op) || + fold_xx_to_i(ctx, op, 0) || + fold_xi_to_x(ctx, op, 0) || + fold_sub_to_neg(ctx, op)) { return true; } @@ -2623,7 +2626,7 @@ static bool fold_sub(OptContext *ctx, TCGOp *op) ? INDEX_op_add_i32 : INDEX_op_add_i64); op->args[2] = arg_new_constant(ctx, -val); } - return false; + return finish_folding(ctx, op); } static bool fold_sub2(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848772 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp386336wrn; Tue, 10 Dec 2024 07:30:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXJHWYSL0JkhHzPsaNbT2IQH2628NfAmZLqklVwUvrQ8ITG4LzNIfp4+sxz4atSSzOI7uhqfw==@linaro.org X-Google-Smtp-Source: AGHT+IEo0Y9rIVTJsHS7J0XH/2G5ZJ4FLNHwSycpRxlGFFYo622pwcjj290fvEQoMV8zNmO7r5J7 X-Received: by 2002:a05:620a:c43:b0:7b6:e872:421c with SMTP id af79cd13be357-7b6e8724388mr208061885a.9.1733844606719; Tue, 10 Dec 2024 07:30:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844606; cv=none; d=google.com; s=arc-20240605; b=a8SKIf33ySnYa9V29ycLGBADK5d2S4KYM3wjm28oz0tDjA6Mkwx2Fq0e3oEaLevLHf jevCIGU/DRtZXICA8GEyh7P0aLIKCWS8y3GZOYlWrxyhF+LLFv1e6S3hu/x0/YXX4rCG 6vCeCgnLKQ3hYCuc++OguiTHfAdT0O+CsAzlc5CUgdPbqXo4X+WQqf1vfUuFv9Bi5dUC R3ElXeo+yefJaNmiB/Y+HQwms4tW7pOnRQs+xQSpOgT91Vq2f+DGNxj77aSWD173JIHt T9pODCjj64hc9c1RkUijNSyU8BDD89yPpXc8w25v2GlkNgQ6i/k+0uh++PQvD8OE9DjC mR9A== 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=f6P3xyzuUO6ajbsFv/D5weUMav3zZ6/9YwAqMDo4N8Q=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=TbfI4XWXTjvcTE1xr9LFrP0wo5PRV04TLyTH8Q79X0Fg4MVNkZPJZ3lR7MAHOoZdOt PaE656o7UdplRtfloFEZoWh4i55pLBUnY7Jl8MpIGXEOaV4uUkBm1I1ffA9pJTUmdacG y4y75cZQ6SkiSTY8lHibYVcwsCKqL9xN+7Vlllf/PVyhYtF4V0Iv6I/ta9wKsZ+2Onij T37IZaCWzMJP3lJMtBgrBhQt4WboSV9bPx/qDHxN+qNJ5siod/BiVNBD/PUwqLPj2jyL QZe/9b3cotq4uWnQrBw3jE+6pBmicihm5+DXLeMBsBK8Z1h0C92qHqvcYWrAzkdEWeUY 1XxQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ybUxyOdl; 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-4672984001dsi139298941cf.605.2024.12.10.07.30.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:30:06 -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=ybUxyOdl; 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 1tL280-0006hy-6Y; Tue, 10 Dec 2024 10:26:24 -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 1tL26d-0004np-CH for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:25:00 -0500 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL26b-0008Qk-Qo for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:24:59 -0500 Received: by mail-oi1-x235.google.com with SMTP id 5614622812f47-3eb5a870158so894394b6e.3 for ; Tue, 10 Dec 2024 07:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844296; x=1734449096; 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=f6P3xyzuUO6ajbsFv/D5weUMav3zZ6/9YwAqMDo4N8Q=; b=ybUxyOdl1hfr51PtOePA3Wo9rxHWfbs0fkg0AjnPaYvxuw3SV2X/qwT0b8k+nlGeej 9uO6/AT+L0rrYqHvvnsHVg44t0jixkiWL31ybrRVoBTe9fd/6MBIReYVqePrVpp1C0nr GKJ6pF2cnLOkE6sQlrQVpr/eLaTjeTdDfoKfQR6KofZztQS12F49zGdjEbBVKJv4hMIs XWltBQ/baDQDuT6/mrENYNvo5T9mfncVZPPK/j1ZNsYVg8uiHP1eolxDhgnx7U2N5yNT Vn16UolNqq2cfn6ZRCxIjBETBEYAxAYsFAi1Xi1t63kwQm6q9jtc9fLlztlxseBuxjPL mGWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844296; x=1734449096; 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=f6P3xyzuUO6ajbsFv/D5weUMav3zZ6/9YwAqMDo4N8Q=; b=iwD9ZzkOpSMWReOINcp07Kt2aPxvOEPVpwbT9x07iSjlqgI+JPXpDJ/aII2zfP0B1N 4uJ61avAqoLDSflU12vGaVpfapOfb81+zn80CK7kxAhDOCHyGJn4WkJuGHvC7ab3S+ff SEdyiKuYa5HJ80W2QLvvy3MYoDoSeN+gGOiy1U9V59MKCEnXNhnHlvGpYPEkrqh3rI5b /n+xBPxrOW0Ey89XmfJ85alc8lMTle48BOFdTvrHHDW1YBY2uUtyAq/DabgvPWQI8dgt EGZpLoWLewuIuknbTfZv2iT00wm39+JElCAEg0raPHj1Km1hC8VJp48CJgBJKi7KdNWA nfRA== X-Gm-Message-State: AOJu0YyJfxNtURqSj59bYTDhf5qsgq/OUcTg094IA49ygZiQi/V0Oj46 ytZRj2FCX8IkjhADiM2h5UxYWsnE0u7w8SyRL3/bmI1BsDbA7dJ6ETvfZ8VdBuarDls/4i/QQ4u sOGVBREzT X-Gm-Gg: ASbGncu1H4TucH1ecatvowfa2anzXGQLCDU83MYiHHrnGViKXJL5l0q4DzNgcDyIk9w UNPSqtMkfmMfpXQUy/zjaZVr7P6bf678xfPrZYKSJsfrdb45tupFDaq9E4zJXGQzMrX3lnLu62k rcymIH7mJJ0w8hN7QCzY+Vs8P5OZ8jQNWT29fZJnnAhRmkHyNUI12AertaihVTOAiJy1cE+nI4M jr/gKGhLiWZoADFE0qe70qX2rOUhtKq5OrAlPIsX1qi3GzLcSdkciGOrjK8eQ== X-Received: by 2002:a05:6808:2110:b0:3e7:df63:15bc with SMTP id 5614622812f47-3eb19c7771dmr12152193b6e.12.1733844296666; Tue, 10 Dec 2024 07:24:56 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3eb076b9168sm2776435b6e.14.2024.12.10.07.24.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:24:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 39/46] tcg/optimize: Use fold_masks_zs in fold_tcg_ld Date: Tue, 10 Dec 2024 09:23:54 -0600 Message-ID: <20241210152401.1823648-40-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::235; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x235.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 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 6412d5df37..4cccb3b0cf 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2636,33 +2636,35 @@ static bool fold_sub2(OptContext *ctx, TCGOp *op) static bool fold_tcg_ld(OptContext *ctx, TCGOp *op) { + uint64_t z_mask = -1, s_mask; + /* We can't do any folding with a load, but we can record bits. */ switch (op->opc) { CASE_OP_32_64(ld8s): - ctx->s_mask = MAKE_64BIT_MASK(8, 56); + s_mask = MAKE_64BIT_MASK(8, 56); break; CASE_OP_32_64(ld8u): - ctx->z_mask = MAKE_64BIT_MASK(0, 8); - ctx->s_mask = MAKE_64BIT_MASK(9, 55); + z_mask = MAKE_64BIT_MASK(0, 8); + s_mask = MAKE_64BIT_MASK(9, 55); break; CASE_OP_32_64(ld16s): - ctx->s_mask = MAKE_64BIT_MASK(16, 48); + s_mask = MAKE_64BIT_MASK(16, 48); break; CASE_OP_32_64(ld16u): - ctx->z_mask = MAKE_64BIT_MASK(0, 16); - ctx->s_mask = MAKE_64BIT_MASK(17, 47); + z_mask = MAKE_64BIT_MASK(0, 16); + s_mask = MAKE_64BIT_MASK(17, 47); break; case INDEX_op_ld32s_i64: - ctx->s_mask = MAKE_64BIT_MASK(32, 32); + s_mask = MAKE_64BIT_MASK(32, 32); break; case INDEX_op_ld32u_i64: - ctx->z_mask = MAKE_64BIT_MASK(0, 32); - ctx->s_mask = MAKE_64BIT_MASK(33, 31); + z_mask = MAKE_64BIT_MASK(0, 32); + s_mask = MAKE_64BIT_MASK(33, 31); break; default: g_assert_not_reached(); } - return false; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_tcg_ld_memcopy(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848792 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp389941wrn; Tue, 10 Dec 2024 07:36:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXAHyeR/X0RvUvJylx4UUA4dRCIRM2ACeHCJjB6iTdch5oLQBd6+ZLV1Lgqct2jcqOasyF7SA==@linaro.org X-Google-Smtp-Source: AGHT+IEsAmP+sN3I0k6d1LLaDtx3k7eM0vXD+Xasy/RTRftuqHzaq+lqnvQh5DboCD3WrE7070WN X-Received: by 2002:a05:6214:d83:b0:6d8:898a:a508 with SMTP id 6a1803df08f44-6d91e31453bmr97470316d6.16.1733844960068; Tue, 10 Dec 2024 07:36:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844960; cv=none; d=google.com; s=arc-20240605; b=gvjfE2TrNdW1SrifamuSHG5JubHqHep3u5YHdkTKdAxaKuhg4IG5aB90KLPrP07qWV BoBBtb0cdmWs8Skew38BIwHqOKxhxg2YQKK2IiHjTbjNItMRxSgxb94tsV1egls94omX cCIOuJ9q+6fcPgiLPI3m9m3mwedwWohnpnIq3RuaUgVp3hQJefbQ8PaNWATSG0/taQcy /YPBUYKjtItlGiYa3/o0x5WoNL8upTQVDKbtb/aHwdbV4uBnBdx2TSpfiT/DppyZlLGu 9BRV7uTn2QhYsar5g1znlgrHRowc92TMBDfvMuWPLrh1B6zIHi1cFS1rvwPirrUr+8/W Fjjw== 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=rlF3+b8Ya/xkhDBFRDkErRMqlneQEiaGonizob7aHXQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=E1TflrJ3I24i1m/a8PZjXjm8vPAzEdpUGiRQOqKv3iliZmqSz8wSxcrAYtZbc15sE2 /y3x7pleu2NYwpVa00NABA6SHR4j58jB5mQCGev2/tldr/W8fA5FCZk/jhu7N5ilWzJZ ENLRcyH23GW6coG6jPdPUsncD0Y6aHBzu+TPo20SkxylTMjEacd6zmu8LH9yXt5dSMcg rZZjsY8WtgL46u3Tpr913NvrKaiE86XTy8JUSo8EjH70angZmnVTjcHDlMjZ3f9IvDtm UNvnkDTXXVY6Q609bFeuOTuxDlYTf+mMKVoeKozkJjTYEtB8dPY5llAZU9RW9lokr2HL 2n4w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aqTytw+P; 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 6a1803df08f44-6d905eee3f8si76088516d6.424.2024.12.10.07.35.59 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:36:00 -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=aqTytw+P; 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 1tL29g-0006WF-0n; Tue, 10 Dec 2024 10:28:08 -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 1tL29a-0006KN-Mh for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:04 -0500 Received: from mail-oi1-x22b.google.com ([2607:f8b0:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL29X-0000It-K2 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:01 -0500 Received: by mail-oi1-x22b.google.com with SMTP id 5614622812f47-3eb4d2b39eeso717746b6e.1 for ; Tue, 10 Dec 2024 07:27:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844478; x=1734449278; 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=rlF3+b8Ya/xkhDBFRDkErRMqlneQEiaGonizob7aHXQ=; b=aqTytw+PRSKYsYDKDhlOujTAHze2HCbUcZra74XJGCAfRChIT3F0eZLuvogkbnyu2C 4x5fhbd92F1/OsrglGgkgRZWDZB6W0WrsGoRUUscM88drBNDblYc8oOQVQIY5misr0Ku /AsmfbzLGYf/jG0a7qQENzTjFgE5qxIQP5gBlls4C7k47rEe7br6ACx2RjsGdToP3CSl MNhx2XKEGdad2B6Aor0k8FKieq/RjWcqgiPm330Mvqcl8RltlVWag5ISXCOtzsjUu3vY OpBNr6+QrjHLX6D+jDLtSegTkr04wTfkEzglKWhBm5oN5NaZ/Wn5fmOpSm1QJLjo7K06 5rPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844478; x=1734449278; 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=rlF3+b8Ya/xkhDBFRDkErRMqlneQEiaGonizob7aHXQ=; b=BidP5XQa2bl1YWJdHXYiyiuVWDUfJT5As1/WrTQ/SUFzWCQz/7cHYWdRwdTM3xAA9R JOLJ7bgCPzdSvPy5l9Q+PyjvWyNazHwjhPD4rkKwCYlwFzLXP423BpO5sV49dYhJLko+ /8gYED2v1TCz6fOv5tya2heya1ApwzthEl+EpT8Qx+SDcUs3MkGaKSeXf3U6rT9AU3n2 NWts7ZhMYi6qh20yaBGtq6JFW3esJEB0LNDH3FMvJK4cjNC4ejF5c43uVL8scC5lLOsW 2jAiB8XC7pqFFE5g8s7CCu8m+bYiJ2eO9q2CTHA8DeYDbOv2NrMAXoSXu6LLdU0mKdwO /LQA== X-Gm-Message-State: AOJu0YxPNOBFi9g9XTiMYTUD/7aaPnF5iabUKRAv+skAJQUjN0c9iU4m tvrjF/u/fwqu5OdjvfI5xZ+wkwnvaTt65VPoEo0UndKsuCLHOfYTrjfWBHsQQvFcvrInd9sX6XL rBYu9CWvn X-Gm-Gg: ASbGncvAkc8zupMcUn8Jp6NdtTYwYdo/9ZND8ecXSkn/UgFUsQfkVB/Ua4K+gFgYcYC O0dW811OVjIlKl/0Ri9KGe3erVUswc+GNoHc5REBuFoXpG3thxBUJIXUQL1etj7M3vR0ETHnBhD iPivsWlPbH9VwjnZtiVc8sxgwz6d/ezEi9EWSYGbQrLNTNTQK8v2KnxNih7Jvfz+0JrkTvxuAbD owoEGJjjG9Y9JK3ZlWr4w1e1N8l63LzWuE6NJP6Z7pm120kt6/jbaJQHb6jqg== X-Received: by 2002:a05:6808:1408:b0:3eb:4b3a:d578 with SMTP id 5614622812f47-3eb66f52790mr3749172b6e.30.1733844478517; Tue, 10 Dec 2024 07:27:58 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71dc4a0267esm2785955a34.52.2024.12.10.07.27.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:27:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 40/46] tcg/optimize: Use finish_folding in fold_tcg_ld_memcopy Date: Tue, 10 Dec 2024 09:23:55 -0600 Message-ID: <20241210152401.1823648-41-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::22b; envelope-from=richard.henderson@linaro.org; helo=mail-oi1-x22b.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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 4cccb3b0cf..46116970f3 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2674,7 +2674,7 @@ static bool fold_tcg_ld_memcopy(OptContext *ctx, TCGOp *op) TCGType type; if (op->args[1] != tcgv_ptr_arg(tcg_env)) { - return false; + return finish_folding(ctx, op); } type = ctx->type; From patchwork Tue Dec 10 15:23:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848791 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp389832wrn; Tue, 10 Dec 2024 07:35:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWpR9PBl83jrAFrOyXxgQ2oj0sgXG754bvXwj8sGCchqtUttIloFpULIyN9dhAqClJtovce6g==@linaro.org X-Google-Smtp-Source: AGHT+IEhDtoAXCkMagqp3jIkgi/tIO1P/6SSZFsWqKo5N4Q5RNGVrDhaVhIXELhYT/zvirdKdskU X-Received: by 2002:a05:622a:30c:b0:461:169e:d2dc with SMTP id d75a77b69052e-46772029ffbmr65884461cf.49.1733844948325; Tue, 10 Dec 2024 07:35:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844948; cv=none; d=google.com; s=arc-20240605; b=iZ2YrUXiaC0Cvt3eQU9a5J9yC/5cp9aSfxEssiU+iYxtSXhgYjhZswm53exVwRLs3H YuyOid0Lo6beAx6izrLMPw1/5vFYYv5qeBIbcs99JuxNtya+vuR5/AEqsB74E79lWNRf GfDntI8X9YUgTDQgmpaJzmOYGmXM3JDYZAzy6tE/SbxkfR0FEgtsNcQfUSqNOebct/4C 2LtwBO44UANlnsZzXFFleS7VIe5AgNQTFtUHnIo9l2AMD91rbd52/9AbZKUBY6FbHoIw HszorcxLSMi7Igt5MLxr5KOEQWVSTrXxx2gi9f9xTaEbmftd5COcLVhV561PnCChV5XY dZSQ== 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=G5qyspCYN19hthHdUnJwpB6rA6TWvsrls4PjVzoBXSI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=LtHoUE6W549JW/iapiRleT/IlwFup2gYfACQx0GuDuadNfsLAQoCiBTJcuJazJSaIb a7uIS4CleD0IMP4GbgC6HrfESKvayv4GRu8alQYMwAUvYjYsAUe0UfVR+EPAc9H/KjNZ yGpq38DP5ar5HzeFFMgHcJ0nVKFv3A1WRb+dq7OApNE/PT5uEpaVEQDHcOZ/PPgT3Ke7 TZXUmeDYoRxppNOxWSbrouJ5nIsJgx3a/oaszI053H/NyV/hTdorO2KjAvXj2gbLVL3W xGQRsZKjiYA9RuaAc8/NNVsRHxOy3jK1zurWZBfJ4+APySmeCTFh3v4hdxStTR44+OEj 9DQw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YOjQPRgP; 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-467297b979csi142381571cf.338.2024.12.10.07.35.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:35: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=YOjQPRgP; 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 1tL29g-0006hE-Mj; Tue, 10 Dec 2024 10:28:08 -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 1tL29a-0006KO-Mh for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:04 -0500 Received: from mail-oo1-xc30.google.com ([2607:f8b0:4864:20::c30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL29Y-0000JB-Ip for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:01 -0500 Received: by mail-oo1-xc30.google.com with SMTP id 006d021491bc7-5f2b71bdeeeso993865eaf.0 for ; Tue, 10 Dec 2024 07:28:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844479; x=1734449279; 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=G5qyspCYN19hthHdUnJwpB6rA6TWvsrls4PjVzoBXSI=; b=YOjQPRgPKSRPGG0vdK5PK+fbwotPS8ZwbygrXBTO2xN3rs/9YlIibk1WDwv6e2NEP8 uDY04XsvBP3JzzMOgfEk/zobbSoEtWCjdDeTU4S1zd8/xgcOYOBGI5c3kG13xPN1ZLh7 2QoIvJvV02a41eBjseqMbsOkE+sI8n0p95GX3hiJBvbHlVk2hWVLIxYsqBrSP89WfACr sxC2pWiqjj4yD4l1jipzGN+h0L70K43kTl+CZp6csGgEXo9TiyYm48BWTbutVNq9eBc+ 41NtWxg7NVwBVbh5jJlNz3AyVbr+2whqnTCjbQOg8TY+cx7VnElIHSoO/olnWqlsPqSy v5Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844479; x=1734449279; 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=G5qyspCYN19hthHdUnJwpB6rA6TWvsrls4PjVzoBXSI=; b=NR0fqrB2UygQ36mpkYYppysl9aQJiFQglOOVaO7PcPuDI3DnK+qsqouifBOlmgroit yO75bsh6apkUvrFbAbj9dYUFHho4ONpT30PtR3CxjkP/rFZt+QO72jVVgG75q7p4luFd aiFjIU/crZrXMbHzZROx34C0y3SlZWq64NEw4dhFTqh+rhQqZGV1w33Ox5cBueuTKwpQ PY1aduwfQhi73oR/UFdWvSmg6DZuzk5CURBR8UBumiP8jZhI6a5OG1VcGuOY2jG76weI xNxaqq8AnMvtpTm9AG2RHTWhkYN+ZsfrJwEgVRMcN/sbmGjHjE1/KO/rj1EEewx78CVj cagw== X-Gm-Message-State: AOJu0YwkGjeY7Rw/bAu/TTDkulvHD5SOl35b+i20HMpnS9dY0xcveHUP Avsuaju99a7nkyQKxeRl0Sy71TatJK/cInwCXi3+RJ4O2c9KbZHFYpVECL2R24hNn59qNVrSgB7 +o6Yi/k7r X-Gm-Gg: ASbGncuuJNXvW+SnYW/n48vWP8/r0MwQwUxvSmfoJqPE8G49opvCIa+h64iasYzIFH0 pi7FVwMg29d9voVzVEXFXOBOvA0NdeVrwJzVXfDdU4vbTI/vgIKzUFYr1hEyOoe3MDWwPKqnw4Y 57oeQoAb/eOzgJBGY2/4NbkEbS2XevexOX2It0mAUOSI9xCNjz3zto3HQgupndc/Pv6+EoHoekA vHv1HsqDsIh8n+rGPBiZ2rZFX5sFbohWrOCuR1utRouIAoEzbKC12xrT51PHA== X-Received: by 2002:a05:6820:1a05:b0:5f2:c4c7:390b with SMTP id 006d021491bc7-5f2c8bed69fmr2900109eaf.2.1733844479272; Tue, 10 Dec 2024 07:27:59 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71dc4a0267esm2785955a34.52.2024.12.10.07.27.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:27:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 41/46] tcg/optimize: Use fold_masks_zs in fold_xor Date: Tue, 10 Dec 2024 09:23:56 -0600 Message-ID: <20241210152401.1823648-42-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::c30; envelope-from=richard.henderson@linaro.org; helo=mail-oo1-xc30.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 | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 46116970f3..fec46014be 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1093,11 +1093,6 @@ static bool fold_masks_z(OptContext *ctx, TCGOp *op, uint64_t z_mask) return fold_masks_zsa(ctx, op, z_mask, smask_from_zmask(z_mask), -1); } -static bool fold_masks(OptContext *ctx, TCGOp *op) -{ - return fold_masks_zsa(ctx, op, ctx->z_mask, ctx->s_mask, ctx->a_mask); -} - /* * Convert @op to NOT, if NOT is supported by the host. * Return true f the conversion is successful, which will still @@ -2758,6 +2753,8 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) static bool fold_xor(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + if (fold_const2_commutative(ctx, op) || fold_xx_to_i(ctx, op, 0) || fold_xi_to_x(ctx, op, 0) || @@ -2765,11 +2762,11 @@ static bool fold_xor(OptContext *ctx, TCGOp *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); + z_mask = arg_info(op->args[1])->z_mask + | arg_info(op->args[2])->z_mask; + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) From patchwork Tue Dec 10 15:23:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848786 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp388152wrn; Tue, 10 Dec 2024 07:32:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW4nR4kzIy+jR5rr7Pm1gyxU+UA6QgkrPE7RuFlvCnQclI64EM8AWjsAf701v1wmqbs/MtcIg==@linaro.org X-Google-Smtp-Source: AGHT+IFg2yB0S7orJ0bPRGFQduqRu8DYa7/GtE4IxZHzg1FyAZ6WVTG4bQgE6m8GLw2z0amEz/Z7 X-Received: by 2002:a05:620a:1b8f:b0:7b6:d0b0:4ae2 with SMTP id af79cd13be357-7b6dce98638mr675724585a.48.1733844772266; Tue, 10 Dec 2024 07:32:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844772; cv=none; d=google.com; s=arc-20240605; b=hNz0jrM5D2DsTtxzUSfY5qNSlDhbRxu2E5MmyJKTa6Ey5czRVzm2O3M3y5NYl8FvQ5 jry/3P0u5jYWvxiRPxsgY+qYIWR1XB4xpFK8RRA5kc2uS7qfgfsZmLCEw2+/0CA6ERVW coBpnVSZlMlbT3VexlHXojGo05HsIIRR+gA1sqqYsdY/0dcqemkMQOrORUynL0q1SxTO 2RONAFbZ7EI79Yaelk5qyt1R64sUFNOFTAqcStGqSNAR4aLIXsPncnRiY5RQSGlc8Isa HOJVKf8EX22m2niAvHMCbMN+6ZuU1u2c1lJq2AseLKeo8WS2U7is4QBrrPLZfIBwptb7 thfQ== 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=PkRBGiL4qFQ9PblYJoRzdxqhNIP/1epQ19VlxU5LaGM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=aAdYdfJqPqtKC3S50guhoZ/d3qXng9y5GNF/Q4d6VlHYd06Z1I+UF7LJthprORqkPL BCPLPmugMNiu89GrRHmwRPY+/hKbTXpNax99fgfvhDvHEs0ykZffy8JTxf7zwnJ44o2K aYwByRj9k3zh1EIiYLDtvShGTGfsGTc3yzEOerZmtCGu21WpPNqoh0YpSzejpBcuJN0l ABgvcNn93u0UgvVLrAmY6IH2jU8x/ntfYamLREtjlRawsALfzX9ulNnlu+IxkYruc8jP 4sS3oliPb+RUzuqxobsSNhdqqbQCYgcYOPD65JSWjtNxHXRtfxM2dTuiakZT+kXkStyG aB5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ape+9DPv; 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-7b6d4209c55si560331185a.198.2024.12.10.07.32.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:32:52 -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=ape+9DPv; 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 1tL29h-0006sC-Sh; Tue, 10 Dec 2024 10:28:09 -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 1tL29b-0006P1-3u for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:04 -0500 Received: from mail-ot1-x32a.google.com ([2607:f8b0:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL29Z-0000JV-5c for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:02 -0500 Received: by mail-ot1-x32a.google.com with SMTP id 46e09a7af769-71e0d4f2874so118822a34.2 for ; Tue, 10 Dec 2024 07:28:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844480; x=1734449280; 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=PkRBGiL4qFQ9PblYJoRzdxqhNIP/1epQ19VlxU5LaGM=; b=ape+9DPvK8dVNPOBzh8FSplSX6fzxsBBCOI67fc68q4je85yYL7mlC6HyswYwi+SB4 DXKX2/LPJaxZqoII6qEfY8n5Ug2ArdmyiuJ7KIp2wbqn8qh3wxhsB8PhnTespKKlsZOu eXsR5D5xOQrhfQikYHBKiCjdU1x83KG4GeIj0dp6zMgPva4vW18Fc4jtK9dGo9uWMYUM Z63ByLTFj8Xw2L5VsoWlClS52eo9PqzVUBHzgvcxSKjOygi9NBSeqfBEwPChy+BQil44 H059fFOqwgMjeF9PMWCewQV4kYsXWBEVYovG5OfS/kJVBYGNZCh9WzTc0SVxeG9Ba5Pb uxdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844480; x=1734449280; 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=PkRBGiL4qFQ9PblYJoRzdxqhNIP/1epQ19VlxU5LaGM=; b=RjCoeHLmMz4ZPO+hk5yeTpOO40Jxq2IxNq47HKvT1/ZkvOE/S2s/yTyExZFnCAPJIK RvzyZTeq5e4C0wWNiyBQEWCfIrJJ04S2e/803XEI9dpGPVkZWTHePcSF60+OYxTfuGIv y+yDDpzK7dQnDxTBSzyrdCUp42waQBzVp3zOmgiOA2ZwgwGX2jQHwH0aefN17qcjbNI7 ADKcrUBffvr+hNH/EXrlKFaKXyxq6f+4dDsxuVVH6genVcZ0TEcLdwG3y8h2F0Ev1Yth NjUMrRiHCgUGmDKFkb5Kah4Rg8rwXPI9YLDXovzr6/AZRMO79PfrLfxFQsvmM0690TV1 xCEQ== X-Gm-Message-State: AOJu0YxG8t0dExqbmGMFKkrdx1sSLADe5OgPArtx1onaMHbByf1dqsot w81g9K+JtrehGi7I1VFfAQPj9VVardSOHKuHsTEQoJrnQJCb5ehiWb6FTRQcx/Cc5ODRxjAodIP oZj4NC01i X-Gm-Gg: ASbGnctbpbf68jF1gY1gfuJdRlRHrPK70MAWonU9asaswsBLSxqtElSM1R8PEJWQMx1 JqjEfJL8mA7FsITDFjKElB3z1lWAZg0dNz3YrOc/moPgo8JCtk6teeHqDx1/PuOJTd9vUo9I0PN Q59E6cnf1e4EHe525wfRM2gz0O2Ah2lCxyreI1zQKs755r5xi5NQaPZLLC0Izc4aFrIhEHKXscM xVRRyktqSqau6S891tG5m6zukuqlNF3F4t8rUW628AVNk1gKEJu1MeZ1lm9vw== X-Received: by 2002:a05:6830:912:b0:718:9b8b:429d with SMTP id 46e09a7af769-71e021a99a8mr3067529a34.4.1733844479937; Tue, 10 Dec 2024 07:27:59 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71dc4a0267esm2785955a34.52.2024.12.10.07.27.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:27:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 42/46] tcg/optimize: Use finish_folding in fold_bitsel_vec Date: Tue, 10 Dec 2024 09:23:57 -0600 Message-ID: <20241210152401.1823648-43-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::32a; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32a.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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index fec46014be..24ec14f476 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2821,7 +2821,7 @@ static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) return fold_orc(ctx, op); } } - return false; + return finish_folding(ctx, op); } /* Propagate constants and copies, fold constant expressions. */ From patchwork Tue Dec 10 15:23:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848789 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp388881wrn; Tue, 10 Dec 2024 07:34:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWkUqp7ZcWCEpP4kdUkH8aOKQJ4zrXlphb7eQ1e3h2BAytsPcqlj7uJ1BTgBFkWP2PaUYb/QA==@linaro.org X-Google-Smtp-Source: AGHT+IHeP/54dmmRq9esuHXEGFaxQw/6hkwDTmJElolUpSbeUMktcR9+cl1SrzES1521T+pbSKBe X-Received: by 2002:a05:6214:daa:b0:6d8:99b2:63c5 with SMTP id 6a1803df08f44-6d8e70ceb68mr275084496d6.12.1733844843152; Tue, 10 Dec 2024 07:34:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844843; cv=none; d=google.com; s=arc-20240605; b=LF9TJ9oxK/apqP5mwEH++JmxpEWaCZcNCUeagnAPLkRcKGpMPj2N6jvmnjmn2bRESo lbayDOg+E5DukoyY6T5ScPyBWliSuGQnpDozIfgZ/qx9ZNEK51MHnHR5Dsa4i7t0WiYl sNmafPY5zSevDVTSrT/jozD0bEAQTCKd3XW9cyLIYl7lpyAkXmWx+bWZQ6RvlbisVgA+ /iOK+CoDTrGULPD7K7dMkpdEpVodsuG3+b8bfUTYA+GfHkAZd7lffepu1P0Iwee3ndcU ehz18QHtcHMx92q10tqrgq5GewJwT/KDi409A+PM+o7O6jtZMU5Ilsdsyp67hT3pWkWI Umiw== 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=lDI/3EszdlfHW9G8ekets9xBkYRtBXLFL38K4nvEAbA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Ry0OnWV3dDmYIXtn20vn2a3e5SdMynlI6HD+CdgTZI7niQt4CF92t/D/8Vh4UbxDkT Jws3GfNpP1CWXoBKS3+L6I7xUdNkUIRgbKHDFnmtIgycchHSbGT5qORyBRtHwlUtiZJ5 So2MQHHPb28VIQcMIhW1cdDvqB7Q1NKRW4GbSdSm4ZUYFv70hgXcRKcR1YdkVrC2L+5V O9IEhuI9coFVje5sPY+/Qd2pru+6Mz1Zzj4qjmf5TnHQ/Uz0cZ0RVLRMHfSUGPZS3QG9 qfB7t5smEq4vN60WHlpbPPQ2rpojn7bAf+hUD6TrgkAnG3luUxDMBieP0zQo6S3eNlz+ 1z9g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kYogpjaP; 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 6a1803df08f44-6d8e6936317si125540566d6.281.2024.12.10.07.34.02 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:34:03 -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=kYogpjaP; 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 1tL29i-00071h-MC; Tue, 10 Dec 2024 10:28:10 -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 1tL29c-0006Pr-23 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:05 -0500 Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL29a-0000Jc-EN for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:03 -0500 Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-71e163493efso22799a34.3 for ; Tue, 10 Dec 2024 07:28:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844481; x=1734449281; 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=lDI/3EszdlfHW9G8ekets9xBkYRtBXLFL38K4nvEAbA=; b=kYogpjaPl/ZsqFO9uQTXjLIeST8q4fCClHZtzrLhSbQv8pd6k07xMQWEIEAEhR2Sq1 pf8o/VGBIItLVP0kMMOZHSmjInbOMJDvm59+kFMl/UhJ42tFluJQ+UEntwo5m1w0VH7P fbt036/oVS4Eqt7AmNHHEhnwNENbzgdqPRVq1Hfo/KkdH9fwhAa4RkvcAFPvo1ubIGkm j/ZrTRnFLq23f8AE3fBzlWPUo90Emt6Y4p3mw0b12pUyss0ZH0nvMrNpKFqcFMS6DIC+ t90aBD6i1fkVREBVza0QQ2jz3+v6qSmdUV+b4zKl1IUhwX+RNw+RGiZJICQUpKbSfd19 12iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844481; x=1734449281; 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=lDI/3EszdlfHW9G8ekets9xBkYRtBXLFL38K4nvEAbA=; b=SBshqPr3MolbOQ33SBxr6tQKrnao6AnjRPiLHtjp5ea1NNu3zyCn03mNLVU5ogLQVE xhQ7CHLa9Jo3HJU0zijmJrftGxSKS/a5GFjYA4C0p90uBYIcKC9rJD+pjjmjRsia0mge sMkT7HpD4JakeErv2XaTcWk+kqPPsY8JfqF+1Ok4gfGTp2XAcdi4GwOpv9GVCMrcH1Iu 9t65vU/6eRBZanReRlGd/lnrEn3B7zuJFtCOq+za5F0ACmgtVqKQu8nKSRCyNRew8wuM +KEfxzukpaGlftrB9naRwF5mnefC3ACVUNsmf1KOmSNIKo4ND4asEhpK9scxTB3ycqx9 B5lQ== X-Gm-Message-State: AOJu0YygVvA1tgtwl0wkZOHfM454z2wU3UYgUdjRfsvAES0TpIheha2f m1XzJ6CNCGuUx6Erjlrn8SJTtRKyixigr6Ug2xkLvOKpEnNqNTveP/Xx62F636qJHzxxe16MyoR lD4FfLQAW X-Gm-Gg: ASbGncvHolOskhPx/O79Xe2eSGH5NJqPqkj4edA2X+hqAzSGAPIVP1ZR/mqSmj881Jn p7dRmL/TS1nXNHlfxGMxUpfOtPJ9uwKeDPGySRY3paEU7ocR/9e+YatT6+kNrpc1InkbM1Hdx4L 1amloXmX0zdE2ARYrmxXvh0AP6iB7XJQiXXvNw0PSdrjO8JjfyG+1MU4NvOvcs4t7nCPYrltfHr NO8wfBH6yuPrjPbu5Jyiks9ctkag/1k1YlS5vZgVKLLeyoU1qFpY/6Z0LhzSQ== X-Received: by 2002:a05:6830:65c2:b0:71d:ee65:7c38 with SMTP id 46e09a7af769-71dee6581cbmr6580907a34.22.1733844480944; Tue, 10 Dec 2024 07:28:00 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71dc4a0267esm2785955a34.52.2024.12.10.07.28.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:28:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 43/46] tcg/optimize: Use finish_folding as default in tcg_optimize Date: Tue, 10 Dec 2024 09:23:58 -0600 Message-ID: <20241210152401.1823648-44-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::331; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x331.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 All non-default cases now finish folding within each function. Do the same with the default case and assert it is done after. Signed-off-by: Richard Henderson --- tcg/optimize.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 24ec14f476..94e942e1cf 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -3085,11 +3085,9 @@ void tcg_optimize(TCGContext *s) done = true; break; default: + done = finish_folding(&ctx, op); break; } - - if (!done) { - finish_folding(&ctx, op); - } + tcg_debug_assert(done); } } From patchwork Tue Dec 10 15:23:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848780 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp387475wrn; Tue, 10 Dec 2024 07:31:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUs2DRDSV5iJXqbArj2Zt3/hnhnr0RkM9ONItUMs0wrSpNcZz6SY+52jUfJlCUw16J5sy6qtg==@linaro.org X-Google-Smtp-Source: AGHT+IH00eFSmJexxMW0dTJJt+0PpGdBlxwbpxlap38oGH4JfFBxQp8ttN/avEbAnToGxICM7xoi X-Received: by 2002:a05:620a:890f:b0:7b6:d8da:909e with SMTP id af79cd13be357-7b6dceaa1demr737036085a.58.1733844702637; Tue, 10 Dec 2024 07:31:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844702; cv=none; d=google.com; s=arc-20240605; b=fHdrVEG6RyK9UZf88doXa6RH70tZvItrhLGfS4KAmSiErJM4ui1/gkGmlAxclRTJ0X AfBx/Ab72ZzgQAx0OuPdfVWIxEj6zOKLuZluX8zMG7oM9cscIUMdwcju7y9o+cYpij8+ xdIMSioV4rLjoXc3oClwI1EJ7naAS0x1Cosd7ddIQ9UjvgnLlxOKvUGfbAKr0u387eLy 0Ynl4A52+96kr8f9k9Ra1QXVx1oTLrbe6lt59Uc1IBYeGOVdfMLafyHKAZEMctt1qssV pDEIEZamG3mqZH/8FVuKgBTQqZZjs4BaOsusMft1NoEQ2Pi8ZSSy5jMSvNXCEK8930IC obFg== 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=eaoltddxKl4v6Ez62fvCnLv/Rwse0SlBYVLIzgwT8Cc=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=b1gF6YoJBbtaSFvmQDlYCwSJGrBu7bTDVX4q9a7zy4xrfATNbZhtjUAzJ7GsWqLGwl eNeUiOYx8mOE707IlA6uvsr/tRmO5afTcKCLO7b0leLWe9QpSAQw4rNmTZVz4rxaWMS+ 2KOQMu07eB0/qFb0HUjETqjbYARIeqsmz/gxerXxu6hVkTdT9NZSPaiFhOBJt6TMfCx7 2NDNuWjgRoPjTzEkdzutyNXm9eOxfo1w5bvMsV3t2jH454ta6AIPJCQWvkz3eFmhVSVX SKU3FA2aCYeJ8p11RhFZlE83KongE+6UKLjcdOv9V3PnyoygU/gfAkRuaigj6QAMPiT2 Ihiw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TezuvRI3; 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 ada2fe7eead31-4afefe9f4f3si1245794137.334.2024.12.10.07.31.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:31:42 -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=TezuvRI3; 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 1tL29k-0007M4-Lo; Tue, 10 Dec 2024 10:28:12 -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 1tL29f-0006bx-VH for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:08 -0500 Received: from mail-ot1-x32e.google.com ([2607:f8b0:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL29b-0000Jo-37 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:07 -0500 Received: by mail-ot1-x32e.google.com with SMTP id 46e09a7af769-71de22bc86bso1192950a34.0 for ; Tue, 10 Dec 2024 07:28:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844482; x=1734449282; 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=eaoltddxKl4v6Ez62fvCnLv/Rwse0SlBYVLIzgwT8Cc=; b=TezuvRI3BzF6K45udtYili4fUyKeEZo72E6V0F6bhIP+dheHC3HvnuGfNjXs8NHhX/ vdtOsm1Vj+soDSekPvizzkSW9mzoHgjXERqCJOAmjvRgdcP1koHTEN1MierjfxeGHdvL KroY6zOhl+9sj1rTma5+uSXrCeKHEmHK80Rz5fjuxxfboeVJwKX4NsO+tCxr+HIQvlPl eGAU/xkKCOB1lMW2Z/Quob4xs+24WSs/E79iyxtw7wFSmoFCe0NzkNfPRTLtuVFLOSAS Eq7qMU7ruVh7p9efZ/MqwuycCQ77Gxum4eppz/gXUtVo+nG9mItUR2VP53Styl4Rm5Z9 zalA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844482; x=1734449282; 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=eaoltddxKl4v6Ez62fvCnLv/Rwse0SlBYVLIzgwT8Cc=; b=ID80yGSa8VQXyHtpva5Op5X1y/JuY6Ow4+7045KPZ9pGU6ggm6Ukmgwre9PBz68YTa m4lfGEn36p2iNIOu/U86BlIl/5tR1HQoAqgHPN+1YNzC107/UP5Q2vjBAs5aw7x2O3MS UcpIZhCh+Ehbaapo/ASztYdkJ+OQH8DXQKholO2MNLmEjKS42TNVqcdxDWG0cwa5p1sk rvrby1XUu2ayQUsP7HxH68IyIAFTmXM3UlVkG7xsPeJ7db9m+TyHXqZLE0CKLxftOWpU JhN0V1sueaxxUq+sL50ViFU0NE/ZBPZqAgltDjgt5eXEA+hxm6Hv0mvUSczzFHhwy7Kv XGWw== X-Gm-Message-State: AOJu0YzwMjDn86PkP9W0SSPswJK3iei2iVs/3F31pzn589Sj6SZ9JIRB c66x104bDmgmqOi48ycP+2+646DBBT96xSebZ10Sv2riW4njdV+4+JXwGVOSDMPB80ZIIQfEMe3 Am5f6WOe9 X-Gm-Gg: ASbGnct0/tmaV6ILyG+Q46F3ETmLWV1vnvM7Bny3kG49/uixDCmrM9HV1KcdwwLddco RWrgNTlF+jiAdjP1rVRdv/nn2AUJHSi+SLR8IW7E6uhBUL+wD824SGyYY5PaXW+GcHECsKHNgsl Zu5OgcDQaqFXyMAds4SzEkRZhemdaff+zMUguQjclTp5rMsDUeykK0C9OvYQCKNvd+cfWSpTd5p 5ZIaQvNBUoZs/yAIME8mZKm8NOacovHvfanDcqrS13Qk99SzVcURa8gGw2Avg== X-Received: by 2002:a05:6830:4992:b0:71d:fb64:b5fc with SMTP id 46e09a7af769-71e02253f75mr3364301a34.21.1733844481869; Tue, 10 Dec 2024 07:28:01 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71dc4a0267esm2785955a34.52.2024.12.10.07.28.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:28:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 44/46] tcg/optimize: Remove [zsa]_mask from OptContext Date: Tue, 10 Dec 2024 09:23:59 -0600 Message-ID: <20241210152401.1823648-45-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::32e; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32e.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, T_SPF_TEMPERROR=0.01 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 All mask setting is now done with parameters via fold_masks_*. Signed-off-by: Richard Henderson --- tcg/optimize.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 94e942e1cf..eb6e93809e 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -64,9 +64,6 @@ typedef struct OptContext { QSIMPLEQ_HEAD(, MemCopyInfo) mem_free; /* In flight values from optimization. */ - uint64_t a_mask; /* mask bit is 0 iff value identical to first input */ - uint64_t z_mask; /* mask bit is 0 iff value bit is 0 */ - uint64_t s_mask; /* mask of clrsb(value) bits */ TCGType type; } OptContext; @@ -987,14 +984,6 @@ static bool finish_folding(OptContext *ctx, TCGOp *op) for (i = 0; i < nb_oargs; i++) { TCGTemp *ts = arg_temp(op->args[i]); reset_ts(ctx, ts); - /* - * Save the corresponding known-zero/sign bits mask for the - * first output argument (only one supported so far). - */ - if (i == 0) { - ts_info(ts)->z_mask = ctx->z_mask; - ts_info(ts)->s_mask = ctx->s_mask; - } } return true; } @@ -2867,11 +2856,6 @@ void tcg_optimize(TCGContext *s) ctx.type = TCG_TYPE_I32; } - /* Assume all bits affected, no bits known zero, no sign reps. */ - ctx.a_mask = -1; - ctx.z_mask = -1; - ctx.s_mask = 0; - /* * Process each opcode. * Sorted alphabetically by opcode as much as possible. From patchwork Tue Dec 10 15:24:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848787 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp388294wrn; Tue, 10 Dec 2024 07:33:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV/HLX2LhhW0gZHKm7KoQcCZuxv/j1qsJ7+KPFaqIzz8Kkeqjc88Zshd42Ch4Ig30WTHbO6fw==@linaro.org X-Google-Smtp-Source: AGHT+IEEbNIvTcWq2S3OXURF55aRLJ5S3BZfmCNptSG91vVRPYZ7gNNWJX0c6XbUw63/NlJV8Aoh X-Received: by 2002:a05:6122:4d0a:b0:509:e7d:b7b2 with SMTP id 71dfb90a1353d-5188832a0c4mr4910249e0c.2.1733844787637; Tue, 10 Dec 2024 07:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844787; cv=none; d=google.com; s=arc-20240605; b=GvEfLuAXdOv3r/tqXKaGz1313qrySaN53ApQcMGz8sCX6W8wJbrNubGvs2xhopZqMP zOkIq93zYFvHkGJxpo1iyaay4xeZM4AkRCCGyMZ8k3acqd6uWCR6TcLQ4QBkszJYoBPq QBiN2CcdWaABTilP80fPwn+c/sllYrKq0COA7RX6bW/XmYwoOty79Zs89v25tBTVwHq7 RtbrCFZ9cZwdhtZLVxADb3JKIzaxvA+XKks1DfyODdMTF8NnDYovpsRljqwA+CoTBnwI dWGZgZGzTcWZL6buIGMqKp1e8bwvjXCqADLAt59PrsUsZoxknbaIEY1KUwqVeLgM7NW0 SHSg== 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=kk1vW6jFHzIeel5bbAGFsFlrjy89Dvl21DC4rV/7wrE=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Lab5KHjYNF38g2fmBJnBEBUlg9Yn34rhTMg+xTYo7OaZPEQrBHLBWSobcn+jFUo1hk Q1D/VmhRBrlHBVKWOvmGwaNptAi5uNRv8xzxCso0J25t7qbR94zmCOqWvhzf/7/KBhjf ZIOJsMyw+TYvNnBR38R2qhTUsw+3j72qCDwDvtVueX4aOtt0HDMu91MGOxPQBx7nr2f0 fy2CvC8mdZENLL7F32bd388AgRgje9UOnffW4IbDMakCVUddJYidL1XKY6X7LEopXAl+ RYIqcTffw5rwaCV261lb/DNstud6XMK140w9BHUYxCOr8LvyPcBjU+AYRGtFgEwAwYX7 ErdA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=O2TTLg33; 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-5174e40621asi1209606e0c.103.2024.12.10.07.33.07 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:33:07 -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=O2TTLg33; 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 1tL29k-0007Je-F3; Tue, 10 Dec 2024 10:28:12 -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 1tL29f-0006V2-4h for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:07 -0500 Received: from mail-ot1-x329.google.com ([2607:f8b0:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL29c-0000K9-JO for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:06 -0500 Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-71de334f141so734479a34.0 for ; Tue, 10 Dec 2024 07:28:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844483; x=1734449283; 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=kk1vW6jFHzIeel5bbAGFsFlrjy89Dvl21DC4rV/7wrE=; b=O2TTLg33l3CZia6oKueByDTLbwShjORKW/YGyNTkTooKLM8es5hmcCnfiUkvK+5Uqm tV7e5Dpic1A6rgq/B39X5O+rPdPR5c+NYTWdcJ0kfmLsgayzW2aYp8oqi8zdOxp5WQeh zAO+cyamMYb5Rm7dp5NSDYKx0xMTo4eSH97xr7HS5bRj33SebSrr/fJBu8gymxz+jr+J 9zCcdRPmPC4LOQs7HYwYpJVUj4xT0PNlEt01/danOkxTKVIYtJJWwikQOpoE21WP1i9l hhVL0xKLbPwxGTczhgXfLD2MLQJXblxkmdPfqI+oaiuvBLtG5q0ikDZRHMDWJS2iLnnc 8CgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844483; x=1734449283; 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=kk1vW6jFHzIeel5bbAGFsFlrjy89Dvl21DC4rV/7wrE=; b=n3vLs2MWA1gVzz09Fc2xWFf1qaXxgw861+Bli4i1GiNsbaJT96HP5oCBLoxC8UWZzH 2UfuQLkp06hksFpq2pN2E16ZfHr2wvl/KGcq/ZUXSMW7cLZOgcVb0Crv23vWkFV/KRmC KWKGoNBq6m1OSoFk8BugXR5yeEZnxmXpLy2P0pat8+uTdZMy1JW0vYMNEq0Um0VyDTeg nrWl3NwaGlBcXjQnh8OrGA0SeS7I2QE0wLpa6zFTnxI7LGAeNdaqS0vGKP9pbv82xLVj cYYfTX0IoxRunyx8AcWyHoyDPnDEHWHxTLsuwz8b5LhOZIPkHbx5Z5XB8CzOglrkjD0B 6BIA== X-Gm-Message-State: AOJu0YwUviPm0mbhFlZtaE7IlyFixhchjmPDCrpbOX9/kTKO9uVFJCc3 aRgmUcFePOqUb21Ilwsp1dYDbEEFsINWcexwHihyxIdOjjan5qC7X3PvsFmGwpL7kykeazoHi24 KL2DNhyzC X-Gm-Gg: ASbGncsJgoA5+RzFXlyjSLzbh78xPaOVP+WT9f8LEUSDY9enVishAvYjb+fHyGpAwIb mGkS9ObVVOcNO5SZay642pfkcLAr6ZrvVzYg5f6VvjZnBu3RRSWsSjdQa4fFGxJ2W/oUBMUeoOM ZeoIUSYoY7AdfZeWXhArbQUWL2wmcaE80chTCwe1a+HdoknbWJBTj/sh0F0QZdq5POV+pNTuLs+ r/Q82397wkCc+Cq1ETf0jqkYTUdOXZizajeeBdvK3iorFnS3iKvGnooADbCyA== X-Received: by 2002:a05:6830:927:b0:718:1863:a3fa with SMTP id 46e09a7af769-71e021ac7e8mr2409944a34.10.1733844482995; Tue, 10 Dec 2024 07:28:02 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71dc4a0267esm2785955a34.52.2024.12.10.07.28.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:28:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 45/46] tcg/optimize: Move fold_bitsel_vec into alphabetic sort Date: Tue, 10 Dec 2024 09:24:00 -0600 Message-ID: <20241210152401.1823648-46-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::329; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x329.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 The big comment just above says functions should be sorted. Add forward declarations as needed. Signed-off-by: Richard Henderson --- tcg/optimize.c | 114 +++++++++++++++++++++++++------------------------ 1 file changed, 59 insertions(+), 55 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index eb6e93809e..54082042aa 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1191,6 +1191,10 @@ static bool fold_xx_to_x(OptContext *ctx, TCGOp *op) * 3) those that produce information about the result value. */ +static bool fold_or(OptContext *ctx, TCGOp *op); +static bool fold_orc(OptContext *ctx, TCGOp *op); +static bool fold_xor(OptContext *ctx, TCGOp *op); + static bool fold_add(OptContext *ctx, TCGOp *op) { if (fold_const2_commutative(ctx, op) || @@ -1347,6 +1351,61 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) return fold_masks_zsa(ctx, op, z_mask, s_mask, a_mask); } +static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) +{ + /* If true and false values are the same, eliminate the cmp. */ + if (args_are_copies(op->args[2], op->args[3])) { + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[2]); + } + + if (arg_is_const(op->args[2]) && arg_is_const(op->args[3])) { + uint64_t tv = arg_info(op->args[2])->val; + uint64_t fv = arg_info(op->args[3])->val; + + if (tv == -1 && fv == 0) { + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); + } + if (tv == 0 && fv == -1) { + if (TCG_TARGET_HAS_not_vec) { + op->opc = INDEX_op_not_vec; + return fold_not(ctx, op); + } else { + op->opc = INDEX_op_xor_vec; + op->args[2] = arg_new_constant(ctx, -1); + return fold_xor(ctx, op); + } + } + } + if (arg_is_const(op->args[2])) { + uint64_t tv = arg_info(op->args[2])->val; + if (tv == -1) { + op->opc = INDEX_op_or_vec; + op->args[2] = op->args[3]; + return fold_or(ctx, op); + } + if (tv == 0 && TCG_TARGET_HAS_andc_vec) { + op->opc = INDEX_op_andc_vec; + op->args[2] = op->args[1]; + op->args[1] = op->args[3]; + return fold_andc(ctx, op); + } + } + if (arg_is_const(op->args[3])) { + uint64_t fv = arg_info(op->args[3])->val; + if (fv == 0) { + op->opc = INDEX_op_and_vec; + return fold_and(ctx, op); + } + if (fv == -1 && TCG_TARGET_HAS_orc_vec) { + op->opc = INDEX_op_orc_vec; + op->args[2] = op->args[1]; + op->args[1] = op->args[3]; + return fold_orc(ctx, op); + } + } + return finish_folding(ctx, op); +} + static bool fold_brcond(OptContext *ctx, TCGOp *op) { int i = do_constant_folding_cond1(ctx, op, NO_DEST, &op->args[0], @@ -2758,61 +2817,6 @@ static bool fold_xor(OptContext *ctx, TCGOp *op) return fold_masks_zs(ctx, op, z_mask, s_mask); } -static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) -{ - /* If true and false values are the same, eliminate the cmp. */ - if (args_are_copies(op->args[2], op->args[3])) { - return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[2]); - } - - if (arg_is_const(op->args[2]) && arg_is_const(op->args[3])) { - uint64_t tv = arg_info(op->args[2])->val; - uint64_t fv = arg_info(op->args[3])->val; - - if (tv == -1 && fv == 0) { - return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); - } - if (tv == 0 && fv == -1) { - if (TCG_TARGET_HAS_not_vec) { - op->opc = INDEX_op_not_vec; - return fold_not(ctx, op); - } else { - op->opc = INDEX_op_xor_vec; - op->args[2] = arg_new_constant(ctx, -1); - return fold_xor(ctx, op); - } - } - } - if (arg_is_const(op->args[2])) { - uint64_t tv = arg_info(op->args[2])->val; - if (tv == -1) { - op->opc = INDEX_op_or_vec; - op->args[2] = op->args[3]; - return fold_or(ctx, op); - } - if (tv == 0 && TCG_TARGET_HAS_andc_vec) { - op->opc = INDEX_op_andc_vec; - op->args[2] = op->args[1]; - op->args[1] = op->args[3]; - return fold_andc(ctx, op); - } - } - if (arg_is_const(op->args[3])) { - uint64_t fv = arg_info(op->args[3])->val; - if (fv == 0) { - op->opc = INDEX_op_and_vec; - return fold_and(ctx, op); - } - if (fv == -1 && TCG_TARGET_HAS_orc_vec) { - op->opc = INDEX_op_orc_vec; - op->args[2] = op->args[1]; - op->args[1] = op->args[3]; - return fold_orc(ctx, op); - } - } - return finish_folding(ctx, op); -} - /* Propagate constants and copies, fold constant expressions. */ void tcg_optimize(TCGContext *s) { From patchwork Tue Dec 10 15:24:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848788 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp388597wrn; Tue, 10 Dec 2024 07:33:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW5/9qFuBWlQ6d51WL5zFDTrP44+qctS6d1pmDcPceKekU2vfYFHV+BTSpL7kHxqeZNu6bhQg==@linaro.org X-Google-Smtp-Source: AGHT+IFISV2WkKbR/utCHiQyUFWdVtIpgJoIL/hggwSycTr4wOw4sfGkEO8fIzGWiMgyEpOm3UFR X-Received: by 2002:a05:622a:4d07:b0:467:8217:aae3 with SMTP id d75a77b69052e-4678217ab77mr25730071cf.47.1733844816602; Tue, 10 Dec 2024 07:33:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733844816; cv=none; d=google.com; s=arc-20240605; b=SRFV8w64n3OGONR/lWRw0ckn52Iz+ayk/otH8fA8v7hfrJ8PrOm+eMtZiAXos9F5uz nGxzns6Oa+Wiz2bNb4TLt7Enltqw3ZC8NNoXuohXuUPcj3z9sYpUR30yGBP5GxqH+TkU YgWOzZDckdbKJ7pmE6Wp5opxceXIZ9Xwr7Y2CvcaYRBnBA47+IXsbxZL7lESf9QcCh3e 1qzOfa/vBfV6VNORoVFfJ7tw0UXQwLHD1MxJw03sfHkJKxbX4ghH4kch9ap9uFEKeCnH 6Y9uWKdR75bmx5NbLfKE+iYFqmm81WUpzU+2xtu7DudlivznR1GcR51AQQ66AksQACdi 4RfQ== 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=lMlOWnE/8rGwDe2I7u+91BhniWC68DXpBuoq//8jnkI=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=DZhdKilwxG5J2I4J5ORF82QD5y0en3gie9LQhGR84lDLay51HQuPBrFla/K5s3Vf+L i78ZEWgRvNk8jdWm+/ev7jq/tnaZ99oRb2X0YilaVk5bfMUF92s4lWYTrjLxyyTVULgx TMTPAcHF/IFQIvo3dFB/L3FjpziGF1IBrB1ge+NAZerx607/LRwtFOB3cYWKlI2eDyCN TF2byM4GEptYfSOds0xSEz8ue+Lgk9Uzh6O5AIV/v7JC7N+pL4B16ygneNrnU9c8nYFh XOqOoA4VMocBPsdDYOS9k7b6Tte81/P7D23qFgU+XxtSVgSN9QMTpiRnHso4SZviWsoO 8HwQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=s4bGPw8C; 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-46749026737si90927261cf.55.2024.12.10.07.33.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 07:33:36 -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=s4bGPw8C; 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 1tL29m-0007YO-Hu; Tue, 10 Dec 2024 10:28:14 -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 1tL29g-0006f0-7F for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:08 -0500 Received: from mail-ot1-x32b.google.com ([2607:f8b0:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL29e-0000KI-23 for qemu-devel@nongnu.org; Tue, 10 Dec 2024 10:28:07 -0500 Received: by mail-ot1-x32b.google.com with SMTP id 46e09a7af769-71e019b00e8so694329a34.1 for ; Tue, 10 Dec 2024 07:28:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733844484; x=1734449284; 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=lMlOWnE/8rGwDe2I7u+91BhniWC68DXpBuoq//8jnkI=; b=s4bGPw8CiGK0VxXfIr+Im4uA4oek9U9gUdqclIbDmrW4Pqpy478fSu51jdIMoCVoXg 6mYD7y+KTTqye9RyJOr7XYM1ZlBUIRcQI25XwNeREg1KrcFjDbRDGbKHQPi/uywMuamy DvrfeQ9C6FxVvK8yOnydqcbtJ+OuuXyrIA+qzllR50AI7PV4Yd2mNAn/fi+cJGbLbwfD 00jBA/Xi0bmEu/adoTOLH4yhV0qN7oXe/KlRPyycWgxLQPvbWaO57Be+o0rsFL1D030V upijd2KvYTSRTg/uoSF2jdWDX7lACV9iBow49BUULQ3QmbfKWtFpJ22B8nqC1Q562+3R W48A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733844484; x=1734449284; 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=lMlOWnE/8rGwDe2I7u+91BhniWC68DXpBuoq//8jnkI=; b=RneyxFWLcTOgbfkhs5xRfbm1PMffuv0tRs5j/T1jCdHFvQHY5b4VKfV7rHp36JAZG+ PLxoH/+/HXSPgWFaY5lvXOuzfdHc2TV28KbUU3641pXeN10BAgg9MHQMFZmh1IySLQ3W AiqtRZF7tsG8p2ilGMxgPZ+JE/6F4s5GMrFQtBSsHfUzuZB3DXgfZ2Vhp5XmousE3Fqj /M4gLUmxfRQJ3JXvCiSnrxmbiZvRmYV7BtH27dSWx0kbCZuz4wZI1icXYnlTydQXxxR4 GBGoZ6/LoWwFC0ITAZplDaeGs52bFYUaO22QuSGoYL/xXUFxjz2jr/hPZ3XLTcRA5Ees AYug== X-Gm-Message-State: AOJu0Yy5T4ZtpftexmVSc9c5sZKC2I9jE0BVBHQF3XZm6fOoDrSiNMmv Oh25+eUfB1J6l5LrC5WZPtdUCgEMzP030XEhurUD1lUV4e6NQorC4LHqmsl8IXHL4Rmuu9CcaU2 IR1S1rZTD X-Gm-Gg: ASbGncsxH1YmIf2dWbU9blKpbjgmH6ndOhP6JHSK/RylbNfE98MoEhxqhZoB3dc15gL qclX7HnssA2xEXdc5UzUEmka9J41mpwD0NFMRQoOYVgusUfrxoCPzyWIx/MGmEP3xzcoN3jtDc3 mog1IC6XpyloeBYNQma13Jcd+8+aC8ObsIJQ5FHSjDO3lblFQ8Kdk3EaUhJpJIqMY7TH/JJ2w+E fNesrMmib9HW4s1kWX9s/DXMCH5T8lB3n6s2abC2yWSco54OeZeTvSM328TLA== X-Received: by 2002:a05:6830:6112:b0:718:167f:7f1c with SMTP id 46e09a7af769-71dcf4e7ae5mr11509551a34.13.1733844483928; Tue, 10 Dec 2024 07:28:03 -0800 (PST) Received: from stoup.. ([187.217.227.247]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71dc4a0267esm2785955a34.52.2024.12.10.07.28.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 07:28:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 46/46] tcg/optimize: Move fold_cmp_vec, fold_cmpsel_vec into alphabetic sort Date: Tue, 10 Dec 2024 09:24:01 -0600 Message-ID: <20241210152401.1823648-47-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::32b; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x32b.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 The big comment just above says functions should be sorted. Signed-off-by: Richard Henderson --- tcg/optimize.c | 60 +++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 54082042aa..2c5691e3c9 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1610,6 +1610,36 @@ static bool fold_call(OptContext *ctx, TCGOp *op) return true; } +static bool fold_cmp_vec(OptContext *ctx, TCGOp *op) +{ + /* Canonicalize the comparison to put immediate second. */ + if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { + op->args[3] = tcg_swap_cond(op->args[3]); + } + return finish_folding(ctx, op); +} + +static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) +{ + /* If true and false values are the same, eliminate the cmp. */ + if (args_are_copies(op->args[3], op->args[4])) { + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[3]); + } + + /* Canonicalize the comparison to put immediate second. */ + if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { + op->args[5] = tcg_swap_cond(op->args[5]); + } + /* + * Canonicalize the "false" input reg to match the destination, + * so that the tcg backend can implement "move if true". + */ + if (swap_commutative(op->args[0], &op->args[4], &op->args[3])) { + op->args[5] = tcg_invert_cond(op->args[5]); + } + return finish_folding(ctx, op); +} + static bool fold_count_zeros(OptContext *ctx, TCGOp *op) { uint64_t z_mask; @@ -2499,36 +2529,6 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) return tcg_opt_gen_movi(ctx, op, op->args[0], i); } -static bool fold_cmp_vec(OptContext *ctx, TCGOp *op) -{ - /* Canonicalize the comparison to put immediate second. */ - if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { - op->args[3] = tcg_swap_cond(op->args[3]); - } - return finish_folding(ctx, op); -} - -static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) -{ - /* If true and false values are the same, eliminate the cmp. */ - if (args_are_copies(op->args[3], op->args[4])) { - return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[3]); - } - - /* Canonicalize the comparison to put immediate second. */ - if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { - op->args[5] = tcg_swap_cond(op->args[5]); - } - /* - * Canonicalize the "false" input reg to match the destination, - * so that the tcg backend can implement "move if true". - */ - if (swap_commutative(op->args[0], &op->args[4], &op->args[3])) { - op->args[5] = tcg_invert_cond(op->args[5]); - } - return finish_folding(ctx, op); -} - static bool fold_sextract(OptContext *ctx, TCGOp *op) { uint64_t z_mask, s_mask, s_mask_old, a_mask = -1;