From patchwork Fri Dec 20 04:10:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 852392 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1854010wrq; Thu, 19 Dec 2024 20:20:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW2axLV1HmA15iLOBKfzquV2G/bjLhVnQoC/yVJV1k3qtz++6wx7cbOpJJxUEikhAK+3HOWqg==@linaro.org X-Google-Smtp-Source: AGHT+IGplY4OQPD+Hn5BPCEycPVIYnF+IPTVHtCqiRr5MCeicEGslwzvCFGzzy7GuiSY+2u56d3s X-Received: by 2002:a05:620a:600e:b0:7b6:cb81:95d with SMTP id af79cd13be357-7b9ba770bdfmr295780985a.21.1734668423266; Thu, 19 Dec 2024 20:20:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668423; cv=none; d=google.com; s=arc-20240605; b=iBK/CGCdNSttNq6mD2fDAghPIkwsbQpdiiYoAfffLxvQ28cgj2iIVTqoDRU99VB+PM BFcOHHhukMRUVntyD4b5fFy3hcYGaluU4E9yJTjYps7dhscuRAeD2mssX+Jvhz+2xv4L lLkE6z1rZee58xjC80XRA8C2//hTtPnCiaOdrAT7gkKtCi842kKBeTfvZlMRt0fqF2U1 /3FvmSDDzZDxIsGrcvEWi2rY5VNSK0HcMDqi4KL2pfZm8gb2CeOWquhHaFFTFuh/BYph jH46LrJgTVVBagTnRVo2G+KKpIUOB0BHO56Zvvld1ZuH56rBK2lGuDfBfd4y1ZPeZHdz lh7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=i8y2SP5gsVRd2DDyIzSjHzTbblUtHqyMo6MFtQTYJr0=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=bsL1HVl1m6AcYyh/4STTfTdb7EjKpNyrTD8MQ/unmOo4Mf3XsqpeY/RpGbQEc2iRzV 6SeguQ+2ksIUVHS5xSWuzu5+dIvHh8zd143SabHLSso/sEv2/1JB6FCbBoBXURjB4w+i 2VJ/WG0mHLxqvDz/obEAyWM2+BsWz0zxJ5yHmej84uB7uU9xXMTPa9dEaxiUrYSmNR6j 8CgVwIMHsXjhH+R5e70Pw7VuHnH1Nx4IyE3nkG1SjkefN63ut1dPYRe4tTphZYSp5elK SpphTp/9ZPqCnSBacvoWaKv4a30O+vcpebvhOGemBvpiUSyM1sA404wjx6yTG7/cIlgt qbTQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=y9dOPg+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 af79cd13be357-7b9ac4cc62csi310693685a.355.2024.12.19.20.20.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:20:23 -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=y9dOPg+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 1tOUM5-0008Ko-2J; Thu, 19 Dec 2024 23:11:13 -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 1tOUM2-0008Jj-Vu for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:11 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM0-0006Fr-3Y for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:10 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2166022c5caso12521185ad.2 for ; Thu, 19 Dec 2024 20:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667866; x=1735272666; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i8y2SP5gsVRd2DDyIzSjHzTbblUtHqyMo6MFtQTYJr0=; b=y9dOPg+Ji83v30rY70HGLg5/rEjIeA+YGg4GGS+6YhSRr3k1kkDrRiME7BSWw0q14n dy/xwiHrYyBL5Pbo3WFKoEJvJBfz5J4jE9yeE1InMnjmqgWRHvOF6q3f1OTcNqopRKA1 s8WQGUl1rdTMmi1ppwugeJrSCFbnQSUnkq/uXJjth/y+xuG9NmhFbaByLVkCvhS7jNf/ aVvBCN3HtDjcR0oSOOPJxaNWsc4KeydyqBH4CKS/k/8M3ufRBrCxPkJcdK42OcYwKTM1 Yi2ac11VQhX0qfOC4+acwIXBHajnTaEQe9YOuM/Ixnglj41eJZ+/VxyOqg+lxA0OM+DY +H8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667866; x=1735272666; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i8y2SP5gsVRd2DDyIzSjHzTbblUtHqyMo6MFtQTYJr0=; b=NGH3pxFVgePta61xL94uPuy3LTQwAz8yZt973m1semMsmqLA8XMN/1MeMq11uiKDHJ Iw3L6uI3HuypDtDhg1RC4xMHfbVgaACPk5c1a4uoGudJdJRlveSR9HGI+DYF4u2bGvu+ 4QXqDULYgLiwezj4z7ALpKVGzGde3CT4KqTD3YWRpQ+3FCjBwGyyfh69J7VKk6Z9rVv8 fUUflUuEwPPnAtZC9Im+3xgsBECTbs6buS0RW5XX6fYK8cIhIEcwTeOW3wcfuOEuutlV CNl3N9qVgEuXrP5FR9g8j6KVywjDosJMXCKvxesM1Xeen+tKHQ6JuFR19+WjcBEj9162 p38w== X-Gm-Message-State: AOJu0YzG9c9zXvX+Ip5hK7uxigcgdgf4AYUROIbGDEnLh0OY1NYNYnJu Sf8OAfg4WdSqWQoX6E8+GcAwHpJH+Tn3u7xBGrZOh66e85ubYY+qF2Q947BGd490yNh+GoOqKTn O X-Gm-Gg: ASbGncviRD/W2WblnlEJ4oWmy6Ib0Hix+pYsBZcAkHymjTYDW5m1EFMtNuJltbi19F9 eR/HQyH1tNrDjcLDcsEGlsxUEZKZGuZ13R6A8XEA3NxpQn2X3CIGTozFQFGCoZvrCmOjkIJQxdg b8LBvM8cBcX4/M5vx0fZ3BmZlsESedl4mKrCdtLpm0Kb2zhDY8A3L6zfXs0OTCG6ZwjsvMeuYKf R8qkSF5VWD5/WXE43XsSv+FtEqqZmFlIAczz8PQv2p41KZpRXLbBo6n+kQMH4k= X-Received: by 2002:a17:90a:d448:b0:2f4:43ce:dcea with SMTP id 98e67ed59e1d1-2f452ee5e95mr2088579a91.25.1734667866161; Thu, 19 Dec 2024 20:11:06 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 01/51] tcg/optimize: Split out finish_bb, finish_ebb Date: Thu, 19 Dec 2024 20:10:13 -0800 Message-ID: <20241220041104.53105-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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. Reviewed-by: Pierrick Bouvier 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..453e8c43bd 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) +{ + finish_bb(ctx); + /* We only optimize across extended basic blocks. */ + memset(&ctx->temps_used, 0, sizeof(ctx->temps_used)); + remove_mem_copy_all(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 Fri Dec 20 04:10:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 852378 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853079wrq; Thu, 19 Dec 2024 20:17:07 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUF+Ru4ASQhmqE/+D87pLWLgiO6tk0R5Xak0a2H7iu8Un7QAYz+lS84CxjTbz/C84tqVoqdig==@linaro.org X-Google-Smtp-Source: AGHT+IGXZ30dR1c7dOMoz6PtQyFSvjs8vMBbPSPhD4wiG3f/MMigwMnDRzGEkHOvnMXc3IQ0IQu0 X-Received: by 2002:a05:620a:244f:b0:7b1:55b6:409a with SMTP id af79cd13be357-7b9aaad54fdmr893574085a.30.1734668226965; Thu, 19 Dec 2024 20:17:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668226; cv=none; d=google.com; s=arc-20240605; b=k5Z0UY8qNYB5O6SEoqeTxPvUGIE9rRW1zj02ymcoztvMiH/pe+sNF5YX/i5kFnY3p/ iXjeLsb7dQH5gt3/qedcD1w5mGAA9NW2KZDbCw7VE6qyOrKIqyykhWsNP0/UkaQh+jnF /lLaFZsfBMNfbC3WmnShC27z+4yrF9uYSvEUHA7+z27DtLatiwzOPkmsDnate3jLWx6E MxrAGWB0qUWvBWLl/WmBZ7rHz2zGlgRiAJG0Y0pUW+CYM3Bm1bn5cKnk5MpYxpzcV9Yk x4j0Dlv8w1AtxOQKlemQuD/fq11hvKFff70T29FWjbDVbllLtSvsWQsV2Ag2LkaSmmI9 Dk1A== 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=Y9RnxHpN0x96A+UA+qFx0eOiDNd9nU3BGhNBeQSd/Rg=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=IydsJTuN3Bw/pnhK/qgjD3Zd/BqHWJC64MkU7Z/2P5Kcc8UU5aQqeMw4y1mT6Z0Ssh Kp/g5rt3oOLcfnooDKTZVGPuh+2lIWZWoj38BPVR6ZVJjr7fVudwAJy23VpHtEgUMsu2 dL9OaR0BFVqLS8dMozi8caxVMgXv/f0yvdZeQcTPlLHEzz7HsZDPMO9dI6ZLTpRrrjjA BtRXC11N8lNvImcmvneaRABv43laGugZALZx+nW9zoD3b382G0jp9Y0Zo9v8tFDI/X3Y JeIQqPG2yQJ5wIYmRiXeR/EJBftwjSVtrF5XMeQaQCVqvy9L3DwkKzMv2Pwo6T86WIxV /3pg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=D3SizqZj; 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-46a3e6813bdsi28743801cf.53.2024.12.19.20.17.06 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:17: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=D3SizqZj; 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 1tOUM4-0008Kk-Sq; Thu, 19 Dec 2024 23:11: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 1tOUM2-0008Jg-UK for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:11 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM0-0006Fx-9a for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:10 -0500 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-820b825cbfcso2157999a12.1 for ; Thu, 19 Dec 2024 20:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667867; x=1735272667; 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=Y9RnxHpN0x96A+UA+qFx0eOiDNd9nU3BGhNBeQSd/Rg=; b=D3SizqZj5QjBT23cabkwuoVRwwYUlfoii6kzMCoxp5kJTUg5wGinVdRNk6VK14AwJt qYxy/FVYy/90BZs/eIPa6esIri1Fn8JuzLaeriyo1OqKOQpmt+w2wbwttfBKGBKFYZlU 3NlNGjLmRIKnIaPP0TlPkrS5LbD+OLhpkEUxJJSrzLGbdgx3OmGgIZ7nHT4xm7vE9ewc PZ6yMH3SD5OWkwGCWHC7KmD+7eJDWSmJ9eazmhqqgDJHxQbr7cobfSXyotOw0Hi0SzLe ChnHEKhHWH2UY2l6NDSz6NdW2S6Q3KiyTagMYj38k850w1yUxECjiI1DZl6Pmlro396K SFYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667867; x=1735272667; 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=Y9RnxHpN0x96A+UA+qFx0eOiDNd9nU3BGhNBeQSd/Rg=; b=ktSwLajhOiexh6uaIruhGsis/+Eyx5NGjPWXPF56q/vUmU64in8BLSzTHMzX5YPOdC Pzh1A/bY34Ep66pfM+D7HeeEZev3AsrBWFfDgxSQkEHKTMCdByX97b3jRMadpTpwxgNE h2g/BA87sgp9JkYGQ8vxW+p3ISBkUk5ef5DaBxF7tjs38Mb9GV0S6J3M+L72+fVZXKJ0 IqyNs8gC7hhcdjovpWoVVnkhGGQw7h9kC9O/k+sb0lefS0m7KeC3k+IwlmfbwflmUXI7 uwi4siDcLWKW9UfBqTOBFZAG6E4vbJGNZ+RfGEsPfGLUG6osjN4B7TzSUMm+RoNY7Cjn vvbg== X-Gm-Message-State: AOJu0Yyv4RJwX8ZVNxTWY5smaACE3j74ZtvdyNZulEqXL2WOJ28K06o4 PPIv9yg18BVFEHudGK/1Q2oM4Tw1T5Y5B4mKFF7VloMX1lF1aaH3dxEYL2NpNWgn2axfZxtc4K8 o X-Gm-Gg: ASbGncuz5iLgT1Wfli7IUhUw5FugoBCeZ/kkilov0PpKzKXedpljRr0njZOCbZ15+ce 3rrwtO+cnmoQU1VPuNZlhzCsF5wZEKKyMUNR4Odry7/BNk2SjpTjSM9N7gLkk9d7Nl4Pme74UGO R8jtHfY5l8MQj+BjVa0WYWew75YCgPlwwmskjttdtIhKsvbdZHzLq57nUoIJHY0udyGtKk0vUlj OBi+r5ovzpJjPtSQsqPDawcapMpS8QohzWiesYITHl9mjjy/cMWK18zxD4mWWI= X-Received: by 2002:a17:90b:3a43:b0:2ee:94a0:255c with SMTP id 98e67ed59e1d1-2f4536d25fcmr2140111a91.13.1734667866749; Thu, 19 Dec 2024 20:11:06 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 02/51] tcg/optimize: Split out fold_affected_mask Date: Thu, 19 Dec 2024 20:10:14 -0800 Message-ID: <20241220041104.53105-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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 There are only a few logical operations which can compute an "affected" mask. Split out handling of this optimization to a separate function, only to be called when applicable. Remove the a_mask field from OptContext, as the mask is no longer stored anywhere. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 453e8c43bd..6757fe0036 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -64,7 +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; @@ -1047,7 +1046,6 @@ static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) 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; @@ -1059,7 +1057,6 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) * type changing opcodes. */ if (ctx->type == TCG_TYPE_I32) { - a_mask = (int32_t)a_mask; z_mask = (int32_t)z_mask; s_mask |= MAKE_64BIT_MASK(32, 32); ctx->z_mask = z_mask; @@ -1069,6 +1066,19 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) if (z_mask == 0) { return tcg_opt_gen_movi(ctx, op, op->args[0], 0); } + return false; +} + +/* + * An "affected" mask bit is 0 if and only if the result is identical + * to the first input. Thus if the entire mask is 0, the operation + * is equivalent to a copy. + */ +static bool fold_affected_mask(OptContext *ctx, TCGOp *op, uint64_t a_mask) +{ + if (ctx->type == TCG_TYPE_I32) { + a_mask = (uint32_t)a_mask; + } if (a_mask == 0) { return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); } @@ -1305,8 +1315,9 @@ static bool fold_and(OptContext *ctx, TCGOp *op) * 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; + if (arg_is_const(op->args[2]) && + fold_affected_mask(ctx, op, z1 & ~z2)) { + return true; } return fold_masks(ctx, op); @@ -1331,7 +1342,9 @@ 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; + if (fold_affected_mask(ctx, op, z1 & ~z2)) { + return true; + } z1 &= z2; } ctx->z_mask = z1; @@ -1709,8 +1722,8 @@ 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; + if (pos == 0 && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { + return true; } ctx->z_mask = z_mask; ctx->s_mask = smask_from_zmask(z_mask); @@ -1777,8 +1790,8 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) ctx->z_mask = z_mask; ctx->s_mask = s_mask; - if (!type_change) { - ctx->a_mask = s_mask & ~s_mask_old; + if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { + return true; } return fold_masks(ctx, op); @@ -1819,8 +1832,8 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) ctx->z_mask = z_mask; ctx->s_mask = smask_from_zmask(z_mask); - if (!type_change) { - ctx->a_mask = z_mask_old ^ z_mask; + if (!type_change && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { + return true; } return fold_masks(ctx, op); } @@ -2482,8 +2495,8 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) s_mask |= MAKE_64BIT_MASK(len, 64 - len); ctx->s_mask = s_mask; - if (pos == 0) { - ctx->a_mask = s_mask & ~s_mask_old; + if (pos == 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { + return true; } return fold_masks(ctx, op); @@ -2843,7 +2856,6 @@ void tcg_optimize(TCGContext *s) } /* Assume all bits affected, no bits known zero, no sign reps. */ - ctx.a_mask = -1; ctx.z_mask = -1; ctx.s_mask = 0; From patchwork Fri Dec 20 04:10:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 852361 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852248wrq; Thu, 19 Dec 2024 20:14:23 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWli+bFgUHgT+DeMx3uhAHJiihmeDEZ0wuCHJXJaKmvg3XokJvM6bcDwFi0CL3ZKK6zTNh5KQ==@linaro.org X-Google-Smtp-Source: AGHT+IENRpBC6jgg78aRzW7egJyGJCN9Ii6qjSkgAOIzrsO+9/WXRLqa4KcA4q4Hh7hlK9ymvAJg X-Received: by 2002:a05:622a:55:b0:467:5444:caac with SMTP id d75a77b69052e-46a4a9bf43dmr26301971cf.55.1734668062870; Thu, 19 Dec 2024 20:14:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668062; cv=none; d=google.com; s=arc-20240605; b=lboEI3v983xUhF0nPIqtO7/Uj17d8gSLtbVoShk4PbZ5TTl7/mYKl3Y2X08IOA/00c z6JMHYpmYs3F6DDGGNes9G53fITjVw4k9s1+JbcEP9WzM7Di6UwkDorLf2Fnxh34TD1f qAfvJ4TM+Ly+tgxtZwTsEi7NjheMtWZgBiu+MBIhmcHgGijSV2e3ThjGAn3m5FbkRTpM fwPxMSbgUMkuFrq+HuOnCKcF3UkC8qO734w3XYhGtzTiCo054z30kWY8hOJ/wV4mN1ad 6k1ZkKLjMFRhJthi9aziflq8pUwA3Kgcgi97+XhyNQIEGWJc2CpC6H9HIZ0hd+h1g/wq ClRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kwAmrbK+z6InFUYOYJQouqu9jlEe2zkE3MrW95sabRA=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=DWVjfyUiVkOsToEl8kYbjgu0kntsLN6pEB0T/aci/w+Gvu7q1w774Q0fWHr1PBLC5Q TEI8sL/EgaUfBHpQkxYlLWMQ6Ot8/mxxKSF9AzYl6B4QtjQ66Zo5UhqtDvwNNfag13HS c4woaMu/ptUSoAhdekgDl1unH5SlSXlHiekdnrM9S8V9Ec5DQ4oBysFPigYN4VDYndSv ad1MOYlPPxkXAvWFNVnQELQPz8HA7avubCAaonrMmkwZ+a2HYfqSPynpCpvxy1OQIrzM 9WTBAqC5aBfBj86bQ2c5C2bJbT3WpQBFWDTleDAetfMhDxi1BFivsY9WmWROZdqxw6m+ 98Bw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kJFQp3XD; 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-46a3e680eb8si34082181cf.141.2024.12.19.20.14.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:14:22 -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=kJFQp3XD; 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 1tOUM4-0008KJ-DT; Thu, 19 Dec 2024 23:11: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 1tOUM2-0008Jf-UN for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:11 -0500 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM0-0006G5-OJ for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:10 -0500 Received: by mail-pj1-x1031.google.com with SMTP id 98e67ed59e1d1-2f43d17b0e3so1413195a91.0 for ; Thu, 19 Dec 2024 20:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667867; x=1735272667; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kwAmrbK+z6InFUYOYJQouqu9jlEe2zkE3MrW95sabRA=; b=kJFQp3XDcUGaPuOK4fvrDeNPGWVUsOhxI6bHVAYiSaroStM1WCEOK41N+MFyWJoa2Y 6Oi8d2O6hr+dt5SDwXH9pP3IAs9X7MxApYEFbPy2beYC/XcWbBJgVv3vFoPHzGO/i5z/ HHqSoQxA77+DIQIOT9b4NN+O+lzwZu1xCXQdISD7AMJT18dA41ZHZnjG8BJ0Nj+PDmWW Iw5cWk2KVX97aHXugwxjODWWu1DVIg3vjeEHx/jL8l4pRW2a2uFuGnDzjU7OBaosiWIM Fwh+TuZ624PlWYR6KkrC3epaiCV/n77WOLAGlJqIqFC/aYad6yjobKQzeNxQcsI6R9CQ 0Yuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667867; x=1735272667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kwAmrbK+z6InFUYOYJQouqu9jlEe2zkE3MrW95sabRA=; b=L+mEMhQpb7ceqUusMre14WV1UebCi6Qb9o/UePeqsBcsxHBxOIRpbsxyNri5TUcu9C //gjlwfdsHXL9/U2hhWKIfLxIGn7YOehXmWm6fC3etYJBxe8mX2EdBswOCaJ1a3pGK1s jsYQfRIITjrEdyjTkQmYk4ucrHnctBYGvZdAHmROGDx9/8IEIN25HfYQQrPyZViNB3By 31uL7IFw+oRtUZyV/dd+lo6KvkJ5DqDXxqFSNxAumHC9kLEWs51dXLmr6oxUq+qjaCsc X8vHoOww6Qf2EQ/UYt/WstMT7havPzzovgS0FPNMsAg/5kk9HctcirLzW5bI1mBAor5N N+wA== X-Gm-Message-State: AOJu0Yyk20jHNis5LOut7mlfgkdC6c3g0H3y0xEAOPXIEXtuEuwlnprQ Q12fTDJByuuH8wOEfsfaPoeCRJd9bwenN9mXjftwVrq/PBlVz9DuUmLjQuS010LovDuRAiVYbB+ b X-Gm-Gg: ASbGnctuv+nL35KCr3buSvUigeDWeQfUvYwl0M8INuBV2okhuAz1Vy0jrw1lpFdD8rP WeilGphkB1c1vdycOSsQkkdQmO3grPJs5dlcO2n1ORHHwU2Wg69hGXW1673HLlSJxxd+V5GV4IL lBezSUEYVIBqujIpOQqua/g5JcS3OQEJ3ttrgV+fh/YcjQWR0vM9/rESS4cj6QZkdaFUJhtQ8wF j3Uq6LBM3gZ+Du6W/e/aV0jO+vJi9SDSnY55JZYmKFe+2xrxqLrvU4d+gi9zoA= X-Received: by 2002:a17:90b:50c3:b0:2f2:a664:df20 with SMTP id 98e67ed59e1d1-2f452def241mr2418160a91.7.1734667867386; Thu, 19 Dec 2024 20:11:07 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 03/51] tcg/optimize: Copy mask writeback to fold_masks Date: Thu, 19 Dec 2024 20:10:15 -0800 Message-ID: <20241220041104.53105-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1031; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1031.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. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 6757fe0036..2aa57afd64 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1048,6 +1048,12 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) { uint64_t z_mask = ctx->z_mask; uint64_t s_mask = ctx->s_mask; + const TCGOpDef *def = &tcg_op_defs[op->opc]; + TCGTemp *ts; + TempOptInfo *ti; + + /* 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 @@ -1059,14 +1065,19 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) if (ctx->type == TCG_TYPE_I32) { 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) { return tcg_opt_gen_movi(ctx, op, op->args[0], 0); } - return false; + + ts = arg_temp(op->args[0]); + reset_ts(ctx, ts); + + ti = ts_info(ts); + ti->z_mask = z_mask; + ti->s_mask = s_mask; + return true; } /* From patchwork Fri Dec 20 04:10: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: 852383 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853432wrq; Thu, 19 Dec 2024 20:18:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVl1P4Lko65HUMPwzzbc0btUpGjhpQZfza9A21UMlWqYOeQXtyhXUDeZ+1auwfEppfhg8ARow==@linaro.org X-Google-Smtp-Source: AGHT+IF/Br4mwb4BujMduEq4qvoHMUvM2DEpdd1A42iO2wePD/bINnET7Bw7lHFstKvNA9fKLJvq X-Received: by 2002:a05:6214:3a8c:b0:6d3:65ad:5cf9 with SMTP id 6a1803df08f44-6dd233329e0mr25893246d6.15.1734668311233; Thu, 19 Dec 2024 20:18:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668311; cv=none; d=google.com; s=arc-20240605; b=dqJRUnoCEiSRfrH6F8IPGY93p1qYqQTwUKCi+S11laoVECYwuPBEZe7xIe82yrXZ+c SJRsNtAm2a0Ur76phfFCl6wPR5zTfqqW0HZBTvI3q3bxklZA+wplNkUD3zCbRKuwo94c tMEZI9/UuzyI/nX45r6h5spBmVNy2YvQXBp0quVpIBQg4TMDyDYQ9WF/U0RlFcbTexoZ 74TkWc0IRNjjYsDsPKZ7WUGkExZfiMqmve/r7Xk6OT5VzLOlqTCqideBBkXlheTACvsz aDsbe81ESUugwqDEA+4iDbZ02w7QPlnO4Ax8DJlPNooWcXf7aZBjmh7LEEFL7Rrew/pY LyTQ== 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=Y0pidgR3zAliJqOpHhhNlBry8ChrLsZBHd/pCpZ2Pbk=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=RdhQ8GBa7W57ez2Ak2L0tDiiYoWYa6SXBDR9B357FISjcmAqB2zbkhDVlh4XyTxXoh chHE7QJlu9OkyeTjCcnaV4xZ96SEcFtPz+oMYrefBMTl/uPMpm3wrpxg+ysgGNPMd9U5 bysXVNU5XQFZ8NSkHu/4dCH1xYgo4sOxLxIaO5wewJdK+YPP33q0AaHwu6Lyta+VhcWD tr5uAJDu7QLcKBF6Eu1krovbVysPiy98P1qw9vaiFssKr9iRio0vc7K4csoaIZrdCzty uN4TscAux8fy15o8YKc/z5S6nC09Xxz0EbeJBk3UcvJUZj7OgzP+kvgTBgGAotJ96G53 i3ZQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YgUHrzMz; 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-46a3eb9881bsi33303021cf.338.2024.12.19.20.18.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:18: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=YgUHrzMz; 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 1tOUM5-0008LL-HY; Thu, 19 Dec 2024 23:11:13 -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 1tOUM2-0008Jh-Ua for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:11 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM1-0006GB-8y for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:10 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2ef748105deso1061362a91.1 for ; Thu, 19 Dec 2024 20:11:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667868; x=1735272668; 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=Y0pidgR3zAliJqOpHhhNlBry8ChrLsZBHd/pCpZ2Pbk=; b=YgUHrzMzInai9xuc6TdAvvukC/5HyxgPOXxBEc6S252TQe1nqjZOo8RhCbUz0doJZu iIPAvPCL/jB87RAUMhAux1Kj2nfPPetOUot8Ysaqxk1cTdEgXwzBWUWQaPdGLrsBxQUK uHhCEulMlh8m3Lnq9qnfxoz2Jf/mYMPRR5rtw5JgIlxmvt7FyNc7iIhhFx9IzmUTUG7G b0E1T0y7Kd0+W4V5iMJWHqWDHQyHKYw4QkMcHR+u3O/fXUYI/5Fm3rFU8FqmK62X0pPa /VIOL1eugfebX4wQhwViG6s7+65tuiT6fTyPb9AZ10atP9mtEVDaWYaoD/cxGt6Vr2XN JapQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667868; x=1735272668; 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=Y0pidgR3zAliJqOpHhhNlBry8ChrLsZBHd/pCpZ2Pbk=; b=oG3xBoaso61mGxCf/d1akj4xqbeyfrNzWYvAUIbEYAKgPgQkqsOwPG4hnpG7+0cVkr ImdSVhJoVunWtQiPX9HGT7Pjrd6vqwM4bo87iFXfs21fUDd4kyf95UoOkgKbzBUQah9C TR3wAa9VLgV9ORrjxUAE0SA7Qfhv6ztesiJYdkGVWVUp0QcqpBlNJggWRi0uXWOby60q I61pAnZgh3tDm0+1scDjRplLFTpEtOZ5S7pZukd1dYzv2GMbW0sZNIPxspMFN+T9KT82 /g+pQjmhH4uu/el0OnekMJMNcA146oYuT1Z/AbzKZO02UKHJT9FSk5XjNep6rAbN/gnb AIfQ== X-Gm-Message-State: AOJu0YxONXK+1Z23PEcoImbfWDlNCAxCIaYcTY1YVvyujQhmvObo+A7k nbRHKhVJQlDp/Eo4WVE/5Ro0AcoV84/qtu2xpy2aHKo3AqmoxlbTSOnEeadgGJsvqsime+PoVjg X X-Gm-Gg: ASbGncsDnYC6xRSovlgtjm4lm0PNPfUeeNbwjFK3HDlQIprgwhlkZkLVVQxHUak/a82 coBfU3ZUlW3i/Cwmern6lTLX4tmJBEYRDjMDP6kMCb8+7dZH/ekbvYBJW9Sl9dYBOK6dRNYCYi8 P8XyGMfAxKszqsQ2zQ2gvw3JU3gOp5LtRThx28VA/Ad9opBQrpEY+mdbCCdnW7Mq3uPa3X+SpwU QaKmSexgT3Q0br0sk0UpDDS97+9bFCuIYP/ymUaZ2+hw6Sdgfk8Kvnd6rp2ca4= X-Received: by 2002:a17:90b:53c7:b0:2ee:b2e6:4275 with SMTP id 98e67ed59e1d1-2f452ee7147mr2000231a91.26.1734667868016; Thu, 19 Dec 2024 20:11:08 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/51] tcg/optimize: Split out fold_masks_zs Date: Thu, 19 Dec 2024 20:10:16 -0800 Message-ID: <20241220041104.53105-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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 a routine to which masks can be passed directly, rather than storing them into OptContext. To be used in upcoming patches. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 2aa57afd64..d70127b88d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1044,10 +1044,14 @@ static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) return fold_const2(ctx, op); } -static bool fold_masks(OptContext *ctx, TCGOp *op) +/* + * Record "zero" and "sign" masks for the single output of @op. + * See TempOptInfo definition of z_mask and s_mask. + * If z_mask allows, fold the output to constant zero. + */ +static bool fold_masks_zs(OptContext *ctx, TCGOp *op, + uint64_t z_mask, uint64_t s_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; TempOptInfo *ti; @@ -1080,6 +1084,11 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) return true; } +static bool fold_masks(OptContext *ctx, TCGOp *op) +{ + return fold_masks_zs(ctx, op, ctx->z_mask, ctx->s_mask); +} + /* * An "affected" mask bit is 0 if and only if the result is identical * to the first input. Thus if the entire mask is 0, the operation From patchwork Fri Dec 20 04:10: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: 852376 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852998wrq; Thu, 19 Dec 2024 20:16:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXA0vfoJZ8WLZAm6jDSD4mUSUJp7Qzlhauxin68m00a+9UewrXGsGEUMyNg6vUy9FPT0t6pCQ==@linaro.org X-Google-Smtp-Source: AGHT+IFbrcsmaBcuHuTESVh8Kgvumig/U60mEIXNOHfYE18CY/Xsji9JovMLUCruduW2gVTmyqtS X-Received: by 2002:a05:620a:4406:b0:7b6:668a:5a7 with SMTP id af79cd13be357-7b9ba83aa1fmr261444385a.62.1734668206174; Thu, 19 Dec 2024 20:16:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668206; cv=none; d=google.com; s=arc-20240605; b=UatejYKWXu0/nI4sIfaQBVWc+HAKW6dN5qwsLJqzdRw7Urfng+UC7KX/WuVrDWR4rw NcuuLlXsZFIClz1850utzVR3ss7JueRufdphu2kHaEj1ONqCv67m9NWwbFaDfiP1KDh5 Pf1G8Z9Q07rPRK8JaIHBgzVWON2libi8KGYRLwb6nH1R580CDdyOE005QWktFHHzA2L5 7WBiN/kfcNZ3QRT7IWjySPAMBn2v5y8DnQi0z0dC6IxuSro/3PDqsmG5kebzvj4mc8iC e94exaxY3w19paeb7enN6t4Ll6VXheilICKQeDcJuhjTbOyoK1C3HQlMq1P+XjAeRIGC CM8g== 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=+TJ5IfnYTy94xBh6uHrxnvEXKZnmCMvGdvkeZvXUxGM=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=MMEs1FLRbJkq9wmNVSeQJHNlTN+TuvDqttgGY4K7Sui46r/eGngV4aTXrrPTYdyisP 2E2/R0xOOhUiPwgiiHLkN+UM4oZ8F/aFRYb2q9d55kCMB9ze38LSQfbXF/LNrCQpvThu BnY1wpxDKGEPbkXbA0N7PxXBWEmD/EEhMnTlWO9YupwYfYz3w1gJFv6qKRb2Og9tG0Kl uqpGwr59Za17p2Mbr4smjEED3jpm5WJtMZGAG1g1ytmRwSDJ5x5R47zw6DWYO4UmMhPN dMJbdehsrSNJgVtq11SVr3CNiIBeYKmZuLp0tDzv4lMg/5mr2VmFEfhKq0QVFuOHxhXg pv5g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L3EaXDcG; 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-7b9ac2cc36dsi323216285a.149.2024.12.19.20.16.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16:46 -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=L3EaXDcG; 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 1tOUM7-0008Mh-SU; Thu, 19 Dec 2024 23:11: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 1tOUM4-0008KL-64 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:12 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM2-0006GQ-7c for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:11 -0500 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2ee786b3277so984832a91.1 for ; Thu, 19 Dec 2024 20:11:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667869; x=1735272669; 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=+TJ5IfnYTy94xBh6uHrxnvEXKZnmCMvGdvkeZvXUxGM=; b=L3EaXDcGu71FElBWglDSqRiBfD6ek4SopLanQzCV7mOSdiKOd94fw6NhYzVxF2+Eis +TsrQ9Qa4OHEjn11q4pKDrPNscqtb8rRqnyuilP7sjMjZlD5yU6bhScUihAYHUctVrh6 Tc34RAMoS3UGyVGRfLySU5MqXLXA/SwBzkrUXS7ZdHzHFMaDG3zrxskiwhp794LMROEp 9I2/Uq4n5Bm7f+XE1odEQLe1RjIlkQBW4XV9To4KGqHAdCIY2PERBna44V68JLdoJI+P ONteupoPkLY7CWB06xaWxa/9OzLxcwAS1eDS+HQI0/8CfX8gpxLjal/33VJk/dGc1zKM i4pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667869; x=1735272669; 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=+TJ5IfnYTy94xBh6uHrxnvEXKZnmCMvGdvkeZvXUxGM=; b=KOgLotv4mzFgNSzqr9qEAu9Ym3UscTRX+Rk/vFU+XJED/zQDmMDyLY9pztV9ZzcJpS 9N1RAY/Z11H/OycHyJo1He03SqRHWy7QGUBrLgJxUdiKQDeQmL+4nk1qgv7xlBzcdYFw Cg2tLAMcAHqtOAny4cTZmVrStT4u1poEoNy/JZHkpeLHVREkMlouWsm/62DnLYtb/8DV 8y0OnLfZ1/IlcwY1b6g9/kyHYHsbVF1AhjJcxLhfK0sQdaqbH+TiFuCwXFOplYxMT9Ux XiVDgV0vxesCrsOFDZtLu1Kz8lXtbOnHLctRXWemTnLrGwjFlI4Ykbb5g+qRMhN3iZHL QgBg== X-Gm-Message-State: AOJu0Yz8dfxqaN6PYuOi7iDTiMIo8UlIOvfFEgCEx7AQ/iN5JI0eugYB OSkW8HgFlm6yc8+GdXaLJxNkLEtXWrcHpdgAcufJl6Z5W44yQ33RY5HBf8XdNgfWQuBfoohjC7q C X-Gm-Gg: ASbGnctNy63y1eRzrW12IgLidpxrUMMkt0dO3f2Ntw2bynpHDz3zCDAqVKoEbsEXz6G 5PnQK/8+QAT7+hA2/FMboyBuVxyyDeEBjN8ZdFO9QBxQ9ar4S+OY0wrAcW6pVx2pxWvq0P3sfII DhUlZAlOMLxiVmz6W7kfYg22AlzXLEWZr1WMfA2pm9kfCuZavDXPziaFJEEXmnydxor8JataiYP 71u4lzxVLr1STC0m+59ypv7GDLazUsIZi1ZOgFkCrxiau4BhpBATdZigo2/Bc8= X-Received: by 2002:a17:90b:5184:b0:2ee:d824:b594 with SMTP id 98e67ed59e1d1-2f452eeb56cmr1929180a91.31.1734667868786; Thu, 19 Dec 2024 20:11:08 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 05/51] tcg/optimize: Augment s_mask from z_mask in fold_masks_zs Date: Thu, 19 Dec 2024 20:10:17 -0800 Message-ID: <20241220041104.53105-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.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 Consider the passed s_mask to be a minimum deduced from either existing s_mask or from a sign-extension operation. We may be able to deduce more from the set of known zeros. Remove identical logic from several opcode folders. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index d70127b88d..17b72fe759 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1048,6 +1048,7 @@ static bool fold_const2_commutative(OptContext *ctx, TCGOp *op) * Record "zero" and "sign" masks for the single output of @op. * See TempOptInfo definition of z_mask and s_mask. * If z_mask allows, fold the output to constant zero. + * The passed s_mask may be augmented by z_mask. */ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, uint64_t z_mask, uint64_t s_mask) @@ -1080,7 +1081,7 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, ti = ts_info(ts); ti->z_mask = z_mask; - ti->s_mask = s_mask; + ti->s_mask = s_mask | smask_from_zmask(z_mask); return true; } @@ -1519,8 +1520,8 @@ static bool fold_bswap(OptContext *ctx, TCGOp *op) default: g_assert_not_reached(); } - s_mask = smask_from_zmask(z_mask); + s_mask = 0; switch (op->args[2] & (TCG_BSWAP_OZ | TCG_BSWAP_OS)) { case TCG_BSWAP_OZ: break; @@ -1534,7 +1535,6 @@ static bool fold_bswap(OptContext *ctx, TCGOp *op) default: /* The high bits are undefined: force all bits above the sign to 1. */ z_mask |= sign << 1; - s_mask = 0; break; } ctx->z_mask = z_mask; @@ -1605,7 +1605,6 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *op) 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; } @@ -1625,7 +1624,6 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) default: g_assert_not_reached(); } - ctx->s_mask = smask_from_zmask(ctx->z_mask); return false; } @@ -1746,7 +1744,6 @@ static bool fold_extract(OptContext *ctx, TCGOp *op) return true; } ctx->z_mask = z_mask; - ctx->s_mask = smask_from_zmask(z_mask); return fold_masks(ctx, op); } @@ -1851,7 +1848,6 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) } ctx->z_mask = z_mask; - ctx->s_mask = smask_from_zmask(z_mask); if (!type_change && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { return true; } @@ -2354,7 +2350,6 @@ 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; } @@ -2455,7 +2450,6 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) } ctx->z_mask = 1; - ctx->s_mask = smask_from_zmask(1); return false; do_setcond_const: From patchwork Fri Dec 20 04:10: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: 852373 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852924wrq; Thu, 19 Dec 2024 20:16:34 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUg3wNB2G6fERAqacjsqEF/uw2ZvBvOQ3Vj6/gYKh1B0OOreBEgUdQ6n2sOUSyNLPghNY8w1A==@linaro.org X-Google-Smtp-Source: AGHT+IF788TY1xZkM3c+aKDAIQm/X3l8nSZgrgKjn7QmjXjuUn3FboMa5IQNcqc9t7JeZlNHiSj7 X-Received: by 2002:a05:622a:12:b0:463:648d:32 with SMTP id d75a77b69052e-46a4a699183mr22752491cf.0.1734668193831; Thu, 19 Dec 2024 20:16:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668193; cv=none; d=google.com; s=arc-20240605; b=cr2WQlWdfMT6NvJ0GKEEoaaBGxZuzZQyvko3NdgfO3H2sAuHIOyxdyPYTEzDMod3VL ae9hSJYGZz+FgZVRwX04NrOelvwdOaIKY25h8hEWdboXHCHzWQRKVgJON8Z45RJZy1AS 3QRqGVZYhxyLNiFlk167vpbHG0TgCg903K+jMFouolepxB0Fs//JFIZnG7GUSVkmQ9Jr Zwouq8B/QsZEquH65ji0DUERIueC0MfkY1LR9TCmsixXk0HNKrE0BSPkvkfRzhzRupkj KO6ooAglU3GkSD5RTcuirfmFYZUzLYO8oeizLlymPXfLCB8/AeAk13WJtc9aavggX75w PuNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=IKiuA+O0PzoDklDp6nENMYQ6rVNeilXqGGPdsOwMo3c=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Ec6yCZV8+Fa69A1x9Zc5CDP583LhoS7yasWQ4AFa1FVDzn8LsNbqbPKvdQPhZSmknX u6u/3b2Mvy7t7qjo08xQFIh70J7ktDJKol/fn8BL8X4RdFB84/6gZy+qtHkHOYRVti64 jf3/fjWXsr+aB9JmV2DtpmaDBJGMrnomWPr74/dA0ncpc3F/Q7uXOcSxtZ3+j5N9SAQt qABeTxotNrHaMN9cGGelOXzCFKY1U/iuq7EqFbBYfsfS+PyRWYvHFGUJXO3lAIEDRXP3 zEKb/v93XgyFpt1HIR0JHR8B2Gzh1xcH+mVsHvjOmcO/YvudyXEATTMxQkDClulntyYR LADg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BrR1h7Fk; 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-46a3ebc0a65si33438871cf.438.2024.12.19.20.16.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16: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=BrR1h7Fk; 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 1tOUM8-0008Mx-Gr; Thu, 19 Dec 2024 23:11: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 1tOUM4-0008KT-E7 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:12 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM2-0006Gh-Vi for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:12 -0500 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7feb6871730so964035a12.2 for ; Thu, 19 Dec 2024 20:11:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667869; x=1735272669; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IKiuA+O0PzoDklDp6nENMYQ6rVNeilXqGGPdsOwMo3c=; b=BrR1h7FksGwxQEEX9bWYnW9LXtB1VsbzPa21OoIKCw2h5XAGjZvYnnWA70DO+QkhnA wQueOII8tPQfCnY+1GkhA51qL0euJrpkWQxGuPstw3B7ventN3T4wY3sOG1Sn10CneWi 4X270mUzGdkeuFz/NqEIYoKjFipi4EF0BXI5QtQaxXD1QjryvpDNT+B6HjU+yIaPosw5 YeWZijhjnJD+WI2C3SJZXW5xg3FKDjXl4XYlVQ5iHR0rAT++rO2+ADfyx3+cKuY5rTfQ wSeTgPBdItZbqeoluUehL9bPQ0MMZBWVQ0QH5wj1cDGAkhirA9ak71/PH0veAq2VkNwD k7/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667869; x=1735272669; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IKiuA+O0PzoDklDp6nENMYQ6rVNeilXqGGPdsOwMo3c=; b=jFTuAh9pkKXzbsE0XNqY6YWvVfWoR3dsAkqaK82nEuaTsiVQMPTzO7KFgO9JGmi7XC e1t/NV+zncoasiPSZ7JRKjZpUw6uM0laZeCpBiVSDxx5KvK3Bsdq0NBPagJhqS6aBKZJ IZnikIWazSuFnhO36TGOm0yFUeNi81gY85UqrCwT3dw2bcCmS/GwEf+mDAgdNMHv5DQq jnrZi/BQDAzoUGVVik2xWkuO5lbv6OQ+LiNJ9b2xWai2DlY8snmv1C5mnI+TnnT2RNsv cQUBuBiAxz7aLzfn42U/UB/vgqPAuBse9eW80L7H3JofHb3yu8StvSdrF4bV2JrCluNz Sing== X-Gm-Message-State: AOJu0YwTdZ6k1g0SxW/Z/s1nPFrhW+o+Ayc2AddJVohYCKfp+aPuCq5E u60OLGxIR2ZfaFTzRdO8GIdOW5+pmLzi0zerD/FqzJURYHebmyae4UljDKNEdqWpb8FJA5LXZBm g X-Gm-Gg: ASbGnctuooXTWTcf58oBTvT0ZO6u2XKZoC84xk0PzQnKiFgYkhdpQPZJ8ZcwekFb9CM HKYOWEEaAZE/rJwPCE8hIq3UIwYVU3K4F5evUzlBBfrq/KOBz+ygD+87kDuJghph6M4ovNAlHJk y+B+uhUWLGYVUvTM3Vv6vmLJE38HJfo/BxOfCzPkvC/A1lysebTNIlOOhPWJXox7KX9BqhtltRT GacpuhY5uFNYP8/a3b1tLE5C02+fHoIE8MQC0BUagyOs32wcgcAotVOqO8rZgo= X-Received: by 2002:a17:90b:2dc8:b0:2ee:c797:e276 with SMTP id 98e67ed59e1d1-2f452d3000cmr2701038a91.0.1734667869508; Thu, 19 Dec 2024 20:11:09 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 06/51] tcg/optimize: Use finish_folding in fold_add, fold_add_vec, fold_addsub2 Date: Thu, 19 Dec 2024 20:10:18 -0800 Message-ID: <20241220041104.53105-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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 Reviewed-by: Pierrick Bouvier 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 17b72fe759..41fd69365b 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -977,7 +977,7 @@ static void finish_ebb(OptContext *ctx) remove_mem_copy_all(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; @@ -995,6 +995,7 @@ static void finish_folding(OptContext *ctx, TCGOp *op) ts_info(ts)->s_mask = ctx->s_mask; } } + return true; } /* @@ -1221,7 +1222,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. */ @@ -1231,7 +1232,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) @@ -1298,7 +1299,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 Fri Dec 20 04:10: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: 852370 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852840wrq; Thu, 19 Dec 2024 20:16:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUju60PqrakJMfjuvoM+KIg1m8hjWD4vHLoQ+l8BRqxpBIKxqreGuNL23O2/u7mXDY0fTxjoQ==@linaro.org X-Google-Smtp-Source: AGHT+IFr1Pq+dsNio0KGFEhd24b5sZvzASUgfhj1c39pArm89BmUtDfkQkw7yMye5LMkoQQkwMDc X-Received: by 2002:ac8:580d:0:b0:460:a82a:39a8 with SMTP id d75a77b69052e-46a4a8cb199mr25190291cf.13.1734668184389; Thu, 19 Dec 2024 20:16:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668184; cv=none; d=google.com; s=arc-20240605; b=BMGkMWsWW1fkpn8ci6rbIE5dqCMIx/uhp3Fw4PNEq3QsdlZNnhmnITPCfO0gMVD0mV QnUpuhkzNzGtvsTsY7L2sWmyxvhS6jY5tiCE3sOjjQRTpUxfDfcg4HDvEyrlOE4sJ99T wQ6wJQwCVOTpEv3Q5DqvuHHLGdzQhAavN1n5nMxKJhdZxCFTI5M3sUwNj2qj2ns2JGY5 9mNtc8wGlgLHhgCDmQSsT5+bKrvNqr8/YNZKY06l37/xgsAgHamqFjr2jvSbedefuyDG 6P8QKtrmdpSYrVBjJPMemorO2oqZBJ1+rZII/Li/xh3jA+0qdawUEFwvncvY/xEAAtVE qwCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W9/02VItWnKuXE48s/sX8jbBZgUlVlj7VS3J2PwQvow=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Vu5yy5S3N7/i6eTpGzbvMWtPxazJeR5kEw+6xBnDPDnoZj/kTGRVa4tzUQRkwZI42E h1IfDgjoesVJ20Qx5f9J9llmoJcsoA/++YkuAcxbYeERA6xwgqb6kNTY7vFT6iYUhXT0 6pMEyv+wlwAzMgg16EnSkHnAYGL8/1JqRxobgnOdSe9CTByKZm8j/JhSCHYD4dgfxtLv CuUMfC/WZM703fvnEbK9ChzPwQpKVZ0N3lkzvSYQA4XUZSmxUHEBBFl4Wb/4TAw6XnXJ 81hmjXwLnov6YETw86VN16+/ezvh6sxDT2s0HZso8NgNyKUp1TvXivgsIgRNX1+O6mf6 JPJw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hwNDdDIe; 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-46a3ebd81b8si29009351cf.613.2024.12.19.20.16.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16: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=hwNDdDIe; 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 1tOUM7-0008Lu-4W; Thu, 19 Dec 2024 23:11: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 1tOUM5-0008LN-Gf for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:13 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM3-0006Gt-Ep for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:13 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21628b3fe7dso13176365ad.3 for ; Thu, 19 Dec 2024 20:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667870; x=1735272670; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=W9/02VItWnKuXE48s/sX8jbBZgUlVlj7VS3J2PwQvow=; b=hwNDdDIeHUwsokUfkP+ivW7VYxRqUcF7j1LFin2cAn/OGPuBTOkYED6j+J0EaBAFPo 9edP4U+NfZCekYUh4p7Yxv83/uMxzeGHz2bSnVdpchc7eVljesD1Au0yLu+XOleT6wCO VmDZi1lVoAaA5pgM0YcUkVgZpz4qGNQ9jJyJjwAkJzYHyt6cqPSHGzBQkAQs9aHrgsRb kOdnEYp6Gezdrf/GsdW2wSNREMyuQbgkU65Dn05S58fewBQkLy2tbtZ+RT28Z0tROMjW 32eVxnMUj9IuaDr/vodIeZMJThn/0c3YReL9+MFwPVg+Znz+IXKAIfEXBY9e9DIDaRU0 1Pxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667870; x=1735272670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W9/02VItWnKuXE48s/sX8jbBZgUlVlj7VS3J2PwQvow=; b=gQ6KMyX6zXP2yTS/yrNQm0ipwKzn8D0s/Sdn2ZlPIZT75kbfQVlgMFwdx772oXeBjj e73DhqVXcJeUGRJvp4Wi4jLxNnvgCWyxGE9HeeXYFczNwGcs6yQNVDAumHl7NYa7wzbY GvK2AYHJhROTTNJ2SjIcToojukNdqp6UaMrx05ZIS/fkLhuj3iMoqJrhhA/mK1nb1eex ai0/1JqHjSj84nCaW6m9Kn0kbHLiQhDLYrE4rvtmbxN/Jy2km0n8IkZpChLSAZ9t61VI nP69J4ibGEqKcrz+7yEhBPURV7uTdd2QlGmbKybLmdJePsruvZC5Mk3EpPdvmfQAP2Ap HxKg== X-Gm-Message-State: AOJu0YzwNJ3DZCpE+MRFET5VxsbYm/aa5Oh7DzRzZ4ZNxdR1A1u19DFh yJ6ZDkYDqSXVj/vefqGxMTuywlGwMPjfJJmyN6RDBHIT3xbYF07jS4M0K3X6lbX7m49RHkPtg9y N X-Gm-Gg: ASbGnctgcO+X80dl/HbX0XM9GDMgqbi3sslmW3UKDmSEUCUc3KMsYtDlbpQ+IARAsKN co8E2QCEb+WtxlgdXm2LYasCPd2i9kvBlCTcKUWO0flVTKz1/r5FAzSTjgUhH7qK7SXW5PSW3z0 t0m/TEA27b/IIH/9cAc12Yizp+Ik0DIu4VLyzsbn6qjS40Al26S58bgPNuasH1U1oYWEYfS4WF3 iRpmwIhffFw/9+nPK05/76C3pfIm7hKoWxeGW2tdZAL0E1NIpPAynOjwx8bD8Y= X-Received: by 2002:a17:90b:514d:b0:2f1:2fa5:1924 with SMTP id 98e67ed59e1d1-2f452ec1ceemr2003756a91.26.1734667870127; Thu, 19 Dec 2024 20:11:10 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 07/51] tcg/optimize: Use fold_masks_zs in fold_and Date: Thu, 19 Dec 2024 20:10:19 -0800 Message-ID: <20241220041104.53105-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Sink mask computation below fold_affected_mask early exit. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 41fd69365b..52c785472f 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1313,7 +1313,8 @@ 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; + TempOptInfo *t1, *t2; if (fold_const2_commutative(ctx, op) || fold_xi_to_i(ctx, op, 0) || @@ -1322,27 +1323,28 @@ static bool fold_and(OptContext *ctx, TCGOp *op) return true; } - z1 = arg_info(op->args[1])->z_mask; - z2 = arg_info(op->args[2])->z_mask; - ctx->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; + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + z1 = t1->z_mask; + z2 = t2->z_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]) && - fold_affected_mask(ctx, op, z1 & ~z2)) { + if (t2->is_const && fold_affected_mask(ctx, op, z1 & ~z2)) { return true; } - return fold_masks(ctx, op); + 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. + */ + s_mask = t1->s_mask & t2->s_mask; + + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_andc(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852349 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1851939wrq; Thu, 19 Dec 2024 20:13:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWw17M/A3mdLltLLW/Uqree5hooNoLBdiRNemQEg2PePO2qC13xxDCjwye3+Oe5TGutx4KdJg==@linaro.org X-Google-Smtp-Source: AGHT+IGAQz1PmgstzyJZAy9fxi2xWh4LMqxtJAMsHFKyITRJsubtQE0XHPq+cf2wFC6PnTn0OHOB X-Received: by 2002:a05:622a:1aa8:b0:467:5eb6:5153 with SMTP id d75a77b69052e-46a4a8e4669mr30820851cf.19.1734667989002; Thu, 19 Dec 2024 20:13:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734667988; cv=none; d=google.com; s=arc-20240605; b=efLj3EQNhgZTS7U51l0Qckf3Gt4mzUc9ynUU2OYJkTe4Qu58dj7Ybf//sA3lQiUUnC BL1RxiPSegWrHCNsvdZrfMoaDmyUb2sX1ImpmEyh8HlkZWROE9Tk4z8E7WDOZuHEFMbi oILjzvBhFrjID1vBkdmUAs7bJuZS5D7woxfgc3WxW8jqyADJXaiDt0csZRY7GPOAzPNR bNzolunVZKy+Q0zkJtYc8V0i1HJo68CDOWPyja7NlheE/5kyEwtSRpM2y8UIQTKJhOQU GyDdx1mE0t0NKBGqYDBIXi32TvyiTLnTQbhQ7dwL2yDlkHH1oC7qC3I1grbl9q8nNxCQ 8psg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kFw3rpA76sVRd/4s7BeQ7vzsn5gYxdrWXruIEcEABL0=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=N8jpeoqet4MFZhpgX4T61pscIaC0wXUzwx4lSbaUwM9WWC9l3RBOGmUAyLwzgEt6LH jt6D8IY4QhrbjjlnZwXvGioUFyMxbj7At60GwglPwdz3vdXo59mcL5L7x7SbtYpqlL5a iseoqWIs0TSxYSleM5stFLlDgpyit1+D3bDRXzwVRgb5caMjxDFSuS7YpD3kFTsG5YoV A5gDFrvovKlZ+0JnsaBN4TREDgyErltqXRJ/oIvqjptSWPsHNbj6e3G2Lff/Liy7ttla W6KjJQXK68Mf1MDVvm6K/zwcqwFsGrw0GuV3/LgCFEoy19KA82tHscQprgPZuzsgqUu7 /L+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=llCCBWhq; 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-46a3e6808acsi33350141cf.97.2024.12.19.20.13.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13: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=llCCBWhq; 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 1tOUMF-0008PU-3f; Thu, 19 Dec 2024 23:11: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 1tOUM5-0008LS-Ls for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:13 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM4-0006Hk-2j for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:13 -0500 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7fd49d85f82so1124696a12.3 for ; Thu, 19 Dec 2024 20:11:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667871; x=1735272671; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=kFw3rpA76sVRd/4s7BeQ7vzsn5gYxdrWXruIEcEABL0=; b=llCCBWhqGNz1YgPThs3Eczh2dFPXiZXYhzndh2p0HK9ENYmVBPIR65rWm3rkmOqi1+ xIm2YQIMkEymCaoYs72lEcyLZ2mShflQO1+7z8zBVTyRDi3HYZzqLkec9B+NI6eWna/I NVpsLylsfpk+A+wJKGO0WTpDagPYVrE0+B0RoGvvextapPufYEdfQK+a94b38IWVb9Vb VLL7GtqVawTXiD6REMCmXyoi6BLR4N2AGYwqTNF2m/pq3TFkp83QXv3MEBRTdeFA9AWk UVTVhD0EQgok7Qxyw3GFnz0pigPFon4S/ezNQfoFf356pKypI3LJfR1KRT6iXgTGJ5av Llgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667871; x=1735272671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=kFw3rpA76sVRd/4s7BeQ7vzsn5gYxdrWXruIEcEABL0=; b=HiOIwOdzeE3hOnKCjZlBT36FQT151ugCNKOZ+Q/2fLnj+Uw6jycBDPosWpiFHVnnbf wVNlwfftOcyD0JKSWXneLWegML8OSdpsnPKlFdNzCTPvkeHsaXij+CY4jyBmZgT72/FF jP2XTmOGTRW5wDj1VUadR48YN7cx673asuIjF52GQA/MXx+EvcBJ4WVntMGEWjnRM4hD LA/2vNBBY6TvyPGZfpqgC2rQRAN1PNTqKNar0dhXDdh4zwrvPbvGFB8Ur/jQel2T0/JP HkdeGhcDcMkKp3vd4Fqn5yAwbRoDcJbbiRayAzioF2xIO4zXUuNzxswWp90ThEMn4kHN DOvQ== X-Gm-Message-State: AOJu0YwDNBllGR4avAz26wHm63Mz9bp4SwR9+8PIz+zaey8FNc8l1pmh ixpcDzYAsmRboGW1G0cy05FJANeMo3Yor2k04ZOkRgUDhym0SzlI7Eoaa4UX5f1YWc/DMc1o+x6 H X-Gm-Gg: ASbGncvuscegGQGOunuSnOYeo3iOQ/skVe4xgdRCIegUFkc8+HCkTYfIPye0n2+rWy3 6t5j8RQuIcKnMwukmv8jEVAhxYGZKnd+XXPAchgDFxRPkGGJTAdqhNs3jZzeqThBd9HSDbM2E0B YI0lewlQkKHg0AYT/L7EjhXWgi/ftRBp4gWbSe9TjHAcl2imcb/Mo37GB4jsTni2Cy26s2ge5mA WllUnMxgl5Ns4rWbi8rUaYeKWpZYw6X/God8JLmt11UvuGFjQzpcS1eFG21EWw= X-Received: by 2002:a17:90b:2551:b0:2ee:b0b0:8e02 with SMTP id 98e67ed59e1d1-2f452eca3bbmr2132026a91.28.1734667870852; Thu, 19 Dec 2024 20:11:10 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 08/51] tcg/optimize: Use fold_masks_zs in fold_andc Date: Thu, 19 Dec 2024 20:10:20 -0800 Message-ID: <20241220041104.53105-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Avoid double inversion of the value of second const operand. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 52c785472f..c73410232b 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1349,7 +1349,8 @@ 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; + TempOptInfo *t1, *t2; if (fold_const2(ctx, op) || fold_xx_to_i(ctx, op, 0) || @@ -1358,24 +1359,23 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) return true; } - z1 = arg_info(op->args[1])->z_mask; + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + z_mask = t1->z_mask; /* * Known-zeros does not imply known-ones. Therefore unless * arg2 is constant, we can't infer anything from it. */ - if (arg_is_const(op->args[2])) { - uint64_t z2 = ~arg_info(op->args[2])->z_mask; - if (fold_affected_mask(ctx, op, z1 & ~z2)) { + if (t2->is_const) { + if (fold_affected_mask(ctx, op, z_mask & t2->val)) { return true; } - z1 &= z2; + z_mask &= ~t2->val; } - 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 = t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_brcond(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852347 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1851743wrq; Thu, 19 Dec 2024 20:12:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWw2IkHu59BaHMbemjZ55SeMgS3d2dc8Oe8Isp3/nbR5UMz1VKyRbMvK0aVbeHU+ZJ+YKcZNA==@linaro.org X-Google-Smtp-Source: AGHT+IEiqcTTo53DAzEzuNze+o55IuMHe9MjpGXIchE9cvw6uvm6keI072Fcf1pDqVRWUUuTlBOd X-Received: by 2002:a05:620a:4413:b0:7b6:d754:207f with SMTP id af79cd13be357-7b9ba804ac9mr188638485a.50.1734667945337; Thu, 19 Dec 2024 20:12:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734667945; cv=none; d=google.com; s=arc-20240605; b=SmHdtFEjDFKnfPN9S5gH2aPTiutuVEiF8IpojWbW8qwyXm/dewAOn9PAEzpdUCqEmW c9I7M6c9HjCneOmPUuenOsHwKEpwySZHCQ7fP++vrVzWn5rEmvFpk9pqYJLf2ENT/PZR j62FdvjGWVDaYvQ9M+9RuXIgb4whxcV6rCTN5q/l7A0OOMykcrwyhoHu7CaFx3MCbM1Q XRKtPQxfD6u2nWFU1bzVbmYCxXnsbFiL7ejjj+cj8JCnRXsOXqjtYiDk6ipQl0Ap1UXu 5gHgS8iWt2t3vCQmS5wj1HwRLoM+rA54iuSZD6bcmroiEmcWCx/pFeouMSnqG5tP8jjp cUSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pTlIt3yFdh4Ary2wfKIiByPP+3BeXY1y055wil8BQG4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=N9PXbFW6HBgEOAzsXncWjFU6PKDBzCAOpukKCXGHsBwvNZXvIeJ8xw+sy5yN/uI8NY y5wSVlLBIlzp1FWebnkuJxfJ1+8SPmB5NMQ6y+aj6o08x6O5fPhuhTvLJHSv3bqfeFoy c5BbOOJQSYb5GVmVyjxsUDmAwWbCHBtyq0WRqV8DL3J6/pE4RO1uzEgO3UDW0+KppUlJ VpkqoKe5FBz/yIIigKrOsVIOV0EDRTr2SumEa0WE7ZZYPDlz3VzB3P0WdORYR0VcE3u3 WG+krO1rPBIlOO7eRggiU9XUynM0zmf6BcjYka5mpwT15jOxcBz78llrXpx9NLuTf1Tl sYAg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=KIhTgOVK; 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-7b9ac2ad91asi357415885a.39.2024.12.19.20.12.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:12: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=KIhTgOVK; 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 1tOUMC-0008Oi-JZ; Thu, 19 Dec 2024 23:11: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 1tOUM6-0008Li-ES for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:14 -0500 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM4-0006Hs-QH for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:14 -0500 Received: by mail-pl1-x634.google.com with SMTP id d9443c01a7336-218c8aca5f1so16998485ad.0 for ; Thu, 19 Dec 2024 20:11:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667871; x=1735272671; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pTlIt3yFdh4Ary2wfKIiByPP+3BeXY1y055wil8BQG4=; b=KIhTgOVKsSd22foZ9vs/aHRxaxE48BQcZ0Vt+bs5mvbrsu2UD0MoQfA7Ytqizkg7nc XAJWUPR4KokSXNlfvWpPl53xWjyA9gJ2yhixGFwjSHcbHTEI89tY9VmUXEUnmDJ865FM fgaWYDks5kmkWNk34dUjPOBRcDv9nivrF+oHWNsYt+WYdF0uMpdxCn2xdY3z2PsYySTc NxY6hwc+nwWjIVEY0w3asPx0QGb/G3iFQ8KMEexOTPMU8otSmq+k5QPHui4iCeHtlthe cwRl8n3pr0zaYST2CJohTse/TEsWS6UrY3F1HTGULs0Xu+Y1uJVhkU/Yz3KZ4Zl+qWDo WetQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667871; x=1735272671; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pTlIt3yFdh4Ary2wfKIiByPP+3BeXY1y055wil8BQG4=; b=qdstZ0LvFZRxY4uMTKbxENqVVhwTlk1ufZTAPQO6FHxEAkRoG+xbSzOkn7qHS58Ld+ VUagd7HEEEnGSX5+m81jF4WHx8oVYQabl/53kT7PDiu9o/7GZHo3vuVngs422UliEeHx V/bCS40ueaEwxVRutIF7zto1iLjWkiD9x/3G0b1z0X7OccjQb0cFaaH/H5T9+J/e4LQx LyWsLeuhuZrX47s2jB+FVutnmxR/flrNmyyBHvc6yi1dyE2elfTwJz6gTuWdSKdoMq63 /C3CzpbSpd62JyMprEUa0C4WFVcwRG5V9XTEd76hLgO01++1+XOgoai04oUbZ1KatX1i DqPA== X-Gm-Message-State: AOJu0Yw5FGmxH/D3sf8meP3yFlJbeOK1X5Pf3Xf9Oha+le/KgBtGe+zn wH/Z4JVIOa8sJfGqTRVjua7M7ZrIvQ5qyMAhrMXda7WnAg5unr9jPsRK+3i9sXpW1zbOlBVtfUk 6 X-Gm-Gg: ASbGncv06wc+ct/w5qOxpSJHpJ/7oY/3Kism5AqbWqNWKfNNJoFDiItmUeRUJpBUwbH f5V+1KTrNNQ0ofTjUvXKAaAQlE5pcJEFMvxiEOQojyydzofo+vMJoOQZWUEO+BSgHOcOETUGsEX CuLB7sg6YhZZm/pIj98Co1Li7R2OnaiVVhz5bxT4F9cYYg+W0f2wKedYhOGk0Qi04fqZfVoD7Xr gv/7v10NvpwgbqCmB5GXejS3yBa4BcS7si3r96jsdfmfYpUWbCeVrvncjvtN2c= X-Received: by 2002:a17:90b:2543:b0:2f4:432d:250d with SMTP id 98e67ed59e1d1-2f452e372edmr2051809a91.21.1734667871434; Thu, 19 Dec 2024 20:11:11 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 09/51] tcg/optimize: Use fold_masks_zs in fold_bswap Date: Thu, 19 Dec 2024 20:10:21 -0800 Message-ID: <20241220041104.53105-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::634; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Always set s_mask along the BSWAP_OS path, since the result is being explicitly sign-extended. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c73410232b..b8e9ded821 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1495,16 +1495,15 @@ static bool fold_brcond2(OptContext *ctx, TCGOp *op) static bool fold_bswap(OptContext *ctx, TCGOp *op) { uint64_t z_mask, s_mask, sign; + TempOptInfo *t1 = arg_info(op->args[1]); - if (arg_is_const(op->args[1])) { - uint64_t t = arg_info(op->args[1])->val; - - t = do_constant_folding(op->opc, ctx->type, t, op->args[2]); - return tcg_opt_gen_movi(ctx, op, op->args[0], t); + if (t1->is_const) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + do_constant_folding(op->opc, ctx->type, + t1->val, op->args[2])); } - z_mask = arg_info(op->args[1])->z_mask; - + z_mask = t1->z_mask; switch (op->opc) { case INDEX_op_bswap16_i32: case INDEX_op_bswap16_i64: @@ -1532,18 +1531,17 @@ static bool fold_bswap(OptContext *ctx, TCGOp *op) /* If the sign bit may be 1, force all the bits above to 1. */ if (z_mask & sign) { z_mask |= sign; - s_mask = sign << 1; } + /* The value and therefore s_mask is explicitly sign-extended. */ + s_mask = sign << 1; break; default: /* The high bits are undefined: force all bits above the sign to 1. */ z_mask |= sign << 1; 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 Fri Dec 20 04:10: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: 852368 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852780wrq; Thu, 19 Dec 2024 20:16:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUNNL+tF0lFnaWSLnMnzUhMyVPOP8BkRvN1HbGMqZhsDM6m14k/rJLJ2ya7zh0bnakuRiwkiQ==@linaro.org X-Google-Smtp-Source: AGHT+IGZYPXhkPYnKJYg8Wo9IV0+dzqLcS2p/DzU6ndluh29uY3EUyGUxFXjYxalva6RgknXAJsN X-Received: by 2002:a05:620a:191c:b0:7b6:dd9c:fac1 with SMTP id af79cd13be357-7b9ba7f562fmr228735785a.49.1734668173410; Thu, 19 Dec 2024 20:16:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668173; cv=none; d=google.com; s=arc-20240605; b=PDOonkI6OEzobOQ2QAfQNHJIhvHSOk2QCVVUg0//SwQXrnP/Uxq7Ju0BTHlm66WAJT 0YgKb6DP4Y7QDpKloziicJzyQ1fy4Gu87429XHXBDIun9aAh6WWWxhkFEryJjKWBgtsV ukRK744/+3oYfMnVG59qS70a2/+Cxot7DCjCE6j1qVZJMWWn+L16maMC789QoGVCDf9/ bEiLilJ6SAZpFgZmuyAJ9zt78/MdYC38ZVc8SEuo721Ag94maY5fRUcd9T0DrX9n2czq iQd9jbbtrymg58WZjstgNKnJSAk3IAGNexE6h5CwMep9m7KHuq+nHECtlGrlTd55F2g8 lp4g== 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=e83Kh8y33SsGtp3mBjjq9S+0kBQxVM7UcwxTwkf4goA=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Tif5Wul6JI/NaO1HmWG1Qefa9+Jdq4Fqq7gJOU0uKsxr1qC+gqe/ngKnvio+CpbXmO 6H/6/K582AaGU+POnFgII7vClopJwRf7TxdpW1cS+XQIj2SBkTEUFMjBYqQAyi9pddB8 evGaIA5yYMDIqdo7+os2Fctc374GloYp4qCHvBLs1wNXRhk1m3X5kolrWqK8Ft4lGhBs Y2xYubNR0MAqzGBZtLyiTuILILjIe8vqtLG8SGb+No7DTr3N8PXCLMKVRPOYKi58aE8z QIE0zIcmxXKeAfgG84yn84uKvJ+86OpDxA4VNb/NOpO4rLHPdBPMedotynp7IXZbdEIn ISag==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FqGhC9IQ; 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-7b9ac2adb3bsi320404585a.108.2024.12.19.20.16.13 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16:13 -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=FqGhC9IQ; 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 1tOUMV-0008VJ-01; Thu, 19 Dec 2024 23:11:39 -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 1tOUM7-0008MS-GZ for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:15 -0500 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM6-0006IK-0f for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:15 -0500 Received: by mail-pj1-x1034.google.com with SMTP id 98e67ed59e1d1-2ee74291415so1115334a91.3 for ; Thu, 19 Dec 2024 20:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667872; x=1735272672; 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=e83Kh8y33SsGtp3mBjjq9S+0kBQxVM7UcwxTwkf4goA=; b=FqGhC9IQTSb+lCy5X1v9uNYawfosSiIV4QhBMWwta49UW6817RzPkPvkoRenWAt/9n 2PplIaGL+sFF2AFdOE5vHLa8sO/EzT0qKhpfLArCNNv9GBfl+qqTlV1N69WboRTmcM39 IPrjUeb6NFqafXvVZP5kJR1Hsg0VDiJOSk+ME3wMNolOudK3c3PjmVDWOYFrx3FrrmWR PYB3W0AABbfC/T4o1ghtZ1VI1Up9dpq2LE98sR3tvRQGvK/QlE3NZiLQ3kaAuMyk9o/o rgyizQPEXCBqCy3efG54XrYKkbkpOmFnu6wRtGaFrI0Z59MOyExSKiWtLFlfqNiKHzBi VqOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667872; x=1735272672; 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=e83Kh8y33SsGtp3mBjjq9S+0kBQxVM7UcwxTwkf4goA=; b=RQRPdL5ZxYnDur3QtWNzywoTn/aCtng8FIQk/2mcE/dpesqT7jlUON14tUfg9BJ+00 /1x1R/Y4S1ojXA+eM+kqjflgo1UjkESTu4hbw8kak/X9fdmBwnCZuOmbpqjHuPNN/4Fx wPIAMZOrd4O4ZpE0t6cDfSDPGHW43EMERbSWRZLqxybaIMd1EQGjakLiHyuebN4kR4/b R0vEoquSsfr2dAe4fbhc2SKj+lUFLtV1ZcTgz2NIA4XYpx06iBRY0BhEyDJbXx34fcpR 29YiMVZmeUsdLKE6LdjGs9YWFR+rF6RLBtFZQPo4xm0AfP6aMR8hp9u0sJ4RdJ1LGJOO Zx/g== X-Gm-Message-State: AOJu0Yxg3cV3Rvtb9HwYlNojZ/yUJM3GgBo19LjBY3auKoWO8TEz2REr 89kGmfOS+ToVn04xdL9W8i4gLH5zQ05c12Rdss2PORnlUUOVc3xoyGor/+hs74Pjm32WmU2dzxY S X-Gm-Gg: ASbGncs469RgKAfKUsuM5SBlpqYmDdfTgnDxCzH2AmLpcSEt94+aKvoO6uspq2P778/ Go1kJ8mKBQBosm1e29M7ZinUgclUryPmVxeEu57W8y637xKmrY8nj4f8GEtHq0juOA2xd5YdArt 1z6jYcOZw5ttCay6lDa/mnThfynYukFq8s3qAIAj37o33rhm0WK28uM8PVPE9cEGarkySzedfZA NK7wrSmI/N0Ql/zJdugRhup2vyFxfbSHcD3eI+UvjZuThihvuUc1ZZJRSeQk8E= X-Received: by 2002:a17:90b:2b8e:b0:2ee:3cc1:793b with SMTP id 98e67ed59e1d1-2f452ec6ed2mr1985899a91.26.1734667872223; Thu, 19 Dec 2024 20:11:12 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 10/51] tcg/optimize: Use fold_masks_zs in fold_count_zeros Date: Thu, 19 Dec 2024 20:10:22 -0800 Message-ID: <20241220041104.53105-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1034; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1034.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Compute s_mask from the union of the maximum count and the op2 fallback for op1 being zero. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index b8e9ded821..270051acd1 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1583,10 +1583,12 @@ static bool fold_call(OptContext *ctx, TCGOp *op) static bool fold_count_zeros(OptContext *ctx, TCGOp *op) { - uint64_t z_mask; + uint64_t z_mask, s_mask; + TempOptInfo *t1 = arg_info(op->args[1]); + TempOptInfo *t2 = arg_info(op->args[2]); - if (arg_is_const(op->args[1])) { - uint64_t t = arg_info(op->args[1])->val; + if (t1->is_const) { + uint64_t t = t1->val; if (t != 0) { t = do_constant_folding(op->opc, ctx->type, t, 0); @@ -1605,8 +1607,11 @@ 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; - return false; + s_mask = smask_from_zmask(z_mask); + z_mask |= t2->z_mask; + s_mask &= t2->s_mask; + + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_ctpop(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852346 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1851611wrq; Thu, 19 Dec 2024 20:12:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVNUwQWYaVzYdO827pbGigKoe9Gu2u5CYMhtur/AlPiGIURatf9VmCvmf/2XCEiavQs3HtdKg==@linaro.org X-Google-Smtp-Source: AGHT+IGqzjKFOoQVlyDIKF/GhWw4f0L3l/MU86C6xbog+xTzexGEcn1JiqxpgUHBqvcuAHKf4n+l X-Received: by 2002:a05:6214:e83:b0:6d8:7d63:f424 with SMTP id 6a1803df08f44-6dd23331dffmr22533366d6.12.1734667920600; Thu, 19 Dec 2024 20:12:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734667920; cv=none; d=google.com; s=arc-20240605; b=dYMZaQeqVLknGidSkI/UJWiHTRg3UNoF4dJR9J5Turs3U36xFWX38M9dkT7vdWhBcM tKucxAbrxSPkIaI2JgupV1THLtMIz6c2D/J8F/jGscI0rT3ObH9YLmPU6VLKZQooYcLK GPB2fP3GLU4gyDfPb/sEFAlaLUvvZnlTE/Ke933C8O56Lpus0D2OB6+g0vq7L3IAKBof aO9uz1nF6a8bwGViN50JCwQ5JFeHP2sBeFb5+1kO8jKSJBYVJanSZ5qSrB/XbfENkOpE f/IJjWOuqq7b9qFJBeUKU9c+XHp+Xnz4H52BTmOORCwo/hBurEg8SBpWeVVyB/Oqtgf7 5+QA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Wg8rqRAgWRCDilgaz5IPxRaaVO9cOj5AUka7Masx2ag=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=E6S3i+GwO68ao8GINpDGq5Dma89xXFFxLPruONlfSTYvbcGOXoXApaeI7GYA2wqFlQ zg8Q8WZ0VTW0Ef9U60ai/2uj5CZ8244QRmF60hiDCkY0IduDGFZ/aFx31uIQcbClr5Dj ijtBtNynA48SIEqkVAT47fUjPmDP/1UPOOhBo37ptdBuOlTXsNBOcZz0h8Ju/IBO2Ijn feUZxe3xFPV4U7aeMToJzi4n9kwXAfgBs32QSlFu/Ddj7CIFh52BBOUHWmIBF6GywwE8 rhQoop7t1argcyBEIpVp0+q0/v+2SiWwiygdHi+uhLIA8k6QMEAfptR/15dixZL7qLOE LmFA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dzUQCSS0; 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-6dd1823641csi34231446d6.218.2024.12.19.20.12.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:12: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=dzUQCSS0; 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 1tOUM9-0008Nu-9c; Thu, 19 Dec 2024 23:11: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 1tOUM7-0008Md-OH for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:15 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM6-0006Id-9i for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:15 -0500 Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-2efe25558ddso1055759a91.2 for ; Thu, 19 Dec 2024 20:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667873; x=1735272673; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Wg8rqRAgWRCDilgaz5IPxRaaVO9cOj5AUka7Masx2ag=; b=dzUQCSS01mB6O3F2CekUidvje6/ZkNftRophfv8T31HeWLqmx2muuH33XJ3gWgFGHb in1/oo/Q4o0/7Nq1HDhNx/IqHc1d/3iMaoV7/5Jhm5L1y4w7FfDVpZFbE39R5pPhpgfd LagNBuibreD5xbQokApJ8mf7TbDb9GQE65zWsQ28mm1V7O81LbOKdxCtPDphukYGMMa0 NBwN5K/tXtl1UxoG89HxuTV6xwMfKrAZDGOI6cBh4Y2jNBJTh8NjHL6gEkQx8uS0MALP Sc1r1C7vktSWqbd+hxwrmavrotNWdDu42W30enbOmmguwF67UHtUGXV3FO2XYm435GPC wYyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667873; x=1735272673; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wg8rqRAgWRCDilgaz5IPxRaaVO9cOj5AUka7Masx2ag=; b=F/ZEQmzC7bI8aFLKjoBizB1Unflmti/kG/YS80RoZMMXaMbMT47Ud0OtlQm5kXdIHj X5fxvYl+1bBhVjV9yAzojHwk4JQSzk84Yi1786aafLRQI4RWn7oZl7b0kDxCdneLvUNR CE2Jkh2s/EYR7jHvfm00+fBprKqoR3I++TCIzjJP4tc4NjzHBFklFOLD4TxCdKTTpGJU AOUdylbuYHFrJZOrmPYnjZyoaktl5mil1SpTLNp5Xc8zSgjMzJM0scJbZpQJG/DSMZJb SRVhYZGwFCfRuO84aWnxHS8ze6Fg9MJMNtbVWC5HPB0R0JvgLSjjwmu+9xWyPmVU0ISv 08Eg== X-Gm-Message-State: AOJu0YwHe62WVufPuI3movs4nHkKSMLtphOtV2aTncVoKw6hPkQd7LMT 5zzVK5T4VnGf6A6fe427CAMnJXOuHtLA3m3iqzzdRL7dIrmszD/E8nngXPNWNq02HnhVQ6LfJ+x k X-Gm-Gg: ASbGnctidfklxkjY5TmGu+99rBMH+UWivMslEh19ttxjd0FxFCM1YrXJqNoKxRV8Fdj WHLU/sCi0POBi4ZoIHeBIg4m+7U7sRFmb+1JBlTth2yKwQCftnldaupuKJ7dQFz32P+1AuSNLdh SBBZQ7ntdoiqxKZTNKzxLmEGS/GpwwIq0uoPk5MZ37CQ5XMlVFKYbclZEUdYPgxRi2fPVn77VMO nf5zu+nTG+W1KjjFi83Alhw71vLUddd0gzzF9J8Wb3sN0Ip/hi2Ep8+r+KySl8= X-Received: by 2002:a17:90b:51c1:b0:2ee:8031:cdbc with SMTP id 98e67ed59e1d1-2f452ee634bmr2053664a91.23.1734667872955; Thu, 19 Dec 2024 20:11:12 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 11/51] tcg/optimize: Use fold_masks_z in fold_ctpop Date: Thu, 19 Dec 2024 20:10:23 -0800 Message-ID: <20241220041104.53105-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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 fold_masks_z as a trivial wrapper around fold_masks_zs. Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 270051acd1..af7111c98c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1086,6 +1086,11 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, return true; } +static bool fold_masks_z(OptContext *ctx, TCGOp *op, uint64_t z_mask) +{ + return fold_masks_zs(ctx, op, z_mask, 0); +} + static bool fold_masks(OptContext *ctx, TCGOp *op) { return fold_masks_zs(ctx, op, ctx->z_mask, ctx->s_mask); @@ -1616,21 +1621,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(); } - return false; + return fold_masks_z(ctx, op, z_mask); } static bool fold_deposit(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852350 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1851947wrq; Thu, 19 Dec 2024 20:13:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXdcQqDXjAGXq15Qc4vT8zQMu7PTKMu9Dio17LjbuT24P59gB42EXELGXuCLm1pXuJh8LYCcQ==@linaro.org X-Google-Smtp-Source: AGHT+IE2WYh8py/z/QIucBl2grReVnpmh5yAkKEaGvyZbB95e6O1H+wF/ss2nC+rAtBoUyrASLhe X-Received: by 2002:ad4:5b83:0:b0:6d8:850a:4d6a with SMTP id 6a1803df08f44-6dd2332ee4dmr23068916d6.1.1734667990139; Thu, 19 Dec 2024 20:13:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734667990; cv=none; d=google.com; s=arc-20240605; b=ZHasG8n7zc71cDHRH6vfSmtZsbF0YvDrkENpoKokiPIhmDe7jjiZQnI7iguiBQrulf LZ7S6sah1KbEDt8aNxArBpQgsxZMtN9Hf+XT+jB+1yXq4KD5vKe66gxohCa2FTPnAUcz SzrXiGXKw4yhA7ZoLJIda6gCdZBXd1Fphz1BdeD2N5tWFvD9653QPenTk94IeMrTCBls co+ZsuhHDDb4CYcVAOioeYx6AWfe7bfdtTA/xYnEI4IvtNw3iOaxtrm39lqUVPsLZt1R mZlzltOTKvhFEdmzwcmN3EroKFmNNgLwf7JZBW5lljHKmcw4lXycOpcjP0BCqgHB2H+w UyjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C5r1sayG0Y/5s05OtCkYtZE41zRfSkyjZqixbgF1qiw=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=a92LeI9Io2kzNCbanvCLqOvG1KbjXg3wZMy48K03mlDc0gO682iZj7tmvOwMMppeUQ Xky4N7VISFQoSKxEZ35uXFFzNQi3rndm49Xtd99AviSzLhjeodkpyolaUhanKuOFinhE JlkQxtpBnbJweThjCSQuCWagZcW/eWjWCBeOSUtY64ho16IsodtF0s7ucbDOeFrUbb3P VmAxSuGgADd7W9eRkOE4cLPTpDVnDoAFCKP3n40Q8HGddmKCe7yZGziEItnyTXbaryi0 IHbNXWfzEUHGsNiluqw+E0OR252QP0xQxlOIwaG320Ebb6asl4P97RFDOzfNYx5vZIp1 dXsw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zL+DdcsW; 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-6dd1835a6a4si30030346d6.459.2024.12.19.20.13.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13:10 -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=zL+DdcsW; 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 1tOUMK-0008Pn-C8; Thu, 19 Dec 2024 23:11: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 1tOUM9-0008Nk-5R for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:17 -0500 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM7-0006J1-3F for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:16 -0500 Received: by mail-pj1-x1036.google.com with SMTP id 98e67ed59e1d1-2f43d17b0e3so1413250a91.0 for ; Thu, 19 Dec 2024 20:11:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667873; x=1735272673; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C5r1sayG0Y/5s05OtCkYtZE41zRfSkyjZqixbgF1qiw=; b=zL+DdcsWJUbuHWxmCQQLBcjyQRLlc1NTgNZLrxcl0ZA2xmIyuL/6gRUuWzVtAVyd9G LByucI/7xi+pTrI4ayaPaM1hxBa0EJvqliheeKjUlyU0IwdFl0Sjfid3lvTg8XsF0cKh JEtedady+9fmxkTqeX9EltLHE0kfk9edKuBeqyj1T+T2cinaglGq2HCtFKd8YI/uzg0t 0RqEBAoZA/TTMKbTq3IxUuNEDqsFc9hvxfM2pHOQjgrAW/JgvXevULLAge0f7P1/i9Wq PhmA16a/vWB07EfdLJTtWgYpl9N6A5aiU7hTWPBn5S1CQVt78u0SvW4U0fmEjZxA96dp tFFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667873; x=1735272673; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C5r1sayG0Y/5s05OtCkYtZE41zRfSkyjZqixbgF1qiw=; b=RJr4A9ttcUKHBW+2oxjR7NDIMqXYOYJWkBpt7USPvVSOaPvGIkIhP8xWaWQyqhetn6 98pXMAh3Xqz8BX5xvOtVk4fMBLntVajqwrCKVmEhsxeNK53/qKHbiB47v1BcHkC+ypUT 0MEG3o15H+7uirJQ/3Qhqwf0D6wpN4ylxFdGbzY25mha+Tys8uEBciM7RYLoK5E5hQT3 F4Spc3DkUaB1QcXcysWI8xe2YmX3HmTSGVfbfKYk2oGvnrprRlc8mV7P8R0twxXsMzXc c4C2Q1YISemKHNxsUf4VPkQCN4+SGvHQR549OTQfein8rl8GZrrL1VOmwPgmD1QtjtPG ZAqw== X-Gm-Message-State: AOJu0Yz8/quTRiY1bPONQaec9cHAjv+/bQI5+1UAfF+LuTuaQR6noWD+ 1pMgpo0rmLJ1K4YSU2xtvU6/rm/kcKxmB5gz8BjUci5briV8svAZ8s40EJOnkDCh5NdjZVXVims y X-Gm-Gg: ASbGnct22XFz297YYt62EzQPHH3+KBGUYqYuQhkRad1XFGFtHR6oW7xTm3Q2koxBMmJ HIK3ZZW8J+sDAfAWQgTR71goo3WRRBPwYPxFl75y1jCVBleev/gXkE/Ki2qjod5zL+IVj9w3Byd 1TrmFq48d3L35C/0VmNu7wSutVj+A783zWSAh0d1WJLK7owlLDtV+mSE9fYJ2Dooxe7WxTtOzw2 J677nD5hHkni4mOeg2l6m02cIfSxo+yjODZt6yn42fjZFkPhJYisuRD1YUgB/M= X-Received: by 2002:a17:90b:51c2:b0:2ee:9e06:7db0 with SMTP id 98e67ed59e1d1-2f452e1d3f9mr2311897a91.11.1734667873645; Thu, 19 Dec 2024 20:11:13 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:13 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 12/51] tcg/optimize: Use fold_and and fold_masks_z in fold_deposit Date: Thu, 19 Dec 2024 20:10:24 -0800 Message-ID: <20241220041104.53105-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1036; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1036.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. When we fold to and, use fold_and. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index af7111c98c..de32cc0323 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1642,14 +1642,16 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) static bool fold_deposit(OptContext *ctx, TCGOp *op) { + TempOptInfo *t1 = arg_info(op->args[1]); + TempOptInfo *t2 = arg_info(op->args[2]); + int ofs = op->args[3]; + int len = op->args[4]; 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; - uint64_t t2 = arg_info(op->args[2])->val; - - t1 = deposit64(t1, op->args[3], op->args[4], t2); - return tcg_opt_gen_movi(ctx, op, op->args[0], t1); + if (t1->is_const && t2->is_const) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + deposit64(t1->val, ofs, len, t2->val)); } switch (ctx->type) { @@ -1664,30 +1666,26 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) } /* Inserting a value into zero at offset 0. */ - if (arg_is_const_val(op->args[1], 0) && op->args[3] == 0) { - uint64_t mask = MAKE_64BIT_MASK(0, op->args[4]); + if (t1->is_const && t1->val == 0 && ofs == 0) { + uint64_t mask = MAKE_64BIT_MASK(0, len); 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. */ - if (arg_is_const_val(op->args[2], 0)) { - uint64_t mask = deposit64(-1, op->args[3], op->args[4], 0); + if (t2->is_const && t2->val == 0) { + uint64_t mask = deposit64(-1, ofs, len, 0); 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(t1->z_mask, ofs, len, t2->z_mask); + return fold_masks_z(ctx, op, z_mask); } static bool fold_divide(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852366 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852492wrq; Thu, 19 Dec 2024 20:15:21 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUn/7zN6Xe2v4TQaW6zvAVm2b5jHYHwsqXsASL7G1luXS6ZQX8wknIx5xB0tdu/Ynjkqvcrtw==@linaro.org X-Google-Smtp-Source: AGHT+IEK+OMYiJlcZ6D0mu/ycBlPRox7iGe/H5/RfoP41waS1dC3Z0GSBgf6xYcVO553ZCSMJynu X-Received: by 2002:a05:620a:459f:b0:7b6:db39:46c8 with SMTP id af79cd13be357-7b9ba735352mr223328085a.15.1734668121063; Thu, 19 Dec 2024 20:15:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668121; cv=none; d=google.com; s=arc-20240605; b=KQPR41bD1s9hX99wmbwCTofr7Epqvw+9G3KJgSsOpLSn/L+Pu2hVOcpkZk4GNt1rup Mg1invifY0I82JvLd3Ula6lkXCmC0ebova9xhzNx3MIi7zgOpF27fvqEVcj/XPs508eW PRyWGDVhwHEoEIEzYeGxZuBiUr10ntCphyI7aIurvVw5Rkphsuq4Tna/J3ejUyPAS09B qra3nrCYCqAmpf+QLJayoaLRWlj9CBYO/psBpjmCXjhdXmTIJdDpAA9evU2oCfc1KGXq ACfjRFpTGy2zP+zU0XAv+ulzh+Qyw5kK8egsqD84QE8OI4m4OAU322yMES4Hv8pzpCd+ tCpA== 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=0rhYtVOEwyu15py/YrAnbR2XfkR4Vy3WymLT2+T9y40=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=X8cJf2pJVqBMUaThms8jOQVo2ggUtHGjRmnrBQx6ViIhAWcQlduAoydDtlXWua5Z+r nS1XjRSHOJaM3bPEQNecOvuAz3WoSoLZhEU+mAWq6OTBK0VHxS82mRwaeCjG3eNiP316 6aFYMopuBZrWoaE29gIldSytWx81sHx9PjDrCPh4TkVarfZH8wgQN+D8+LYIg3rSCjZZ rfuU3ROdyfEJAYq+83DzpppkUbWvikja3c8k7Ze8hVKUfxP1yEohSOqvwlona/IJNC51 pNZ8tsutB2v33IbiITahR5NIrHC55e0l7y11+FJJNDg/UxNYejWW/49K1MdYkSiuqlnU /Xvg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jqNujmXz; 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-7b9ac2ab70bsi356603485a.31.2024.12.19.20.15.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:15:21 -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=jqNujmXz; 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 1tOUMP-0008Sq-Rg; Thu, 19 Dec 2024 23:11:33 -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 1tOUM9-0008Nv-A6 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:18 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM7-0006JD-Lf for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:17 -0500 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7fc88476a02so1174240a12.2 for ; Thu, 19 Dec 2024 20:11:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667874; x=1735272674; 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=0rhYtVOEwyu15py/YrAnbR2XfkR4Vy3WymLT2+T9y40=; b=jqNujmXzXkhAasEjuhyN5Q1ZTethUrM47fN5QApZHrsuFSAXszPswy1P8T535H7T5T KrcY7vjSpp1r/h+zhnkqWE8ZNa4lP1AurAebkBY/PZt02TRil/QbroD3LFFwOZm0NO08 R6JFIbRrRPFxBntootqifybz+UP0ZOnQcKyA2XIEXGhLxdbJXK31DZR5tXE+phBiDHSL cF3ren9m5jI273myJGSXBWz2wOJoAempYHlN+EIyffqrWW+9YA8psgspv6Y6/DqcwrBm 0JBb7qdA4bKEZ3M8vWKlQRtlGaA9pvWg5k5sptjNUVKGUWBAHM+EkZmFfhEqQ5uGvoJ1 CHAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667874; x=1735272674; 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=0rhYtVOEwyu15py/YrAnbR2XfkR4Vy3WymLT2+T9y40=; b=Ytw4G1wmiMJHY197CaUrx95muEJkVWafjj6c3bOeOh6ctL+Zw446bnoiiJ3lQSMeHW oML7wlsZgHd1QVKr3cxRPoSQ3/2TEumrfjlxY5CEX8Gxq9Dc8QTYO96/ShEx2JFLHkzh 0TECqUkttE1rfNaJV75AOpwm2Hn9alddOPW0h3u1ZJq3rGYy/wxhAYZ3Q3PJB+Vcp/sI rGVrBA0LYCuRN7dusA1IP3veoPwphZuGnStBbHz+3wn1gsLR19ZmR+s8hUUlrF+H36sD hXWRG/bA3Q+2Nf/PcoNlDqPbeqHTvCLwStxfkr9isWMvRXXvndh3CgARowvaXBBZxdDb 6W7w== X-Gm-Message-State: AOJu0Yy6XGrlXyjp/fCgIYfX2oFPTi6XaBOjLjmq6+tpa5qz7Uoy60Mq Tmu0E+whY1NO+vrOtcQRaQ8e4xQV19vzbX2bDGVhUEf5AkbRVNVCvL5TyqosC7j9YEBSY0CGkWd / X-Gm-Gg: ASbGnctIp8dFcGJANFk94zsDP8SEUSrzaMK24+w3M2SIkpQSvJJzzDRTOj2cNG5HUAr fgYeQX4kF5iK1YMZnFtn8yvHh/2bgjq6odElk3qqzva2R/IkExShAte8wRvKtWbFtPlmZJarvyt aGN3gNvquXXh/6GgsXeBi4Y7oimKZRH0anz107M7jGFgUeDGTk5JcWfXUbhxVTHMcBvh+uW+huc wopvXSbhgJugkrOqO2cHgWZAdx5iK8X0bH3EyIEzRK4OLsUa4s5p1WKVrHNsqY= X-Received: by 2002:a17:90a:cf97:b0:2ef:1134:e350 with SMTP id 98e67ed59e1d1-2f452f02689mr2383973a91.35.1734667874433; Thu, 19 Dec 2024 20:11:14 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 13/51] tcg/optimize: Compute sign mask in fold_deposit Date: Thu, 19 Dec 2024 20:10:25 -0800 Message-ID: <20241220041104.53105-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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 input which overlaps the sign bit of the output can have its input s_mask propagated to the output s_mask. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index de32cc0323..e4f68241ce 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1646,8 +1646,9 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) TempOptInfo *t2 = arg_info(op->args[2]); int ofs = op->args[3]; int len = op->args[4]; + int width; TCGOpcode and_opc; - uint64_t z_mask; + uint64_t z_mask, s_mask; if (t1->is_const && t2->is_const) { return tcg_opt_gen_movi(ctx, op, op->args[0], @@ -1657,9 +1658,11 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) switch (ctx->type) { case TCG_TYPE_I32: and_opc = INDEX_op_and_i32; + width = 32; break; case TCG_TYPE_I64: and_opc = INDEX_op_and_i64; + width = 64; break; default: g_assert_not_reached(); @@ -1684,8 +1687,15 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) return fold_and(ctx, op); } + /* The s_mask from the top portion of the deposit is still valid. */ + if (ofs + len == width) { + s_mask = t2->s_mask << ofs; + } else { + s_mask = t1->s_mask & ~MAKE_64BIT_MASK(0, ofs + len); + } + z_mask = deposit64(t1->z_mask, ofs, len, t2->z_mask); - return fold_masks_z(ctx, op, z_mask); + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_divide(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852345 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1851613wrq; Thu, 19 Dec 2024 20:12:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXcnQ6pl0Obf/PrsEFaEsbK54V3tzyR2JZekZN1Uz2oGa8FoWN8RsMykwZfpmfoTptZWHeJcA==@linaro.org X-Google-Smtp-Source: AGHT+IFG+bKJ85HVrgjU9y8JD9+HF6/hZxcGJoI0niXxu5EzgxPz5ty05lsZfNUr8S8EHr9BcJJ+ X-Received: by 2002:a05:6214:2a48:b0:6cb:99db:bdd5 with SMTP id 6a1803df08f44-6dd2339ab75mr29623916d6.39.1734667920660; Thu, 19 Dec 2024 20:12:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734667920; cv=none; d=google.com; s=arc-20240605; b=J+vvPb7f8zqPPITpiNNfj/OyOzWFU1xu0vBDUYedqOkxMx0iZmKx+9SKtm7ymGNrNS 3oBL0CWhhDtskUJD7unJhYGoZ0cKgA/jjPRNH67P7q/Bi/UqH3Ov9KIDW86BDbH03eXX 3ZOSdCioGMZVXIgVXZx4xXwK/N/yDxZivy68guQrgJ8I70Lu/KHu8N0v+0hgmr/aut1/ t6mVYbvi7AOSpayTNX+7xFVj7cAHd0ozZKRXcybQzg+HwEgNqMwnwm1Fz0gzTGdBAY66 BWuHzVnoq5wUNkmUaI866Z4E5oi6KlA3+67Enzmlj/DuQTqWwbmoSkkN8L0grZbYDM/6 dgPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m5rs4vqPumew13A8ZSX+8VQdxJZqMApYfWlhr06K4Zg=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Oo9BW/WIBxP1QcG4zmM/szbifQERHdl+EY9mSUX8FAU8/5PFLIYzDnAU8mBYFJztJ8 EouqRcomajzQtBEBtqMYZtB6HAaO4bV/FLFTRqOYxnQRCZ8IAPi+k3R3bGiB2Jxwk6XA 5AZtzz8rgDbaDpjjQ+sNcjpev71VQ7YaJesd4QpyACYFJyNzUtN7o6EGcYt9/Hrll2Ri EG/p0fSvXpq5LbP4tNbJYa5UlsDFXRC7Im7w5vZbnLLQSaCEuOZ+3bJfhUgZeuflOcNr Nlpu7IZzlLOK4YRLCN4GQ35gIjX/0DyaxPhypEAu5GhvabaVON4E+PUluILcWeIxWQc5 UWjg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="s/rDZ9KK"; 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-6dd1824eaebsi30824226d6.320.2024.12.19.20.12.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:12: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="s/rDZ9KK"; 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 1tOUMO-0008RH-AT; Thu, 19 Dec 2024 23:11:33 -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 1tOUMA-0008OH-8x for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:18 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM8-0006JU-Mi for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:18 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2ee397a82f6so1398045a91.2 for ; Thu, 19 Dec 2024 20:11:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667875; x=1735272675; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m5rs4vqPumew13A8ZSX+8VQdxJZqMApYfWlhr06K4Zg=; b=s/rDZ9KKJbgirDDL8FUf/SJdmpdN3IOwpNEsgnA5Iu3NyqJhIwGBdGcpsH7Gk5BPe4 m9fNHiaMpyXKICMxYA0Gvk9ZLFkNVm8CZf0Rei0XnLgLcCe6eMjhzYFm+upUzpjk0Ipj k779AAwwP8N270KUH27yLLecmA3EvIWsgwQHnlfmboN7SQa0hGOpdWV4gJr/5TSypc5t FDfC0VSb+YEF5G2fPG9X8QkTsleUMaL5bmB2rDhPr8/S1i/X7VksSPrIzBjVBnqoK/S6 emOJIAVC0c+OkrR92td4s2080RPe/2UOzCfEuDFs3Hz0FamoSOkukVb5nDx2Y9dv1jTD UhqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667875; x=1735272675; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m5rs4vqPumew13A8ZSX+8VQdxJZqMApYfWlhr06K4Zg=; b=CZ4t7kLImjRbKO57wR1Mk31WEvOdZleo3bW3/ZH2HmMCk2AS4sUmCXy32NSR3h8eGl X2F9UMkHRqOBp5oi7RoUZHKJCZ+fYsahBofKM87CHxxyTuyHunjiiJanQE+Xo0ZsoBqN TMdPPgRspEeW1Px75K9v8yGcWEOzDjDaYsU4giOrqOu4n32+LP6Y2mPxJQ8TOCC/r+mD gac/+I/5uOGqRhtWugKr+5u7Ko1FuZVzKZdSpmKtAXYyP3QxF5LP5cP6aQ5DPg8O83FQ Z8BJS0y+mfbF7Hgp2UvKV942cq0kBoIH+np9dt1MNrpyLItgLcB3ntpkuLaduVfZHMJz IzSw== X-Gm-Message-State: AOJu0YzSH366/nP/BRkxVSYQ+GZ3UOiT3SJdoJLB7Wu6AuEdYhHQlHbh EpTM7XlVwBfz4V2NM9DVzV43e6rL4gF6qWKtq8z+vej6e9oXJvZPkVVQo0FusrM6g7EGkN2nnhd w X-Gm-Gg: ASbGncum51r/1jRK2mHbyHwyxds5r0HlEmS+E0Vm21cOCzVAAVbQx0cfqsyYE1YqAsp OQH5XFhaUlzU94fTWUMgDDB03dXdtY9Y91w5E5rjaEUba7BLYA7DKID/shaCnzhcEaTamUMuuay fv0HgDQvVbTZEP0uGTkWzDfNqYX6/jteLv6Aoeo1th7S1taCz6a3AH0wKukyb7iYlM9D0YmeRMT 9g263gcqZIDqVgtxMitUyV5c0x0OLv3rIDODosNcLfJOC1Gj0cgXH3h0KX34IM= X-Received: by 2002:a17:90a:c2d0:b0:2ea:8aac:6aa9 with SMTP id 98e67ed59e1d1-2f452e3ed33mr1988000a91.21.1734667875192; Thu, 19 Dec 2024 20:11:15 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 14/51] tcg/optimize: Use finish_folding in fold_divide Date: Thu, 19 Dec 2024 20:10:26 -0800 Message-ID: <20241220041104.53105-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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 Reviewed-by: Pierrick Bouvier 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 e4f68241ce..0ae96f34e5 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1704,7 +1704,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 Fri Dec 20 04:10: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: 852359 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852159wrq; Thu, 19 Dec 2024 20:14:05 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUwy60N7ZLDadT3yxats8K/98vaHmMBhl88nDP5d3wS2FcLtPbagJmb2UXFFxH35M9JgC9fzQ==@linaro.org X-Google-Smtp-Source: AGHT+IGtySNqv3mZUIOVrDMR9YYVrVgEObUae6GtIGWJnH+qCWI9PCVJCTVTaaMbfc3w7nOw5gDk X-Received: by 2002:a05:620a:24ce:b0:7b6:913f:3df3 with SMTP id af79cd13be357-7b9ba83650amr271825985a.47.1734668045041; Thu, 19 Dec 2024 20:14:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668045; cv=none; d=google.com; s=arc-20240605; b=W4exSozUgOTrBkItCZp8wAGX0aMz+aJqeuvLFJ2d84xTg+o+e6D4WnMwAKv9hyh/G3 B1E8Ie8O/2A6fCirLm7I/oW9MNgFyrIabGXClC1cNo29iD75BRFMuv4TWs5HeT8asyZW eUFL9FuUGGBcMDFbA85atRCid8LGErMBv4Ywfx23TTjt+qL02QUKTTNjoX3vnoZzeOp3 +sc91lw2wzA7RSXReRjRbKUvCGSx2+WlDwl/fkSaZb9mVVelpLly8OiMU/1vAIMR0IKd Vazeaf5V+ReeBsqkJV4uAQdL1DMg73GM25UcM+i/Sf2RIVP5McNPp9PqVptcT6AhaPuz MOEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=prpZjgFsa/vChv6dl20aQjC+mL9aG1wh+Y/YSCIlCzQ=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=VYlkcMv8hOidz5LvJ8VDt31uDMAt00q+JQRVEbLBR6cIHDzAlI0GanvrqR/ooPQe6z HSmePXdUxiN14qWLC5GxnxttqAFPDmQO7JalDJkxADGZ6CplIcGVFhI7fZiIgY92gqvw U6/hDSmT+dMDG5TlvCjfxvR8EVWT0GtpYQOhZueck6KWoCebXVIcCslBYIt90BOGwY/U lUoxBExDv+AJEw6vszJsu1HhKlHQcjMCO8uF1hmVRUBdH5CvU6QSqxXdTSKzkT0+/JAd relsZdpH/miJwbxi8PhJ9vIOQVUxa7AIFF46c/fdKATdoYMUKdQBFTk8DBEdXGSAxY9l vJmg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=xoH+6XJt; 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-7b9ac4face9si320551785a.555.2024.12.19.20.14.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:14: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=xoH+6XJt; 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 1tOUME-0008P0-Gz; Thu, 19 Dec 2024 23:11: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 1tOUMA-0008OI-IL for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:18 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM9-0006Jk-7v for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:18 -0500 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-7f46d5d1ad5so1069668a12.3 for ; Thu, 19 Dec 2024 20:11:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667876; x=1735272676; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=prpZjgFsa/vChv6dl20aQjC+mL9aG1wh+Y/YSCIlCzQ=; b=xoH+6XJtGRf9SyAxg+nTYlG0OmcorQR4SdVcPygihM+elcZh7KujXZEujWWNHsiWi2 dQlhTLRp04N8Ms/C5D0n2jW3MKe6m1ivF/1nF6hpp8bjil9ej1SJAvV0tYEAAMZNbVlq 121PjHSeLJgKyuv1HgbfD3V+Vf8cY30hwPUBiyQF1/RFkCZtTWf/bvulxul2irV4flr1 BFXX9SKTS3MY6R7LsFQVR02DpqussF+dCAYJNXuzZ18AzByAOKh02Y4MxIW8KVMS8639 3YE0+MvGRe6XhgBdATMsGuNEBLhDf/qV1zy3PddLiUXnAIKnL3r2sZZFS0HKUeULolAa 2/jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667876; x=1735272676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=prpZjgFsa/vChv6dl20aQjC+mL9aG1wh+Y/YSCIlCzQ=; b=I1tzgHUv69NGdo6F6hiIi1ehvWHt4lGySO1TR5gdB+K+PgiibBFRA4DbyOdZMlPG72 I+8RCqIMLzrRiL57rMSKEHH1NZfniNjQEauWIbmM+4Q9kaxcSORtby2rXxo/Ng57bVAf yFZf0uM48pu1SzZZPejl48rhBuOy1e7BnenSfbeKwMXC295JuEul3B3wWEPQG3E3yJpD HRNXClfsc8mQdMNq+o5RKaKjcxit6SwscVXuFJwN8fUOngBbz8SVCceSiQl+2RNqh/qS uzxaQPNuRSU2XmhuxXfIIwWtmQEde9y4Dteq4mmEA2UQ2gjhGZ44jgkAjZrEUmCvDRvE 88Gw== X-Gm-Message-State: AOJu0Yw900hcrmAXQpRMMa88zhkr5gurE38u0RWCZwxzMnecru/uVQHw 77XTRDumrJqGpTuEBAdpMS6iLjR3kIoxkxSUxRQTH04F/CaD51LKPDAYY2i8O6i/YlErGjqIw30 M X-Gm-Gg: ASbGncvNgDRfsU1WisTLwH5S8MhVMYYLaRryypnKz/voozabuBrjs2AYMFopqnz7RM/ KTPE1JxUGtGc6g0RxZhBx0ieWX4m/beSzkjHfdNZm2+MnvrLpjve6QsyKA4h3hBQx4xRz7o28Ti ZSacBW29NNL/VyTmXay7rLAU4amMKlzeTtXAckbdBa+TeEJ9yy3aXbdzVlJ3iuLwePw3MHWxAuu IKRrrfrOiQrN0meaYn0zeHBHwayTtRJ8axD69x09XJhJjg6urxByAWlCuJfwdQ= X-Received: by 2002:a17:90b:520e:b0:2ee:b0f1:ba17 with SMTP id 98e67ed59e1d1-2f452ee8cdfmr2337945a91.37.1734667875875; Thu, 19 Dec 2024 20:11:15 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 15/51] tcg/optimize: Use finish_folding in fold_dup, fold_dup2 Date: Thu, 19 Dec 2024 20:10:27 -0800 Message-ID: <20241220041104.53105-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.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 Reviewed-by: Pierrick Bouvier 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 0ae96f34e5..0232fa852e 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1714,7 +1714,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) @@ -1729,7 +1729,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 Fri Dec 20 04:10: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: 852390 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853713wrq; Thu, 19 Dec 2024 20:19:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXaB0rAxEBqJbQ4RVmzyJD00mV4juBe9E8ZgCoKu8tAi0cFGqfccbhnlHW12I3aH5PUo8cyew==@linaro.org X-Google-Smtp-Source: AGHT+IFhGp7t5fixEq1gSVrvYCF8VgdC26/Fj8liY93rrvxj/CQwu9R/mzYzRR7Od1RGjX4lAxSy X-Received: by 2002:a05:620a:2697:b0:7b6:d350:9bfc with SMTP id af79cd13be357-7b9ba79b50emr260919385a.27.1734668364950; Thu, 19 Dec 2024 20:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668364; cv=none; d=google.com; s=arc-20240605; b=eVKk8/qJuVtAlQtJ6gWM8vAQQUOwvREwFMr1UhDFFkTViYMerwcWXNXZwt6RLEWTHu zrRsBwLKh3Qmal++NKY7OIOevJUXSO07Rey0PWc0OLvavhuRifZjkSG/BrlkJ4AWOmFP gqvwtNKuxpe4ATylepw4JNmpqadF0pxo8tJaM85aCvw43MBPGifn7ED02+DijRQoixYX 2NvVVMqQVqFWWt7NnOVxI41mz6KFxzNytpnoCrKhKwsGvEqbcXFl6Fa6Px5UbVteiI4O 55TQV4LK53mj8Vqowa6lfF+C8yhMl3OXf9w5Q46s9JE763IBlkudELpH6NOKQTKTiUSF yaAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7nPSOr42G4L6zld5O7HAmbijFDz7S6mbvQ4Sk1BkFg4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=NcmurNIEwLHiCGu6fGE4A7NyvmlSfPEW4JK1puMeLsFP0lwNHInankArvnr7CddvUh eA/aTsrXxGsKGEZe6OtNFbCX76c3z92HdCCEXMeB636IXzgeDJiOyQNB6dQ7Y+hjo8AO eWkrlcW9pxS29KKVP4Ya5hybXrgS4SFnjtRwfrz5fc7lkimcgPQMMwazZ3lFXedZvBdn 9cT0xeAdvfP02nd/x/EVomYEe65HUBa/7aMUF0NP4yhunIeZ+/MIDIfA5obvCIGxOmLd qU2tpDE4PjYL1j0WJytqFqxXMkMeZfbiJb80J/KRT7go0qmrKwK0MaQZdeePiAyb4Vpt qyuQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M4Vlu4PS; 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-7b9ac478d78si321511085a.276.2024.12.19.20.19.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:19: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=M4Vlu4PS; 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 1tOUMQ-0008TD-47; Thu, 19 Dec 2024 23:11: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 1tOUMB-0008Ok-Pm for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:20 -0500 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMA-0006Jy-3L for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:19 -0500 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-825c6570a80so925244a12.2 for ; Thu, 19 Dec 2024 20:11:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667876; x=1735272676; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7nPSOr42G4L6zld5O7HAmbijFDz7S6mbvQ4Sk1BkFg4=; b=M4Vlu4PStqhW/b02tje/lBg6wC/P5EsJIP7d1KTIwa8EmhzOxGR5pwPofKJ9EMI8wu YjkgCfYOoVSTqNJieEFq7il+E0dACA25XyY2eofFAKRrGWLqDtZEsYYzEZe5a/YPAnuZ uXQF7og/lJRpJPlJq0SpvKX0vVVtNKt8PqiPphUFxwX7u9yes5PGLBtfV+r5KDkvomy9 iL4rvRyjqDr42/iBKQdScwNp2WgMffCGuaH0T9flRgtN4qtpa8D2ZwXdGrQ+EAVA2wlH 4v65tckcDfvjHoz4xL8DtlVq52B8R7HVKOzedeB26L/5hGODtEnpCeU6eoEOB9R/Qzd/ Znrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667876; x=1735272676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7nPSOr42G4L6zld5O7HAmbijFDz7S6mbvQ4Sk1BkFg4=; b=sUWh3XIhXPad/WAORql9eqeBA6iBYE23k0yV6IdC8sFvUYO7h3DAIM7f8qdqKenzbx wX+CpYzzIRlPaG/nxbBi6juLgnxvS3pBqaYAuwlebN0RgJi9nPEG3vLgNiejcxblSVmG zFULjpL/arEhKb+tQ1OqF91mcNavxDwwda3NiJY2/1JaiwjbrlT+XaMyv6/TJITvGIMC qyT9Q7B4NqdL8Xvg7SpVn8Hg0ZdKKovP6LuYLm/ZUuXhxukQcZOSt8pUrt3FDB7XGoNx ZIO1WnqVKNdFOQ1XU75Tjd0GRvPh+llgKDnTiccCqhPb0YOWKvhyI99utb8DbRdsI8Mg 1F0Q== X-Gm-Message-State: AOJu0Yz4uDa8NVSFyzZ/ihJgr8L4xGDLvhArEDuTXqXbkA4k0W3Mwsro h2SwFCSZspQFBiQe5k9hGE4efQVCCv8S6juGSqifeMTn0pYkuc+9s8ERB5GFLptp8kjqkgOnjKp i X-Gm-Gg: ASbGncs2pS2jp7DSiaQphK1VsxNrW2fogaNwJ5AiuLUT8U2wqEOrboVA+wyR0zuJ5z3 Jspqf3ELQrzXAWW174LAYc99TCJwFaQkF/uc4RmXSHRIr3WhRvl+9K2xCuYbTROrZss+h5R/p3Q 9Z6V5ezd4hrQ1jlOrxRGuTihd15ygIONhuflvKJo/M3wYSS0CWtdGw6mXsUl9HxTqRtEguC/CEi S4xjh1iAJ8/tJwtp/qO0SY4dsc+0cjymoRnR50nv/U7lPnxPWMwtQ+RCls311Y= X-Received: by 2002:a17:90a:d646:b0:2ee:ab29:1a63 with SMTP id 98e67ed59e1d1-2f452dfccb7mr2109201a91.3.1734667876601; Thu, 19 Dec 2024 20:11:16 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 16/51] tcg/optimize: Use fold_masks_s in fold_eqv Date: Thu, 19 Dec 2024 20:10:28 -0800 Message-ID: <20241220041104.53105-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52a; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52a.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 fold_masks_s as a trivial wrapper around fold_masks_zs. Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 0232fa852e..56043a02e0 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1091,6 +1091,11 @@ static bool fold_masks_z(OptContext *ctx, TCGOp *op, uint64_t z_mask) return fold_masks_zs(ctx, op, z_mask, 0); } +static bool fold_masks_s(OptContext *ctx, TCGOp *op, uint64_t s_mask) +{ + return fold_masks_zs(ctx, op, -1, s_mask); +} + static bool fold_masks(OptContext *ctx, TCGOp *op) { return fold_masks_zs(ctx, op, ctx->z_mask, ctx->s_mask); @@ -1734,15 +1739,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_s(ctx, op, s_mask); } static bool fold_extract(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852344 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1851612wrq; Thu, 19 Dec 2024 20:12:00 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVE4Z9BGqKvCQFcfqwgMmJWi1wJFI9dhG1ARRC93aTX3Jw4nDjLMuQf9GgArk11+281uyJvNg==@linaro.org X-Google-Smtp-Source: AGHT+IE9/2tQCmY/kfIUrWqe+I4qSQ3wV2PzGMwDIYvmbhRyn/PueM3CuXXyfbwrZJM3iF78+XLy X-Received: by 2002:a05:6214:f22:b0:6d8:b562:efd7 with SMTP id 6a1803df08f44-6dd2339b860mr23909686d6.31.1734667920643; Thu, 19 Dec 2024 20:12:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734667920; cv=none; d=google.com; s=arc-20240605; b=g7Iz9dd0RyBicW4Syn3PQk9eCmtoqnMV4AlV0t8s+paHoxUdhqd0PLwQm3pfpFH1o8 riIguxCGeNhjwBH+l0zCox35f5EK2CDj3upGYFSIEIoLWo6vXuB1ol4M/M8MEyNnvKhQ 6ZxIhHWq2KP0ZTHD4aDvCjNd7IB6c8MuvXtgPLtG6W0aDPsfnRzeLdu2EB3xE6b6gDDM QdYkgwbLwZcSkn7tw7Ib8YGv/hBbEf3ef/StKY04TWdCGUaTztwNK4W+UxOz+NbdgSQe OKHjnMYwY7jI2KlkryKE1BJ5GJerWluP7YFXtwEjC0DETO+BlaA1VQgBXBwmlIkDthkc IYGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pYuC+YHXS7R+2bMWumhxixewSDDRoEnZD362H6THvd0=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Vtve19jAJE9ETyKqLDboRbkMLVQ3GPKyeghYba22Sh52CQtKp/dhO/5hjowsheEWER DYirxvQAg4EGpsiJ1n8VNB81JvOVfIwGjzAQa6mkYnqIgiDxYL/5dZpLj4zNl1b1zrpm pvitw3xSOtgfQlEkw1CoZhAeywit3bwG3keilgUlW8PCzPW3Nwvq/iND9ktzicq77tra XBT4BuPKAD0hGZIqgBp3b1KqtaX/+zAkTwT49S6tMXSczEDrOwlns1nFNmK/wrDUxGsL +3R9DQYpz18ZF1cnm+9d0tJLicDMHIM2RMTuxC14G8tMGP/KsgSuy2bMgn/+sx5vuiKQ 1jqw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=T19GeWlW; 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-6dd1835b29dsi35085796d6.426.2024.12.19.20.12.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:12: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=T19GeWlW; 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 1tOUMP-0008Rt-Cs; Thu, 19 Dec 2024 23:11:33 -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 1tOUMD-0008Oy-0v for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:22 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMA-0006KL-Uj for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:20 -0500 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-7fd35b301bdso1245588a12.2 for ; Thu, 19 Dec 2024 20:11:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667877; x=1735272677; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pYuC+YHXS7R+2bMWumhxixewSDDRoEnZD362H6THvd0=; b=T19GeWlWwO+8frr3L2RM4FGFtIb2S8RldA8yT8RlGx8IQ7vCqqk1J4l0xdnQmyLOfY Xczxrw2FKgEdZzdYGMs1Q/1OWTuh2xlBQJsIpPNC/tPUNSgcl6Pp+hGBj8XnZLPZKz3H 9PezAS+iUL6LE8fE+HFe8cXWQ7hOn8FLgY3yZGCOySPrirp8EtE0+SIbpekTV7YWGzSa c9I/slwGF8jvQr+9mJ4z8McL0kmw7NTY58SNuPNcZLfGODAsET70IPENj1mZVYMLGVfF 46g/W0rDTks6tkfnXQGhjETvtDSwQHcESe0Gm0Gc/hbUu/R5DUtnenjoIOZrmiJCCuHl YSKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667877; x=1735272677; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pYuC+YHXS7R+2bMWumhxixewSDDRoEnZD362H6THvd0=; b=o0lD4SV9D9F3EggvR9YSj7dWxUcaP4TpFxS0giQQKRXuwAisQDCOYa2nTbtOI10wfo Zwh+OP50JL3NMFL8t9sA72mGjzU35bRFVeEuz1PtAbC5Z2g9Eqmi3aBm9C42IIRUst5+ 9KeT/PyqYTC4d9jLWLAko9bKwKzI7+VDq7FDUsRYgkjGAz51UzhIUrg934Wi8yXpPbIP AP+1shaQaW+rwuQdaylAHLsYbFCavusu3v4cXXoR4ppYhoTwPDrHG+h0LjaEv4NnhSd4 nx4whfCYdBIhEROZvSszQOzRPYEuE06WcEBMCiWoOM30GZ6vvLzYGxnqq3zC7ILhLFkV BOPw== X-Gm-Message-State: AOJu0YyqGefKEXOiCcEhCzmr2ZkleiOTwMaoON9SEN7Ad2ZtJJM/kgAa GD4Yh5gvBxNYzJMO2OxKOBc9gI3Ubl3Iv3qCp5wga+mpo/En5nwbPYBuy781qK+kxyYyWl9qGVt f X-Gm-Gg: ASbGnctl4dImm9AGJZi6Fzzc6hshF6v0lJJQhMxk2eACRL/O6Ve4YvK/CPSK37d8NXV g5nln4l0vP2HoeNnYlHAYKm8y5tkJgH7DEXX6rC68jCFm4Ik7Am92S1fdbJ71oR8uI1u7nVgj3X 9g5MH5AYaBFboL/JE28BzrRrVusr3GDRncrrGm5SX1AUJGFQ/WqlRu+DZptUsmex+PZHsR229b6 SG0sgbcn8xOue9k29eu7jTbtzOTSMB+btnBtpe6j8Ep4XM1EeXiHqIWHCN4LaM= X-Received: by 2002:a17:90b:2f45:b0:2f4:434d:c7ed with SMTP id 98e67ed59e1d1-2f452e1cc5cmr2464537a91.16.1734667877385; Thu, 19 Dec 2024 20:11:17 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 17/51] tcg/optimize: Use fold_masks_z in fold_extract Date: Thu, 19 Dec 2024 20:10:29 -0800 Message-ID: <20241220041104.53105-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 56043a02e0..6f7166414f 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1755,25 +1755,22 @@ static bool fold_eqv(OptContext *ctx, TCGOp *op) static bool fold_extract(OptContext *ctx, TCGOp *op) { uint64_t z_mask_old, z_mask; + TempOptInfo *t1 = arg_info(op->args[1]); int pos = op->args[2]; int len = op->args[3]; - if (arg_is_const(op->args[1])) { - uint64_t t; - - t = arg_info(op->args[1])->val; - t = extract64(t, pos, len); - return tcg_opt_gen_movi(ctx, op, op->args[0], t); + if (t1->is_const) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + extract64(t1->val, pos, len)); } - z_mask_old = arg_info(op->args[1])->z_mask; + z_mask_old = t1->z_mask; z_mask = extract64(z_mask_old, pos, len); if (pos == 0 && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { return true; } - ctx->z_mask = z_mask; - return fold_masks(ctx, op); + return fold_masks_z(ctx, op, z_mask); } static bool fold_extract2(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852371 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852890wrq; Thu, 19 Dec 2024 20:16:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUaTYpWQYOGo7cELgCEGC2HuuVV45UaVXY6J44XoB7N/M83MexkO3Zlgn56yUIz5OuvKU1N6A==@linaro.org X-Google-Smtp-Source: AGHT+IHK6AIPHJl6TD//ne9OQBzQDNwhtCOjIGLastDMiZZfvIfj2W8f0rhF4V7M/1s9S8tO+xdw X-Received: by 2002:a05:620a:459f:b0:7b6:db39:46c8 with SMTP id af79cd13be357-7b9ba735352mr223709885a.15.1734668189888; Thu, 19 Dec 2024 20:16:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668189; cv=none; d=google.com; s=arc-20240605; b=gCQGqktTSpFFKEaX95NItli3ahxUd2fHfWTXW7b4itiEVX8g3FRqpafqPKeGh2S8rX sEov7QYhOxtZ7D5q/2c1r4advupYF5HAj0pcYciWxDFquIRDyAv9rFW5pNL9RMuVM/Ll 0VQ9wkG7gMlLeixcsI8xLGr20NXeb6Tc0S2IbbbTiL0jvLu62L/7qI3D2bGpzdpSdMIs ilI+ZH1mTA2ny67c6GZQzls4l70kWn09vRgdoZWbCjze16Qr6zKsRQwq76rwAezDmhuQ 4N5ZTh2ckKS+LX1+DiOB4eQCHnEZ6VTvf9Zh37w+gJjE+QOvu7B/yu3iM/EJ2T+UICVF 2jsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=m3AWL6HxtV2uFTdmZozJUF3KalTOisLiJ8sjQ5ZB2Vs=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=dpdpj6r5iTGVgzqk96whryZ04NUziviYEsQTixD+zHuY2OVh2PId/vStTPsGBHsBOn BhFFwa+bts3Q28MKAmOYu3TJ7ww9W8GWK2H8Kl4iVyFRCWljHfweIiYA99X+1tDnu3+A M2Xucqp3q4EB6eS8d7BE65AZHKZY79629Y4rJSpix36sxpdeot3p6UjbtF464LIyd2CA JT5nd6Uj5WWwfjMb68xmcHr2Na7bGO9gNyu1mxP61Jr4oZfEk2r+3UgKI6CkMxWAq4k8 TSGPDreKKWCJ3HMl/Tw6jw2DC96xRJdRWK14w8Qix9irSBGP8mRydSTZGiYabXnF91U0 5p+w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=scUzPaIS; 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-7b9ac2ad73asi300130185a.90.2024.12.19.20.16.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16: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=scUzPaIS; 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 1tOUMW-0008WN-IR; Thu, 19 Dec 2024 23:11:40 -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 1tOUME-0008P4-Dj for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:22 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMC-0006Ke-Pu for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:22 -0500 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-7ea9739647bso967896a12.0 for ; Thu, 19 Dec 2024 20:11:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667878; x=1735272678; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=m3AWL6HxtV2uFTdmZozJUF3KalTOisLiJ8sjQ5ZB2Vs=; b=scUzPaISNr7yqA9e0UJGGEfGGJSbhYp2MVgn9Yynjy337Q1Cvjhm/WDe/TKJsYDdpX 5qHUoYyrm8duvN2OeuuZOJrtjOubR3K3s9dxMP4o86GjupFkpWHXBS4dTaUSyhMDEH5i YMrW7eKoPlJb8hMwosTxo3y8AOND1BnBFw1xli8Y19q3rAL2n4+wIaIT/UYIeYPHt5Ir pzZADyvJW7ZUXeyFmvNHq+YvmILnq1hKItQHQ4K06iP5E1QIixn8UOH/enpLtTv1bufE hDaWAhrvkh9lT1IefV5WsHrfD/MxpvygXVqqkyrzYtXMQ9pvhChVeKiUHnW3MFjVZe8R GAtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667878; x=1735272678; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=m3AWL6HxtV2uFTdmZozJUF3KalTOisLiJ8sjQ5ZB2Vs=; b=JvARlqc3oQaRKkZzBs0BRToJX08/XoOl3X20YuDGX6WZ2frIRonFBcPFFGYDuewxOQ oEdCFF/qFuDYjJTxMCw5PI8BpNjdmwoteC9meH419C4Grh9SOUxvEdkTnHPYdtgthgQ7 tzfmDebzL7IWuZLApiqO2COJcelB1ayDBJKw5Wmc/7iURshll4PAwD3Jy/GPuZEJghUN xfroJSmrOkwYQl7vuQJ1YYgyRcAPuTxT+aDXWCvROECZk4gK+gsdYBnhkJCaTj8IXE4u xbL5vn7MSKshioyEiz7gORIYC+UQdVE2WHQran34dtSecChCM/pHBq/0Cqq0yry7foan zTHw== X-Gm-Message-State: AOJu0YzjPv9YghGSQWvACS3MWKBqoKdME//QORqU1lJcnSQ/m6cMHAQZ 5ITeB7ajcDQ6tMJRxD0mXMFRLfztRDVhEvPzGB7VBJyF8h4hXievUEfz9N9bNvCaRaKxzSBBw8u k X-Gm-Gg: ASbGncvYBb7JxFajeK7TXUc3JXhVFQMytf7keai99A/COei1nl/TEnxBi78MT8r9LOa Qh5jj4Fgd8B3pmT/4s2Kobl9b1wU1a3SMKVfPQFmZnutd7VlgRvOmxKa3/CmjBXMKmP2wG6qaxA 2Rzmo/5SeXj/gB70qlWo/R+rpuR92vEQ6xfC48NZfbEm2AeVaso6LMssQMzRSMnXB1lN7Zo27Yc f9scuj4u4qOu4jB9hNsu9bQxgDAbKpKaGkGdFMeiyTjmwHAbo18m8cb+xTaceI= X-Received: by 2002:a17:90b:2e4a:b0:2ee:ab04:1037 with SMTP id 98e67ed59e1d1-2f452e36956mr2448055a91.17.1734667877991; Thu, 19 Dec 2024 20:11:17 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 18/51] tcg/optimize: Use finish_folding in fold_extract2 Date: Thu, 19 Dec 2024 20:10:30 -0800 Message-ID: <20241220041104.53105-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.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 Reviewed-by: Pierrick Bouvier 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 6f7166414f..30bce33ca6 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1789,7 +1789,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 Fri Dec 20 04:10: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: 852377 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853010wrq; Thu, 19 Dec 2024 20:16:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXlBZoteI1DBzaRpSXyfXXxxg7lj2QL9r/1steKll/+nF1X6jgDQend+rXuA/0eXJ26UF+duw==@linaro.org X-Google-Smtp-Source: AGHT+IH0wmX1IEMIPE8eQzjcmZFp8gNdujgTz6IowCy4wmqj7/zbZuyJ7IYXnlVOQAgnK9tYp0P/ X-Received: by 2002:a05:620a:3193:b0:7b6:cdd4:bdd8 with SMTP id af79cd13be357-7b9ba73a8b5mr237109685a.16.1734668209099; Thu, 19 Dec 2024 20:16:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668209; cv=none; d=google.com; s=arc-20240605; b=OYcuO3gem2OPXz/0w4JILg1uAJh+TKXgzBrNR7IzMzfMsTTCiJfuh049fYSHbjWFxk Fkf6Qkst87dYRzWNvTVSX6gUwz3sZdXbz6X4Mr36ZWF9yuGPpHGCM+cBX+wCOnwuhFrQ wAQqfYhlaDavmTq1ESfH6MxUoslssNw5i2HjoY7RU5PvTua/+c5CeqS0yky6sftLCTMt W78sEmsy+yh/Qsy/QgB6gGy+lQKICaBCD4m5E1uQoJwndW7tKaNzvQgUv8eakZbAyz8R 9Adoa3eAxD1XcLeo284Urihr5KgWmCBH0hgFbOp+s8TTOwtgjUofjKgsRgvj1BH/99WF zNdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3uGMa5ilZclwRxAxELWf+zCLQJhdJ3SzUWO/11Vp97M=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=SAsv85fGTQD2ouyuzitcqru7hABsYuVT20uHKIX1ocyKfN2PmwB80sjIHWg5adO99F 9SjrsZ2jTXUAWL/ej0V2ol61IDAPG7DvtpWtG9iz9c9NlrG7cbg5RxYdmhiyeXduN+JO 2x9KSxIULe8/S19S3xjpjZtjH57PoHzzOEJcVRa2j/qp+DoUbkYdKzF8B7rGTa4GdoRy TIMS00VVuTEziz5hngWxJv0d+3azJoRVDHFPq25LR8dQQ+XwtzlSOthbRQoWB1y/tHNg uX7Rq56Uhe4VGO8N0n7KlH80QsfNppTOHomvZQu58m/5I7BEGYxOapOD1T7qHj07SYjs corg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PXBak6qE; 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-7b9ac2ad964si323515585a.50.2024.12.19.20.16.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16: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=PXBak6qE; 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 1tOUMT-0008Uy-Kh; Thu, 19 Dec 2024 23:11:37 -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 1tOUMF-0008Pc-AS for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:24 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMC-0006Kq-QD for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:23 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2f43da61ba9so1178865a91.2 for ; Thu, 19 Dec 2024 20:11:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667879; x=1735272679; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3uGMa5ilZclwRxAxELWf+zCLQJhdJ3SzUWO/11Vp97M=; b=PXBak6qEcNBrHs/6j008BNxaJEoUumNiZCLxrB7UYXIDgkHQPdZSUYu7liAlmn2Wge khwghgFDSGynujFDg7TBE9JUvKKNtTI50F4m6gtHerHd5vWFeEIJ5XJGsUH3Me7S44xq csir2jUT1y6Fusl4LmQpTWHLuWqrPbenGH5juHbJRYDtkiwz8+GPhvnHJ0jawf1pG+bG jiBIQfzN6iAL9lSMlVUyW71CG6D/vFvVyHnsQnGk3OetA3d5BANaqnfKTcW5Um6Ez6Wi pkOHILpnvpFDlbgbqH26uQ5CweAomCVleKdKaXDgRN0EzUUpjtSOHFs3c25rC0aUCED+ 5Eng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667879; x=1735272679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3uGMa5ilZclwRxAxELWf+zCLQJhdJ3SzUWO/11Vp97M=; b=Cst6efL0qXoEzUdFXTD0LYxryTOPlbIhyGI6x4zJkO4nYI6mS9GwVjaDMrEayjWA3V ZNqmkvZJVU1t4WxHhOMt10XFzdt+5T7qOgAa3yEaPhSLDmEgybu4lmPscvlKCaffQI8J BJhr2UolzIpGoVw0ZL2CFIXQucvzC22JUEKMIRBN6uBik0lkXPBgXSwvFBZAKdo3GWOQ qKIz6CIkv68pZ5eXjZFFEByY9MCixEJzg4KtgOx5vDESqSEI+CZpEjwLFeJBmsa8Uc0Y 7JuGlCoIQH5/HIEYQVOrrixeW8ucHfiHoB9aiGVq4OB5EMYyqqqa5jHkLWXvMWrithXG Ql6w== X-Gm-Message-State: AOJu0Yz6o13xFPaVuG/QwjU4mqk5W9hqsRuau/jQm/Sj22n9eLHX7uWn I5MO3sMqu1TGZJ0L+bQrCoiNG6ELsmNQswHR9DVZY2Os9U+yYDhhsl5ZWweZ1XNJXiQt4fMndCE T X-Gm-Gg: ASbGncvV2D6faCPU9IfvRBAi5MrEGzQl7meroLqTceqUM5mdO47L3CIaCcWlOTNSdK1 87K6/pkUx13FtKFzp2yZ5uW+XakRJ80IfY0LIPe49pJuFpjv2BRBfeapliFkOccVOkzL7BEOjHc 3bHN2/EXmd2GFLCO3OQyAkTdBpetoWQhsUfyty1R4lKHoRmwGxMw51gvc8Bs/xQSTv2KoGKDJUF fZR0wY+8CWYISbrN4gTSaX+N4joxzm29buR7QEEu+qkTi757UHSm6VifruUQMU= X-Received: by 2002:a17:90a:da88:b0:2f1:4715:5987 with SMTP id 98e67ed59e1d1-2f452e1e7b4mr2348647a91.9.1734667879112; Thu, 19 Dec 2024 20:11:19 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:18 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 19/51] tcg/optimize: Use fold_masks_zs in fold_exts Date: Thu, 19 Dec 2024 20:10:31 -0800 Message-ID: <20241220041104.53105-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Explicitly sign-extend z_mask instead of doing that manually. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 30bce33ca6..659190dcd8 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1796,47 +1796,43 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) { uint64_t s_mask_old, s_mask, z_mask, sign; bool type_change = false; + TempOptInfo *t1; if (fold_const1(ctx, op)) { return true; } - z_mask = arg_info(op->args[1])->z_mask; - s_mask = arg_info(op->args[1])->s_mask; + t1 = arg_info(op->args[1]); + z_mask = t1->z_mask; + s_mask = t1->s_mask; s_mask_old = s_mask; switch (op->opc) { CASE_OP_32_64(ext8s): sign = INT8_MIN; - z_mask = (uint8_t)z_mask; + z_mask = (int8_t)z_mask; break; CASE_OP_32_64(ext16s): sign = INT16_MIN; - z_mask = (uint16_t)z_mask; + z_mask = (int16_t)z_mask; break; case INDEX_op_ext_i32_i64: type_change = true; QEMU_FALLTHROUGH; case INDEX_op_ext32s_i64: sign = INT32_MIN; - z_mask = (uint32_t)z_mask; + z_mask = (int32_t)z_mask; break; default: g_assert_not_reached(); } - - if (z_mask & sign) { - z_mask |= sign; - } s_mask |= sign << 1; - ctx->z_mask = z_mask; - ctx->s_mask = s_mask; if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; } - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_extu(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852353 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852080wrq; Thu, 19 Dec 2024 20:13:47 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUttKEti+AuTxL4juQeuQIIc/9Kr15LB/G3tyqlZ3VU9MDAVhy4H8jMarwLi8XJkLAOrFKJMg==@linaro.org X-Google-Smtp-Source: AGHT+IEMh27xtwgQAPUXrkxjnwrUI1lqqScGsmDMhZI/2+Y8i4LGfylqqcXqEZz9Tlu8j58M68g/ X-Received: by 2002:ac8:5f85:0:b0:467:67db:ef7a with SMTP id d75a77b69052e-46a4a970269mr29871881cf.44.1734668027254; Thu, 19 Dec 2024 20:13:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668027; cv=none; d=google.com; s=arc-20240605; b=fG28NO/z8wdFZVH/WoALCJCWKMQL6mAo32J79pvJXxn5dnB/uLCy/VGCmNyhgsTwlx SYg0Xp3TceYc+6HywON5hZSdyiWySOerE3bQbU9K98eRv8qTrMeezyyr2qBQXlnwNG6x FVpOKRYH77BbNG0INVfirSmJHX17u1mdj3MWzgcyKWxTre51yeuAiPlbby4UwJJL5o1v JI6mxX3UggBO2vl+NWaJpwNjy5HqUQ0jgC2L5Srdi05yZakEI3GNBb+SPjpzcPRu5ZGu CsLjFiUovHr71VMn/kwhJHjMMNR8VMjgo+gCIsHNtc3WY9eoQMFyj0bOw/GpspJSb2HU 3DMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=c/ah1dWGqejqWrs6MT+NkiuxSvH28n+inVu2cC1XbF8=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=PVVoK+gMvDSoXp7mJ1jT7vDn9JKFTWVYJVH6MRbPN+q26WXhMSgMjZEJRCZTLJKbFk SNci3VhJqiHGNcWHSAv9ksDF1xdi4K++aiP/KDnzc4FcTyIxoMn22R/qUHway97CX40N AAecYavQFHhtUs5Yoqwww29Ayr1DyuTe0KT//ibdF+SCVmMgub1cwK846wglOHWKyBD2 9fsfmdIqwo3+2ldEyAQTiiSO6NxnRdpfC4Z16hFn6E+Q+IFxSzbj2GY4yfGt+3EXi8z8 QsRiM1UUropzO05M7VS+XNA12ron2NnhHD7OyHHf/g/ybtmWC3CJNN8hjc5bUnhXf8ct yqhw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pPFas3z2; 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-46a3ebd8a9bsi28693501cf.599.2024.12.19.20.13.47 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13:47 -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=pPFas3z2; 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 1tOUMS-0008Ty-Hk; Thu, 19 Dec 2024 23:11:36 -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 1tOUMF-0008Pa-9Z for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:24 -0500 Received: from mail-pj1-x102d.google.com ([2607:f8b0:4864:20::102d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMD-0006L1-99 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:23 -0500 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2ef6c56032eso980322a91.2 for ; Thu, 19 Dec 2024 20:11:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667880; x=1735272680; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c/ah1dWGqejqWrs6MT+NkiuxSvH28n+inVu2cC1XbF8=; b=pPFas3z2KDvEOYTzIqa/ZJyJkaSOJvyqDPmo8+7t1P9P+YjkGDJHVO7DeO7fA/qM+/ VdgRKkZQIV0kqflrx/OVkmbPnzzXRwOTrUHNm5gOjXAPmTObE7IUz8OOXJNmdVEeOSEv FKTKHYoCR5Fw0zbC2No88L3SRMJTesVRMPxpSeTm2NfuSAGkw++zeo9rFaGx56mmR0Lg UCARvv13ZOf2vQd0H3Luij1ZQe+ZV2D5PyJeI8tLGLmQR9ZH9BmsT3rvWGYIE3ZCsDFh 8VwTQMb2DAxnGNFPu9DKg20TyDpOwBNAS7qLaAkQb3ONgBy/Xi78wgM2n4UE6CoN4JDp pFEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667880; x=1735272680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c/ah1dWGqejqWrs6MT+NkiuxSvH28n+inVu2cC1XbF8=; b=ixPCbQKe+Lcn8+Q3l8KTr7p79udsthQUen8D6WjZaN/9FprrbA1fDIm5egxfrDRl+i hNZodKaYj8x6EANqgJNPsT7Fsfn1zBb/Dh0qIPFaDAt3rjyW9muLMJ3woIwSRBqvsJ/B 4X086y8pxJvJhqd2Zr1WC4ANUs48HXgWZ4+zlon+ZbgaS78gh+3A+rCGDrHtbnwagYSo Otz15YjKeaCJ/z6Oyc1eGqEQ6+RI0OcPS57bpyv3OsDneXIQLlwJTT54nIPgCnV0Nokj G0nzwaVcVvLdvB0DGJ8N4vTrgZdXvn1SVz2Jlb32tX8S5UUpv8oByasTIzJRw1jPAfPd JIEg== X-Gm-Message-State: AOJu0YzWBWm6inZX6LatpfcSA71t8InmIYQhuTD3xseKlVnd0+RFlVNS jvw0MTJfvQlUYwMhC0ah7z4wPB9TM16nzTm/UNHsU8EZ4TpvQhJfe3qMtOLHU2hYpvfkHB3H0/4 e X-Gm-Gg: ASbGncsC3pPj7Xyr0vAdej7Yw/q/HO4P2ktvK1+mk8Yk2Nwa8JJu/bChUFpWX03bshO z1fuPcpXKOZ9JEstDj8BbzDIt/GpkOHYj7gzqyQ6Ck2Nsc+eS2U5baRXe4BYLoNUFOp5klxmchk yYQZmdtEF09gQHcFYyzLL4Ibmrv98Otmcb/D0s4Oa8XdkH6BSRw3hMgILDbLG9eUmd5P3/N8YHJ medh3rdZfV1oWU4/YNqDFGfgAP5YiPbnc7VRBcNIWTbZF8IQGTKZDBtsnnkHJo= X-Received: by 2002:a17:90b:518d:b0:2ee:c04a:4276 with SMTP id 98e67ed59e1d1-2f452dfcd8amr2404191a91.5.1734667879863; Thu, 19 Dec 2024 20:11:19 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 20/51] tcg/optimize: Use fold_masks_z in fold_extu Date: Thu, 19 Dec 2024 20:10:32 -0800 Message-ID: <20241220041104.53105-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102d; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 659190dcd8..85e6dcdb26 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1868,11 +1868,11 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } - ctx->z_mask = z_mask; if (!type_change && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { return true; } - return fold_masks(ctx, op); + + return fold_masks_z(ctx, op, z_mask); } static bool fold_mb(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852351 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1851954wrq; Thu, 19 Dec 2024 20:13:13 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWXKTl9phfUWBYbPXk9COPFvY0BAdffDtkWjYFypYPtYwCNic4JQvFZCCfFBbLgSoQB+LWtlA==@linaro.org X-Google-Smtp-Source: AGHT+IF2KWWWWW1D34Sngn4gnRfatLnl6rl0k3s+wtUlAG15kfpsNvkCsCaFIUUjBq1vQQaegg7K X-Received: by 2002:a05:620a:470d:b0:7b6:cb84:8130 with SMTP id af79cd13be357-7b9ba83a7camr253203185a.60.1734667992941; Thu, 19 Dec 2024 20:13:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734667992; cv=none; d=google.com; s=arc-20240605; b=VOYO5ekQr9mUC01NEKKrJ3mOatC1egSn/hPj6zwHRG7eNxlZ6Ax37spQIn1XZY31Uy 68j2e7OlQMxVjhX7IZYsGyLsKPYGGG2Qhpa8Czu66AG/+xQVi+P6+ZvnzCpgUmo/i2Nc t26qzCjG6M/k1J8m8w326qgU8MrqClhIiVJO9lHzuyZUnlH+NJIA9LLlOZOGyImc59gy wsDNTiaY/gLRmzu0732IVw5Jerg4U9Xj46N0LCta62eN2ha55EJ+RETis15YHMysguWM C4K5QUJszbZbUuwqwv0MuU7PCublu+1VyyPMOpfSD39u06QhM8TNxFhjJJ6cgUZ9HIvZ bb5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M3YEuh2xqNooYYBq4iR7eWG+DbYvG5silVCxI+MmVcs=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=OtvMa11mmzblpu2TqaZlEyjHYM671c7425jtZeBKjZbCe0W8NyWF/1SDiKYNmLSrdX 47UMXoSXxHL/XBNMaNcIk/6iDMm9M3d1/IRH9GY/p52v4KdpVcW1d/JIJ+OifEVoCq0w WJW/2uIJgB4DciAdct4RvaGVcNSnfvT4eNuNIF/6oltN6iIFyNkFa9ujTPuhhBrxiJAg BtVy+F0HiS0pnpTQpbnGairLnUijgTs5pgwR9PPodlcQj0s2Jpf9FPniIBZpLg3Ell9v +9n1wMNMeT3uPkF22DltbbKlEuwpu7oroQvb80HDdWXnaZQYwjQ04R36qCp2DJ0qnUVH yuCA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F2IspAkY; 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-7b9ac2ada91si358368585a.91.2024.12.19.20.13.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13: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=F2IspAkY; 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 1tOUMX-000052-41; Thu, 19 Dec 2024 23:11:41 -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 1tOUMF-0008Pd-B4 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:24 -0500 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMD-0006LA-K6 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:23 -0500 Received: by mail-pj1-x1033.google.com with SMTP id 98e67ed59e1d1-2ee46851b5eso1121756a91.1 for ; Thu, 19 Dec 2024 20:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667880; x=1735272680; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=M3YEuh2xqNooYYBq4iR7eWG+DbYvG5silVCxI+MmVcs=; b=F2IspAkYSsoD1nG405XCrWgPQAqtExRmh3d4dY0mJkRoZj80ItdZVzauuymNoLvsge 5UgtBd9UtQ2KCv6AkEH3/Su3oJ/nYciED0wzRedKcnE5qXch+eq2cTXEr5L5zbUF98k5 OHMbV397YhqzM4i1aQmaQL/semp7oThX+eRkevp1ycI9FTPBJOpc1GIYAt70xjaoLvQv PV5wAPTpLeuKNFqoh6SZ27Z/k0cFHUJEoMJ8vbIbK2nSdzREecNmVmuYQVxal1RBdjzp fkZCYHHt7LY3RPldrELRBpyxYuq4OUkTX4VFgZjXAgE+iP/84I+DJ83vX682ZaIAnNkw ukXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667880; x=1735272680; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M3YEuh2xqNooYYBq4iR7eWG+DbYvG5silVCxI+MmVcs=; b=bn5jGi/PBgCrXAEk/cB32BtM5scy8bkyQ+c871EtG5Z+fDGM/G0FNAK48AOuE5O2il 4o6pslCMUH5qaU0o4VFXTWqCE0Z+L9+SrZPoCcF7Xye5lhrBksBhnQ/gQmu3zlpcmCL0 /A4tIIPOAGSZqhPC6HCQ5ezIjXJxeo0l/LpyOD1P7kaj4Ys976z7vap0FDnf7IoDPYm+ aQ20KI5Zeuk/Q6ntKGDhsj43wMafkvZaX0AarrGpQQ+3QRa4e14tX0i2MSPYDbXW9qeA syZt8EJy4UP1D3hpH/IK/toSA0SFbCZkeTArYy63ueHkgA+wb2qs3fCISLRd28ZQjX/E meNw== X-Gm-Message-State: AOJu0YzoK5xOeoA0HpeIdtAO5yQTcqqSN9VyeAko15kTbgoqDACs18Q8 rp0oSV68QwV6v/9FL4hDKizKmTRvmEF8xKdKxg7kKw/8Q3nTnF3/FktFx6U1NCgyoVFs+QJCIym Z X-Gm-Gg: ASbGncuAVHX9DnWZhiVj/X7d+vgSd7Aky9hsLvso25FnuGUAIbyYYNr7pUfsAuS+MO6 afiRSuFvJVtoMnlwVtg0QfEI1PlLQyotUymQvuNq8B53FdJdiqxreueCwXlJbizudDgzM/Naijf 5h2+KgvwyIoKmYAvrKBMYQqlkD4lX8L3ipFK8xtyXJec2GfzlUFqAnnUoRd+qggPIVEcumKTFXj S67m/YV0rXzfjVRzpfsOm6f1I6jOdH/esdgjRYhORYBnJiT8tSL1FGNcx23TEY= X-Received: by 2002:a17:90a:d64d:b0:2ee:b2fe:eeee with SMTP id 98e67ed59e1d1-2f452e3021cmr2623306a91.15.1734667880491; Thu, 19 Dec 2024 20:11:20 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 21/51] tcg/optimize: Use fold_masks_zs in fold_movcond Date: Thu, 19 Dec 2024 20:10:33 -0800 Message-ID: <20241220041104.53105-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 85e6dcdb26..e00d86ab2c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1906,6 +1906,8 @@ static bool fold_mov(OptContext *ctx, TCGOp *op) static bool fold_movcond(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + TempOptInfo *tt, *ft; int i; /* If true and false values are the same, eliminate the cmp. */ @@ -1927,14 +1929,14 @@ 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; + tt = arg_info(op->args[3]); + ft = arg_info(op->args[4]); + z_mask = tt->z_mask | ft->z_mask; + s_mask = tt->s_mask & ft->s_mask; - if (arg_is_const(op->args[3]) && arg_is_const(op->args[4])) { - uint64_t tv = arg_info(op->args[3])->val; - uint64_t fv = arg_info(op->args[4])->val; + if (tt->is_const && ft->is_const) { + uint64_t tv = tt->val; + uint64_t fv = ft->val; TCGOpcode opc, negopc = 0; TCGCond cond = op->args[5]; @@ -1973,7 +1975,8 @@ 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 Fri Dec 20 04:10: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: 852388 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853708wrq; Thu, 19 Dec 2024 20:19:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUmqzjlNiBSnXAfv8Hb5oKWp52viz9AkYwuwotDEkPJbcrThN0LXdfNc4eor9o2wcBb/zhzQw==@linaro.org X-Google-Smtp-Source: AGHT+IFLUS4gSj98QMIDJhN1/9+Ltps5luS2rrGCSOWeVfdCtAohK5pFMgMjsA6+W4/hfpUJqreU X-Received: by 2002:a05:620a:650a:b0:7b6:6634:5a42 with SMTP id af79cd13be357-7b9ba79b290mr227106385a.23.1734668364345; Thu, 19 Dec 2024 20:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668364; cv=none; d=google.com; s=arc-20240605; b=ELC7VKtKX4KruwTux5PWeXV7Wx0RBxuSTu+oE/NBR+HS43ZOWIq+QxetJOrdxX0OmS cPlYh7ljMFPHgsaLI6Y7T/kkRJd5RFRYK16Wa21KfOE02RN6rppPeecBXWBMjxNRMBwJ atugr0pXRru+qGD7cBUh82bButccT2qWM7amJY6RcMoqpE5F2hp44pp6/VRzejCufrpp UXwaMzqHii0TiTZpJ5Gu/qj4+yW5F49/AA7xHBlb3caL2OzCdTIDkJ0GfkBZmASQQaMH BHXjn0mkb5KESvHFCKYkT54eJaaUn4ZUFvsdqaXyg9ltVWGmuejkxN/192QUnOTM8VTp Fwdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=50pAv+oMelKz+SzYeaXvQfHyrSKx1AQ4ZmtRaoZUtTM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=EgzYKpspXA211N/6WzsLuAhRJWGUvaykUQdVJxM6lJgOa2pyTJBslCCGEfemgGfVxb ufQv+fDadlrvjiWE/OJv7q3QcR0SsgvGzrC+bR/1KJ1wUrn8JficoecKoRq37gVX8wJs W4cuRrepc/9YaaYl/XrCS1GA7rg5q11+YNlGubJt4IQ8UVcNQyDP0jUoiE28OCe97ZiY ujKWVUI5pFWuWn21ElXvJlaw/2OjBLqWsID8Jb2yMatrnV7mXnVPUi/do/Dxie1RALKH P15izs4o2StOH8Vdef4Avb60DF6924q8ojbY74/F6haFtR+dBWgSgEwWWQDbDsGYPJg5 E5rQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kKy4gNfT; 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-7b9ac4f3699si323238485a.538.2024.12.19.20.19.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:19: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=kKy4gNfT; 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 1tOUMT-0008Us-HX; Thu, 19 Dec 2024 23:11:37 -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 1tOUMF-0008Pe-Ob for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:24 -0500 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUME-0006LJ-CN for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:23 -0500 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2ef6c56032eso980328a91.2 for ; Thu, 19 Dec 2024 20:11:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667881; x=1735272681; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=50pAv+oMelKz+SzYeaXvQfHyrSKx1AQ4ZmtRaoZUtTM=; b=kKy4gNfTaxIQyGmZGBlAAPkJZkQdBXTuUiJDMjDt0duvX01TRW+cwi+vBqts6gRH8L Jpj8a9wmU7L2MajcbWTqmnBz39nb0SrKIkqrj1dr1yrMfJen3L/XoA1HQ12P4ZkBrmkV tyqVBTPRRMID2SX14OFFneYUGuFvqyI7FGq6NwCAIg6PpfCwZxXluoH8pVwLDJzRkshm s9xB6cfrJJNsm2o032oh0kNP+KVYPQDlX20rnU1CGS5kKsW0iV71tx5WbnJj5pBkkE4f wbGulM3X+KDjhHUcO2O05uMt2Z7NpV0Zi/8cOKhz9WydSrftbnvnYBtI3ed0WCwJD7Ig k5pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667881; x=1735272681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=50pAv+oMelKz+SzYeaXvQfHyrSKx1AQ4ZmtRaoZUtTM=; b=GXsd8ncuLtKgpTn3hNJ002Dx5CxKugUC+ysT0THG1HTjJPTxHSANG2/Leow9rErB6F lA5IpCTC5YPjXWrczSQdXBChBq7gxsVrFpxs4zRyKX03y8HckkI3B1/DI2DVJRnwco1f F7XbC9AWhhiZ4ZGnLkHf22NBeQthmNFL+Y1UXe1QHcOYxFwr07mGr+CvWbYZ/w45SQzO 64Mx51WFFZhwiwnbyp1eO62UI/MUkyzWW75H0tdcZ+umxjf/c6//Lpsj/A8FRRDku2hN KNec7sJ3WVpd3jaJ5hw4Q0BPrzyWNqhsSWvA9aaESwym1LdWp+fA8mmGrQPK4yUscoBr cvLQ== X-Gm-Message-State: AOJu0Yx4/pXYpEmQ9hbXTAomjdijUgumaX+/LZu4mw4iRxEqtXdTZJnZ Vins6ouXGlyyCEzCQyjniOQ6c2OFASnphUYQREUgDfFBdMsf26WjOZPPngCir3g4fUHl34F5oCq h X-Gm-Gg: ASbGncv0lICakVNNKHGd6JCtuki+SgIFM1hA3GUTOexsnjqKRdbC4ww7xHieUkDxarB +pRWSOEp7BQzGZWkjHAoqtgJCY684u+N1ltWcmHAHACcJ8VMVzEqOP5l+gx443zK/qoMoebRQ9e g5RLYPEBG/5zNE+++L3XK5OHB0qV97zyGDpI4jVBwSJcN9LiqSYeeVGrRw/+Vye4qYl0ceat1js WlFSB/uFxmQRX5j6MbMOlH/el4qDTpkZMEVsBinqfvheYyox21HuMyt675ymfg= X-Received: by 2002:a17:90a:c2c8:b0:2ee:b2be:f390 with SMTP id 98e67ed59e1d1-2f452ec3780mr2098079a91.28.1734667881024; Thu, 19 Dec 2024 20:11:21 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:20 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 22/51] tcg/optimize: Use finish_folding in fold_mul* Date: Thu, 19 Dec 2024 20:10:34 -0800 Message-ID: <20241220041104.53105-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.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 Reviewed-by: Pierrick Bouvier 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 e00d86ab2c..5b71a98cc7 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1986,7 +1986,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) @@ -1995,7 +1995,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) @@ -2040,7 +2040,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 Fri Dec 20 04:10: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: 852354 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852093wrq; Thu, 19 Dec 2024 20:13:49 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWnlzMqWKUhi1NYnffZEx7nGNMxWXOGqTQudqDjij0XT1b1U/zAvxQ5ZBB/rIbWsU+LICZ5Vw==@linaro.org X-Google-Smtp-Source: AGHT+IFhXzYK+YO8zE9AMkxaMx5xFHX8EDY5GaoYLotuTroj/Okrr9SDq7Ll7snJ1hDXm98o6WxJ X-Received: by 2002:a05:620a:4711:b0:7b7:106a:1986 with SMTP id af79cd13be357-7b9ba79abfemr247580985a.27.1734668029515; Thu, 19 Dec 2024 20:13:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668029; cv=none; d=google.com; s=arc-20240605; b=aj5nQQd4Vgs4hNrqIShLAZL2pRoKPSUeX6DGG/LCwuD0Dlzedhy7fCL+6swVr5AgRD w2JDResqYTxkewS/7h3o6yZgFjZoDH+fX+QS8jsNLwxh7cDEdoJopGjFTQSiSAE/GC+d 9Fpzltxmqfokx/Z5D0XhuHCgwdrro/dM5McREWJNU7byhMifNsnzBMZlyIPHqX7Gmn0R 8kdeaf8QJVWC7JkKty4oOZPw6Q/Ip0E071BMB67ziHhKdMXOAcCY/m4RbM+wi3o9vkGj D3TcuCdJpF8T/WbFUYmJocAMDq84AqndYYmuqyEYdd0DPn0rW2fEGN418hTIKfOJeyyO RjKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=R+Y+Gl05V5R9wO/k+rBUGjrtuN3gf4BK1vVOJZqpHsQ=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=INEl9WyKhSU0ZK4qlVexKmKsEjzsXCybZ7grKS9URM2/q519FEdBw/rOdTGhWUXgwr JdPR6uylA4+gJy5wLw3+p3JsfghhbBWZBskxODP+8Imc7sH65cxuUP+ka1kZzdsIfCcg hiN9zJTSYVgWHilHuxN9h4uiZ8YM3Ge1OTmXWPmCdiBFlzAhsaoN2+GIQYjWV7YoF31X T4kYV8MEP7VnjuGTATnap5UTYqThmC2N4JzfAVFwnHNWlwNLhZm9mAt6ecN8QwHZTfVY trq3BtOfC2Tiym//RW/FhA3PEThJqpOFeICvP//2tCf169edSj9uoUfp6+uRjB/1uWRr XIUg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=qJbAnaNY; 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-7b9ac478de2si296746585a.268.2024.12.19.20.13.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13: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=qJbAnaNY; 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 1tOUMS-0008UC-LD; Thu, 19 Dec 2024 23:11:36 -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 1tOUMG-0008Q4-Hs for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:26 -0500 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUME-0006LX-S7 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:24 -0500 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-7feb6871730so964103a12.2 for ; Thu, 19 Dec 2024 20:11:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667881; x=1735272681; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R+Y+Gl05V5R9wO/k+rBUGjrtuN3gf4BK1vVOJZqpHsQ=; b=qJbAnaNYEx7xkAyd8YS5D8HzA99DH5FPjCz8+5qBMNIZsSVyZi2Hq1KmyNkHj6VljX 3fmmSRMBlYrcd3WSWAry4XZDRHGDu2BOnW73lCTeIqqTy/Yjb7WCMVgkc0G3RY8cr9uH vwA6BMkTwSc8oljBVZeCFyf2yJxV+wDNmRRVvXQJC/cB2b4YmZ/UIHZ0wJBuGK/TBwfE fF76to/k63N8qpgN/SrZQRWmZZ2mMYVEsxPN6T8GUQL5mL8NmH0eFNtwlBNcgGdH/9ZN 5nF8mYWJX0JhnS29O+l7al+qg1uJzCh83iJ36QVljyVqf/UdAYljeByJ3FGE9w0GST5G rLrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667881; x=1735272681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R+Y+Gl05V5R9wO/k+rBUGjrtuN3gf4BK1vVOJZqpHsQ=; b=Q66kyOoBbDB8ijKHwHVEqOdA/90BD3r9bcKdtpUCb7xP8AmS5VrjpgUnJ/4PZ2PY7m 5mluDWiwtpHud6OoyXw6v8Cp9wwANl1YJJcvKBQnFr9m3ttwBouAP5wm7BX6xz09UM4S KyTunFV42cyGTHSLiBCrF73pdvs9KqFWYeVA8NUWJQtaCJAM3vmf52CaU4IxRJVmAooC yuJ0ZDFSQIBM/WqCl+7k2+iHtiFOfB/g6J5oyL2NlLHwXCWBoJLNgJIbbwJTmBafXY53 +bYB4Y3bnHc/deBRr3alJSY0CcfOKN1JJExj37IXGt7fnK6iLEtu4XWQgEKwoHgFIBli eFag== X-Gm-Message-State: AOJu0YyvsSaZWNogo/i6ZEMAsPA2aDRKDZRG8Z3qMnHWTFh1oMCV2mTC O9ai4GxIq3Y6njisoWu1gMaSIm+1OV/EQ1khya7c8kLef4lYQfyD8WSeEvH+y62ypnFNCowdkju y X-Gm-Gg: ASbGncsquK6KQda9p4/nqhZxYmzUXrhtJWd/Jf6R1eWVvrcKZ0YmoHPaNu032Dr5L/m fkDWMcGZKtrGagHAi849x+EmS+krtLDN2fNUz6P/Q28q/W8lLSMRjaOnVS0Az/jKKwSWhtekd6j Vs5Crh9S9Fay1GWIiV28AEWLFmtQk+hF3mz5yAysqYC4zQG5CF0UqNXle4nKkhqJCcHyGph0X2b V0lRmz8B3VzzdFNHPpde9H0p7ztFV5iJfS7nr2Q/3+3jOn70xvKNIIHaUX6gNM= X-Received: by 2002:a17:90b:54c6:b0:2f4:434d:c7f0 with SMTP id 98e67ed59e1d1-2f452e22c43mr2788986a91.12.1734667881629; Thu, 19 Dec 2024 20:11:21 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 23/51] tcg/optimize: Use fold_masks_s in fold_nand Date: Thu, 19 Dec 2024 20:10:35 -0800 Message-ID: <20241220041104.53105-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::530; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 5b71a98cc7..c206c0f40d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2045,14 +2045,16 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *op) static bool fold_nand(OptContext *ctx, TCGOp *op) { + uint64_t s_mask; + if (fold_const2_commutative(ctx, op) || fold_xi_to_not(ctx, op, -1)) { return true; } - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask = arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_s(ctx, op, s_mask); } static bool fold_neg_no_const(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852355 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852097wrq; Thu, 19 Dec 2024 20:13:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXh5ZZ7aa+AXx1vsMu6uhCX9KBRQENqXVUVP4ZctnVvxPeO3m17ou1OZoHgdPPzpnPOJ/85tg==@linaro.org X-Google-Smtp-Source: AGHT+IE6C6aaNTihrMAKV8XZ0tTO1aTSkKPG9CG5LLh0NZL46r2DUpA2JYmeMNI04RWQ2olH4cuy X-Received: by 2002:ac8:7d94:0:b0:468:f722:d44c with SMTP id d75a77b69052e-46a4a8e4512mr22520381cf.21.1734668030811; Thu, 19 Dec 2024 20:13:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668030; cv=none; d=google.com; s=arc-20240605; b=TzpeG4D8MKUzsA/6oJREl3bjzeetJzxfoukz6D9ILce8AQCUMxgrzoxncaoMH3WRvB 7MtrYr+caqbSBRVV8kcx9VJlnj1j4pKEtlsRooyLI8NndTWA93BlycQy4uQXEv0RJHTb 3qb10K0kHBaCdsngdYdtZfZKVS/8Qfax6cqBwTZiz4uNNCD9dEEtQyD28haQYQg6b3ow aznK4gl6p5lhGmK5IGOpBCALZjfKyelXKdUACopMzpcU8GOGwxHwOOSVg1c59aBNiVzR Wxk2SFaBJuKCgbkMWFqtjrk4SMrsEAkiFBOh9/t7KHfE6MNWtjaqFU8BEmtX+Sc+EesB Y5tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9O0R53WBozPK/I6haxAxuHnNfQ0ZmBvA6nPgwPPpwik=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=F4u6gB+Jmk0nmwim8bQnyia9zXc/+K8EuwkBpqGBlQotStQr2MFpSW/WcR7P7l1w5O C8WSHABiMEuJ6b/lOPtD1wFJRuAx40qIFQQCnRgJu5afnokQQg1ueetb1K0M+wlDu4aQ dKfS1rcn39I81f9EG8CyuG0oK7esfTvGtE3NCLcqBoVKkuidJpHsBUazdFawDWAwjr+l R4MnzrGtz5RdQea33NdWKNAYk8ECybakVulEDZjGfje3ko9ZIHMi0MdBpgnqRdubpw8e rU9UccTsceM5wPUwaO8oxHujkW+KjECUO77L43BJiCyF4chu97si3zf9N2sWypS+ZK2B T4Rg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=piVosxdp; 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-46a3ebd8ec2si29069191cf.602.2024.12.19.20.13.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13: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=piVosxdp; 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 1tOUMU-0008VA-CU; Thu, 19 Dec 2024 23:11:38 -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 1tOUMH-0008Q6-0m for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:26 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMF-0006Lo-Lk for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:24 -0500 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7fd2ff40782so1278039a12.2 for ; Thu, 19 Dec 2024 20:11:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667882; x=1735272682; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9O0R53WBozPK/I6haxAxuHnNfQ0ZmBvA6nPgwPPpwik=; b=piVosxdpT6WLwOZs8QxDhzHhPI8KxA8qWCBExNg16MbW/sc6SWhMj7R9DUXMdco5ql E3kADkR5D/oM77YnytrA6rYbDYV374RghkO1Jyrz8HWL8juzE8YrDoyUrJJWK2pCPCb/ eh9jnahdKVFGtmJyeauDYpsyoA1rGIKmos1Y5gAH1CxUbUVLcPKLYTR3wyycDvkpqgxA QJgju0Sls7dVSYYm0BbM4nu0KPEXqUPDT+ICLY24q8ueKbKVhvRQxVw2WNeW7GG0Geb8 TXc+jrf0x2XTiLCelFrtHoE+6yw5eJoBiQeyJhXarUX0gjE3GAYJ33+Ws6wf+zJXqcKj YxUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667882; x=1735272682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9O0R53WBozPK/I6haxAxuHnNfQ0ZmBvA6nPgwPPpwik=; b=LgH1gEP1HXLNVc7PjiKrsvvWd+I677RRL5eokR0JDvD1yCb9iwRToOf4kVgrDsRgVA TEY6keszZNWtIEVrSE5VTdz5charwHVzsjaM0D+n+BkNU9xPVPuutjImDEqIcEfqTv4s GUsFL4JkSywH3HJnFP6aKAr1bqgOdB6/9GjK+Oe4+SSHlwOhZ5fs9YDmjYQLEe3MzDr0 w1dIP+2M71juXCbB0NKMdwqJbXJas4BWDZjvSuQf6QdWdy4gyZvQNXDrYUNip9U0qlIZ VOvxWAW8pRhRQmwlsMIFwu1M5xGRmRZYVgIHcOssc+7Ew595ODjmS0oFEZvRVBKj9Oow 7oOQ== X-Gm-Message-State: AOJu0YzG2fHRqft+EEyGZMywy6b1dBdMgCA/O/pdg0F3IErm0QSwznMc FDFyn/OEMfxdEKTQN7RqECXM8PrV/spg+6rStKZTLLUch97i0JjRoCROIpxlSdyzArpG+eVLgJq m X-Gm-Gg: ASbGncuBz5QoiU5jUyZCybz1tf+2XanCNegRwtxi25LE+bTFjg27XdjdP9lgVoDsz/4 ze/fCSRQlGtZ8b9QA4WHDChaARPKRp9nDDfUYPfah1BuUj5V2CDbeStJupwHLtuGQz2Eu7n8kMv SG4m2YP0ZVsQnG7xzqhsc1IktHpq5W3pcaT/2YXPUoFjFBbnCTnsahTTXUwku6stxhZOmaBuCft rP861NOqscMOUGFa4xZLBn9EszGQItHoploHoYmQOYMcFD2aVcxbpijWXc1Xgk= X-Received: by 2002:a17:90b:2e0b:b0:2ee:c4f2:a76d with SMTP id 98e67ed59e1d1-2f452e4ce1amr2034024a91.21.1734667882366; Thu, 19 Dec 2024 20:11:22 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 24/51] tcg/optimize: Use fold_masks_z in fold_neg_no_const Date: Thu, 19 Dec 2024 20:10:36 -0800 Message-ID: <20241220041104.53105-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c206c0f40d..baf545df24 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2061,14 +2061,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 Fri Dec 20 04:10: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: 852365 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852324wrq; Thu, 19 Dec 2024 20:14:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWcP3bwiwP3TBkp8GXfCixbPkyn9AFHSjuKZQiKYXSPf1UPVsuWRzm41SZlFNsSX8KIz81Qjw==@linaro.org X-Google-Smtp-Source: AGHT+IG0f92gQF9EvkH8vQvD+QklPHgkkEf7gLK/as+lC3vZazTbjffrzAuh88UcCMI1GSeb4ZRB X-Received: by 2002:ac8:7fc2:0:b0:467:7557:5fbb with SMTP id d75a77b69052e-46a4a8ee06emr25291271cf.27.1734668081278; Thu, 19 Dec 2024 20:14:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668081; cv=none; d=google.com; s=arc-20240605; b=kKjwJd6z3wyLGZgdzi7wniFUw6OiqvpRZC9x3Y9La/d6lkraOdPAZgxDRYX+4bRYUW oqm6R/WubUt10wguuiFyENeHLMsb1FYXAyegGBLqoVy2F7Rq4JbHgcSTSC/kkjs6ksMs 4qC21dEaJR6uudRcZVP/95J94P5vYF9UhlPjbzByqMWyK7G2IGIQG2dq3J0EKY3x9fdd x7JB/fqmABs6Sf1pcuNhnupGls15v4vzQKQhBbVTHhJQmCgNwtOIwRV4Xr8OO2mKD2td iBMjy33hFKU8dg3akUm7cuF6zFzHOVNJSHhX1IQLMEFiQU5Bm6JIndG0ynl/exDfuS0u hAiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=etPXGBNUHIHB3heMgrLuh2eOx7VVtNwo2nGUXXUzJtc=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=NhZ+NF/mG+5A8wOjeKkjqBCh573uE/YX668kn42ylBzPdS5CYnUPV3ZBszLg35Sbcj gHtY/eYPFW5IX9CsBFnnZHYtN6Bbg4bKtrS9fPGVywCOmO9wMrXNV+YuP3XYfvbBekq1 WES/dqAaDFLufDoTkN3DJEpG5ieOezJTOyRGCxj6Xk4xjk8AmkwgyHrLoJYmFo+EEAFD uY52JYdepXCXBwNw/VGW4bUp0TIuWlFplMIvRykMoaXq9ps5w/pUHLV+i0Cf0+aO+7ks 7JnCDMjbsO4EPs//ub4RIEBaO+YvcyIzE+6CwaViexCXTiE/z908MoSdzryFohtyfv+c vIUQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zFzXk1GY; 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-46a3ebbfccasi32709391cf.467.2024.12.19.20.14.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:14: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=zFzXk1GY; 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 1tOUMg-00009x-JG; Thu, 19 Dec 2024 23:11: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 1tOUMI-0008Q8-K6 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:28 -0500 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMG-0006M4-99 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:25 -0500 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-7fd17f2312bso1114379a12.0 for ; Thu, 19 Dec 2024 20:11:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667883; x=1735272683; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=etPXGBNUHIHB3heMgrLuh2eOx7VVtNwo2nGUXXUzJtc=; b=zFzXk1GY/Pyl6WwV2fbNnk9P4+W2Bm37pQu8KIgpeQWdgacck9P3bFVTF8V8j0JKNu vrVOiKtaHO2pJAlFRXKuUOACeTKUzKfPEPts30qnI+eynkkZIpjm2pdqk06OpVpglU6M vCcpYogeOQ2h9pXPZ+4O/whpcDnaYbpmPjSI7IHQMQFr8RYR5UnA8ro8LeTUBoWuPvfI ZSmBYcj4ptlbP+prKgIwYLJCFtFa9zWUK624N05knZrRxCIoS2BVIxuaFO/PZ4v5fWoc Vv0dNLTOgvNYH1/i+LLrJLwo6sEpx1XZayBA2R2NIIqiLaP9XIcrVEIZRbnCRrc7144j ZAJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667883; x=1735272683; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=etPXGBNUHIHB3heMgrLuh2eOx7VVtNwo2nGUXXUzJtc=; b=L3PkP4AHg3kLXDN2ckygyWnSUKkU4gb60/phEvgSGSeXJdnC7Moz3zGMaPhmcKCDR4 vsPnRNHSuqsl/64ox8OdIY/uRkLdhBcprPw6m4EWEkkt/9c6qVkRyOKg7RMSecJdj8rR mKlw16VpivkPn/n0UjyGWczO5S88dbqtzEX7wd3F3seLFfIO4f77JIXYtjCxdR04lxD/ LzpSYG3r5/7zYP88RJXQTnmIrBC8fPickRt8BlINV1E2D9qkmjvMJnGr5QrW/KqD5e5L CYtdnF8svNu9o4s3s1/gmVurMSjKlwTTpx2QbksoiVBetXNhORr2d9f9pVeCiWuZBX73 T+UA== X-Gm-Message-State: AOJu0Ywhx/iyogTTJDw3Ag0tdPX1obltPfkysrAZyZeRqVt5Hvfi0zi9 sCbmzmw7HChn3dnJvqLkrS94XD+1qfv3tdMxGX6O+5y3AU6wg/4eUVYmV6xnO8Uxj8cF1Bqjqri 2 X-Gm-Gg: ASbGnctrE7PzbX81rRKafMggJb8xUrUIC4JSCE2aphdRZoCF32ebAn+NPbgxQABIVjx 59AW2xQWLDAfOQQV+1VQOk/uu5gLoMmfTOgTb3k4/eIDGvjNGz6hIy2lTWbi8jVTmnMMQbo2MDJ xHHyvu8NPCTESu5JFPDnYGfwTg6/zE3E2NKkcWyh4wPMWuHSgT7WrlfaOa8Mc6oEnjpuVbfl9sj tronDFZfWZuLUKSG0SttX79D8DRY/r0V5pVkcg+UB/HFSZuL6KOuexo3yZFvhM= X-Received: by 2002:a17:90a:fc4f:b0:2ea:5054:6c44 with SMTP id 98e67ed59e1d1-2f452eeb641mr1914839a91.31.1734667883027; Thu, 19 Dec 2024 20:11:23 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 25/51] tcg/optimize: Use fold_masks_s in fold_nor Date: Thu, 19 Dec 2024 20:10:37 -0800 Message-ID: <20241220041104.53105-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index baf545df24..04f0f8b9d2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2073,14 +2073,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_s(ctx, op, s_mask); } static bool fold_not(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852393 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1854083wrq; Thu, 19 Dec 2024 20:20:43 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU5kqNhIScnH2HDIhg9jcpUC/iyjjuopMLl67wIEOXGdRNoPW/Oo+FtSUCKCRJEQsACTcIYsw==@linaro.org X-Google-Smtp-Source: AGHT+IGKCC2eRBIeBPbI/1jwuq8IVUDLzb0WNOHMJayQ++lWgMCIns4ZbBcDe1L8jUYzKZFNGNGv X-Received: by 2002:a05:6214:629:b0:6d8:b81c:ecc1 with SMTP id 6a1803df08f44-6dd235cb32fmr20584896d6.13.1734668443506; Thu, 19 Dec 2024 20:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668443; cv=none; d=google.com; s=arc-20240605; b=XZfV/5TJ5Z+wZZISiuxDe47yfV8TLYDDEexTpGfVP5JC0rwVujFVNuvqUAHWO8y5QE 7hUt+oyt2Fx2bd2r44FAvIegjmu6ycs0HYlDXO2KragVozJ+3qMmyEpSG8X5QhKNuNds 2CC53tSUg3FPGkbVcQyJFp0Y2lGeonyw73tmNS4/gl8UqUMfZgNLeJh/g/HvOcBexQ2r s8IPXvk/jHDRINvE5UeeTtiRbRMzrtsqBdvODL9STS70MO4JWG0eWWajGo++Ah3I8cdc aTG3DjX9STxTBqCiqgyxc26SHD22mzTsIZrzEPPV+LHBja+12YpXIc/kp7H8WoypnndR +vdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=wYogLE2cJhonKzxn/dJxhdWBVbT5TGD35lyasdR9UTA=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=FGDtr76SavOxJy0F2xI6WFm0tSOsZv4efwdkfE2TRAnM9yD0ioNshTJN/EE07Pgb/m JwLmjBtVWMey/awmcNZ2ykDI2C7bMAo6c2ABpJsafqVKVveCpuhCZ5SDT2h+PcBxFx2m jd9q+g7d52cEny7hyTfVc/SHakuU4huogk83USCBeQLxkYJljUCWnw7n7k5TB+TC5Ocm j7bq9uGt6HxGfm0oRQG3aUBQQnSbEQeuSGfyq+gx8X5ulP+/twH188GrU9dpUOjYFRqC bZmJ+8nmoiaZwel02R8wdn+FT5O1BuPJwRz6UArguwB8qAyLJbDhDO0IwmQPKssKBj0g ExAA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zPxi7xfQ; 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-6dd182336b9si35648536d6.200.2024.12.19.20.20.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:20:43 -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=zPxi7xfQ; 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 1tOUMV-0008Vt-Lu; Thu, 19 Dec 2024 23:11:39 -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 1tOUMJ-0008QD-Pf for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:28 -0500 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMI-0006MI-Aj for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:27 -0500 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-801c081a652so2049670a12.0 for ; Thu, 19 Dec 2024 20:11:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667883; x=1735272683; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wYogLE2cJhonKzxn/dJxhdWBVbT5TGD35lyasdR9UTA=; b=zPxi7xfQrSJrOS68OxzZFZLwbAxMyUdtO1j+S0Kr9We6XhdhWLSJxg96WTx1ymYYdQ Vc9jYq51G3l7JT00AopT2M0LsdfU16sVzJMvxT9yRy63KJT1bo6N1FfypC67PmBvyZzJ mY0KZd80pdGa3FWMqmelyuZKehnNksk5T/Ke6mqSN6FaCnKJ56ASplORfve3107jR3l/ /RNEAXtZ8WeEQcYZ5Yh9i339t8eVdXJjM3a5AgLJyTMPCIUVAlUTSzrJGfS0LOqp1j9x SQk0ug/CS/XcpetYWj1WKwfKbRXtzChn6vTR3t0g/ZwSOKdIU3YFQa32apJdZQh3PdZF J7dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667883; x=1735272683; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wYogLE2cJhonKzxn/dJxhdWBVbT5TGD35lyasdR9UTA=; b=MTlCLSWe/8RcQLSGTEaZRkTWEjQc3KkQJs0Kxo/Snf7NybxCvSDrD6/z9TsG1ZaMmz VWDBOTbvxO9M3pvrkiqvWngHcQIkBrwBUEHWrLcciF2392fzEpNpt7of4XOQSYLuUqC/ vVV8Mn5Fu1KdCalQf1rG3l98ealA7yAMT1o7bsanyRtyDDQIMvYA5G2gaGDhdqHGy1RW gj+uKSU1N9jaKT9EbNDAHLncZqc5sIBIZ/0NyAj5yiyno2uZIcPG50uwikLHNPQeDmUz lWQNdltPXDRr80cCMyjU3gpfaL+pP4/eml1bd8xu+yfvQCVYA/DhxcFERe2bwtJ95abT xh6A== X-Gm-Message-State: AOJu0Yzoxhx9VR02Qe/V7cOuoxq9HpWkAFVmJuZyhZwpELq59u8pavoG TVbyv5sR9zxfnUiY1z560KzR2/OnQfFgZnxK5g5YgyMbUyur5zZFBviuX7cyMP5ejS1uygBDywf / X-Gm-Gg: ASbGncus0e3g21/JB0Wg/mTYSKE4w/HlCqbHGEKITFdUdSHq5MQfNwqRMBlrzDpxcyK xqXowLvS5cFpHHelodOs0c0ZItjkueluh9kiPL4Tk2zyYFtML6pe1FFecYy/StVQ5CHUHaAxnIm f8u8ALpPs8QsrdFbUbfuuFhe6ijrJYHa55/EqNdXsyOiwkK3R79Fx5bOe57dUhHoJ6sPu9bInN8 yCz0jpEp4467CybTAkw+ZvQ8NEaJbi1O25VJlcpU6dLXzU1kWcEL0H2A7+KofM= X-Received: by 2002:a17:90a:d502:b0:2ef:ad48:7175 with SMTP id 98e67ed59e1d1-2f4438e4b30mr8648213a91.15.1734667883597; Thu, 19 Dec 2024 20:11:23 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 26/51] tcg/optimize: Use fold_masks_s in fold_not Date: Thu, 19 Dec 2024 20:10:38 -0800 Message-ID: <20241220041104.53105-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::529; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x529.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 04f0f8b9d2..6af23f8512 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2090,12 +2090,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_s(ctx, op, arg_info(op->args[1])->s_mask); } static bool fold_or(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852391 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853974wrq; Thu, 19 Dec 2024 20:20:16 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWugSlZ3rNnUEB3oBi8HRp63mrn8vvmaAj7wyRIcLPdP+2OP12sYMSXliVJIj5QdXhP5CwghA==@linaro.org X-Google-Smtp-Source: AGHT+IHfTkNK/6YggdClrsIOr2Aco9iyxjfZysIxRK9wtnJr2KrstUIjo5n0+TpDvJzB0GFG9U73 X-Received: by 2002:a05:622a:14a:b0:467:81ef:1953 with SMTP id d75a77b69052e-46a4a8b6f0cmr28155031cf.7.1734668416624; Thu, 19 Dec 2024 20:20:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668416; cv=none; d=google.com; s=arc-20240605; b=DDbRu8cyoC3BLce+cPKa9bS5fAkS7WeW6VX4ZM2IVF33LgiMt5+XOSMduEPBbL99S7 s4k5o+iYimBxAxJY8XHSNwL2IYs8ThgYRBNtSmFrohrtIMoxOgftEHCKHqEFQ254h7d0 eGpIWoScc81jL7ESTv6gijKFr1Xncb/ZoxnC902tYUJCbq/Uh/HFyFyMahbWdaukeKSy LwdTGvpRUtxo0wWf5aWaGK5sc8M+Dn9+f5SuWUe/NZ8PuWAma+h9pvZJ71FjZk8bP88A 62FEGfDteZaD12bwLWvNOkLw2GwBVxV9ClYYRy/RhsJN2mVNFKqxigg6+1ZTE3jLqMnk QhzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ubZIvSbsmGCFHv6oeJRswF5HFflaseUD+CX++cK93ls=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=RoaN0ugbVl0p4dIKf/qo6gQSn48bx3AaDl3RfHPL0Vy8v5PV8zwpBByOpHMOO87bc5 u+/zwA74C25qgdYEfYeNTO9yZaLF6rkLZaG544ur6Zf2apvtYSdPWAzprE53jIHOPDnp OzHcKRRtuPjClSonru1Cw9RzSG8e2Ke5xtxgkPFme5eixZ1tPTcwxkjfKbbjOqi+5YbT +c3M1eYRZzKrPNg7MLosZUad1hlRqfjkugrSgmih9+82b4soujk7nZezt4Oey4wIcCAN XXtyisYzMXFFFXVM4ZFH+KpkuTA17ssEhaD4ccYqqM8yq/HxbJ03vEzV4idZA6dJ+1ku x6mQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=vx7im5Az; 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-46a3ec0adabsi29673001cf.726.2024.12.19.20.20.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:20:16 -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=vx7im5Az; 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 1tOUMV-0008VK-1o; Thu, 19 Dec 2024 23:11:39 -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 1tOUMJ-0008QB-NK for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:28 -0500 Received: from mail-pg1-x52d.google.com ([2607:f8b0:4864:20::52d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMI-0006MX-BV for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:27 -0500 Received: by mail-pg1-x52d.google.com with SMTP id 41be03b00d2f7-7fc99fc2b16so882570a12.3 for ; Thu, 19 Dec 2024 20:11:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667884; x=1735272684; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ubZIvSbsmGCFHv6oeJRswF5HFflaseUD+CX++cK93ls=; b=vx7im5Azh6gFryvr2+baTl0wZg6WDN2nA+s/wWU5aZCiymdvnRIvXYZrtmIE70yoCu D3ov0bTSTFnBclgJsNB0MEUHHHWAYUvv9A0LHhuf5fFB40on7EBx3TF24jACzh5cLbQz rtmW5iueghSQytwelggvdDvU7oojNc3Wj+QvZUXxuPbTFwtz7Zdcf9rbasc7M6TX95ap IjK6yjaKwyJAWPuvb4tqT9gC9Lot0AwxgEBF14V16k+oQW0+UaHdV+EEKB/Y6aaC+Ek4 jpK/Q8NSNoOI6Yp0/CKOEalsaGcAYym+DBq+nO+IMDEQ9X6Y/htsOMnGYpIfTR0hH6gY +YBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667884; x=1735272684; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ubZIvSbsmGCFHv6oeJRswF5HFflaseUD+CX++cK93ls=; b=gM5J6HJmzai7nDXDe0TxMLJs66AiBvH5tO4yf4xO811wzLt44McFHPds9SX69EiVZQ UqubHxT5MXS26za1/fqu3J8XJ4bdFtbsIgnwT04iDaIOI077lgBHbR5aDS5MXb0WembD qm57mrRbteOc9JqR/oZskPIfo7yfv0hC2AKTZFesiEFHZwGTC5hiaiUlG+odJAvGF9rC pFoBSaISu0Dd7eUQK/W3G03ceoY+VZWGEf7/sB+ZLj78ZGBVQkH+VdmT/XJyYGer4zmA aszAiy24LPVzlQiCRsQENXeXWjHPWvfpQSi+IZseJiP4oUUKhCZyAUwikcb/gguaJlix Ddjg== X-Gm-Message-State: AOJu0YxEe+lwGB4qKXenYc1r/PRZNLZU5PnsvfXZXyA9CW4wkp/1suKP tS6p8ihbdXQVUsMyhploIVFfctpCeZpWToST/EptRBYoPukRIcKTDijLDbx9CSL+9dkEnzBqSH7 W X-Gm-Gg: ASbGnctdGIl5VyBwC4fr9sdU9q3VvazmTajMxgwSZwpy34Cp5XDO4hNCORoxNCqi8W1 +UH+GIGe6L6hcnf8tLOZE5e0w2gLyruDrPXGcEAJFT8pK+fs5XiZuJmmg7UJpNNmiFk7ZNqbfUp DPvBEqNq8zMuqErHY2cX75z9uqFOTLLw2I33z7YgEQ/ujrAk7vqVaKDO7CP0+7clDG2McOPfE8j j5xjhQTePiF4+FRjldXhN2NrrKJZA1J26EFQk05VH+D9z1tveE5m1SqF5xfM40= X-Received: by 2002:a17:90b:2b86:b0:2ee:edae:75e with SMTP id 98e67ed59e1d1-2f452e0a44dmr2296450a91.13.1734667884228; Thu, 19 Dec 2024 20:11:24 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 27/51] tcg/optimize: Use fold_masks_zs in fold_or Date: Thu, 19 Dec 2024 20:10:39 -0800 Message-ID: <20241220041104.53105-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52d; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 6af23f8512..9b351f0521 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2095,17 +2095,20 @@ static bool fold_not(OptContext *ctx, TCGOp *op) static bool fold_or(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + TempOptInfo *t1, *t2; + if (fold_const2_commutative(ctx, op) || fold_xi_to_x(ctx, op, 0) || fold_xx_to_x(ctx, op)) { return true; } - ctx->z_mask = arg_info(op->args[1])->z_mask - | arg_info(op->args[2])->z_mask; - ctx->s_mask = arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks(ctx, op); + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + z_mask = t1->z_mask | t2->z_mask; + s_mask = t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_orc(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852362 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852261wrq; Thu, 19 Dec 2024 20:14:25 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVl5V8HvEI2H5SBibUAE972GlpSICUHunijLJondT0bT1iR4NKePYqvX0nTHiPGvX3Po/6Cdw==@linaro.org X-Google-Smtp-Source: AGHT+IFpHPT6Bc0hD39A/zcOAV5xmlGTSo60uUPOpgS+Dams5TEx3FP9wnK8SNrZDQgMP2uycy2u X-Received: by 2002:ac8:5d02:0:b0:467:6461:e143 with SMTP id d75a77b69052e-46a4a8efe3bmr28625241cf.33.1734668065283; Thu, 19 Dec 2024 20:14:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668065; cv=none; d=google.com; s=arc-20240605; b=TQZhnelU3vPPD05On5y5lKz9y++b4dWmIbf8GycwAqBiNUVdeQSQkqk8TbTqml+7Ib 7zsX8s2/xCBI5GSGgW8LH4+kn4E0iW8M8Nom8rQ+PhgI6xFAsgM8v3kr8+mjBRoPPXU9 trto1TsYDil3bz9AbsxJjpzTPS19jehhdufmkqyTpynKbP01yEdM98lwujiYvYbbzL5k 8m5O1rgi0ARYv+5DADYHKBjZKzA5LCZcbDdakVjPyC+aT2EIoDCx5MRLkzJJmTyqggsY STCWrJVj+Wem7DzGlN6B1HTVa53fnHu5JZS1YLYTpfFqrsh5uRVuCnWHEQbAUjjov7yd R/zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=C1oOVeQtXZQwGm0E7MKnqUzsP3l72cl2b6h7Zprs2aQ=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=LGUWuptAG5OEP5oRJVIaxtcwyvQGS22s+aoEqRA35OCuB8pKuCywJ/IXxDi5jVn0GW MdfIaBjexzkPXGhaZL0mTsgMywVjMhDQ1nzCJoYFUNP0xrlHWnLt3wL64EKlO+GJFvHS 9PaKv4BUH1aZUdtE+u/W0Pzbhf1DIxf0AcmTJXgAE76kj0YQLdXDZ1sNcn/fUAACXbuP EfrKCiyy04C/g+nQrHBnyCCRVSa6GRZPVo1u9aE3sIv81gBB3w+WwuJw/BUO6Ai6fS/t QmYskOposw08yt0aS0gywGoNY6wwTsxHV6J75PjeSzZc7aQiM1Uz2UTFV5Srk1MA6/at lS0Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Q3e7tRkH; 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-46a3e6812absi25154601cf.55.2024.12.19.20.14.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:14: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=Q3e7tRkH; 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 1tOUMg-00009q-1l; Thu, 19 Dec 2024 23:11: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 1tOUML-0008Qa-3A for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:30 -0500 Received: from mail-pg1-x531.google.com ([2607:f8b0:4864:20::531]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMI-0006N2-DL for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:28 -0500 Received: by mail-pg1-x531.google.com with SMTP id 41be03b00d2f7-7fd17f2312bso1114388a12.0 for ; Thu, 19 Dec 2024 20:11:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667885; x=1735272685; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C1oOVeQtXZQwGm0E7MKnqUzsP3l72cl2b6h7Zprs2aQ=; b=Q3e7tRkHrbuftw3DhY964Z9YGRCSGkL9gsPAJjQGn76d99gdwXj7dMqTOWvUSv+24c TShaZA2VEuVI+R93E16nHKE6cXM+SUtNoy3C1dMwoIthhCWYZcL2TFLqLf2SvvbxGYlP 6hokPUpNpighxgUi0AFO60sv1+VdzyE1AL5cmJbJBVsv3m1nHKeisrJg7TdgfVlTdQKu hZo0nI/xIVKcgNqXlhJTxh4haYiMQCdbr1K8pof6WeKE1jUp85b3WFr2zINg7Vawo3pk 7VTJUf9h53yFJjC+WaGniTfxcP6ilFmfNTy6yBrJPXyIjGiuk4CAJgzhWAPXwfMP6CLY kzrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667885; x=1735272685; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C1oOVeQtXZQwGm0E7MKnqUzsP3l72cl2b6h7Zprs2aQ=; b=rcFztXZxPpVmAKORWfruzMBuHiF5cqOg31WOVhgMkdswDdF5cQjmWpdL/nPCy6WLON lIx4KUHZ+Fo1o2S8cNVOavk6KpiCikrJU8DkczQq3UEdFUEGtGyZmNGJDelHvbkMjvG8 vEpfL/HOFbmqMiMFYiW0Pefpps62KIsZ/3McRSEzsHgRYnBm8HfsqXmRkeaM05lMIGyj g/8nA9PH2NCmifTcS9IKej4H/bMN3ZZCGrroOYvk0F+cHLJEoT1CqfS9qXjKDDvRGygs GncpMc1NOnKVNhDvP75j97gCAGHWTCdusBm+JnstYR5yy4J3UG47xalcNbxQE4w+M/j3 YP7Q== X-Gm-Message-State: AOJu0YwqWvN3pJKSKVXSqu6tHEFEs2MIGzEun42jKsMfVuFUvutBhV3A XY7PChGIVL7LL3PMt/eyma24FSqC0JfuicDrWWNtvJH5pouSxrffUYgHLOMVdkCLNB2yhKm/HMk 5 X-Gm-Gg: ASbGncvVX/jI0k1gU/mPl4SAEczjwL8supj1pDT08pOu6taGQfuTVzVNumcY7KuPI1i /DwJi4fKvXMnLeLfKx1WDyKoepnzcmCXW7evaKG04lGwS3ONR8FTnJ6cE4nITrF4HbeT61Jm/MR XwwciZ1qzz4im5gTGU5/UW9CZ2hJJ8XTiPGvPTQg+PihKGue45c4XuXelGuST34PwiYeQ6njgUs jAMT0DcUiqJt+wqAjNR6RsuKkXaCpEpLwrsZc+2eW+SLC+/Qu0G9fQGCaBqFbU= X-Received: by 2002:a17:90b:53c5:b0:2ee:74a1:fb92 with SMTP id 98e67ed59e1d1-2f452dfd236mr2228302a91.6.1734667884834; Thu, 19 Dec 2024 20:11:24 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:24 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 28/51] tcg/optimize: Use fold_masks_zs in fold_orc Date: Thu, 19 Dec 2024 20:10:40 -0800 Message-ID: <20241220041104.53105-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::531; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x531.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 9b351f0521..da9c8c4669 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2113,6 +2113,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) || @@ -2120,9 +2122,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_s(ctx, op, s_mask); } static bool fold_qemu_ld(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852367 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852595wrq; Thu, 19 Dec 2024 20:15:41 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUyx7VjniB/4FV/PMYrHhN39URVouD84tMBSye0zD4YVk8+td4khSQeoC7UVp9cR4+wQN08Ww==@linaro.org X-Google-Smtp-Source: AGHT+IEVgKOd6D1G7FC5kRG1Kp9ZQmbIDfu0n8JoL3cAy2Xk7KJ8tQ5e27hU8ND6LCfROlL2FLsu X-Received: by 2002:a05:6214:3a8c:b0:6d3:65ad:5cf9 with SMTP id 6a1803df08f44-6dd233329e0mr25807896d6.15.1734668141324; Thu, 19 Dec 2024 20:15:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668141; cv=none; d=google.com; s=arc-20240605; b=Ymx2AcGpGMdYsH77/7vgB5M88aITOHUvxlMzU1JgkPbts+skv+u0Uw5a7B599NvusK As6eyGGYO5ZQVUSOoTvMkLrqy/VM2yk7azerWJz9efbn1cq8rusJHBY2QHgRCzDRHPDk KDxzAEH8QgSL2FJuKAuKMpzCSpoWSEUyYfXIaFdRjRY8hKaaKTAoDAY0egpCuikRlp/P uX9NQR9TVPYOU8QTRQ7QOvPi6dn5gIWkO+7XZ3MLKE6aHTPkeg2rDdUtsvkHKwJQ6I7c BiQRRVSCPmwL1r3J0zz0CPefsVbRjuvdR00BtUr88vQDZ5WBOCKTm+DnR6ze17g+RRcK q6sA== 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=ldx4yMmQFQdLg1ALYs2lWhfuOJE12kF68SKOPYDg5SQ=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=Omazf1TSmt+b24W2zrYzgfBfvrWEz6KO6skKraBzC4Nt8ZljLAD3I+WGILq7iLF19U o3RaSZJNjLLYZl2ua80gANllJwplJoFgieVrVVpjO9iAYzbQo+m5GjTkvufqEDc4tq74 G0zELHzwY0BNjMBQHZ49WTUaV8Me1LMKXjlI3ZWV854GZvP33yAVLFcEqEY4nJzdAJKC XMf28/azGXkb8O4/fEyKTiaMaUSx3YKNZq79dE/T3HGCOSWQnzMKO4R3w7r1RZ2aZmRD ffq2mOkdUa6ub/zXAZslohmpO1pd2bJvVnh09BFwKjsH0ymBdyliolxSySbokPB5z0LH 3L8g==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="bvLq/s5J"; 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-6dd182337c9si33526126d6.257.2024.12.19.20.15.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:15: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="bvLq/s5J"; 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 1tOUMW-0008WP-Sd; Thu, 19 Dec 2024 23:11:40 -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 1tOUML-0008Qb-44 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:30 -0500 Received: from mail-pj1-x102f.google.com ([2607:f8b0:4864:20::102f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMJ-0006NK-Fe for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:28 -0500 Received: by mail-pj1-x102f.google.com with SMTP id 98e67ed59e1d1-2ef8c012913so1054897a91.3 for ; Thu, 19 Dec 2024 20:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667886; x=1735272686; 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=ldx4yMmQFQdLg1ALYs2lWhfuOJE12kF68SKOPYDg5SQ=; b=bvLq/s5JfCs1NkoAb1aCalZqxyRL+o8qqfbJXzzAAJYMUbm2kZvPyZEyqWmzVWKaqY d8Vha3zcWqvI2ALZbDjdkbIWBDDbN+gMR12LFAR8StNsZHSBHmgwsyiXGxYlpbJGI/90 9WQKh9ewVh8OjkuT2qMXfDAT4p3e3FN74If3qh5Kt6N+AUW/yfalThNFnSLYh3jSwKNi 1gW9ejSprM8OjteMdd+HGdWAO7146BRduYp9GzmRLJeM3R9llk4/PPCx0dsPf7UISCsu vgLlVBK06wknS77qfZ6Q686Jeza7cxYWFeiTZu10/d582HXuCnZIiPwaLnOvJsKSIoPq Q3XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667886; x=1735272686; 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=ldx4yMmQFQdLg1ALYs2lWhfuOJE12kF68SKOPYDg5SQ=; b=oNI2SJoTVXeqFmXettgFQkEKW4A61T4VRBGC42QvQRlD9IZpVuiQ2n9OCm7sTnVRix i04aZxOeOZz1XHy9grR9e5AClnhvx4MmFiYfkhaOAjhtOVLJ1U4xUuEzPtc33PODwSfB HM2elDXpnjDlLWO2ExrL2TDoYUNoidmQ/XZWEMSSjghQGEyLQ1EwT6JtT/aR0pt67HVX RjogAq6O3/2zybULKn3PpT765/wjhuCNvbdZVU5YjaSyxJTmjj5MRRzRwKh8prc11AmV fF4USkQTcTDc/JHxRYMo6NDtTXLpp8+jSikwXa6ncAD4RXWVvE6Prwg6Dk+2EBS+SsOe S68Q== X-Gm-Message-State: AOJu0YzPt9VfqgPfrmqQGAzRWC7T2a1Bi6tbsA4XStdQReqXUOad4GWV A5PzX6uakbmXk33HWhDc0RfRLODxFyKvPCN48z8RYUT+YXwc3YG2tIQk5pb+7Vcr1IAnlouquBo n X-Gm-Gg: ASbGncsnt1kOb25bDKtbtw3zACuJMkIC0OLq5v+ihjL8mRKqCKrXuKwJ9ynYk/o03nX k8nhNyaMdLVJbFqxDtW7rB4KSpvHeiP4CXJtt1utC0ekn9X4KyxgU17PinpFz8y142copuTBmpA k1HlcfTWCv96BhrFMw83JJlfum4aE3zQsej7kH1KQIIRZ8xkoY+gr6TnII7eOXPC2Hnd09uhLRa UIyR8ZncgZVwfsRcVqkG3BizCq5Kg2rPbGWC5BOAnBUH+MP/XkwGWINl4bOtT4= X-Received: by 2002:a17:90b:548f:b0:2ee:8aa7:94a0 with SMTP id 98e67ed59e1d1-2f452f014f1mr2106427a91.32.1734667886205; Thu, 19 Dec 2024 20:11:26 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:25 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 29/51] tcg/optimize: Use fold_masks_zs in fold_qemu_ld Date: Thu, 19 Dec 2024 20:10:41 -0800 Message-ID: <20241220041104.53105-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102f; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102f.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. 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 Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index da9c8c4669..b01929fccf 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2127,24 +2127,33 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) return fold_masks_s(ctx, op, 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) @@ -3033,11 +3042,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 Fri Dec 20 04:10: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: 852356 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852105wrq; Thu, 19 Dec 2024 20:13:53 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWZwUwrx0nhyW8D+rW0FoqFtjamKwshf0+Zzv3lkl6JwvIMNDVj/xiKRUPeFEKTHHaPBMhH+Q==@linaro.org X-Google-Smtp-Source: AGHT+IEShCZerM2LM4gz9iTkc7jC03tExpVdpoiXWcR4SuFPpe2hD/Zg50ohXdYmfxCbgPR2z9zS X-Received: by 2002:a05:6214:1252:b0:6d8:adb8:4012 with SMTP id 6a1803df08f44-6dd233a468amr29344206d6.45.1734668033051; Thu, 19 Dec 2024 20:13:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668033; cv=none; d=google.com; s=arc-20240605; b=JwPXpG1N1fn5lsjqOUYFTunCwrXlRivgzcRnI8P1K8ND9uU9MOHX0XxgvF6HwvcIJM WBZKM8IcOgUJppxend+nvY7hyrA3AIzFv4Ish+h5/YYVmaBEqZ314gB1SS4KixSnAM+0 UwoR/MD+zr5mG9K6D9PV5Dcvz8APGPJddgg2sPaG+pf8xvHPwZwxdfyywsJsujPeVj/g fk0g4SJnpSbO/SanqZeP6NuqyuoUhsyiJuGasYwB3vHkUXat5v6OcqgUpRgQwy16KMJ5 sc283AEnCwzghVA2l0OF0yXa61kIjlviDLlEWbkPAfQtlyBW/tfdc2yDEAc9HrsxJz+H YFDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Owo9Xj6Jzu8SsqWkFVwwmR6pwZl5kA1ujeah6WfrAwM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=PqUJd1Li+mxJmbBo2nzZEUDWomDVb35VgOtxZaE9MAtwgaay0XOmSxHSqBU/QApIX0 kh7PpnU+295Zh3KugPEcUlts7yckWNOQqJYi+K1G9yJJe6fOzBbtLKQcb842Mu2y90M8 4pQlfQQW28HLtb+d3bqLfrh7gNqepwVzKvk3VicgJC0eyO8sUvaONOCl8gzUJJcXytTd olSm0Xz4Pxq9uFY8gEIR+xVifefeNwUZfSE8IpjjoDQQidU1/zlPsWN453exCTBp2zy1 7D4mLBf+le77tG0NboCLENDANH8ezY2GKiVpbmK7wapvj9sQKJwwTIQrfzuum0kWEUmx fwqQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W3liBIQQ; 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-6dd1836f760si33666976d6.511.2024.12.19.20.13.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13: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=W3liBIQQ; 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 1tOUMU-0008VI-VE; Thu, 19 Dec 2024 23:11:38 -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 1tOUML-0008Qk-JT for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:30 -0500 Received: from mail-pg1-x534.google.com ([2607:f8b0:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMK-0006NU-2C for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:29 -0500 Received: by mail-pg1-x534.google.com with SMTP id 41be03b00d2f7-7fdc6e04411so961560a12.2 for ; Thu, 19 Dec 2024 20:11:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667887; x=1735272687; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Owo9Xj6Jzu8SsqWkFVwwmR6pwZl5kA1ujeah6WfrAwM=; b=W3liBIQQrdphS1iQ7G7WK8237imhTiAvZS5h1dAHduracyt1eDHNXJr4Vmu2ft+mnO 5YFVJFnTttbMrR66zCKUkOIHgxt5ebFAIyg6YbwFhbu1ldUPTZFbIQ4yOrPsR6+0PzV+ O7yKBTM7s/+mFrtn2KzxHZYfqz7L9vopYuivufv1DfsHdbA9YkoPTSIkBZYkdTMTm+91 dz6q0k0gsKD5egVfaW7DmcYQbjxRJhZ2xQuxGKia/i1svajEhCunx7IwpKdveavgIRVj Lwb5T4lyts8uQuuEqVg9INz/REXkIiKs3kkAQX+hcuc2DWje7DhJKnT7T1XOWzQRot5g jZkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667887; x=1735272687; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Owo9Xj6Jzu8SsqWkFVwwmR6pwZl5kA1ujeah6WfrAwM=; b=kyvmOAR+QZSclbO+M5b2BbZ70c5tolCc4WCAz0NjHHzHnZ1u9M5uOx2afzwh2p6Few umRuv8fToJSCn1dXgewBNPchV9TtUTy47XeCSUVXX1HNZMJSU/23jcLHHvc0rn/u2e+2 0OrZtXypFHtPbqZVF5xBM3YKRTrsQG/kpOXKUwnhAzRm98787Q2NJEUujiI80Oh/bQ73 rm3K6TTtMnCtmEMOaeyBzIUdnsD/W9OOwHwiA3ZaeTDt9ONEwWRB3mcM2IsqIzl7wdSH YdSjby0JW85Zb4/n9tFI4udHCy59WgktOPiBmG1fcxI89SWH66lYgLxp9EuR1iWBI66q ujwg== X-Gm-Message-State: AOJu0Yw0t7/bCp5Z+SkFW7jAcKREopzXWdprWkAICLESFmNy8cu/BDbV RqFILFm/tGucag48sJ3nK9MJcgtVoMVtddYzWiqY5HOQCO86rXlvAeP7PRe1B1fBvvJLBujkTnX L X-Gm-Gg: ASbGnctqDT/iSRrA6fV38QQh2AvSubyNy3ylRe5dPQjcyBd1CNOY5RVaGCGkS7gPUMo ShPxI61kty6BosiFriASSb1KFmiIzuOF/ynFxZRBKk0O/yCBKH8NLYUZQpzdz78btN6U1L4I5fm VnDoi4+nRho9oMSIP9le2y9FZYm45rSQ0e1BXtCvIqASzQUOW4sdgNL+N2xO5U+utZm7DDimniR RvPkQeDpcOT5G8rUgXte0RZBLVt6dur046tx81zbgU5/acezgkOP1WLmHO4ny8= X-Received: by 2002:a17:90b:2dc2:b0:2ee:bbe0:98cd with SMTP id 98e67ed59e1d1-2f452def731mr2477881a91.7.1734667886796; Thu, 19 Dec 2024 20:11:26 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:26 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 30/51] tcg/optimize: Return true from fold_qemu_st, fold_tcg_st Date: Thu, 19 Dec 2024 20:10:42 -0800 Message-ID: <20241220041104.53105-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::534; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x534.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. Reviewed-by: Pierrick Bouvier 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 b01929fccf..a5a57bb914 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2160,7 +2160,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) @@ -2727,7 +2727,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) { @@ -2751,7 +2751,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) @@ -2761,8 +2761,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]); @@ -2784,7 +2783,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 Fri Dec 20 04:10: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: 852363 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852278wrq; Thu, 19 Dec 2024 20:14:29 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX0cjVvsW1nNNlKnQ0dugV5WDrFqPYf1QSTrAuyGTW8WLfKil4Zn5jbN7iPXbo0DHbGfUD/rQ==@linaro.org X-Google-Smtp-Source: AGHT+IGF0He1uqvBdLwtcdyy4S5kmqRLsZk8uc/oI0PfE7owQfyPLt9r3HFf8U0OneNc9WiMJJ35 X-Received: by 2002:a05:620a:838b:b0:7b1:1d91:5d06 with SMTP id af79cd13be357-7b9ba7f689amr252862385a.46.1734668069786; Thu, 19 Dec 2024 20:14:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668069; cv=none; d=google.com; s=arc-20240605; b=Kr4REtw15ahVcPhaJqAIzWYI5csv+asMhMvbGWkKbg8TZTjyA4KvTQsolek67h1hC+ lxvMR5AhVorz3xYNkPk9pU2IPsnH0RW7gAY/pPN0r3toAuQQTCXO9pVcawLh8M190KAT j20WctFia4mRhWn305U3TseVjHDgwRpTQRc7RASyuwBBy66dls6tBN+a8++r27+du3N0 ihpMWS/Uu7LBPBZTlJcKwVN7YeAxPoh8t2YEObgd9JpbH42zMjTT2Hwj2PH26ypPG6oZ HRUKV12fkxEr7kXT24ZZxlWXGeQqociGEKBammQxPGc1IpPJcr8N6F6Fahu4RE8LNhN3 6xzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ErYpV3fIN2iyazMtPdzOw45/hYntXah9WvXb1jyxFPI=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=FR51nHlOExwnzlu5BDoYKCp+46dmcNx8ASf2ma7aJABWgJf1PyerMjpEHijRdV1E4+ twKoaDzrDxgAERpYPYPtQLtkcEscQdkI1cG3zfWqM1R91fBE+b8mVvjWLZT8qWR3pkla ziwV+IKLnua6zQmMyWM2Sv7ODBfUpE9D2dPjJG2yJio7YP6LvMOpkuXv0S/BxxzYCFS2 BlcT3b1jw58k0FNC1+nH0Zmeph+F5hoBbAjvz32ZIku0vW8fOA/wepKgH7GH9X+GdYPo mYl0bHgU7kxgvKHdmXiU+y0X/TOKmvCeJ5QbrDmdkDAGrSplmGAh4vspkrTcPJedazPi jYZw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d3HyqZht; 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-7b9ac4786besi364999685a.319.2024.12.19.20.14.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:14: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=d3HyqZht; 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 1tOUMY-00005H-2Z; Thu, 19 Dec 2024 23:11:42 -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 1tOUMM-0008Qm-6W for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:31 -0500 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMK-0006Nm-Rd for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:29 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2166022c5caso12522155ad.2 for ; Thu, 19 Dec 2024 20:11:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667887; x=1735272687; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ErYpV3fIN2iyazMtPdzOw45/hYntXah9WvXb1jyxFPI=; b=d3HyqZhtCkyNL1COP30X4hxu8ldFWEuQjj1f3lmsP0vlB3Cn8J5IzZznhu+PGDQgIr wbeLyPkE8lHWzUXU/sX+o3mzTttFDVNZU7Nlqm5ODQ9Vp215gt6NFI4Rxg4/1ngJajZ6 lTV05ecwWnLrv08/iLcbTT5m+UVyWDRMIqu7v/4y/WfTPgjRoaoom2aJHvW7Ai2JEnKn aDt7WyGt98FH5hPZ6Hsqfn1kDBeEDzVFZtZMqEa97ccPHyAeOGUZ4iY82nMtBIroS3ug 5Rmj4xSf7I+C76pJeyLdvmnLjsnRaRVPV6euQaL14YIO6VUSUHjkT++qFR6HowS84wWE 10yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667887; x=1735272687; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ErYpV3fIN2iyazMtPdzOw45/hYntXah9WvXb1jyxFPI=; b=CQBkkMME3/K4JImjIeLeDz0QvY4jJcJkq2YP04L7Xje1b6HiOpdManqw7NbJudMMJZ IjlvrPSmuzY24FkEGSosBc/qWbeHxQuB9W+W4kiOOs3JhNeWDhq0V83R7Ym8t7MHHZJ8 JNDsX2ddbwI8BjTV6JDcP386JDmKQrYCKWniTDOt4bLfrdP1qteBHIvMiDH8aAiZENJd olGWYuxJ1Z05N9hdm+8KaegzelMStbILH7rLX2KCEV7mo6xeCyHid5l8PrsOUWnHQw/2 cn3pABFs6mq+dzRiUJmpueBt1WWqUlEYkzFOar6RreZ57M0eHuPflSYHpzStyox4YMrT hRbA== X-Gm-Message-State: AOJu0Yx/hnl+z4BQZp+5OlYkCQrrbN+6UFPpxk139a/yTuTQT6PHKong Tg3UNFC1iw+6UhssT37CNqoqHzIEZjJ4EnKbN92VWyJTgab6XxqekZZvjKMUijirNv37RpRhReH a X-Gm-Gg: ASbGncvUTjpsEr6xv5wl9JZS2gIOayh8iO/2u0qFDNvOewPy7nEb2DkirQbOaHlag/z 5DOTmtlri5dQvonEbzW1+iy53GVmi4wZU6LGWJUzNKL7x6bDm0PosOk/0KXeBIAPAeJQaTX+Enm jisNlbJl3dd8GWLX7T3dY93JELSfjvjnN57d1Vqun4Cna/dwcxHbJ3bt3rhijSDOKGcLwnYFemS LzcEzjVxfnpMKrX1iY7dNqoZOCsNtEtQIBNApbUI1pYeWdwbBqnaPM7/4FaaH4= X-Received: by 2002:a17:90a:da84:b0:2ee:863e:9fe8 with SMTP id 98e67ed59e1d1-2f452e38005mr2149258a91.18.1734667887428; Thu, 19 Dec 2024 20:11:27 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 31/51] tcg/optimize: Use finish_folding in fold_remainder Date: Thu, 19 Dec 2024 20:10:43 -0800 Message-ID: <20241220041104.53105-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62f; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62f.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 Reviewed-by: Pierrick Bouvier 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 a5a57bb914..868da884f1 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2169,7 +2169,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 Fri Dec 20 04:10: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: 852364 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852286wrq; Thu, 19 Dec 2024 20:14:31 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV4kCaak6Xzn0Gv295WHqz9UFgTz3Vulx6XUkw2CsfO/XGvSbmg8yWqhOwHf3q0oiMYPl6YOw==@linaro.org X-Google-Smtp-Source: AGHT+IH8boQcXtisj1OYhtWLBzp4AsbBfeNqOGGhkExKBfm7ul8FC3xpOlP6zV7kRp0R6lxf06TX X-Received: by 2002:a05:622a:1911:b0:45f:788:b1ad with SMTP id d75a77b69052e-46a4a8ea5e7mr27311051cf.27.1734668071156; Thu, 19 Dec 2024 20:14:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668071; cv=none; d=google.com; s=arc-20240605; b=QOBwhDPfbmBe3Ul8RdbQgrLjxynqHaKetAP3Xdmn2diPJJ+K26Un3UA49fMc7sTLdG PDpjmMm+tU33ovEw+izn8zhV/hdFoC6BO3H3uEVnpLUJtCJVzwpXjDIQu5jAftjZWpCM nT7U9iblDP0WjM3fpLvhMTeRymophfbTo3ANUtnIIjIfUp/0n7x55/I9YAfNZr9S7rZx eXncXCZa9ZPeUyvGdiaB7miHqtDPDZvUoBiPBE3YgFhNJwaV6ahrCORY3lFWEcLrKFSl IizBPmFATu8UCGSW9J/QFaaWkEQ4drFk9CAQmG+Mjy3TMFBKAJ/oaK71SLvopmmnfcfr L4Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7JAIS9jf3/vTegmrONjuLySkdEA9/VNp6mDNTKWpQWM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=AM6BIjgz6vP3Bm0u6IrQwnJUUvXbC6K5hFZKlFETkCy4r9dqZV8aL3eM7GWWIpSVjA k+1Uurtr+m+pH3xgyogNSYCVV7wQ4CbQVHUlIJ0ccNZmya8Se1eDhW+x6cvDmz7+Y6PN ApPvN9EjOo1ID1W1e9eAyCkGOtVIHuYfdIFfbZFJetHvSDZY7/slw/FOoMDGRPbr/M8I hxPSnkzB4A+NDL7QCoFY9J95bPJqPHMD/N1sYaviVD0vjrd4CVWsrz/6AijbfCzoQd0y F8mCckJNFInJyQKjpo4JmNtDJb4MA3bahnjPzq5KffZjmt0fVsgKYxmdq+JdF2LB7JcB yFcg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=slaoGemb; 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-46a3ebc0966si34077021cf.424.2024.12.19.20.14.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:14: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=slaoGemb; 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 1tOUMX-00005F-Fp; Thu, 19 Dec 2024 23:11:42 -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 1tOUMM-0008RA-MW for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:31 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUML-0006Nv-8o for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:30 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2eeb4d643a5so1396874a91.3 for ; Thu, 19 Dec 2024 20:11:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667888; x=1735272688; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7JAIS9jf3/vTegmrONjuLySkdEA9/VNp6mDNTKWpQWM=; b=slaoGemb8D/JFK6Y0RQRY1qbDCCY7LlSm8Plal28dzYfEabxD4ETi4yIrAbzSTJhO+ w/dW6MbC3gt9WDi+bL6c9PXww95P7JnwbbNfRxWpRLx2vZw9BcmF2gtzYKmFAy1x7gwc worx/cwe5CH6BH9/F8V4+rWtyeM/MtR3yGQ9StOOKSW/DhINsz5XfZFTe9zFJXIaDX6H h1+HPlw7sbZLn7TyH1cMFvQYDJ8uwwWXp1eExuuLnWuiy9zJXKM4oC3a68G39GRKQNAs 9JX91qlvmpthilKPi7K0KmF6R0nyXktlWWgtD7uDdIxtjveq23szPzIJzsm0eBEhW8Wa YFWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667888; x=1735272688; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7JAIS9jf3/vTegmrONjuLySkdEA9/VNp6mDNTKWpQWM=; b=nkd/oxW0GvzG/TdUbvK0RF6mcU6b70E0LomR4yj7stDdNmTLIugptoPjwhbpCZknIe F7kv+3GlP3ZW4r3fYycu4y2vsB1CADCwpSStFXDEvEkYUSwpcLfKJAk97Tg40BzcR5YO +3kRf/L/O/+Xe3tf4B4bYg/W5QeMbw145joUoRSlmUmIGFNWkgWYcbduROQINUBpDnY6 UaCqq2LhsnQKCe4N1bXu78s5+aKOvcXSrqQQtkBMcjD3yDs8FtJlK7BWdpvBh3ipFLbz 7qzH2uZ7OdEhS+19B1YUJygw9M54BoSPBK6Qi3jhpGjyMoG/W++e1658IAPTzBxpmcCN ehLQ== X-Gm-Message-State: AOJu0YyNl7jxuitpSgcuEnrxJpsZ7rtWnrLcia1w9QyVkuVL3mzWrm54 ipLrk67K0d3x2PG+lQETdfkcmxksBQMUXOj4xms4qMf0NOalygfoCB+UqZmPvTX/pgdgst9Pkvh 7 X-Gm-Gg: ASbGncvv/z2eqU1grh613N67F1/TVESa3s/ji16T2yHe5YhQwiPgQnRv8Lj9cKRYsvt Dh7JuG9BJXpHxWEz4XvM+2y7gxn9vleD7x4Rdd3u5L5+GQSbI+3CIIOvSqCZi46gqus4BsNtEXu Woo372yfgqapgwPlWplDHKkjBVwhjvt6lvsmYOpRbO7Jt08ukV7U5Jbtu5DwxV82Etmr5qA1EG6 w2Ha9ocNtqzm2SPZ36eYAINNXu+48pToiwD/XfGz7WyEDFZp0nnbj19dQyyvm4= X-Received: by 2002:a17:90b:2545:b0:2ee:74a1:fba2 with SMTP id 98e67ed59e1d1-2f452e3e83cmr2253204a91.20.1734667888075; Thu, 19 Dec 2024 20:11:28 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:27 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 32/51] tcg/optimize: Distinguish simplification in fold_setcond_zmask Date: Thu, 19 Dec 2024 20:10:44 -0800 Message-ID: <20241220041104.53105-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.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. Reviewed-by: Pierrick Bouvier 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 868da884f1..9c4bb1fb91 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2172,7 +2172,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; @@ -2267,11 +2268,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) @@ -2376,10 +2376,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; return false; @@ -2393,10 +2396,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 Fri Dec 20 04:10: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: 852357 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852109wrq; Thu, 19 Dec 2024 20:13:54 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVKGid3Q80KRq1i6SnYO7hDAz0PyDW56A+SFkYyX9z39O5neIbGI0m+0ppIJlkKLx6S3F4AdQ==@linaro.org X-Google-Smtp-Source: AGHT+IEeHBBP3o+4V5bFmCjHOUW6G2vsI0I6y0solXNw/MxMXdhqwwCJ4KKrRZHq+u29hLOEDyxC X-Received: by 2002:ad4:5bcc:0:b0:6d8:8109:a547 with SMTP id 6a1803df08f44-6dd2334d8aemr23492176d6.22.1734668033972; Thu, 19 Dec 2024 20:13:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668033; cv=none; d=google.com; s=arc-20240605; b=M95SEw7U6mYYKfoJNNGe3GyEJHCW38kLXBDaZV8h6ab7uJcR25l0+A+RBqUSnJXeVb XbXVNHoAAkS3Tq55pcsCiCtcbi//mgerWS7kGdwjaOKAukn2Z0cc7y9O79s2dZwaFdIO RTdPtVM7imHj/VF+uPgTeWYB6Qvej9h/Z1ZM3jrSgqjyV9y6PM+rLJPLuUXo6xUAMGP4 pC/qByEzid4mFlHYECepL+BYlc/ZB4EWlaTHxj2yghobYp/Vm5WiAslWbd9ICeEdjS8e 8jRUWoUNh+iRQ+VxPQ6iH0DoAW/rPIElvIcuUhfysegoY68wGWTyO+e+gVwwN3ib3uQb DbGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TJ5jaLrHM0v89QaKJI8z+UOp7RGcZR7YVrz2twbR1Jw=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=cVUUYejqqJSj83/Ldg8ZLReGoQD3rvzIb4f6Era7fBnFp/X77S6J7lmaGJNumiXk09 JONQ9PNNPjs5hHG/yF/bSYdBObpKlp/QEfqBHMU6Vc3h/rWdq7RL+Q5QaizjTBvI3Onf xpL/Qp+u+pYg5TfBxuwuSDq0QLvilMvXYNj2FwVnN5bbTqPytmuRfpmKNIQl7QcgNl6d iP140D+Tm8kQXkBmXZROrmomSvC3J5/XqYsgVUNJtSR+Ixjt62qx51pBqzqT9whhzayz P81dyKGbATtF6uMa/XaNb1cCTtpwgkZFRPb9fWRagnHGbArcTbXyaTeopK2/I8FpPSXN KikA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iO47zXw7; 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-6dd182333bbsi31205356d6.262.2024.12.19.20.13.53 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13: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=iO47zXw7; 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 1tOUMZ-00006H-FX; Thu, 19 Dec 2024 23:11:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOUMO-0008Rf-5C for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:32 -0500 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUML-0006OP-Rb for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:30 -0500 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-2efe25558ddso1055840a91.2 for ; Thu, 19 Dec 2024 20:11:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667889; x=1735272689; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TJ5jaLrHM0v89QaKJI8z+UOp7RGcZR7YVrz2twbR1Jw=; b=iO47zXw74+UnBaidqkFyTzrLQjjL+w56LW2dJBnWCsVHgr5W+z/E6JJYGnSOefp4Q2 L1YfxU5oP48gwdj2MK0MnMuUjcITxI2RsfaE7nK7+xIQamS199VEHy3Obq+WgXeEq1Ko s7ugLCr2JJqthUHGEU0FDkc5BEkvxQ2l62IpZod+UQurp6Rue1A8LeKlZIBOjJmvN2HQ NzwTSYUv2FCtGDfgC+2wFmNyBCoLO+7H30pVGtdNUIm6XTJNNPIDpyR60oJaLg03H0im pwE7yYBFzRXhxWQ7A9zz1DeikhSD+QsNsDfuq4QwiTgNgaARo0KNaUEzN/CjuvfIloOR 5YSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667889; x=1735272689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TJ5jaLrHM0v89QaKJI8z+UOp7RGcZR7YVrz2twbR1Jw=; b=Y7tVyZEpRE0trT71wAhcaieDvLsmEVWwNXX/Xq8jTDP1+Yx+j3irjj7WOdGjI0hE0Y 73e1JADH+g04pHITTS93gLdvB85M4pRCqiaiERpLR31KswJDVTczbZytwL5e9YiPStDg KgBOU4IzTLuG1MGVdFZWulWyZ2JmE2BWYdx14Mmu8afxDaeBUxszSFRGW/HxsaMY5Yea pHJSU3mpryUdE4ayJ12hnDDi7+YjKWlS2JqSMHTH/GeF3ye7K0pDg/aaTZsFC2E98m04 XFZ5CGnxdW/2W14sazC5oogx902orzYM9zrlkuIDCZvixPkZEDSKmnV+Cc4LR+TCV1HD m+UA== X-Gm-Message-State: AOJu0YwsuhJlVYLh3hs2qiwPOB4X1U9lgKUQpsM2D/QbFdtKEsUjoyWZ DEHNCxUIeF0ierO7/cypKrxEB8fB3HWhhzt8OIHeCCD9KK1w4Cuq5nelo1/c/VfXIqi5aagBiEA W X-Gm-Gg: ASbGnct1kKPGAKo7q6bEiwfjqUBstQQ/vWZD1GYdSwMpY67DjEaM2xDqdVct/8wUr0+ uuziIisi8evP/C/aTH/MrTcVq9aFcOQmtl+vAco5YImnRSn63joPNNXNX2AJ4PTmpzpBMscRS8P dgvSZGgCEq/6zP4hFCS3ey0pTxJtqzWUt+GcaJuHgj1XXOLvy1Hoe+zZB4oQodrcfkju7G50nW3 coU+sTYcR2FFJ6rhpBbOY6smFYLDrOvoJSIvg1eBV66SDV3mzDVs8Si9VWy1OQ= X-Received: by 2002:a17:90b:2dc2:b0:2ee:acb4:fecd with SMTP id 98e67ed59e1d1-2f452e044damr2339553a91.9.1734667888677; Thu, 19 Dec 2024 20:11:28 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:28 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 33/51] tcg/optimize: Use fold_masks_z in fold_setcond Date: Thu, 19 Dec 2024 20:10:45 -0800 Message-ID: <20241220041104.53105-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 9c4bb1fb91..079b5b82ba 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2384,8 +2384,7 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) fold_setcond_tst_pow2(ctx, op, false); } - ctx->z_mask = 1; - return false; + return fold_masks_z(ctx, op, 1); } static bool fold_negsetcond(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852348 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1851916wrq; Thu, 19 Dec 2024 20:13:03 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXF/XcVy64rNvKN+8ebcxZuwAM/u3f51fPJd43/udXrRwClNL3baMhvFXMpQdsT9BwFQE8oGg==@linaro.org X-Google-Smtp-Source: AGHT+IF4VRnUWzv5rAD7P5raKdLveT5jS7Z/5aHrX9YorF5tRe/zV925Kb32X6oQwdG7iokU1jFm X-Received: by 2002:ac8:5916:0:b0:466:a41a:6448 with SMTP id d75a77b69052e-46a4a8dcc66mr23122571cf.18.1734667983575; Thu, 19 Dec 2024 20:13:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734667983; cv=none; d=google.com; s=arc-20240605; b=iOC494NtGTEXXzziPegIx4VHQNGfyswiJtZ8lWh2rUO/yVClkPKFMv3A93FZIMOvaE 3GTC7UYLZxlyE4QQfDlxHErYY5+KhvH8x+/4oD793IVrtgdbnFnJB5ngtNGsxQ9RqEKl OzP/OU+9u9tS5S/xyyggcqSDhzJuu4f0XYpSoW2jqLHzOPQ4SmcfqcepgQAP/EGTpWD7 16XI8Uz7slRgq2cqM8nYrvI1YNVHLEi3WVeL38HBp7qTtl/UaK+u8RyB/+R42fc3yBe+ Avs8kaAGfCKWpVh75Y5WOqbjYIDA8IBGGwtG23IpsWjppskuqTwcpfAjiMF1tTuAATV/ u8og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ln9D/mx3EiGh8lpioXoPks5hCwXKzkMo/aAb3sVv8V8=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=RpSt4I6ZN5+lzzM79Zt5XZbRrs4rVXUkOlUdeGZudtYjxd5GxiqebgHw5wNp9Lv+gL nHw/0eZpOWrdXyEyzTkewnfakQVa2orb4K40cRogSyL34Qpdo3/x15sYdQj4rdHnkFce p+sRuEBuJWkR825OT8LdsYV3pVtgRDhYdVNImmT8UElNZBBC+oUnaEK3KaxQ6Af7qMi5 c79Ed+y6sfLmLLHNL4MO85GLYIHE+QyGtrXpZ36YennZtEHXt+nfxmnrxAIQL8iLffVZ s5GU05r1ElpBazsHijkxmVeB4eWOZW5XLPX9ZxfscCt0eiCRPLfMein1MiDNM0AauxbF eSaQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=c08SWE+4; 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-46a3ebd4410si671651cf.509.2024.12.19.20.13.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13: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=c08SWE+4; 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 1tOUMZ-00006I-Fn; Thu, 19 Dec 2024 23:11:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOUMQ-0008TX-B9 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:35 -0500 Received: from mail-pl1-x629.google.com ([2607:f8b0:4864:20::629]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMN-0006Oq-Ul for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:33 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-216634dd574so10044195ad.2 for ; Thu, 19 Dec 2024 20:11:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667890; x=1735272690; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Ln9D/mx3EiGh8lpioXoPks5hCwXKzkMo/aAb3sVv8V8=; b=c08SWE+4t97wrT2eeC3SyquMtkvoFQO78UM/g1q6fvY0qe3lKhS6nXJZinFSpZ7z5V BdYZPHV2Vdms8qTYQy9tONtd2c6FLVvHKLPZMPgQAqR7NRjzRdA5+R8YSCvd5BpZvS5a 1kUmK2cVtJhbLq82cvZg65ud5udJEmCv5cNtlfgRGWl00rexVSan7zOEf870q8MgUz2Z ROe6TpkWc7+/W8B8FRBL2BQMVQmB5ixkU8foJFJCh9m1Eokwyue4XL8Aovl3DbJA24PD zDx29Ihcku7euO9VDNKzFFiKIRRyauPyjHnlQp9fB1Et7LIlrFnrSL6sneQAVa3tGKim mhLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667890; x=1735272690; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Ln9D/mx3EiGh8lpioXoPks5hCwXKzkMo/aAb3sVv8V8=; b=LvkCWmCCfqgsLCwfThNLmoeGDgmfxuh/HTG9JY3BoCdyp0k4GZdGYdIQtucfgz/w9p vrNuWdHdFT+JwcAVTNWuNCZ73oayrw17uyZJCHEo48T50u/2xAifzhQPiRHHChrcWNZr bFmgpvJ9wIZpLTfQWyEmGksEEjLW6vl72l7dADzw/v4XsWKnXCUoV4gRoO2zB2Px2M5A WR0MQue0RXXzIovMLhZ1fuQkNh1VFPO/bUOsvc1rm49hHGMLNn3foIk4g8YXRPBHTVRw nyer2+dTV96bzvIutBxmYP0Zu3Wn+GiVA1TnxWT9HDoWNL5qQ9AVIENWiLGFIvpkcqGy AA7w== X-Gm-Message-State: AOJu0Yy69EsFAv875LEm2hLy4apSIcEYpU8bLROj42/yjWVy2DH9fYfz XhkOgQ4QN0VFpJUkXTpWtKDPmGKl7ETXoK5XvUb5vuHExNZQfCoctmA0Enf1RsksigTC0L2JRx+ b X-Gm-Gg: ASbGnctSL+03z2rnl1hit3Tk2NH6tOb0qCGg+TY/1UONMEOqKffVgCxl5SwfrkM9mIq J0jjJAsyHWNSlsfN6kxxb3RWKCRNXw0R2LbU0XRYsSCQSDGNiGjpiM4F+RqrC3xGZslc7A8z16k Jcyr5q0s2/RGnVYjTL6FewJfRH/H76+MaZfckRuPi//fRoQJ1N0lD57lr8UgzC/Hvt1+21ArlNZ MktiCjCmne1LZt5wmtuMfQAY+RzSsIHeIvuq1F5ymAbPEXl4vyzlWA6wbUlzEc= X-Received: by 2002:a17:903:2c9:b0:216:18f9:528b with SMTP id d9443c01a7336-219e6eb63c2mr17343375ad.26.1734667890473; Thu, 19 Dec 2024 20:11:30 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 34/51] tcg/optimize: Use fold_masks_s in fold_negsetcond Date: Thu, 19 Dec 2024 20:10:46 -0800 Message-ID: <20241220041104.53105-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::629; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x629.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 079b5b82ba..5bfcb22a0e 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2404,8 +2404,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_s(ctx, op, -1); } static bool fold_setcond2(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852358 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852116wrq; Thu, 19 Dec 2024 20:13:57 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCX1Rag24pTmU3mLk/Wm4zX5OlqbbGTN7atsjos8BufKa8Ofq0M6okWkc1Q2jcUFgmQpAyjKnw==@linaro.org X-Google-Smtp-Source: AGHT+IF3T5/2gSD/Q9iIv64Q4QT53Fp0bplvvcfnoWYNsrIthINhRaZhAkNa40KOKjy65XU0g9PI X-Received: by 2002:a05:6214:3c8a:b0:6cd:ec00:205e with SMTP id 6a1803df08f44-6dd231f4ebbmr25908646d6.0.1734668036905; Thu, 19 Dec 2024 20:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668036; cv=none; d=google.com; s=arc-20240605; b=S65gS8D4ZvNgYvYKvBfjbniwRR37FaR8qpTN1LeZ7PkO/5l8pqLqtLv4ms3Tv6fQdB u/i7wy4ndEdXgWL4VcRRg0cthHyEhNHI15G4avGTuQnyaRZf67t7M8O5rMzUfKC6Oktv dk0ZVaiBEuJyQSkSHJFQzpYiB956csUmqggf99urH58Yxq1IZKvJriYHmmMLp5K7VUrA N9rZ2XqICay1sUt5uqCIrdEXY+PiurbpYSHeePdRfeVInmbHgGQ4fS1F/mWvCyhSrOc0 v0SH9QJ8Et3ddtUiH1l7FLTAHn69SDQ5h0qfjyuJE8zD2cU/sdA++S2IyQg8yCA6RDgw fUBg== 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=Z99TKxTEO+476nesx2pjqXvWwDVBvcXM5vBpRSH/Ths=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=ltHmy8bA/e6GG7VoxdjyrEj7DZQoX/1Sayt0ojkWXMTYMjCaI3hdd9kGm6j9ThpP+7 Kcz8zpWjJXHEDScMpjePBR32SerXOgq1lFAfKb0U+Pln7R3k/Jmb2/eHR190ZbXzzAoa VtLyCV4q1BdK0kfxg5oU2CAKvVan+Ml+OV4bxvr0CJ7fF3qHAevryyuSJ8fwNfGSp9mx cgWCm8BbB64VjmPJLZVwXtmJyhuPrNj4nAwvtUgcqg/LqcE64GL9RQDCdDAf/YpkMczB rDkkEzySv00/O11Dj6bz/wHR3oijkScKFLMKsh96i3pnJoVtGzbYKoUH6rVgoCkbrxZ5 0OoA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YHTvwHIk; 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-6dd1813928dsi31175126d6.164.2024.12.19.20.13.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13: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=YHTvwHIk; 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 1tOUMb-00008P-Oh; Thu, 19 Dec 2024 23:11:45 -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 1tOUMR-0008Th-DM for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:35 -0500 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMP-0006Oz-DF for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:35 -0500 Received: by mail-pg1-x52b.google.com with SMTP id 41be03b00d2f7-7fd2ff40782so1278122a12.2 for ; Thu, 19 Dec 2024 20:11:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667891; x=1735272691; 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=Z99TKxTEO+476nesx2pjqXvWwDVBvcXM5vBpRSH/Ths=; b=YHTvwHIk49WuFrORr5yw5HK0/QCnWVo9Z/DV74BdwQdutqOro9R5Z0Zu/zaXE61g9Z mDQtRnzTTQgCJjK45lrersxxoFSGDZul12WjyqKZB2DySCPejev0CvE5QHw7mj3YldcU CzhxO3lqSclh3zGhmL4cgUGgj81hEuVuOJ+5YDW8iH9LsvOJm4Mx6zjVirQs1ztCMH8E frqJWdDftcpu7jfOi4DU/TJD9gkO/vj5hd6GHrWeirEs/XsSvRpOBOM/wMxNPXopB2Ag cP0LfV4oNiipxncNoV9eyCWI9qY9NdRmJ+6GkPu3bQJ0ayImvjaNAcUgjCdZ24U33Z6R WYuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667891; x=1735272691; 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=Z99TKxTEO+476nesx2pjqXvWwDVBvcXM5vBpRSH/Ths=; b=JKOcuq2Csx7AU81DfPZaTpu1vrnYAEBTpyAci0PhUWcEqebI1/kirlStKrnJI+BUu8 O/doQ398L4TAfPisN8a7p1Kd4njPEDS1AZP91bCChU0VYYGZsrjVpGrZ+kgMaWzyraIW Wa7ruU3g38MHM8eAScQhsieTrpYfflPX6T6jhas8nmnWZsuBE+ASCyrUEsVTI+zsDr+q VROH5NhwoN+mSL1u8LwkcmAaa+ucu0yvAjpbc3UxwfNIJ+duThVsyQL5EFhQfGKXrKOo zLQ3344+gnlRUA+IRruvw7v/qvFriPQwROWVaHKKKLh4+7lq0v2pUllneS8UxmvOn7CP p96A== X-Gm-Message-State: AOJu0YwltoGcqC6n9eKRd0+KZJmveL0uhR+iLznDgo25rvxlgJQH/N8q /X4h+Cp0g7hjVY8jCr6+0LAiAeuHFuS493T3isEEXEyFVRpaI91+r7iT5l+uc8ku9xWlYnSXk9S 5 X-Gm-Gg: ASbGnctYKbvk/miU7XlYmnxbH/MC9sumMHyV9jlqRGGtvV4uZIJh1OeXh9jFM+kajTh oy4Owq47gyR+No3f9pal7oFKKlp1XQZOCyS2XaKbd83i3E8T5z/gJ5LaDRrN6l5fxAsEnbR7OOR qKVWMNLvgbCn05jKitJiH2pA1yj/k0cmgNC/qIl2iVjBsUYHuxNcYZhIgw/F1TSXJPeCublSpdm L6LiZU8/NWFyBmLHnOcAAYNVXQ5C5RmDuZfkV6lHxKa3Cg0KOjubt0tjQ7uLgM= X-Received: by 2002:a17:90b:2c84:b0:2ee:d797:40a4 with SMTP id 98e67ed59e1d1-2f452dfccacmr2654171a91.8.1734667891145; Thu, 19 Dec 2024 20:11:31 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:30 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 35/51] tcg/optimize: Fix sign mask in fold_negsetcond Date: Thu, 19 Dec 2024 20:10:47 -0800 Message-ID: <20241220041104.53105-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52b; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52b.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 sign mask is about repetitions, a la clrsb64(), so the lsb itself can never be a repetition. Thus ~1 not -1 is correct. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 5bfcb22a0e..63f80efeec 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2403,8 +2403,8 @@ static bool fold_negsetcond(OptContext *ctx, TCGOp *op) fold_setcond_tst_pow2(ctx, op, true); } - /* Value is {0,-1} so all bits are repetitions of the sign. */ - return fold_masks_s(ctx, op, -1); + /* Value is {0,-1} so all bits above lsb are repetitions of the lsb. */ + return fold_masks_s(ctx, op, ~1); } static bool fold_setcond2(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852380 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853349wrq; Thu, 19 Dec 2024 20:18:09 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCV2kYFAXGASC3pCdkBrI2xfBcwprL2kk/Q1xlSgddiVY0/sVk9MSubYMbSh8p2MkSbcDEL+dw==@linaro.org X-Google-Smtp-Source: AGHT+IGu9Cs6inMI+RbN0+gYsenV7tHRfZCI6ctikMu8w+iwFP+RpCPxy1oDYKQCX3mGTp3NaOwT X-Received: by 2002:a05:620a:31a8:b0:7b6:f34a:c0db with SMTP id af79cd13be357-7b9ba8237d4mr230172485a.57.1734668289255; Thu, 19 Dec 2024 20:18:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668289; cv=none; d=google.com; s=arc-20240605; b=iaJGF7V0ntYz9nKXgUESAvOLfriT5Z151aPLeXBRlVT69EAjfK3TkjYbuHOnQU/kt7 J31zsb47CkdP1KvfDQb556SmlzLp2VlNl1sLnYOncaSKjIVEEE5ckA3SeDozSQ1WCDx+ HBLMrqDTTJ/heOTR5L86U8NMHdey1ELlJtDwJ4XNwnhlcaFjFoNsR/8hORwfog2LAxE8 omOxAht+7YndCyIY6FFij7kh8GWUmPZXzS5P+HKQgqDe2Rd0sJ/ZcsgXYLOd/E11O7yd 2Ja8c40W3/lUjr6jg/x/a2Xi7zeUzr+JXi95UYWu00xxHK9yVwKnqVpin1pHhJcZQ7pt TSPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=EyALDr2SSgMlWiOhgKYyIJNrGLip7wIlDdGWsxU+U4Q=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=RlrZ+lsAu5kF1RjDDFf+xnG8Zf5kuGi2S9EMCAXLOVK1jfb5r96Vut+zy+qodnFz0E Js6RGdlFGLpIy/6leBChqSKSO9VETbPeylqyC3iSQDApBIyuO2CVgeAZ1feIDsleSMBn 2wkDCG07A+jVSiGROir6vjbv/q1e9MCL+5HkAY4B/m0deIws7aurPZ3VubiL3x+SJqNt ZmC8t1cvcuats+t6r0ExDLf0V4ye7FdRN9zXMp5Xdij0CbkShCpXvzALKC08uCGsUgo7 JsDlS2BTf3AfTxKCpWRVk57CWmA9XskcczMnYL6Xehww2i2i1HoTX+ngXcckCrFU2ikz oLxg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DdUv2GFD; 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-46a3e680b72si32664611cf.110.2024.12.19.20.18.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:18: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=DdUv2GFD; 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 1tOUMa-00007Z-Vj; Thu, 19 Dec 2024 23:11:44 -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 1tOUMR-0008Tt-Fc for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:35 -0500 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMQ-0006PB-13 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:35 -0500 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2ef89dbd8eeso991730a91.0 for ; Thu, 19 Dec 2024 20:11:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667892; x=1735272692; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EyALDr2SSgMlWiOhgKYyIJNrGLip7wIlDdGWsxU+U4Q=; b=DdUv2GFDSgcWEy4Vlz8F5x+VkFOLYT99Wq0rNbml40tuNJqbCDUJtHwqGHLMNJ1Wwe S+6oCqhj7iqh+iL3IRKjfWS+ENaC6P9MWSjh158X2Wc5OCmGKdHSS+Zip8S9Q5PiO8A0 YEUiUhE8YF7tCK7+tTdl/xI6UmCQRWFgs3LJM6BxbDJG5NsEukQovGnG8lHmsV3HKx3J 16iaYzlwRSCE7b9HpageL2dasvgSvSp8CHpF+DwMTKv/OUZyYIUeu4NQkLTSmtF0KRyp IddW6fcnWM3ealtDRAbY2JnqkfPb9+A0JNcrjHElFJS93XzmA3lA7cN7YA2IyGpEFDzx drrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667892; x=1735272692; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EyALDr2SSgMlWiOhgKYyIJNrGLip7wIlDdGWsxU+U4Q=; b=bzDSQ3uMDiecm3hLBGej/E5c7a8xORs8rMq+ANQIS51pHC1Hy6CNV93Z8kvjjv8Af7 JUJvTpRVOYh7NJagoxTmXlArIiUqYecTT6qezCbnwpjQiVJbsnxto0YyIqgxD0pTmztg 4k6DYOO62Ja2e7J/S+1OHiNFSIZNPwX9QHKRx6eZ7f6PsymMer2w13CZ9hp3sTd4pi9Q LrbnZwCU9cTaPxvBU0GPhoAGjCRWAGR5tCbJmK9YbN8emhLyHhcfmO5x3Fxor0HTTXVO 4OcKbESxDeam4+zeho33O0fny+wzZu89eqB6o23Q2Ekbaz7sQZh4P+LIdPNQX89sdZM4 t91g== X-Gm-Message-State: AOJu0YyU5htGblIzxQT121Q3TJrj4wWprL8elvyFsXX0oa9SwKpKOmry zxCu89CwtGwqRJNEGTL08PCOC10Twq61GcyXqgY8UH8bLrlhvgZM3nTQTr5DvPVUMG8bQ5i/qxK m X-Gm-Gg: ASbGncurF9aRbkFFrO4nzt9qh1UOUvmAyj94Yn5n9x8pU71tcqqglQAmm5hoybfmIqd KqxNwYWtgO5AyeHFCtPkvXsfl/1fp6rMYsZt8hgxe5qxut6Vj54qorEuBA5Q5+NAnpQ38I7J8rX BFkCiJf/ePsoaEFM2z8rXU2cFKqrbRPexm5NmKZg7a5rtMpidV42HDRrlZoqOGQHe0jg92eJblE Sv6AWWGy/8ui8G8tkNWz7JDpyavDxdcZ3Gv/ig2541bw50LePezn9F6RI8k9OY= X-Received: by 2002:a17:90b:54cb:b0:2ee:d7d3:3019 with SMTP id 98e67ed59e1d1-2f452e22555mr2825610a91.12.1734667891830; Thu, 19 Dec 2024 20:11:31 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:31 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 36/51] tcg/optimize: Use fold_masks_z in fold_setcond2 Date: Thu, 19 Dec 2024 20:10:48 -0800 Message-ID: <20241220041104.53105-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1029; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1029.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 63f80efeec..a7f37a1e6e 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2485,8 +2485,7 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) return fold_setcond(ctx, op); } - ctx->z_mask = 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 Fri Dec 20 04:10: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: 852360 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852239wrq; Thu, 19 Dec 2024 20:14:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW4g9uFMQ9ACs9Ft+SXA6liZYiCfqfR5pTNFaJ9K0r9S+Fkz7ISWJ8JqSJXVD7TsvwFPzdsQg==@linaro.org X-Google-Smtp-Source: AGHT+IFeZmJQgg6OXNR5JH0plJa1YKTlo4A8vii3BEX/KDXHUuN5j6qhPzchkx2VhiF5g2OkZqwK X-Received: by 2002:a05:620a:459f:b0:7b6:dfbb:3227 with SMTP id af79cd13be357-7b9ba6fd86dmr246223485a.10.1734668060526; Thu, 19 Dec 2024 20:14:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668060; cv=none; d=google.com; s=arc-20240605; b=FM1TrnKkrRdgUdDRVx0DmPQeDYT12XwQEtQNuu7hm0hn4Fa8y6mpktiV4Z5fXwjFvn Qj2aNDrRR3+TBx/7TpRjc6jAgYuQBmam/A76tAZyOhHfl5yL8kKK8oFq5Mms3H/PX7Fm W5DoUl/UzzDml7ObvCPK91a+Rz1fQRJKi6j6MHDtsHopQwR/oMH+d1gKyWb+NXFV380J BXKCe08TQMYuVXhlODFmbEJDoo6XLpC7Uwq2gdalQGJKce75xOY080DrptqoD/qLHkQz iXH35zjc/N+q+maIm8NItohAwWrFOoEiwRiF9tzVLWV020nR9JYNAXXy/46ykN7UmyvL OK/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=z2JQONporu2R9RbXK5tPk1t1tzVQToa5YMeaL9LgHVo=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=U68IKZ9IVFrKPasS5yT4Ly7fJDd6zHRebfSTDcVFYjTbPGjlsdvk711aITz3Kw/1CY obRJiKXqn99H/f5ysiwQ9MLCoHtXP9rlw3cwiSrF4Qo5c3x/dH3P9lRY/X9TUdlCoOf2 +MVQ+qzWavFa2KVRm2ov2EFvjSnSoRG5qkjZdKTiC5zX+SPn7dWGcy0TElqIpIS6quB/ Xi4U/uPLhcDrWSEslHPzYdwshNebVuv3iT+r9RGP8cTXTEkDPvE9/M5IaXFyonuB8BSb x6pdsV5uapHk81qtwA3JBwNIAKWrTLYnSD+KiCSN/kCfWhMKWDgZHCXsilPNmoOqwZ1x rqtA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PZQE8AGz; 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-7b9ac47a244si324814985a.218.2024.12.19.20.14.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:14:20 -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=PZQE8AGz; 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 1tOUMY-00005N-Mp; Thu, 19 Dec 2024 23:11:42 -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 1tOUMS-0008UD-ND for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:36 -0500 Received: from mail-pg1-x536.google.com ([2607:f8b0:4864:20::536]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMQ-0006PJ-1o for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:36 -0500 Received: by mail-pg1-x536.google.com with SMTP id 41be03b00d2f7-7fd17f2312bso1114430a12.0 for ; Thu, 19 Dec 2024 20:11:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667892; x=1735272692; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=z2JQONporu2R9RbXK5tPk1t1tzVQToa5YMeaL9LgHVo=; b=PZQE8AGzzQbaEgQWDnat1m2lgEqvG8gGAYQEG/odWBTvn/VpbIiApuQti/751qyMwy FYzPZWutRbhHqouPegiRgVzznwMWL3HA7VjvIC5qc63aYSB5jAzpwRoAnnF/aj3wZR4s mh9fLNoDeNiMq/I9yOTfVt8UqZkGPcFpJqcZcBMisRjX598v4KpgKJ0m8KELt9gDtkGM 1O0TmClGpZIBvQiAlkXjgZ6CB3TDtsQsPpAH/eMg7DaSKg5svrfJ7cNWW7LtfFgQljfw kxUqEsQ25bZCnvVbl2l0F6i/YZHcMDGaoXXDH2fPaHJzyCJiJhkq37wlNICp+30cvHdS dGag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667892; x=1735272692; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z2JQONporu2R9RbXK5tPk1t1tzVQToa5YMeaL9LgHVo=; b=cr0OuuIngHbmzqqGlQlKpMn3qvtmbFOzaKtWjxZzGYs6puPElny7/3IYBxptvjy4M8 rZ4QBFqEt7/Pciwa2xPNwdcRgLPjIjstXRFQNwYhOvM2h5P5nHwtUxDZZRimEtZv0okP yiz5dAGn/oT4sSXu0H4OVeVyYQ2AIE6rNw/J9VDeXKGfRnpd9DC50Dtfx7OrQ5I9eUTf SKqDeLyhSaPbdx2BVFVmwXAvA/b0V1J6BJ1W3G/IaMwLB6wCBJBrWA8VWsqSJqjXXjnt kovRxKsO2czgGMzR8nYNxrLpRADa1xqC4KSB+/USIMHeoxVnyBH9x5TQ7i+U3ZjUFs9U u6tA== X-Gm-Message-State: AOJu0Yz9hF0hgaNopwcRHp99seS3Pl98eJpT06jJjOviXT09TlJrKphP M5dka7oT1ZxIzyiw7MdRbDfsUzOPvFJWafq2bCF/S9ARZeCbgTzmo2Zc8OObcj96sRLHg8h/zrJ E X-Gm-Gg: ASbGnctrLD7mdQZU3CQqSFLskKN/8n2VSs9tApd2qyN2pKHOIh+sR3rq5R1l/0p9JFw f9UgZ6N4pjga7sA7rXqbmLHHA2gvaELEJJZS7Tohv3s0Qm3uM8FURYaj0MWz0DqKAi4OfkT3rux Jl54lR9hyRjGkEcKudKek4io6sPBOEmsjEXi2msBkOYtMblOoqyPhpKzEqVesGOCim7+TI6sqaI Lqdmmjoca/zjW3aCcgdgF8I8N3Ahc5ghWLyzsSglG9RqwFMsZPDBRsNv2Bk5Rw= X-Received: by 2002:a17:90b:2b8e:b0:2ee:3cc1:793b with SMTP id 98e67ed59e1d1-2f452ec6ed2mr1987033a91.26.1734667892455; Thu, 19 Dec 2024 20:11:32 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 37/51] tcg/optimize: Use finish_folding in fold_cmp_vec Date: Thu, 19 Dec 2024 20:10:49 -0800 Message-ID: <20241220041104.53105-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x536.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 Reviewed-by: Pierrick Bouvier 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 a7f37a1e6e..9ce90eee7f 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2497,7 +2497,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 Fri Dec 20 04:10: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: 852352 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852077wrq; Thu, 19 Dec 2024 20:13:46 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUS23BrTcgBActyUD46Sd7QY5YEpMEg/aRlnriwAWMryg72haUHh4y693qLp+/BjrF906EbGA==@linaro.org X-Google-Smtp-Source: AGHT+IF41uBggL5Z58N2I+CanbGkfR5RNDO6fiyLFGE8j0JXfZz4Kbj++0OU1+RyAt4kmS8ZuwF+ X-Received: by 2002:a05:620a:191f:b0:7b6:742d:c01e with SMTP id af79cd13be357-7b9ba79bfd5mr226347985a.25.1734668026607; Thu, 19 Dec 2024 20:13:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668026; cv=none; d=google.com; s=arc-20240605; b=FSZjtMddSoICrQ44T2VE9108B59Os006ZpllinOLHc+VZO8W4nXsy4qjlnEOwsafmc PugIy6SGDVV2zMx+LX8pv8WwDVPteBpd5skVhWxojQuUs8axHwM4djqfDQOnymuyLjY1 2LmXi8GsYPhiET54GvZROPdmuDI09kuKkwPsJYNOftm51OwcNjMEKNkltUMwEtTVHzKy +eMBFF58q//3VTltJkeb+r89kOvuOdpPffPM9cjwGzCZqKa6CPUdKporAYEgFdveCjJa 4JKPJU5YQoGWeGoJrWyS5HjCT/YLZbXMIhywgAu4LKqyoFWXl5xkpQ7zlpSTFMyRiQ+k Qk7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GGsAjj2auqRYQ8ARQDokv7gEPzbvdUhWdANXEAlpLeo=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=H1W6VJUktJvv/IXVE4FN8aUzloeVK8R4SGsENLhUvrcEd3Zq4cWGHQAWmoAJA3vkJ9 htDhezXekT7NxigmbIZe8LJr49sbDQV5rGqeHea3Mb0Wh8kdpGqrpmjaZsbDvuzc6VPv e+91lJ/XFkqKaJPSB5SoskwJWRWzzGfXSIGr1e8hOsKdD75YzwCz7Xn1TuTsJp8IeSSk j+/2Iiczxdi1OanKwiOTmWoNFHZt+8UdPHcPMa0zBv0j0LS5l9hNLorcy3CV+gRRXPft BVexjNk5CGEDWsnZw3W087pA6uZAqRESdSJww692BIjHmuvsbNgDV5ivaWMH1r1pQwrb VKgQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=N6JOlDCX; 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-7b9ac2d09dbsi324641585a.193.2024.12.19.20.13.46 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:13:46 -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=N6JOlDCX; 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 1tOUMY-00005O-NH; Thu, 19 Dec 2024 23:11:42 -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 1tOUMS-0008UF-NF for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:36 -0500 Received: from mail-pg1-x52f.google.com ([2607:f8b0:4864:20::52f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMQ-0006PS-Ad for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:36 -0500 Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-801986033f9so918232a12.1 for ; Thu, 19 Dec 2024 20:11:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667893; x=1735272693; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=GGsAjj2auqRYQ8ARQDokv7gEPzbvdUhWdANXEAlpLeo=; b=N6JOlDCXlccrffIAFdi3gWcNtjIkJxvDCVq8ysKMvl5v42but4zJBqmpkqbqKNqdcm An+QkpaW9zlGJNxZPzKaJTgU9tvpiHYAF0rbgxwxSHdticqxN6W11PcjqWso6ZmQ7yxL C4yRdrWZy2IjCDy5ZSY7XK018uiOy+6HYbb0GmwNGwNjA6FrCu6Xrgi+TV62Nx7ltU2h rpoAMYir/EbG+H2zlMjaYCPLrnrAj96wdvycYR2QUdoIFpTV7+0cK+sSBmoVKWUHOc6h 7mULWAcBMJHg5MIE2EnzB+UFTVgjdJhVmiZqhkEVvj7M6tqgL6Hh9FvR2ZAinZIn5VvM 9YqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667893; x=1735272693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GGsAjj2auqRYQ8ARQDokv7gEPzbvdUhWdANXEAlpLeo=; b=BVt/b95K24DCZAImAAx3LHo1u+PFky77FgOHgIZvKbHfG1Gs6jzTrW71cxXFsOHAEY eB6klqHDz+4PM87xaR1DJJeHVv2TZ/8F0L45+Vy4UXr6ChKoXyEcvdiEhYqTmv2C90Rh mVnsZDwRVrDa68f79yoc82LYnrTwXoVP4XiySuJ93+VABLvqcZqKoY+lJcfTOygS3LUJ LBp3YSr+IZQuiT7yEFefRY4CRgsAx5KHYJxzzaLyO6ddJ/CLzy1c9t8mmtF/FX0GhzyU lglIu3kvsSpdP4glA9YxIPuKVbnTTxTGy3CeOyo1CrncttYUTMnPgAKjMVpdPgWmRmTC NsCg== X-Gm-Message-State: AOJu0YyIf/D6uScidJG5hzcX9NaqgKJhgW9NcUm5Y5r7krAJP+Kaa7By XERM43a6oSyBmF8SeiS8xdf2pXD3LZ2PiGT1AzimfOFYyqgYVtI+uPMCwAXxB8DYNuy9s7n0RCD M X-Gm-Gg: ASbGncsLrSYqYfL0dEVjksR5P55flED32GxuK7VkDPn6xPYFTDXTMbOUK+tlYtI8XpQ 3Xb1plzAJ5cZsg3OgHy89nNhAVlc/tkr1hjOz7tsc58xKEt6KvZ+ywGd0ir/uLA/73VB5QBSuzn IaDcpumpoKrMOizgnHx002WCYu3xkiviYXXxp4TBaZxgfkvN5QJUHLOAn8jzisof3qNoKyKYKHo Qj1wjiRwGgXtoY3VV831Xr7lsywIEgFsfN8XihtXuxqWXn6DtFO7s9SxtRvVS0= X-Received: by 2002:a17:90a:d88d:b0:2ee:863e:9ffc with SMTP id 98e67ed59e1d1-2f452e4ace5mr2013631a91.21.1734667893134; Thu, 19 Dec 2024 20:11:33 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:32 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 38/51] tcg/optimize: Use finish_folding in fold_cmpsel_vec Date: Thu, 19 Dec 2024 20:10:50 -0800 Message-ID: <20241220041104.53105-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::52f; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52f.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 Reviewed-by: Pierrick Bouvier 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 9ce90eee7f..fae6a29685 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2518,7 +2518,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 Fri Dec 20 04:10: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: 852384 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853505wrq; Thu, 19 Dec 2024 20:18:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUmqaobmiyPhnDyx/i7KdUf2enRskdbyP/DY01o0QwRaFBAPNe2iCYyLVZb3oXZyyT9lbjC3Q==@linaro.org X-Google-Smtp-Source: AGHT+IHKbaapSj+m33TGqbNR7y0nlo3PfKiH95jj+waP8+3dm+8LLaKxMyM6V0xoYACHI7+KVo3N X-Received: by 2002:a05:620a:44c7:b0:7b6:ecbb:592 with SMTP id af79cd13be357-7b9ba850768mr250473485a.54.1734668324687; Thu, 19 Dec 2024 20:18:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668324; cv=none; d=google.com; s=arc-20240605; b=VKcqvDy0g725hsx+nOeZToq87AmO4o8iH/ekcBW/OIvBdZVGtwLt6wqeAPExLixv1/ /uJMIc+HNPq3vb2cYiAfECmCwVJKSeyGsK03pyoxuR3/eLR8xm3u8VzPpN70MduIxBJi zIGNmURiIJFBt62doo0nUhmFnMobRzvdk5ULdMnheHkPZr/iwPtkYhczqSG0apGrvnm9 NBp6Xu0TMqMCotcgA87yt9hPgMX0djeG8/pg9G4BpLJYlZ/CmoKF8Cvn9s5HJtNM3YVc 2i8Te4HUvWAeu/oAvHIjAQv1YoPfgWJ4umTqCsTLXSyMfVdFCGmIIzKbK2tFqtRJmfbE P1ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7Ic/XAXWDqyq8gqlT8LhIvS1MArK08ZpPNDJQ4rUACM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=DykVOKIYNgBgV3bHNR/H5rQUsjxXti3zTnwLCFvPzXJTdW9N0cpYs+qIqOyrMP46MY 3YO5thMJiBVbqn6Akwn1zZdeob45kcUzVwxklZEbyN8wOhmJJMHZ0ttm8Bs92bP3xU5t D/BrkToJ5Si0n2qCDwkZl7MIRK4XHartrkPvP2mtB2z/fJgnrSkKE0ZWRjZUhn+gXEX+ F05rHgfoca05REGD/ilXWe111frZX4FZvBdhhxgbE4rF04w7sjMtZDmR3QJMpnnCx5xD 9TewaTKEjjrsNWkjvo6gpTveUxFcGz0EFk5uuzV6aEboHajqActTTAYgXKXQ7CQ9A2RA QdcA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hhA1kuzz; 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-7b9ac2ab743si207414285a.33.2024.12.19.20.18.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:18:44 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hhA1kuzz; 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 1tOUMW-0008WM-Bm; Thu, 19 Dec 2024 23:11:40 -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 1tOUMS-0008UE-NM for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:36 -0500 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUMR-0006Pb-8A for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:36 -0500 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-7fd4998b0dbso1172795a12.0 for ; Thu, 19 Dec 2024 20:11:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667894; x=1735272694; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7Ic/XAXWDqyq8gqlT8LhIvS1MArK08ZpPNDJQ4rUACM=; b=hhA1kuzzQ6O1lfn/lE8/WNLuplL///QZgH5TodYOhSCsFqAUowQHDlzjsolw6+AcG4 EUcyV7gUqqBkb2bj4NnK7qOxFwmDceKvATsKxSL2YB+jYvUy017TbQWsPr+0lfAiobKG 4TK+iL2TaSt30KB5mq0UBxCd5R+XAn71BGALP0Fya5kifAS3s0Azzor4bWuYaXEfmcNW kH7QM8q3b5m2e5MaC4gDNbU3AIqm57jipZLrFSgP4pp51VZvCvrAGi6Qlk0d71teeIjH EP4D+izkbuL0x636GVOjms5HhqXlXqXxLH4iGnKxWetCxPeAGJcNDLxJ5a5afhZIQC5A 7nng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667894; x=1735272694; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7Ic/XAXWDqyq8gqlT8LhIvS1MArK08ZpPNDJQ4rUACM=; b=S5sGiMiG3J0lLvJvmR5BePKOrY1OalhUsil6c4ktAnV9HJ+rDo4dMF+L5yDXZQAEym 0Wj7/14Zn0W81rt9TaGCHhCbxV9/LbUu8io3WQcFVLsC8FpQARFIIKA9cv5qfAT92RQN wbF1casD7mJgxTtkCbhIg417V8vRhjr8/hRFjfWSETRC5UR7nQY5ikfPbCCRvpUq5bxo OMDStKa+3ocpBBxKbDC8fyFIzYRyUOUbT4pXf7tOCX0bxt9Wc7yNRhKDxj8pO6y/26+U /OedF4e9Phn5gLKEZyYfed5WKgnP56zlgUdbWCBeFQh2yAnn6olxTBLLYa51cTrBEji5 VVZQ== X-Gm-Message-State: AOJu0YzcffRjfKKZvLr/J3OqGrnaGUGm6ZB1nT3Qq0Bki6g5bC0Hk/ei hsp/99kx6riwgXCqyt3STsz3vRh4iXOLcmmDCgl5AeOHWiYbewTyJ25in1evabgU/9JUzlCZvVw V X-Gm-Gg: ASbGncvWQLLFd2a2TEt5tJvp2lDak+7ro5hdvwmJgCrEqsxU1JS/+KKM41zuvOM31Ls aHZzj/W+U0FwKkJVsFqzpGD+wv6wZcLOfYYUfAzEjJzB0Q0Dnz/I+T19nLIT2Lp3Wq0OniCU92y kfVQbvUMaZLL6sKAtoq4q2TvnW1VQS8gK4Qwg2Q7Mph3+G6EU+W8VVUvw2o1CLRrsp3KZ4QaVgr esQGhHLhFCQu15Od3vnGAp1KcKjvkcTz7HWUw/g0uHU+j+MirnuqzgrHEsH1lg= X-Received: by 2002:a17:90b:2b8f:b0:2ee:f1e3:fd21 with SMTP id 98e67ed59e1d1-2f452eb3cecmr2111623a91.25.1734667893807; Thu, 19 Dec 2024 20:11:33 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:33 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 39/51] tcg/optimize: Use fold_masks_zs in fold_sextract Date: Thu, 19 Dec 2024 20:10:51 -0800 Message-ID: <20241220041104.53105-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::535; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x535.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index fae6a29685..d0a9ea1ee4 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2524,31 +2524,25 @@ 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; + TempOptInfo *t1 = arg_info(op->args[1]); int pos = op->args[2]; int len = op->args[3]; - if (arg_is_const(op->args[1])) { - uint64_t t; - - t = arg_info(op->args[1])->val; - t = sextract64(t, pos, len); - return tcg_opt_gen_movi(ctx, op, op->args[0], t); + if (t1->is_const) { + return tcg_opt_gen_movi(ctx, op, op->args[0], + sextract64(t1->val, pos, len)); } - 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_old = t1->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 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; } - return fold_masks(ctx, op); + z_mask = sextract64(t1->z_mask, pos, len); + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_shift(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852381 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853393wrq; Thu, 19 Dec 2024 20:18:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW/uxXF+7mzKJSgwHbzdjf2tHBEPlgLBT7M3tp5of0/rRS62nhbB+9N9Tn1rP5vIiC775+WDg==@linaro.org X-Google-Smtp-Source: AGHT+IHoCVUAHQl4Zfo2oz+p0l+bd3yT8HIM0Twz2VkcGRcX0TjnQUefyVhWN5enOWyVmOTYP0Hc X-Received: by 2002:ad4:5941:0:b0:6d8:99cf:d2d0 with SMTP id 6a1803df08f44-6dd2360e177mr24510406d6.19.1734668300591; Thu, 19 Dec 2024 20:18:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668300; cv=none; d=google.com; s=arc-20240605; b=ElH6THVpoIbrS9deawq9ybyjfffjtWyKXy5wM3M74SAbkXuSlVevr+7QRo/dR9pRjr UgFj/CU/nzuYOSa8WqemRecu7JrozgptUr+/CV8f8CHJ4Q+DSH267rt8D/PtBHGrF0A5 QYTAVBc7AkX53EW/Ti9BETgejOYLvkPUUW6DwfGSsdufqKubGXf3AXmMymPhwnAI7E8/ StAQ5BkbYU1p9E6FOoxY7720VXDKrEiTii7iPFKywRgkwIdJmP6p9uViyEzkXf6mbs+e oH3TlId0ethKLJjcE9dtl67vJ8QCHK3MQ4zuBpbzXs/ch+VGR88VxFBj2x3/dQ7V4v80 xklg== 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=zHRYikYlUcGaNY1VZY67VXJBI/Xxa/TUZTqCG4A2qqU=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=d5fX/dUAVqMoPNT/I3QCxIsXPQ/VBoMoTQacziSGX+Qbzuo9g1nFZ0veT0v5JobMN4 7pTOuJJgCUYHaIbbBDpuhFYj7byg1DT1TohZwxzgMbzZBfSEH2pwLvKBQ/9OWW4IANGt oK1J6EqTeVYXOFf/bsfQ8hx6Y+9BCZ4HcS2ZctffsSaUaU43erZ9OV+gftUqlHaEjliU 3IWfl/qdIhIso/mD/FaV+Cz6iwaKA0J9YcA2LrfODNVFdw8YCuTh/jYcYRo0sORnFEZ2 SWDJ7fl/3iCTosl2BAQcB+6LVsEfFEggUMfsmbns+b25a6shgKmAw3AX7GLidk+el3xx +T8A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FPJMWxhx; 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-6dd18136d73si34074346d6.124.2024.12.19.20.18.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:18:20 -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=FPJMWxhx; 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 1tOUR5-0003vG-Dv; Thu, 19 Dec 2024 23:16:23 -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 1tOUPN-00010q-TD for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:39 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPM-0006pI-E1 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:37 -0500 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-725e71a11f7so2030682b3a.1 for ; Thu, 19 Dec 2024 20:14:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668075; x=1735272875; 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=zHRYikYlUcGaNY1VZY67VXJBI/Xxa/TUZTqCG4A2qqU=; b=FPJMWxhx6//IBm9AMSVJvU6TskweitBpOHpNYz1/anR4t3HL0t428iqBfdGcKYUcZZ XRmIiHGlBo+aXINUap1mUKHFVxd1fwkCRm23TINRpJOa8gQ62RDuhfQjp05pEmXhhny6 9WNJ9R5uLB647DRx0IVSj+qI/DBz4ykONa+xAPWdnXEncvZZvohA9GZKYi5MUO5B2Fmp T7ubLFk1jVi/hKEdRh17PCOwkqaktiojOX6JsGU0Ai/riTTe+oQB/FdHtqPtrZzZ29BR /MUmzOhbbEgBNMPSFyBXOMdJS4cZvaqnGbw+JWePQMLAtW5D+xJccpxPLY3bmrcFNp8V JVVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668075; x=1735272875; 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=zHRYikYlUcGaNY1VZY67VXJBI/Xxa/TUZTqCG4A2qqU=; b=IH6J+ml0Gyv97A+PurL99g+/FQdIlPuoDYjS1BCsKUG3Z0uLRudTQGLAv48/XypBzG O4p7YCe9zkJC3sSFVnA7kGLij6ydFw5CpMtzS0wEJYfmS+OL2/m+WLfe+jPobheKzb+L Fa+njOixcVdwMMj6FaTRSJLJTo8q7Mp/nJBCqWcm2Pn9cifjcVIL5r5pfpdWPxBaYxsu 1DnFpXwI2sR/CSUElAO4m1XUX5MmQMtlPSi3cVnfxt7/EFydpQvhOLSEQLGSVrwRpmMJ +lchRoeduT+o+hPIktVVIQ/cuSapzpBz6hyq/I7/SpNLDJm1MqyUMrVsH0KJq+a1p8tS E7ZQ== X-Gm-Message-State: AOJu0YwErfakSGA9SIP9oSh3iXthlVtQ+IrD3Lkv9Bxq3/yYRknjVS8l eXgi/p4FELeAFlqj8qRbNhjQrRiU4rXBWzPwBMgIBhd7l0fAIKQe7UwP2/kNQiNv7emW979woP5 b X-Gm-Gg: ASbGnctpDLG09OGJo5XKMe17/z01D/GAE+LDFmexSc9Hb/Aue1qZaL3g8WyMQbVAWEb RZKHjDSTLDS4L6T7ENnKYtWpXCllqojNBUAKHhJYJOxNDIEm9mspvDmcOLwICnllnpmnSUHGQSN mLIaL3uwMt1IEhZdHPd+q90B5A7l6FduSGxFSJFpzr0AtU1gQgCDnMBUFhQrV+QagIHyDqx9T6q seVyPtXDT73XIp5OBsUgoXETMR4F+/TP3R5/lF6sr477HzErUE9E2DDJaKtnjU= X-Received: by 2002:a05:6a20:7fa6:b0:1e3:c763:74d4 with SMTP id adf61e73a8af0-1e5c6d6b62dmr8829195637.0.1734668074876; Thu, 19 Dec 2024 20:14:34 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:34 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 40/51] tcg/optimize: Canonicalize s_mask in fold_exts, fold_sextract Date: Thu, 19 Dec 2024 20:10:52 -0800 Message-ID: <20241220041104.53105-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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 Simply or'ing the an input s_mask with the mask implied by the sign extension operation may leave disconnected bits to the right. Use smask_from_smask to canonicalize. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tcg/optimize.c b/tcg/optimize.c index d0a9ea1ee4..8735dc0c9c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1827,6 +1827,7 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } s_mask |= sign << 1; + s_mask = smask_from_smask(s_mask); if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; @@ -2534,8 +2535,13 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) } s_mask_old = t1->s_mask; + /* + * Use the sign mask from the input, force the repetitons from + * the sign extension operation, and canonicalize the result. + */ s_mask = sextract64(s_mask_old, pos, len); s_mask |= MAKE_64BIT_MASK(len, 64 - len); + s_mask = smask_from_smask(s_mask); if (pos == 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old)) { return true; From patchwork Fri Dec 20 04:10: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: 852395 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1854181wrq; Thu, 19 Dec 2024 20:21:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCW5yWHnQXzbxbulvsb/jocwiLf67gWAYhjBY8QLF17QgtYSvj2C8/sjprqbYjpqcDkraJ+VnA==@linaro.org X-Google-Smtp-Source: AGHT+IFWM5pbJZbHawC8He1PGKfZ7ta7WeV5yp5AoeCslGeXpl0eRZ5T9p0TmWOqP86WYOmQ/52C X-Received: by 2002:a05:620a:4113:b0:7b6:f1be:4f7e with SMTP id af79cd13be357-7b9ba79d383mr225352585a.26.1734668465895; Thu, 19 Dec 2024 20:21:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668465; cv=none; d=google.com; s=arc-20240605; b=ab4vSSG5Yklw7Vbu5l0AFLzVchQwA7ugbUw+TnrEvTFiezPwSPGFI51Z0UYHjWoppC 2GaC3dEQQoumvzVb4+d/u3QTxFLwVLwRYuOrppfjz7PBSwF00eTEBo0MICeBrhvqGkPH 0I0jw1Y+Cocom0gBkVVsc2CuwelOYu/pR8R6EuUEUxgGudtPFBdH5V+fs8E8khVKczpf D3neIp6TATWp1Rr47j44clBb+l4s9BbxKe7wwJYqysiZ7xgLzJi0IkOubaHfAAIcgoil mGvDvARe2wI6baQCJerTzBKslEMcmPiGcYFz6xYq5xcKlnYqBmOsorBhXlcuMzK/O9om yc2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0IWo/oKWpUsKxvLdqkhmOJJROWpNHlQx02FmK6Y4F68=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=U5vKa71gC4jvj9eonTA/pldZuCXjraUXw2X6HvfphUO7Xz1Ft0xPIloFIpara4KOdR r4m+Gbpg0oWaVeDPBKBXWdShu9UNNpxly6PbmvfikstHNC9vf5FaRsOLjkcQwqL2JtZN bBr+g2hT7gB+f5EqTYY6klNRxwgPedexfTsd1ryxo6wWptv1rTSJCAYd9lLdCQe7o3EW iCbBgOLoigTTNWc+5B8QN9aS9wHAc4xhsofztSpKEC3/d5wLXZsTXu5Ym4hwdq6/dM8W dUGDPnFZKr767X1oNLZGn16E2DAw2JjeTaa2FS/V5+tOZjVrSMXDr8g7jQL3Y8XLQ7o0 wTfA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J6voWO2l; 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-7b9ac2adb59si359546585a.119.2024.12.19.20.21.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:21: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=J6voWO2l; 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 1tOUPi-0001cb-FX; Thu, 19 Dec 2024 23:15:00 -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 1tOUPO-00010u-Dj for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:39 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPM-0006pU-Ta for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:38 -0500 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-728f337a921so1602974b3a.3 for ; Thu, 19 Dec 2024 20:14:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668075; x=1735272875; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0IWo/oKWpUsKxvLdqkhmOJJROWpNHlQx02FmK6Y4F68=; b=J6voWO2lWqdzHmsiCapVspq6Sj7RThGn7YIPHzF7FUIteCwg/WxRM05ygvtM+3hj1c +2EQ7jLT3XGLYry+HFBCL8iM0rgDmQ3BDEXFdnbel3vyXbmGFDRsicD3+Oqc4Adqb4eV GlhU17k3WWk2ly7S2wLh3GZ6VL8GkU3m+AFdyTgcnK+BI7p9weIFMnAYWclelL7UNy1C B8E4isRMmUh4rMpgi7UA91TxvAKsOAoB6rRWbX3rcBigwJJg3U1cIGyefMPLZPAQ3SLN b5vzx5GSjDiMoi1FX9ohwJ3W6ODeUKdebIBK1BCA/sBfIPdVS7wHvFYNSDmL7a9QBvEO +GXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668075; x=1735272875; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0IWo/oKWpUsKxvLdqkhmOJJROWpNHlQx02FmK6Y4F68=; b=KWlf0ZVQBqVTLZTSc5Xqr5DAun2VvXlUO1ZfmMl/mQD9ykhKYLqSrYF/s56pnaSV96 4LkkUGfqFAqho2BjUQzWMcrhgy3eaHzj7sD3UAsaBEfFKY6i1Z+tQIPVF9PimiLIJuYs cU42wjVOa3pWvpsm4gon91MQM94s5C8hezX6h6YRGhACnyLktFyIyDbML1sNBzONwkFm uIpWQ+3m+iTqlASG9Gvl69wJZH9++aXpfGJyfXHotR5jup5tn2k4XyT+o0YvJ4pkX8W+ u1JimFGLTzeiyuaqQylPgLk3fyBLCTJNE+yA4gJZG1GfCPunmCIQ+QjcGh3k94ON/psH CCiA== X-Gm-Message-State: AOJu0Ywkdd4FdCGUhSBKnQYCJ/DPIPAzV5KhK8EGmzS4ALvxjlSvCsV6 67kG2RGxMBiAmaIpg4ZjAiD9BlbwGSF0GyomFEwX0iEdaSLrKbdlI+hVqM5kWlk2wu5ZqTfI2wN f X-Gm-Gg: ASbGnctzGZuVAhzTUzdywO9/vn3i7tVBlw7P2VKShPWnA8+KIBqQNkWk9Gjg+HJ9rbb n8JHaKqY9euwgTQ13KprlkHBUvyJamp6cqZB+kEd9Y+3NihG6r10DUGsNrZA7b1Fp1hXFh8/b+C QTzJmBBhAodbBNdh8vgaNgg1qo8Iz82cPigRGJdM3BONsWDXo9enC+rd+iaY3z8xgzbgly8nHST 0nbtFuqvd8eQFRqQ4CeSV/oapafWNJoV2+3a65RnYyWMlFbwrTCuX2YzLX1IkA= X-Received: by 2002:a05:6a20:9d93:b0:1e1:ccfb:221 with SMTP id adf61e73a8af0-1e5e0846935mr2794862637.44.1734668075650; Thu, 19 Dec 2024 20:14:35 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:35 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 41/51] tcg/optimize: Use fold_masks_zs, fold_masks_s in fold_shift Date: Thu, 19 Dec 2024 20:10:53 -0800 Message-ID: <20241220041104.53105-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 8735dc0c9c..da48aadd12 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2554,6 +2554,7 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) static bool fold_shift(OptContext *ctx, TCGOp *op) { uint64_t s_mask, z_mask, sign; + TempOptInfo *t1, *t2; if (fold_const2(ctx, op) || fold_ix_to_i(ctx, op, 0) || @@ -2561,18 +2562,19 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) return true; } - s_mask = arg_info(op->args[1])->s_mask; - z_mask = arg_info(op->args[1])->z_mask; + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + s_mask = t1->s_mask; + z_mask = t1->z_mask; - 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); + if (t2->is_const) { + int sh = t2->val; + 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) { @@ -2581,23 +2583,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_s(ctx, op, 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_s(ctx, op, s_mask); } break; default: break; } - return false; + return finish_folding(ctx, op); } static bool fold_sub_to_neg(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852389 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853709wrq; Thu, 19 Dec 2024 20:19:24 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUXalLakHZ4udVTgxljbV4Tx8mUDvX98FeiG1RRJQzHpVLwoFvRRSc8cvlEdluQgo1tYRHYYw==@linaro.org X-Google-Smtp-Source: AGHT+IGC78Y3rTHjaJAg0v+yD2XG8dx3/YTAb5FwQ1xW9vq8+YTmlOToTTCocGaAAz9d+MlRhLvP X-Received: by 2002:a05:6214:761:b0:6d4:3437:d858 with SMTP id 6a1803df08f44-6dd233574eamr30557246d6.25.1734668364551; Thu, 19 Dec 2024 20:19:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668364; cv=none; d=google.com; s=arc-20240605; b=kvj5ZfNZ/CWFGV+k3m4rLOzY+Pg4jJHCXi7SCEibJKX1i0exeyDj1sqdVVNtDcMIeA dpJJA754OWBWSNGMJ1T5yKd0tVMIwO962PjTGJArjMwfWBNO832qr/BWTW325rf1Vjxv y/pwAfuXZO4BmSKRedSTzbsJA0ysCaXLDqLtcryO0n8efJqzjssXLSpO9bUjonB5bzT7 BB4uh+7yg2evweKVAjp/0D2k8JGNRbpjE5nBBuedqnuLIiUv740W7wxUcodbWTw8tFsf ZCY1y90JVWv4c3OQKaZJ7q5kZwpgBzl1S/C6ynM9z7mFLMXGxIJChefvK1HBQS5XbQDj +bcw== 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=atQvaPE2FE0PiFVNmcXbnVbK/0bdfapYYtNsmIEQxj0=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=X6WRvLUK590jhzxV3wR0qYrQYfjlpOyHcvprgaWIl25Fhl6X0BsBLLD7qWC8IYOBG7 IpHVwU35iS5rk2kbFDQ3s4xrUdVcljMDusPsvdkxVoVDjn8mPXdFFZlT2sPljwl4ktOF 3iiA4RLFDfuVBXqx6ZmxC9bXvPhfTu+i4za03o1MQcjSYeeRl0+uWQy/XrJa6rvpnXyI V44dObTW61Om+uGGCLTZzBkmwuFXvzRrmYjMtO5IGWFB1LGyVhh/9mpza5GiIyzVdNyG Ti6cqgWf6K0Ee1hsNasut5aCASg6zqluM5ppGcaFZUHt9NTAXqJ4Bl8eTRVyzOH0WnQ+ Qq6Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gxIE6seK; 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-6dd18232db3si30777996d6.199.2024.12.19.20.19.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:19: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=gxIE6seK; 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 1tOUQ7-0001z5-0O; Thu, 19 Dec 2024 23:15: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 1tOUPP-000115-OO for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:39 -0500 Received: from mail-pf1-x432.google.com ([2607:f8b0:4864:20::432]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPO-0006pg-Be for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:39 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-725f2f79ed9so1245380b3a.2 for ; Thu, 19 Dec 2024 20:14:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668077; x=1735272877; 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=atQvaPE2FE0PiFVNmcXbnVbK/0bdfapYYtNsmIEQxj0=; b=gxIE6seK8VkIVMydtdQxUewAPF+3uItJm3rRtUUTT0fhOKok2Um0OorOEJ6tlHWvvK OmiqHfL+kxaySoEoSigZ0urSfzb30yGu7qfYAO1WCDyVPsxJEOylE7Yu1wX0ABe66Jxq vqCprHqqbXlSeNcSP8ZoBsZdR4zoAo91CERFYd+djJHBlkz5Vifcqz9VKL7Fyvgz55nC Bqwb4TJVrPfPpmH9yOhGri5T/jOzVZ467lGTJ1XzdiuOEusLG33PF5v0x52TmkwBrbf5 xJNR+TqEkjKUKWzLGfi8pBJp6GJAE/IKWPki9luSJzWf6no71ON7hsD8xDyyEVoofKGz SHpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668077; x=1735272877; 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=atQvaPE2FE0PiFVNmcXbnVbK/0bdfapYYtNsmIEQxj0=; b=aMdFu8cyBuLOORDebXC4/I/5sILw6lkrxGgQkSpARfrp8iitAfKRAEcK6JgxfMyJ3g czoxSu4IWZgSftfCUZjP4HoQuCUhlOkjQiyFhPYW+iHUrwaoxCiAD0SdSlF4CyYnPBEb UT6Nw8+tFzxzBo/C9+OR5o38W9NPra/Kh3Kft0DNN67xPe/DPNvIzf2SN780rUEB9NB3 o8qCYu69dze0kw965Yu+8p07zom5tUSdTwA4EHHlhEeruwfRqTmkeJqjuVrZzYYYCqMC HHQDkiGqHzx+WHL1M9umxJOjDq2DgEXDQBXw3UOB1aEOMe/Ez78N2K0aukE7kjG+jUKM nnNg== X-Gm-Message-State: AOJu0Yz36sX+I4F7X8/LEeEXK5rrE+Tz1xwZa2qIZcbBKo5+7tk+/Q6h fbAaKuyoa9N0NO3EUUvezyAj+UxXTB2eNcsVxP9aCB52nGQNSxtld562IvvOGsQwUJTWrJb6kT/ 1 X-Gm-Gg: ASbGncvfV3zY1UZ6cy8339B44JJ6x5zyp/F9aXfC1ZkW/SlR8tEcIx5ZI9kqEawMjss WvPXpG4BqeZR5bD8/V+eQYnFLatSct6CqT0Oftvwq6PuyFDSyUFekfwefl9ZIThlFIbi8jmEeAy 5082ASAQbwBpgan4CXBKH5a/wNrMu5C44zxG73km4c7OwkF95bU++BDp/N1+paPrUZJrjnO2oGi bXqlMtDTSWnYSdtoODWYqzfum3YXiK9M+FGs/qv2mQ4+zBHWg2AO8aL6rEVztE= X-Received: by 2002:a05:6a21:3987:b0:1e1:dbfd:582b with SMTP id adf61e73a8af0-1e5e0461e18mr2930372637.15.1734668077050; Thu, 19 Dec 2024 20:14:37 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:36 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 42/51] tcg/optimize: Simplify sign bit test in fold_shift Date: Thu, 19 Dec 2024 20:10:54 -0800 Message-ID: <20241220041104.53105-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::432; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x432.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 Merge the two conditions, sign != 0 && !(z_mask & sign), by testing ~z_mask & sign. If sign == 0, the logical and will produce false. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index da48aadd12..7219415fe2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2590,7 +2590,7 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) * will not reduce the number of input sign repetitions. */ sign = (s_mask & -s_mask) >> 1; - if (sign && !(z_mask & sign)) { + if (~z_mask & sign) { return fold_masks_s(ctx, op, s_mask); } break; From patchwork Fri Dec 20 04:10: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: 852385 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853509wrq; Thu, 19 Dec 2024 20:18:45 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVow5lFF/GY10FPy4Ap2z9O2UXSXFtRSjYad2XUyfiOAIe3pPCZsvoPDwV1VAEKFOCAPZTkkg==@linaro.org X-Google-Smtp-Source: AGHT+IF+PzoSa0B3Ld4TRFlBBMbszCSBQ1lr53Cl8VzV7qVxtXduPQQOv6DiJmD8BlqBESiIZRRB X-Received: by 2002:a05:6214:20a8:b0:6d1:7433:3670 with SMTP id 6a1803df08f44-6dd2332eed7mr25987886d6.4.1734668325076; Thu, 19 Dec 2024 20:18:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668325; cv=none; d=google.com; s=arc-20240605; b=kwrkaQCwAOeQe7QNYpexAUyNu23FJ/SQfsTk2LzaQkS/5F1V2gSQnqG814PQIl2viu 2ehzBT73zWE7gCX3MG5z/J5ZcQtoxAKG8xKMf07AwTig5gzNZTNeig1h87SBB2680oJ9 bLSBN+Qu6JKmVjo+xDFR+MrVMSknztIAK21zISkMVRA2tcH9rmG3GDX3k9U2I3Kolgbm T/ORfXtmNKQIlsxdpCKPpFRdkX/7uHTYH4Q92Zaz2DPJmU6hc/+mebK6hH44TyWZwMXK JeftDad3ZOPjjm4GasWYn3fv2rRatSwVrOlvGzsog206HoJ7gr3J2EBix3TJaSl/Nfc/ WclA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dwXMRrF7RgPRPzXWK+0ltvOBnUKyuGgifKCVeP7036w=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=TIDD5qEk1+O8j46f0PM1Zo3mQYliKpSPXESSAMrZLPsVPDroRquEIoKwJsULQlxr5u 1xSGYF+Ap+NLrJBLXjcXYmR8Vw9Z0L4FlfedBeH1BV/7TNQLQ4s75q5gaj9tPlZ1yIZW egn1S/dSfyubvITIYFsqDyRzMxD+G1vtQrS5FQpYNQ8xFEWR8sfTmpDgKaMrifLQNNcL 4XvxG7wEIrLtRmCQnLvKON5n++0qWHa9bt9MkK9rYCrF67FQnkgxRAdKPSrQSf7ntWMg AoqCmWYXFFTcA6Ij1nTcEWoC84NGuPbDWNLaTxfg4e6+Gi/kWZ+GRMgmyp/LYoUgDS9V zZmA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="SjNF/u4h"; 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-6dd1823354asi33936456d6.198.2024.12.19.20.18.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:18:45 -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="SjNF/u4h"; 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 1tOUR8-0004M0-ES; Thu, 19 Dec 2024 23:16: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 1tOUPQ-000137-Mk for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:47 -0500 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPP-0006q8-9M for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:40 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-21670dce0a7so17574775ad.1 for ; Thu, 19 Dec 2024 20:14:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668078; x=1735272878; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dwXMRrF7RgPRPzXWK+0ltvOBnUKyuGgifKCVeP7036w=; b=SjNF/u4hN2Bpc9PyzOojzVfB7McXW25v4qWoTlIVp9OUic+EdR+n9verzSXGJHADHR 5dNgj1vOPTdFeV8OV0Zyb2Fag4X0jCo6OT44zR9DoKIBJ6U2L/6TkKuVSjmFp4l442b+ aAaF/BKaSvvFMRZ+1pGNCPe91buL3LThtuIrJd/uwp87I4O1SjNNNmVRPqUXSz0ZMmWn HpS6ujLRxbF2fowSZ76iow9nK//hTmQWOjqozbr0KfmFmKMHkt5ReqDQYLJtS3Y4rCCv zoKDviIAYBAX86O0fBcqg0qzLDjClyO87Ewde1vmR59sPCt4UzneUWsySfTH2LhpLPCx V+xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668078; x=1735272878; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dwXMRrF7RgPRPzXWK+0ltvOBnUKyuGgifKCVeP7036w=; b=NzFVNMKB6w7HAzVvACsm8EcqC6LZtYCM1XCJbrK7tWNr3FmPZWxaQtoc1QJtKaeIm7 f7hGruL7RAze/wDYiwT6R5btX6CCVhYKcuVrztBRajPxkr4iYcRAgBMt8mCu2Go4eSLG fQ/VtbM0YzGPZqrE3wdh/kLFLvtRwFndkAzBUCb7unyEn4o/wvabL7sX+5qsyNR/aZP+ 7d+2tynu0snnX/nuCerI5JhOHQ/g4hb8u2J3Ozc59MMbvFb4JyKaB9AB/CSjmYjjViSA L6AUdjlLezDt+2CakMHt0dtflalzBGfvvccYOITrMYnpRtEF7/fdm+sAvBiXTPRjElRg igYg== X-Gm-Message-State: AOJu0YxgEkeFMcw2H3EgNvMnhJ9wc/0bkmx4btVP/tTjsceN/BdkPu31 NGinuxShxdfViEpDPeS0XvBCFSCOtQJnYcmJG+4tx/NcGfQ6TAj0iaznGTnXGfNlGCQWM4ulFLN B X-Gm-Gg: ASbGncuT2496zKT3uaD1r6bSTSF7EUriU2ff/7uFtvF0I5ki4qRFQqdhRIQtWtt88zT 3vEH8uRPIJP0w9kEV14TAfQYM4oRPvOPrVwY9qmUfPjJhErS/JfkhTgPPavOEwBODDY9AmZ181S Smik7lYWYFvOOa1eQ4pYMmxaVOSE31l25Yc99riLVkdlbDO8As6qmx34D7/Fgd9vP5kpLU+VD9N qoxlUwr1e3FgAR6lsqT2BlsmY9e2c6kfTEft6NzNz06lCmUxT9iYHIK73Tm9XQ= X-Received: by 2002:a17:903:2c6:b0:216:3c36:69a7 with SMTP id d9443c01a7336-219e6f262admr18225605ad.45.1734668077958; Thu, 19 Dec 2024 20:14:37 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:37 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 43/51] tcg/optimize: Use finish_folding in fold_sub, fold_sub_vec Date: Thu, 19 Dec 2024 20:10:55 -0800 Message-ID: <20241220041104.53105-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::62a; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62a.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. Reviewed-by: Pierrick Bouvier 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 7219415fe2..bfce2dcf60 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2645,12 +2645,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; } @@ -2662,7 +2665,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 Fri Dec 20 04:10: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: 852374 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852973wrq; Thu, 19 Dec 2024 20:16:42 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUJYR38PAyfL/F17TejglQMaofBNYg1Sk4DgjY5PoI+dmNQ+54IrQcysrhtc1KgfPOuOcgOfg==@linaro.org X-Google-Smtp-Source: AGHT+IHmTpObKhpxCDVkWJ/gU4kNT3dtI/Aj/f2WxllFmUTgY7rIb/XTGGhAOZovYIV+exo8ndAl X-Received: by 2002:ad4:4ea4:0:b0:6d8:90cd:ac99 with SMTP id 6a1803df08f44-6dd2331a4a0mr28307796d6.9.1734668202489; Thu, 19 Dec 2024 20:16:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668202; cv=none; d=google.com; s=arc-20240605; b=WeRYuOwkNVdHKLOgPLchgRkFC+044ErqcdwFX83umdVeWAr5cKCIIt8Wm+JrPgx3dZ zhWyJJgYpAiju0JTdumksSaAEkSkeEKVVI5x0L0UjTVmSxohe0XRkgmmgh6UxkQxt7j6 5CfjA0xq2gB05h5sYrERmq1mMnbcOJ8BKXRZ/7AUBY54+GDnDXy5m2vUCyf8Ly3yq/Ay MQ/MZh8FbqeOIrt6QA8HgJxoUrVb680EXeiE3jev6GSfdZVgg8C0b76GbCUO92g+rB6/ dh5FfKdGcMjyv/BSfj2JWIux5YbFeTBntgydjJApokyH3L0vcMbLrECeSN0fyQ1+Vjiv a0ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=bjwaNKNFpgdbaIX3eqenSXZqLGMLSQbd2qnsL5aQqSM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=L52Fwy3Q6aToym3zUNBzesrIbwU5XOsOSFzaFs3JZ/p/WJRudAitJwHSjeFxRneOE2 E9h34dTMp+thc1si0mp22HTjmtsfLP8as78VnebwBKr95WTpk0id+/X+gyOX0EuHHXg3 bVaxrKUdUbcOVIf4zzAgZFjKBOgjS+hpULQCgSFnG+wRMde0FkFvVLpkdUMgEBaLRbcc BPZUPQRGS2pqtn41AdHgTAF0dcg7bZhZu8DHST0aairy2XMbUG++OP5th2nHinrHHtqB bxG2c+rVxu34UQD7vV1SiaRdTzFOZz0LrPTCA95ufPJAVMUGZKiQsRoggWAJsROuD3kR aAdg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OKRbVJM2; 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-6dd1824fdd0si30958116d6.315.2024.12.19.20.16.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16: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=OKRbVJM2; 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 1tOUPk-0001dX-PL; Thu, 19 Dec 2024 23:15:02 -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 1tOUPR-00018Z-Pe for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:47 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPQ-0006qL-99 for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:41 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-216401de828so13652075ad.3 for ; Thu, 19 Dec 2024 20:14:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668079; x=1735272879; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bjwaNKNFpgdbaIX3eqenSXZqLGMLSQbd2qnsL5aQqSM=; b=OKRbVJM2yGcTAm5YlyqIU8nScOE5OzoRHczxAN8n5sqJCP4z+diQWrkwfPhjVW7/hM t7DpQHpd5Nlqwjmk2f0zc+agmuRLRpjouohsNH17YbIN7p17v1cIp+crNpnkUq9DQTjH s/+1kM3pYAb2j8jcT9OppjeCWMO/rCeBtmMZxwDf2r7wenKZvdRIFpNiG6r9snz6rU46 tnlWyZrIaYEIUuRP0or0YwEFgtW1KD6VbhcPBtnX9ehc1+bOYn7cqkfVcyTv3C2XOzZo xyjBj2hDBQbWMYG5uNbXUgjgyVxbk4+o4QE/vnRi0913Jzu2CuZaL/oevQjC+hYWvxVn 7QzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668079; x=1735272879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bjwaNKNFpgdbaIX3eqenSXZqLGMLSQbd2qnsL5aQqSM=; b=ilY7Y59Z3i83IsTSQkBDVASrFi5QdSqvYwvR/LndVuGdoKvXaUh6u1dbh/WqMiBC3V KA3YxH5hpJUxZ0BJcjPw3UxpER+AFeiZhMRAZWuUL6zWOWhlcIEK4wY+jbxEBljnY2zE C9UC3B3ffDZrXt/sQjJ2NA10qyAcB+lXg7odD1Im0FxGzTxl0yZCcsvt864Hl8YK85IX 0Jrk19knGXGSuIfylgIkD9bRiBFgoclonZKMCmY4QsTiOMCTx8ZKomyuB5SXoyoX8YRB ekk3Fy1fBnchsAxOotpl76aPv8OJwzz/Jib7lZAMybtcP+COojwK1icOEada9ldM5e1p IXTQ== X-Gm-Message-State: AOJu0YxrHB+faeutZ4t5n4on4i/EvP4QRW0abVjYtgyUGkt5cGG9OUSC i0Ax5ojfcSW5kAx2h5xsQYDrRp818L/WaLf6tn5KNMFsT1OkrkYMe8rb9VpPo0iZA03H7FtSNYh 5 X-Gm-Gg: ASbGncvR/fMU/cPWhYu9ZK3gJAMz2BY3312QahXme6/C9OhmgcNzi5IL/2xSe+ZSq8j +efP+2y+XPKy7U3Clh5mHu8HM4CekYpGQxpze1V0x67NqSS+X0uABXV8Vfm8GPLSZKZklD2mc+g NTdu7kg0oy7gN5yUdBgBjm9+DfTPdDki1OoCwlGVwNiwhTMDCOQbBLdkyGXc2HCISHyrPCe7Laa BC4klJitiUQqjDNwp3hB+yAxoWwXCLU9mBwMYAP/v6SvW4c07ixRgywZSVrU/w= X-Received: by 2002:a17:902:d4c4:b0:216:7cbf:951f with SMTP id d9443c01a7336-219e6ea195cmr16677335ad.21.1734668078733; Thu, 19 Dec 2024 20:14:38 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 44/51] tcg/optimize: Use fold_masks_zs in fold_tcg_ld Date: Thu, 19 Dec 2024 20:10:56 -0800 Message-ID: <20241220041104.53105-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index bfce2dcf60..56bf3c1aaa 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2675,33 +2675,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 Fri Dec 20 04:10: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: 852394 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1854156wrq; Thu, 19 Dec 2024 20:20:58 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVKOHJfQMCXVFyPlIbmTAf50iU01FLoru8gb6Tom/cfOqYXwHi3PKjmtfExNA1zkN5ub2hmeg==@linaro.org X-Google-Smtp-Source: AGHT+IHqBytYTTeUqI/3zyfIhoKmuADT6ISN3oRB1ogwFNRSnzW2sp4/iAykwRlYyf9VPtGK24B5 X-Received: by 2002:a05:620a:1b91:b0:7b6:d252:b4ef with SMTP id af79cd13be357-7b9ba821d28mr240015585a.53.1734668458232; Thu, 19 Dec 2024 20:20:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668458; cv=none; d=google.com; s=arc-20240605; b=fKzACvP8Y3gxlYSwCENcSmUC8O18IdiBtKF8mc/UwSwBPy8IfxcO3nZC17Znweq4PN d1xBjpdwOg5z/exblxY+W51Tm0+4eFYeOSz1ELdlBBYL3q8HJ5G9cT+ya0RJ93aB/p6D 6lPMfFcU1EH6vnt27ptrfCbGAyOyaRxDgvZ8/HCH0hnnpdxkPlTynCKgZdjWeBFAgHvj +hAPUPOHmUP2BmoCjen8nZsEjsomwcQ9CqErkOvij1UwvN6hqXzAZ7oJj0CDKMYIt3gD nh66ngBHjYpQIdvYruMikYi6fmV1ymQHamU7Db495dSRNQFeGmSP2scn+x09rd8gaFde V9sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HTDMls7e5F8COX2pnh1l1cFEzOeTN6vk1DRjDz2cVHM=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=PRYM0y6e7Ya6bDzlj9IEgWl7PsMoxLDGMjR5wGvqy8IN0c83n0sefcQuznQEU2zGob g31WIpZL64w0kfC8QCqjgnZM3+dp2lwiQrr9b2YVtHQa6icE/WSZMmkK6mXNNGR+dDrg EyMTDIuuGAV1kCOX+s1L1NH4JiwM3UNEcRqj1QP5IL8KXiaS0a+B3b6+H5ElWxnK5cba RHXF2knhNsPCb7OuAadoAOz2krdOlF1RWkOGKL5ivcPnwWTAJZcNK9yKuIihDUUmn97E 0lUhjvzKrPB7bORpfv+DU1GD5ouAuw8v5zwdTVoKWdbGziRk72C3HIUyDsqOQjF9suF1 HT/Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uc5FR20C; 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-7b9ac564645si305592785a.696.2024.12.19.20.20.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:20:58 -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=uc5FR20C; 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 1tOUQA-000234-HF; Thu, 19 Dec 2024 23:15:28 -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 1tOUPS-00019J-Cc for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:47 -0500 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPQ-0006qY-ND for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:41 -0500 Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-725dac69699so1341488b3a.0 for ; Thu, 19 Dec 2024 20:14:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668079; x=1735272879; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HTDMls7e5F8COX2pnh1l1cFEzOeTN6vk1DRjDz2cVHM=; b=uc5FR20CKs8swpIdVSecAkQyUrWM6CWJMGWHc/Z6BsJMDWtsEOR+uFCY75ZzCKeklj Zf6d7EfPpShSRhXsGkmEtnb8UyuPo5bQwTlpGyKrlLgDYEQ/RYR+raNowFzd49xF7jc6 UpemXGcOVoTcXS+gXRio4O2esWWNNE6q1FuPWXTNOjIYuq3OZ/mjHKRDzngI1L5iI50d gFte+dP4HE+hsshRBALkdbu2Q/ZQ+UhWR6Q3C86NXNVGcnVxBkOnUYkCfw/ycQxMijdP o5LZ6nwdREh8p58sH4EygRelPRNQYNAanfyKNhQzM/MKTj+R1nI+yoJwaUdad5HK3GUa gUQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668079; x=1735272879; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HTDMls7e5F8COX2pnh1l1cFEzOeTN6vk1DRjDz2cVHM=; b=i8iLrXcPUoXL2n6JynKpabZiwTXhl2CbbIdeErAJd3Lc2LKm+TYXreeB7PM1fXfR02 jICfsP7pEAvJxBkehhv/YJ4BzJlFXmZUH7A5xXtI9Pfb7K9HKJLnxBiyN4v10L7v2mEa z9q1zs4uqXFbWR1JQFzMJZhHjhSpYTymL2fBXksG1tf4+EkuolNvpwDLTLt09zmWWFrt C6ZOIkIcehdb1A4nER7VR6fFenYPS9mTvl9LRr0PXC71yKoXL+Lr4DIlYNyvXoCBLsvu tYxb9RJnIgYRBo+Jf5X4IKzJT5XklYg7eq1YDSEMIlqd3h1aN1/qTDEAMMB999Np9Ki0 c+Ew== X-Gm-Message-State: AOJu0YyyQzAJAB/TjuI35YFzoUIuKkB6/kAkZeLJ68E67t6IgBq32tlf A1Vy7UC1cRRZqPiiLydQsNmp38NASLUuuRBIYzxV8NQyCxviCgz3wYU/UM41vAqShJyy1ZKGMT+ b X-Gm-Gg: ASbGncs0H/rtREW9/yqcqJO8wC7NXDlbLZvz+WNvmmpJmSUi+/aRjXc/5Gmut2u9rHl SCGKIHVjaqbFgFJZo0QtzTxHXvMhIpJysJkDX2Xc2OIHWiP6L8lgQO/ZugoK60TlUDL+tr/XWnp Wi5wMhHppMONAe/L+H8y4hcJc/MLPIJEj5YMgGi9XjE0hBIp+CHMkcFpdq47GzQSRqjklUayzH2 IEimq2OS5KeYAMcDePl5d6WDAJ8tnzz0v3d9wJuZDFzdQ6FxQ/2gCmieibsKgA= X-Received: by 2002:a05:6a20:7f87:b0:1e0:d0c8:7100 with SMTP id adf61e73a8af0-1e5e0447f07mr2859361637.7.1734668079560; Thu, 19 Dec 2024 20:14:39 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 45/51] tcg/optimize: Use finish_folding in fold_tcg_ld_memcopy Date: Thu, 19 Dec 2024 20:10:57 -0800 Message-ID: <20241220041104.53105-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42b; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42b.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 Reviewed-by: Pierrick Bouvier 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 56bf3c1aaa..0a84959f4c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2713,7 +2713,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 Fri Dec 20 04:10: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: 852386 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853549wrq; Thu, 19 Dec 2024 20:18:51 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUItSq71V5J+EvCglnl6AEeucUPcCj7M4ftoHws3p3YBrOnE0fe+atpnoD5FenC9NlTjMzp9w==@linaro.org X-Google-Smtp-Source: AGHT+IEMWkJzNr6t82zO+PFrwZGfrwXtO0KminEty7OxgBAaXEGPrNHrzumaZGmOXjjq0U106oV0 X-Received: by 2002:a05:6214:20a1:b0:6d4:1bad:7415 with SMTP id 6a1803df08f44-6dd2331fa78mr25734806d6.2.1734668331073; Thu, 19 Dec 2024 20:18:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668331; cv=none; d=google.com; s=arc-20240605; b=TUMyWvlKU7S+xzBvy+8BJOdmxEfG9Eo/PIcviAG7IjYvXA3yP5xndo3/qOx87GljEB Lmx95wvJHUYmIjDrtRngUauf/RnmVeYGWdl6a5NfO6uaKtiAuS5t6Z0lfyn75yXKXqN+ 04+qXfZPkqxzVanLmKdCvSPuhClCYFGPaal1xKEwp4CUbiTxLXBL8pSbdVRwgeHyTnM/ nLHXtY2/akGYr3dXiMU11Hm3CaV7t2bs7qEOYgUqn+AOxdfWFnX24JJBtLqBuMTSSoz0 zfchp4ZYI8LSh20rci3Fau8W7GPrDFWINUha00tQM008a1zu0DERxD4P64BXMIxXD4YE rjag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JRQkBQzTRu7scLpRrqJFno9GLIyKwfRFAwGQsXfZPj8=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=Pz5uvqXxp4ZsIxvo/qeXXYod714gVLT/EVZkYGJNRmqJDnx1NCSl+QTubL5aliU6QM D9maEodDE5iZBt/UrzeFS2kSEji3XfvVfhPrLT+/Grlin+v3rhdObYqdIWjnrY3NMMG2 dgDa7HfOyqrzJoQg6bSmyB5plOjb82cAKwmRfDPnvcLGpE1uRMElj9nicvSFYjC0a+PS p4BmDZprDAp9RsdQXFmEku0NZUIAFR57CTdXgO+OrE302oda32gIPy45wMxOIrpvw4tp WqoeBVMclHFd6p6vjhf2G60bW4NlHI2iuT3RQYcjzKmXOqF0FOEEVwqYi5MHSifUd+ax fvlg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zwx2Nj1J; 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-6dd18136c64si34277196d6.166.2024.12.19.20.18.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:18: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=zwx2Nj1J; 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 1tOUQv-0003aZ-UP; Thu, 19 Dec 2024 23:16: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 1tOUPT-0001Ln-UA for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:49 -0500 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPR-0006qn-Qb for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:43 -0500 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-7292a83264eso1345755b3a.0 for ; Thu, 19 Dec 2024 20:14:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668080; x=1735272880; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JRQkBQzTRu7scLpRrqJFno9GLIyKwfRFAwGQsXfZPj8=; b=zwx2Nj1JD6vqgeeZ/xhwzu2iSPPUk0FAJqcl46ISHfcFZuv/K/4FG5dMkKm0BkZoS7 eWz4Z5uqUamRleRduBx84+8/Iz303qmLB0jZTojlRwQ44Beg4enXP37XZJNWMAINmJlP f05U2ewSBsymEKCPfEyztT30kZw3otXx02KUG4nG+UsV+eD1SaSp78173ALAQdQ5NGpU 76BW0qW5/a/gtZlofk0QSRyS2cRMcUoYEppJLTh/NbhzPMz2dfQwXkkvQhtL6EbI2FEy NNQZQtTPyQbp4/+l/YfDd45zE98NAVOEkkeRtvsUEHcDxyLwmmJk879E1J9LCjFYnb2M yrbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668080; x=1735272880; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JRQkBQzTRu7scLpRrqJFno9GLIyKwfRFAwGQsXfZPj8=; b=qn++3VmWYNJnqslpelQZexkPlEBj7yNBhY5zlXW1tSPsXDFa/WGj5xcx5+4+8QSWnN IY0/3nQGijuQdEQWSEYZXd0M7pkrZ8bmVhGINJNrkDUkxtmoO/5ch+xYUHqCkd+lZP9q MH2fMz+JvluLINjubymVthPwepely1OjZqcDe1SxjCu7sf7DcoGOP5Lcst99UeklQFIH F20yaV+/G3GOvJoXJMsNU58d53yXNIQJeSklWcA3OXe1afrUeYImhzYTzd9M8mpMvdBb OD78VxtNd3DdmtSwwxX5Cn3V4txaYzAPScgF5Lz13t1yss4/j+mKkm+l+CHJhg0LV7v5 zEqQ== X-Gm-Message-State: AOJu0YzzhTJIk8PD7BRb125xyrckUK16l+gr2qpMC9ZKDYsKz/h9KjwW nf/4KrnDLhaN4xFMFZOIscLSIq/z5fsb29gdVdg1a5v5PnPjNtP2HybSC8pLH0NWziMotk2/Stt s X-Gm-Gg: ASbGncsQhRmrNyYFq3jyWHYvVbyWR3ciiw+mr8MFst2c/hLZWgQxTTPf4FUg3Id5eyn nWdFJFhssD3axGrnxkRx6PgkAq4eLshwBy64igKhAgoOiIRvwMO/HKa7Imy2ajyNUvqwfj5Lh33 /jVLgsze2HoWh7UXl7vUlft7q1lwPR6uqQ3gnpatYyEI6ksHSdgeRwVQzfoxq7wuPGoebW4Qhcf pQTPNTsdIKaufgzCsHdRgirvvqG6Jjfi6fGPBOsnZVQUWP1qyOjZWNQbMlI5p4= X-Received: by 2002:a05:6a00:3286:b0:725:b201:2353 with SMTP id d2e1a72fcca58-72abdec8856mr1967427b3a.13.1734668080241; Thu, 19 Dec 2024 20:14:40 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 46/51] tcg/optimize: Use fold_masks_zs in fold_xor Date: Thu, 19 Dec 2024 20:10:58 -0800 Message-ID: <20241220041104.53105-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Avoid the use of the OptContext slots. Find TempOptInfo once. Remove fold_masks as the function becomes unused. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 0a84959f4c..6f81d2e831 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1096,11 +1096,6 @@ static bool fold_masks_s(OptContext *ctx, TCGOp *op, uint64_t s_mask) return fold_masks_zs(ctx, op, -1, s_mask); } -static bool fold_masks(OptContext *ctx, TCGOp *op) -{ - return fold_masks_zs(ctx, op, ctx->z_mask, ctx->s_mask); -} - /* * An "affected" mask bit is 0 if and only if the result is identical * to the first input. Thus if the entire mask is 0, the operation @@ -2797,6 +2792,9 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) static bool fold_xor(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + TempOptInfo *t1, *t2; + if (fold_const2_commutative(ctx, op) || fold_xx_to_i(ctx, op, 0) || fold_xi_to_x(ctx, op, 0) || @@ -2804,11 +2802,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); + t1 = arg_info(op->args[1]); + t2 = arg_info(op->args[2]); + z_mask = t1->z_mask | t2->z_mask; + s_mask = t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) From patchwork Fri Dec 20 04:10: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: 852372 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852915wrq; Thu, 19 Dec 2024 20:16:32 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWkkEbK6Tg/vQ1YhKip6RZK7Vr++S6JMKYDStKaE7pCeFVWtE+8FEvjClQO5sw4hXH9F1WV2Q==@linaro.org X-Google-Smtp-Source: AGHT+IE6EziUZahruHbymchpHzdFThhpFcD7JfMfDLpST0FbQ8ACKJztXX4uKa1YG4MxPF7o5uXV X-Received: by 2002:ad4:5bab:0:b0:6d8:99cf:d2eb with SMTP id 6a1803df08f44-6dd2334ad87mr22339376d6.21.1734668192287; Thu, 19 Dec 2024 20:16:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668192; cv=none; d=google.com; s=arc-20240605; b=Wd0I/y+cn0SKW/6qhAqtI2F1f8+axdpSNUOoNTU9mKjbwR6S8PNHfTNQVzFOTWF7Af gwwZkII8shev8MlOULGVjVWPv/e9cog4G5YnWkrnPb6zEZUmJoJVl9WEVcfuYz6j7zwm y4vttP6mFnqCgl78UpZtLfa30Ulb2QP87eZCIv1CTUApkputu2XZunRVrrDGOAgCnHy+ r8OZ52xc1ndGpJaG98NsqUEJnikV7+6QTwHBz/s/MbN/KwQl4ErRhAdNCBtv/XN0wpO0 1vW1HEsS1m+aYq8JIOCJU6DLfyHoSPD8gO4cKGYUWyhzJQFWSdsGEKmYp+Th5mmjZO7E nQzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=WnCYLrjrRoWxGmpvDns+P9bIwvUmd238WAtJ1MV9Lf8=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=XkH/381Qzc29jpm1KfeYHveqO9aqy5EQNPokNQdNRtbJvwzHI9CrsZ/b2u6EEXWxCP OQ7bv5qjLqljIwH8Zgy6Fpm4tY9B5+h6YnxKJDmn5gRMBktUyH3lFAh0k/674AjvTk0s pcaRR0f681/oeHSQt5qxMGk8SXGjCu/QcNht1dHxp2sePZ82STfMjXC8T6dByBmovkfd ocbo6bj7OdeX8Ch8ZQS5+QdY8hbHVBKFPtETc68H//p8nnz2lOgs8ySDJvvIuDVg+4U6 cGXkLLzjYrJRnMVRTx1FQCDjJv84W+buJOMUYSAg1ROYrFc1u2SwQ/HxqrrJCZz+HJWd 3vaQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=GSXSwG1k; 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-6dd1810bfdcsi35395946d6.35.2024.12.19.20.16.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16: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=GSXSwG1k; 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 1tOUQk-0002se-Su; Thu, 19 Dec 2024 23:16:04 -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 1tOUPU-0001MR-1u for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:49 -0500 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPS-0006qu-GJ for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:43 -0500 Received: by mail-pf1-x42a.google.com with SMTP id d2e1a72fcca58-7265c18d79bso1737340b3a.3 for ; Thu, 19 Dec 2024 20:14:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668081; x=1735272881; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WnCYLrjrRoWxGmpvDns+P9bIwvUmd238WAtJ1MV9Lf8=; b=GSXSwG1kFf+QKhVfktH4p4zdveNpLpWr/st2HLqwDPntXQFMJCW+DSyvQT2ZfUE5zL SISVf/DRWLecmGYq5HfyFqIc6I/tDS/Z9Nhhv/s7ESR9+rINkGS3s5WrO1QuIqKupYtt sS2bXbDRSltjNsMLb+EKYyZan7T3e+pB9Yx3po+npRM6VcidWcfgVwaW03yzaxKfTKz1 T9jolCc09msIRe4IkHQXnqrUgRlz0akczbZHrFWGyNEa4a4lyFYQYB6lq52QWkmyMxGO j42+KvIUT4VK1W1biB22l1oNB/9SKPZMCpWPyu0I1jZia720SCPZ559OL3K20p+rPTxI RSsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668081; x=1735272881; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WnCYLrjrRoWxGmpvDns+P9bIwvUmd238WAtJ1MV9Lf8=; b=r7WCoSaaFbn7npljyhrhtXVe5xDX5ubsuSDnbV4S8YU+iZrpKrQwueR1ZsTyKtO10C +e16hgHLfIyRE76ngg8nHwepRi3WyBMfEJ7goM8hnzTyAtX9W0iIQC27ryGU92KTV9DV 7zwBc7wSeXAR2OQ3wk9WgzaLiswAWDGBDLGVwssgUQGJfE1kEAhfDUq+7h2dSEnzxQIT mhXEF8jfzdJCJtAeMomtRduQoKcg9zfKD9CcsV3NgbIxW19xVgPECMIkhEQOgY5a0iC8 ts/zQA4iLL8xADgGq47Mh7a4Xns85UqrckFYsmpKmuN0Lh43N2W49eaaPo0RRNskaKPz Kp1A== X-Gm-Message-State: AOJu0YyflNO2t1pFbVttZg6q52LGkLWK7r7SzC9kv+PXj0bmq0b6hGzT LwLL7A+9FCX2l6FAnPJJhxbFnQiNYHVGic2mePiTf/QGqDrnOFPDWwv57j2Fvva7wiZjNEsvLoI p X-Gm-Gg: ASbGncuILpA9EyNRzGWBD+lUKhfaD3uAsNk9c2hbxi/K8Gs+DY/D5LzspqpGZX3eKsT K5J1XwEgFtPut01/LL59dqu6z92VnTeoNCX2mO+B5XYoQ133ZMx3Bahkj4pN2+prgOOaRd1zL4S bT5Hd/w/m/PVD6cxnQfu42Hc0Gpot2Xf0bO8NlyUuypg86i1hUsBG/mFcSgw4siCQ/IEqopzpXv /nZtEF7LLYv0UgVVuci6kB2kNRDQhFaQWEqDe3/qVhTeC0SugXGodbf/Q12Smo= X-Received: by 2002:a05:6a20:7343:b0:1e1:90bd:21a0 with SMTP id adf61e73a8af0-1e5e081f33cmr2734296637.42.1734668081042; Thu, 19 Dec 2024 20:14:41 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:40 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 47/51] tcg/optimize: Use finish_folding in fold_bitsel_vec Date: Thu, 19 Dec 2024 20:10:59 -0800 Message-ID: <20241220041104.53105-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::42a; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42a.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 Reviewed-by: Pierrick Bouvier 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 6f81d2e831..74d1ca7484 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2861,7 +2861,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 Fri Dec 20 04:11: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: 852382 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853428wrq; Thu, 19 Dec 2024 20:18:30 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWSsI1H5gi/2fTlUjfqh2MY9vMw5QsE5pykV6gI0YUeZpLdydnHiErTJSinMbZAfCyljv87tA==@linaro.org X-Google-Smtp-Source: AGHT+IFA9xG164/Eg3c3GvxnGHtMgIAHLDyUIcfxjmrtDiQGl0EiumQekK05kCzZIgLkxUZtY5vK X-Received: by 2002:a05:6214:1948:b0:6d4:2910:7f12 with SMTP id 6a1803df08f44-6dd233aea9emr26841576d6.41.1734668310187; Thu, 19 Dec 2024 20:18:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668310; cv=none; d=google.com; s=arc-20240605; b=csPvpC7yATUaIRBP6CB98LTuHTyY8KxpjoXCK5jlBqWzGwg4zHcWOupvPuG3je9MI7 1E9Ke7KfMZZACsEBL46/tIUij2fnKkW4FpyofYTrb7u8gMJo1SlXzmRLCKsF5U1ZPafs UKGPhT33Af4Gmpymy1WJGyKIjGpJRfXweWF7sblFwr6Rp2LMPAs7VznOrM2ioyCN618U CJXgIFECY/UZzshPL7GgtT5BRmTT8OB7ucuqNtMfRk/npjXK219gMrH6BnWE2HV1QFn1 Xf3iqsIIbe8UqnelPR5XiZv251so/smQ2Jn2LvjpYsCuIou9sSauTJT2Mx1WzlxhnIbV mTAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=r7L4FLUiYXqQ6+VueavIkRjEije4QoOvDQPVTQQ73H4=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=GQ+4DRw4+5cq4d86SlrQ9VrY124GTf95o/XgrdU8P+mqQqzwbMn82SRdrY4ZdyDWuq hrTrSa3w+0FI6IT4sIIT/d9Wk+hz5JCTCn8tXItdybIl3J4FUbHNXMNSCau9cKUqRfbA soXRpQ0H3r0JjXBKNe5/W1ESosdkRt/BArLk7dxdy5qzga6d7/ajZnqso34K3pJVuGDt v13o5fB8b8J1+Xiwvi4rPyqiOsqICqsJmv3OfNzG7IPGJ+oz19KHKcY18xYl/In8zj13 DTlGnT9MheT7F92y22r+a7g1WujmU/woY9Z3GzjvXsqotlFJiSmTcPFeeJFrKnLIU3rP +0mA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=d82HzSP6; 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-6dd18137839si35209756d6.170.2024.12.19.20.18.30 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:18:30 -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=d82HzSP6; 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 1tOUQu-0003Ng-Ok; Thu, 19 Dec 2024 23:16: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 1tOUPV-0001W0-9P for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:49 -0500 Received: from mail-pf1-x435.google.com ([2607:f8b0:4864:20::435]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPT-0006rD-MG for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:44 -0500 Received: by mail-pf1-x435.google.com with SMTP id d2e1a72fcca58-7242f559a9fso1866827b3a.1 for ; Thu, 19 Dec 2024 20:14:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668082; x=1735272882; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=r7L4FLUiYXqQ6+VueavIkRjEije4QoOvDQPVTQQ73H4=; b=d82HzSP6W+NgQxSV4RRhb9yniV9Z+9QpdBCqSshC/ZcenkGZCCiJGSfkzcS/XFdYuF p2jXgelnTrAYt5KXBgCMRwtfZfKJ6RHMnMrZ8FoXAQEXXSlBPpVebArDPHBAIPkWGPkM mmI7sfWHfX1pzaIMf64PPRRB9G7y91oj2z62TJvMpP9oMVcRvCsP69QQki5U0TxutnHl HNnAjVL9pTP+lmX2uE5V5vXO4W8dXxeOuOBne/vwnnwwKJedetw2/Yp5ym3pqP7xcBN6 bv/uXk2kONlC/q8IdLTnQNJ2VHHc6Zv71mmHIuVsIPYjcvemGIFd0VV6ile6gnH+l1Qm 1kXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668082; x=1735272882; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=r7L4FLUiYXqQ6+VueavIkRjEije4QoOvDQPVTQQ73H4=; b=Hzi/6OjDl0AqcgdzHyuKGdLrzusYec5+FYvCPQxWS4LBPjB4T8lyGLBtDIog+WmBHX i3Zxr35hu+H2lCPLSr2jIhbRr+t2mFlC6VICgOlvHfFaGjvETpPrKO0+2MdMU9+/TQSV RMdvE9UKijBSUJLKcDj5cH+iJOmHAUV6FOeHxmqXiCkEhaak78btFbF+A6/+OE1Ij4b0 kEteEybG8PNbJBh+pyr0so+bqkabIFk5JphvcT5AYYqJJtw4AGxTibKAPO+4HpTIoRUo oyvEKJBoM5YPkUVDIW88R/ze72Fd2+GhYNWusK0qjTGoQE5IZr4VTROPtkmLC3ABOsmr PPhA== X-Gm-Message-State: AOJu0YxwghNKNeNvg19bSae3I+amFyvyATCPdEmANVOFhIXHk2eQcW7m qhuBrxru1PozDAtKi79gnITiPRxlWIgZijXMW5jCcqEjVk7jFBcSJSK/6q0Xg5i4kOFZchauvbt B X-Gm-Gg: ASbGncvEsUaV2Cp7AC+CTB8StsmxyB9zLrTPRTiLVBrhCaGvJZhnVXPwYj1pzLHh5pH lU9hy6SuY6nsPf08H5VBHpF/HxI+7yjleM2YLNMh6W8GAyezys6t7rPgghUilFLfJwAJXflDRZE c6BlNK62EV6ew24faDUdcBq36C/mFHdbvHkzBr07cSMJPhxcZAukLL9CHVa9zTWpifmDtx2o+Zo uygVcQSMIQLaQtkjQtJJ6or5S0HaPNReuZR4eSvnTa+qLQfrjG/QHsmx1nqvUw= X-Received: by 2002:a05:6a21:339e:b0:1e1:aba4:209c with SMTP id adf61e73a8af0-1e5e07ffc0amr2924286637.29.1734668081957; Thu, 19 Dec 2024 20:14:41 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:41 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 48/51] tcg/optimize: Use finish_folding as default in tcg_optimize Date: Thu, 19 Dec 2024 20:11:00 -0800 Message-ID: <20241220041104.53105-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::435; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x435.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. Reviewed-by: Pierrick Bouvier 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 74d1ca7484..94be844ee5 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -3124,11 +3124,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 Fri Dec 20 04:11: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: 852375 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852988wrq; Thu, 19 Dec 2024 20:16:44 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXCU6c1V8gMkuLOofl32imTSzrxECjQFQZJn6U6y9qgtRpVik7Aq+oRyV7XyVqtmYZscFh3Tg==@linaro.org X-Google-Smtp-Source: AGHT+IHFjQ+9/f68yzt1vhkxPLevOcR5wjiFxFHFIIidj9v5gxB3W5vYimXvOwOxPMHxMtV0MzEf X-Received: by 2002:a05:6214:da6:b0:6d8:ada3:26d3 with SMTP id 6a1803df08f44-6dd2330afb0mr25684176d6.9.1734668203982; Thu, 19 Dec 2024 20:16:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668203; cv=none; d=google.com; s=arc-20240605; b=aTV9YSjctfjgVr/vxT6BNH+g1b2hQG7iUuUgebKg0kyhbnwExwP2aYfxaxdJ7Dm6H/ XFrje/zMNw3PT6HuXQoi5SQVP7rPMgCERw0jf+RFVXgPKEVpFs/n7c983s2Pb9mHxB7k LWCKQoG9K3UJPsWaqSXq66VFYMuHN+vAhO8tag4734kCPtJT9365TsBIPJwSa/QYDrWQ 1SSWYFrWdoLFTw6UPGEQMmQNPnO6hbqmKHUtzQ6WMefQoSFPky8NhFGvKzqDgenCmcvo pHvcDJTS2sWpNQ892PUyU3ssfB5iQS5OZMD4aIUFRGkWzxBQJr+XQ+tUqK8qSF6k8ixr pLOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jULyl7u+QKbWOLYYhEW/2BBIfmsvWodRkVtxb7KDSes=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=RDbLK1LL/goPPjdhDPCAoUOcerZLAOKIImgTkK5z6XoOH2lffIVIjpaaStkD2h7en4 kOuXFG2s48Y0u04bYOLxcdp2AevsiY0W2+apIk4pAVglklVimHRsP+f87kXFlFPm1MeU MzkWXYUxoyViqeojDqL9eW6rmsbwsza2pm9WZ+V6eSpHttcsC5zoUOOFeG8nxp1bkPg/ HHiAjToAmr6V05QscpXaeOkQRz66vTVxppvdlcf4t+WeVgBbkamv9/jGdmXZO/+ookCO xd8V5P9Fjt+ACO84xlaBdB0YqH3IuzccGAw6T9jEXb1Uyncep/DJuO/3otAUfw9cBhyj BRhQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fOsnTLm1; 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-6dd18237378si31389196d6.280.2024.12.19.20.16.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16:43 -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=fOsnTLm1; 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 1tOUQj-0002p1-E1; Thu, 19 Dec 2024 23:16:02 -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 1tOUPV-0001YR-Mv for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:49 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPU-0006rL-2B for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:45 -0500 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-728e81257bfso1357597b3a.2 for ; Thu, 19 Dec 2024 20:14:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668083; x=1735272883; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jULyl7u+QKbWOLYYhEW/2BBIfmsvWodRkVtxb7KDSes=; b=fOsnTLm1bzJd2IkkKD16lFemy5eFKLUxEeAu9PQaNRxDvgTa3AKw8Pl+x6uhvm8rOy 9lX0t9VQnLIH5leMRfd36vmZTF6J7QBZngAR1/KcaGnrPAahoD/yheVww3AktuDd9uDD XD/frzc69MN1CwFJBMUuCB43raUMIXeRAUvojLymCKeIfRoTogvlfmN1Vr5ytQmansgc D09C7fKzK+eh50QamszsZH+jJAW+JXyjsszzbEJgTm7rov8SEnvFOnOrDvX9UriUG942 U/geqU2EWz0/Ye8kG0sPZj/hkqMVDL5+xFQrE++eiMYkkCGkq3rpg+pFDvSWpp/pAUCC pDZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668083; x=1735272883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jULyl7u+QKbWOLYYhEW/2BBIfmsvWodRkVtxb7KDSes=; b=WyWrsaGun6PERWHuAIDSEm+12XJMhbA4bMD1eyJCKstuJTU7UXEY+30G76Vmgil9IZ LqjsXbXWxVVSZQxappxBh5JT3PdfzxiPaxDRq0REXQP/hzY66Qx9IPqLLoB0NDdtXXJc +2QLV5BsQvryszIf9vgH3v3SajfHvAVKauj85G2Q6ld3/7YbT3C3EDUTwNleeIN/MBWL epSZ2PaeP84jQ4SCOKVug2NYy1lodihr+Qqkv6+ywrUqVNOmtYpM3WnvY035Rk/Na+cl RLYnJaKxfKJ4L8r39mSyTPFl6lq6mwKJUcf4QSMQylAek4JxPidYHp+gsWKwLLin7Lys hjBw== X-Gm-Message-State: AOJu0YwlPEJMTBDi0OKuUmX4wifAUHHLkduTBYbfcyT8NrIturHpYkTn MwpJ2/xMTSX/LAzpjyy3yosHMNlJIv27jKtjpf67FawSmXK1mDueWQ7FUhRsnZ2ivbBeJlX5zFw S X-Gm-Gg: ASbGncsS2m2En9X0Fj6Ir6LsU/JegNM+YIRgzRBbt8YCpRu2EO6uPAaLlxSMATPgjPS WLEBwfe5et8bVhfQOHAiHFOGppQIxnGV0ckNu5O7FV+FfVlxrcQNziDbbGbxHppN5atMMhDiGpG qFs/RMnIB9ROwjaSx1LpXcLkN24tmwQN9tOov/cY1i6GI2A2DAFJFWnqINZL3LLw6zr4d/d6GnD lQVQZ4YzCtN8IJqErEEcq7EzlVMnXH/PX7JxLzqHrDcsI08qqfWkNERA2k0a+E= X-Received: by 2002:a05:6a00:44ce:b0:725:ea30:ab15 with SMTP id d2e1a72fcca58-72abdd5efb5mr1743062b3a.1.1734668082624; Thu, 19 Dec 2024 20:14:42 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 49/51] tcg/optimize: Remove z_mask, s_mask from OptContext Date: Thu, 19 Dec 2024 20:11:01 -0800 Message-ID: <20241220041104.53105-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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 mask setting is now done with parameters via fold_masks_*. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 94be844ee5..2b64b8a0ec 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -64,8 +64,6 @@ typedef struct OptContext { QSIMPLEQ_HEAD(, MemCopyInfo) mem_free; /* In flight values from optimization. */ - 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; @@ -986,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; } @@ -2907,10 +2897,6 @@ void tcg_optimize(TCGContext *s) ctx.type = TCG_TYPE_I32; } - /* Assume all bits affected, no bits known zero, no sign reps. */ - ctx.z_mask = -1; - ctx.s_mask = 0; - /* * Process each opcode. * Sorted alphabetically by opcode as much as possible. From patchwork Fri Dec 20 04:11:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 852379 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1853168wrq; Thu, 19 Dec 2024 20:17:27 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXtuRSoDjXfFpqbSXy7Ya05b7sGuIWy5Bcwus0oWQ/Lr36+FP5qKURlAfJnFdZickkRjpY/kQ==@linaro.org X-Google-Smtp-Source: AGHT+IHz3exDVB9rys7jl7AJja2TaowGVFh7frz5W0QtE8DhCXUWrhWUUdG8Sm8laQjaSME+rwLv X-Received: by 2002:a05:622a:5c6:b0:467:68a3:4c44 with SMTP id d75a77b69052e-46a4a972791mr30248071cf.39.1734668247313; Thu, 19 Dec 2024 20:17:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668247; cv=none; d=google.com; s=arc-20240605; b=gHg99IlcL8cLTiYBUeDGa9vHNRH3ymphyGlL0kIifsxJxc/Imufa4BSHiPop5m0jhl DQ/K48PldjwbMRKPV1+0LyIWW3CPSN5dXOi80aTDSX5TmT0Wx98oYDsnYuHf+fgrUqTD q9tCbh9ZEyOTIkFhvwmurcCQGxlbzhAF84lg99F1TVJ+g2Zz7lIgTnHXEgIVNMLryj5G q/75FGZCPqMGqUzk34Wh6SZ6Qb+DaQfNqlcoJxPd+g3EoTEwf4UysbGRHkdvjZQSPFYL cW/MupvILdgnQCF1OUJMqVfUwgwvdtvxBLGICDp4HVmXQZxpNMQ6U7rA/t+JxRqEzbno xYMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=KAulOf64Aq+MQyz7Gm3afpYDj7PG4HhSWEO5QGhMKrY=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=BqZ9FWIOZ5uZqeEEvO82i7+n9dQ3oFD0ibYoKO/fHzJdb1lFArT1uLWhkPFMRBFUZf V+Q1Fzf61C47CnNPjqCm0f/nOIh0+Thza9+oBFQX6x+fqFy3Q50hID1vEaQ92P39Cbbg murtna6K0Nhc2QOgMrfqjCNPP3TIsKC7f+MAwoVd9o7NZm5tmbnVl0s2jX8cB43Y4BB5 KHIfyo1+HzN1IaxaWNJJpc4HiL6FtaX1eF9hYkv83sH+2dh0Jfv0eXk6SrMKzgdKK7PY rxHq1SSd2aYv1xmwWynSfCe+w3EIYnQVPg9oJ1QHmgDjR+JSb8fg+n0OrAHzX3hJn769 U3HA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Gl2dV9IP; 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-46a3eb9914fsi33616881cf.340.2024.12.19.20.17.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:17: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=Gl2dV9IP; 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 1tOUQv-0003TD-BI; Thu, 19 Dec 2024 23:16:13 -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 1tOUPW-0001YW-Pj for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:50 -0500 Received: from mail-pf1-x429.google.com ([2607:f8b0:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPU-0006rQ-Vi for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:46 -0500 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-725abf74334so1298126b3a.3 for ; Thu, 19 Dec 2024 20:14:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668083; x=1735272883; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KAulOf64Aq+MQyz7Gm3afpYDj7PG4HhSWEO5QGhMKrY=; b=Gl2dV9IP0oXdOC0s8bsj0MfbbJbthae2MNj2nYhJXXnKFQsTi5WaajgQsmdlXZc/is gilPTa5oIUItv5AXMe9JoykD9e2i8PZNpc7HIuFswCmTXtlHs6wvd12Tb9iwN/m9bCpJ iNE0RJVYkDJJBAsBKSSyyGD8sTeVSYf9+yAtAcycXxZQhAWfxLlKi7B7y66e85XVUs4N o4X6Sd6SLeggzy32IOGAPUcLq1vMv+PLESgW4GzjcWaPoR+b3WZRKW01d12iWrNTflTJ DiPyIXxlqju8PhTIRY4Zr12zJLMzUCXeSwTEoU/9DfLNlBj6ndu321s23NV4JT3Jn3np Hf9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668083; x=1735272883; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KAulOf64Aq+MQyz7Gm3afpYDj7PG4HhSWEO5QGhMKrY=; b=QuG8dzmAKn+TekqY5eB0DuCYr5dYNeblFHp/YsZWO7xi2BBNjiUOAJqfu73znhXuMX 3zXmwhfRHP/qpif8eIJzP0StG50YK2a2Hr3R17FajYogOwwd+Wl2vCCaQAAfqSDOaGFK qH/s1/7RgSZkHIY2J0IVolCZyNh1iqfpe65c8v7jSCD7DVwcSrJuWKeLyORXgCHrjymu ESrl4dmrnNp57iNeRKev8C6vopf8M+NVDTMXgkQSO6zQ8eKMBz8eB171bBj9QY1Md0bS MJ86KbrXOoocKvwH5C6RHbcZj0hYepienURpl7rrwc+KPEfT24tNObwMu1GeVX/nDp+X l5vg== X-Gm-Message-State: AOJu0YwVyjnatjpNNVvTyulhmjleCYKpio3oD6PWuKsT5kDEydGUk19R Z2kQUgyGPJWf1uyZiBlUq8paCksCbTtOzJLOwp2OJappo4uG41jtyW25NdN/EENIEAkR8L2YK+E G X-Gm-Gg: ASbGnculgmr35MLufq32TAS/VpATL/Y+jZrIPmZSTwWkXGD/ACJ2F1pvBJTi+I7yxfR 7FPWAsdlCj882m/Cbtc4nuyV2B4lY+tqqjV5KlZHihDsw/EZn6KPyttZuYH/0feb9Ck/tWxTC6P 8KWDznsqaoe8ZO9PmgkezAvO/6QR74GFh3rx2MgbyVMq3luGZl1dTZPpkAuaNXUN8/zdnU3B1H1 cMuas97NeZuDDlCIWnFkGR6wpBt50To7p+Ke8c/K/eMYZkUWoSmwwkYlmTt5rA= X-Received: by 2002:a05:6a20:158c:b0:1e1:afd3:bbfc with SMTP id adf61e73a8af0-1e5e0446374mr2820327637.3.1734668083253; Thu, 19 Dec 2024 20:14:43 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:42 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 50/51] tcg/optimize: Move fold_bitsel_vec into alphabetic sort Date: Thu, 19 Dec 2024 20:11:02 -0800 Message-ID: <20241220041104.53105-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::429; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x429.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. Reviewed-by: Pierrick Bouvier 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 2b64b8a0ec..4ec70130a9 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1211,6 +1211,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) || @@ -1373,6 +1377,61 @@ static bool fold_andc(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); +} + static bool fold_brcond(OptContext *ctx, TCGOp *op) { int i = do_constant_folding_cond1(ctx, op, NO_DEST, &op->args[0], @@ -2799,61 +2858,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 Fri Dec 20 04:11:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 852369 Delivered-To: patch@linaro.org Received: by 2002:a5d:4888:0:b0:385:e875:8a9e with SMTP id g8csp1852789wrq; Thu, 19 Dec 2024 20:16:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVdd84LUWg6uJ4ycXX1bK8XHAQL7m+k0F3/kRGuXUZsmpdMZNKByplU6y4fNUauanoNjnxf9Q==@linaro.org X-Google-Smtp-Source: AGHT+IFFcLuE0Bo9bm4O/Bnx0szNCvQwqWKctSWBbZgbzBbuzWnwCS0yRk+qEibFZjQsezI7NsIX X-Received: by 2002:a05:620a:31a8:b0:7b8:70b2:5093 with SMTP id af79cd13be357-7b9ba7f6879mr223686185a.42.1734668175138; Thu, 19 Dec 2024 20:16:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1734668175; cv=none; d=google.com; s=arc-20240605; b=GY34nS6NYJVqOntjQxi9sVv1blAuVpnLhNyIO1jGTVt/m2ISvXmxB8gUrlBqJDHkBl 1j+45hd+7APDbjAANmPJubtRJgDd10+Q9jG5NK3Dxt55F1ed3mQeHPB9HooHLsCeNkiC Ar9LGk4lfF1gqa59aof8olIpuFCKkpzhBHBWTfxTMniwQeiaUnPfDcpYm4q5waLmU9LD E0h3Col4bdX6Uf1182Y+mcKoPxO7YgGJ6khZ6LyV3UdTmFjINUCe0IhROzYi5397BCcg bvKtihV+IwpTUTN0adsHWSBerNLv2qUGczT6YIiUBBmDaFBayImjqa4vWMq9GHmypgEH bQkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jeaDhdgh49HwDL7JKkbuMtxfcE1xBL3FzDC+L5uqhuU=; fh=vm85eyWrvOAHduw3sqEA+cYBqvHB7M0MHFcRJg7VWOo=; b=LelzDBLocL4ELacscoeedPqI+MIPo5DdZ3jInU8riUXDCvYH+wdI6juAOSISJrU2iB SNZ0rcIG/YBq64Dg22MEwoUqUGlSW3VofZrbq+XFTHVt3W8pW/tGj+TtHSDB+Fmdmefx fHPER1x8BRp2KBtC3zLlKoIdwNZ7IvSNR2wNMPvqEf3GrC1gYGntE8ZSlRd+AAtCG8TT pFHRDopUzLQ5Uw9InfqqQG+a2fuG0FhL10JT03JCw3+VbG690bTzc0wdtcOUwAORlII7 fyYludHzHcjvgA8LQJ07hkoMnimfvcyqefPgplys7Jog4fCVAJKw5TaNFDmKCLwOSI8n wncw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="az/e7WiT"; 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-7b9ac47a528si341284885a.278.2024.12.19.20.16.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 19 Dec 2024 20:16:15 -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="az/e7WiT"; 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 1tOUQ9-00022y-7r; Thu, 19 Dec 2024 23:15:27 -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 1tOUPX-0001Yf-Ku for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:50 -0500 Received: from mail-pf1-x434.google.com ([2607:f8b0:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUPV-0006rk-Lx for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:14:46 -0500 Received: by mail-pf1-x434.google.com with SMTP id d2e1a72fcca58-72764c995e5so916821b3a.2 for ; Thu, 19 Dec 2024 20:14:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734668084; x=1735272884; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=jeaDhdgh49HwDL7JKkbuMtxfcE1xBL3FzDC+L5uqhuU=; b=az/e7WiTyBU6GWbHaOWKF+fW0NAOE7ipcGRvHTVnEBOgqw1evvgETq/qCpMPD+Hp/U nq1uqk6uvQEnqz6HPrGrewpckEPS4wnFz+0Ca1G71q7XyjdmiIadziBo7Q9v9Lg4+hGi 6WPcmQ3Gh22eNSQXCwO7LDR088ElAK5pfRPED5FJbz2DiJCxOhbTNrchmZJNq4lnr7B/ s+UEH0Ct9WvFSKCg449rfLfjunMWCaI5NGKMkUzHERiRBnE1LJ7ynZ5bhwlSNazeKX+y xg2bd+RSf8rbJTfhv8Tc88tq3zh4pEojnSVTK04FBD6VOntLDNxYH1F0AebrR4xCLb5Y lREQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734668084; x=1735272884; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jeaDhdgh49HwDL7JKkbuMtxfcE1xBL3FzDC+L5uqhuU=; b=pbX5tQhRZB4UwuEZn05CPGnrR757+Je7ewhP2GZTKYKffJYVHQU25vsV7tNOgYv11s EkrZyE6a3bauAMIUooEFcfkUctXV8yexrmNfGbo6+GAsog1f/U7nKDNCLIFuhbIieNYF OsxEK5WndZi+3dTvuzZCFyU1abvR9VR8/YIxVQchw42p6sjT9niK2BK24obpE6bbCUGV whyXoD17KYfqm1zrnqy17u1jNyTVX6wK0pUVGbMuVW1yazc1YtXOns9gPeMtkJvPMY2h jexba8liWAXlZRqj+sJSnDXsz8kYz6XjXzmRBdvxBdWVclNuvh6ZNcSo9SIULX6z9YVo X52A== X-Gm-Message-State: AOJu0YzrOdZsu/q0x/omLze9ImKKWMRhQN5U2h98y3FePaREykc+brk0 fmbYH9yE4RUoGuxMX1fgz2tQMf+3iVHNytFYpA8Ju9qq0PK9PVtYflS0Wrg1ZqNwYnGqyNp1SsZ 4 X-Gm-Gg: ASbGncuslQ9sz3OpT2u1+C/KRF4AQPscypUMnXo7OAlXwK0kH60l18p9zt3P4gHJrBa LQqHOr29h4TOTMTLXxiBKbXLlKjHzy53j78x7rg1cw14tyrDJWuYCIZmdJ9IuV8T/QSniIQE5pA mbEubLZgEszs9YLEl7lMklC9Y7bnLFFUy2sjCko7FvGkLruHT68eWOQ3vVEYHLZKkgkiuVMeqe0 ujXvXEqiHYOvOuZZtMjHXVdpJ51PMZEin0bgCdGLUvFZL9oKd7Man+SuiE3Qyw= X-Received: by 2002:a05:6a00:240f:b0:728:e40d:c5fc with SMTP id d2e1a72fcca58-72abdeb6267mr1442069b3a.22.1734668084085; Thu, 19 Dec 2024 20:14:44 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-8529e78a55dsm506952a12.80.2024.12.19.20.14.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:14:43 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v2 51/51] tcg/optimize: Move fold_cmp_vec, fold_cmpsel_vec into alphabetic sort Date: Thu, 19 Dec 2024 20:11:03 -0800 Message-ID: <20241220041104.53105-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::434; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x434.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. Reviewed-by: Pierrick Bouvier 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 4ec70130a9..c708e50bc2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1635,6 +1635,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, s_mask; @@ -2536,36 +2566,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;