From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884727; cv=none; d=zohomail.com; s=zohoarc; b=EHYZn5aa4v0m+mQ0cp18yMdJRxQpg57DE4EJrP9jv6NI8bQpS/2E5Gws/uqmahpSFfOTJfXuKk6ZmqonfF/+6q5k36vWbSVxk62YmsPUA4wtUThcK2OdEPSin/nIYFzDtv55qlMCsQuHB1nHY5FgXIb2slHMmHm1f95y1/01Zv4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884727; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=i8y2SP5gsVRd2DDyIzSjHzTbblUtHqyMo6MFtQTYJr0=; b=QARbB6DabvW8QXVQR1DqCvzKud2i9cOI8DucQD6t/H7ww5W9hzgRMftadB0XTcyNf7bJvXxGyPbfKCOXfyUxwJLLeUjlG1gfCuntoHIdFV+gpELXKl0M+Vmnk7aDwKltA3z5D0DEq5KtAndMoEfiORNy39gA8uzeBluLbv4MHpM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173488472703363.90723738952954; Sun, 22 Dec 2024 08:25:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlJ-0002ZT-45; Sun, 22 Dec 2024 11:25:01 -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 1tPOlA-0002Y4-JA for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:52 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOl8-0002wZ-0B for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:51 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2164b1f05caso31192775ad.3 for ; Sun, 22 Dec 2024 08:24:49 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884688; x=1735489488; 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=enPxr/sT/UHNGTQxWtSudzFt78ZZwzD2BTQzV4ZTz6KB0SEjbQeZ0jF9ipkB4x2vVp g/1M8VjSsBiiMxnPASfmGE5ahaqA2KQ4Vunp2pbfEqghiod06MUcQ+8aGyFqT3yvS7gJ IWHKWjujoszTFBHCzFTnrkHe8x38HY4I3ahjcw+x8wLjC2HXpitM21XhfmoKzlXYDyJ5 V2CZmhvG9swsBvuABiMi4oK+HDDMRMFVP5klnNXJCy3Fiv8HB9VFCgSX5xA3yXCrj71l Yg1AsoB6Lc6Qi8ZkDT+bS2aLVqBQqRvWVJetRG5W0/L5GJcc1swn1FlqeFQegBqA03Jy WH8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884688; x=1735489488; 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=BGEDGLgWpcUg4YAkDCuJZxQAbcLWXSPODYADy3mo5QbfY0WNZ0LT0gScd2QfoHaY1W 1G5rqMwQxhClIYOacl9xwlW8/sPymRNPTUGUZ25c6As9nCozVHzX+EyTezgDV6EVhteT +SXMHrzrU7XFFPlf+5JPtF7R3QVkVQLuDNn73Wf8+9lVx8gY20AjSTpJ0+y9PE+NIjd1 sMwW9OBNPIhVBwvfqkCrZl+qtkG1NJ4blglB2CNblb2rcoZXP34pqeZjNZ/O8XXW3bp9 bfkf3tcwuI4WiUnfNp9Ze5m2IYjRgqdICd/h/xnKOoI6dhPgt5R+/uTHQfFv4jCMZak2 ObzQ== X-Gm-Message-State: AOJu0YzhJJISsofRMAFkRTjKscuG7z27vwq7d8D4IgwxaPvRZvbAOtIJ r2Uinjmu1yJ+dYT6yVYN4R5VKge1k1wCT8sOp89aLJtgAIEjH72gL0LN5MyaWnbhTf6tJMroGtZ bNKw= X-Gm-Gg: ASbGncvgy4TpEfwchsHejxbkxNuNX6DD9k6SKiOvZ/s7MG0IiQLGBE1uGuGZwKWpVDN Pw99hX6BWb8HsbqD/Jc+QAdt9lB/c0FcvTBK0mrKvJuxis2WihOnDwfwNbecCvPg7iIHF4wiB20 1TssSoCtfcmh6nNhiPS1GrKHCG47ECovbwEEv9k6FaK3qMy9QM+6AAY0na05bJMJU5KD+uOm3TU INgIAd/X/TaiqrxnCbJ2JpElTtVkIRDYwRMvgQnU12YHldeLoKCKIDywvBvB2w= X-Google-Smtp-Source: AGHT+IH7SODC73G8OQaLqUkM4p/Zm18XhYJsv3Upjr3YP8PC8Pmz66yA/UIs4Ik1Hikbxb9aBaml5A== X-Received: by 2002:a17:903:41c3:b0:216:69ca:773b with SMTP id d9443c01a7336-219e6e8c3d6mr146708575ad.5.1734884688553; Sun, 22 Dec 2024 08:24:48 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 01/51] tcg/optimize: Split out finish_bb, finish_ebb Date: Sun, 22 Dec 2024 08:23:56 -0800 Message-ID: <20241222162446.2415717-2-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884728314116600 Content-Type: text/plain; charset="utf-8" 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, } } =20 +static void finish_bb(OptContext *ctx) +{ + /* We only optimize memory barriers across basic blocks. */ + ctx->prev_mb =3D 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 =3D &tcg_op_defs[op->opc]; int i, nb_oargs; =20 - /* - * 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 =3D 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 =3D def->nb_oargs; for (i =3D 0; i < nb_oargs; i++) { TCGTemp *ts =3D arg_temp(op->args[i]); @@ -1351,8 +1352,11 @@ static bool fold_brcond(OptContext *ctx, TCGOp *op) if (i > 0) { op->opc =3D INDEX_op_br; op->args[0] =3D op->args[3]; + finish_ebb(ctx); + } else { + finish_bb(ctx); } - return false; + return true; } =20 static bool fold_brcond2(OptContext *ctx, TCGOp *op) @@ -1443,9 +1447,12 @@ static bool fold_brcond2(OptContext *ctx, TCGOp *op) } op->opc =3D INDEX_op_br; op->args[0] =3D label; - break; + finish_ebb(ctx); + return true; } - return false; + + finish_bb(ctx); + return true; } =20 static bool fold_bswap(OptContext *ctx, TCGOp *op) @@ -3037,6 +3044,14 @@ void tcg_optimize(TCGContext *s) CASE_OP_32_64_VEC(xor): done =3D 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 =3D true; + break; default: break; } --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885115; cv=none; d=zohomail.com; s=zohoarc; b=MvuDPvs/KSv5gqGQlbwi2auM0If6lYd0Xbl+wvRrrZWA2TySzruZ5yVCvUpApxmhdlHwaelnjyX7p1c9NEaoy+f9BAytv147KVlGF329q17PgP2KoMJViiakQxIe9TDw38br8fsQXUhAWcan8O/qeoGAsl6jwKKs44p9ubkjYb8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885115; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iOzpxqZ9VNfy3l9f3NLQHzVfPYu5zW7VkQL9KwFwxnA=; b=JiGG7ygfFiSWL2PWuYfRBwcn10NfdHZksOO/aozpU36BBXAratoYj2M8pEfqln1JZgXk/umE/AtFvrIEat/DsNRrjZlvnzcgcKJI98N7UnqH1r3j2hTLY28F4IYU9nfI8J01JxiV0m3JXfQEVDDBUhkqbhDtE5qucGFwEUmhb8s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885115834904.0822411135049; Sun, 22 Dec 2024 08:31:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlp-0002qP-2f; Sun, 22 Dec 2024 11:25: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 1tPOlB-0002YL-Q0 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:55 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOl8-0002we-Qz for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:52 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-21683192bf9so35224425ad.3 for ; Sun, 22 Dec 2024 08:24:50 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884689; x=1735489489; 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=iOzpxqZ9VNfy3l9f3NLQHzVfPYu5zW7VkQL9KwFwxnA=; b=RukDIfTjiBL+tFgl+qHb1XCgNvw6ZpLPrrNacHwWQkh1bu1HGQR0DF9uSk49nWUUP7 kZ7EFY9e5PC4Wq+eI16ld+xenENxYSXRVPbm0Rm/5aTcVvlHKdHJNzLqKN7U55ZQdxTn 9wY5XiDJ9Zcr+l06PiAZiCb8B+d9HBq+8oe7VlMtUUqFXgvhPtH+xE5t6gu7Pp3Hr5n3 KB48Cw69uqG+FeEegUXEfZpJZUmvi+ih4mLCVj6k+ICO+63qkiVmHWLidwiiYtsmnow1 gIBpaKikWv98Qhu/82cI/oVZYttRLymY5PEL0EZmaRTFviMqqSp9ylDApJ3AUaC/9nLk wDRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884689; x=1735489489; 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=iOzpxqZ9VNfy3l9f3NLQHzVfPYu5zW7VkQL9KwFwxnA=; b=YJhCD+1W78ckRULSOfVix+gk56VYHEm98YORt7Zm2RPPlSl6wHlmw0L/j3NZry8txm vQvTq5aEOLA+MfQZtOqNFpgAVsSBhDAdO4dx8W943vQjLalyVZ9vdv3Ks8HJoZIBktDN /IdVDHKhp7hHN6J7Jn/cg/YAFNHuWW2SnAN/gb6LmkpbNj5rwK5w+Tseg3TaFFdkrZUg /C/3djDaie3PoeFCBlCouucouDI20PN77DdC45OpmR5sJfSi8IoHmzQg6T9T34mMaJMJ wYGgvIOyQWddQcyO4IDSimzCOlog8N7itBpdU3KeD6Pe5GyGjWMhu5CQ5V7nfBf49e0q S3Jg== X-Gm-Message-State: AOJu0YySlcJkNGVFVGjVuVevLoy7tWQr8opnBN09/sa9S3Nxdqd0gyUd RHsz5Uf5sQE+4+gdyat81WiSrRcvFEV4FuL17++eYyWvz8gOTWlAujjNYbCqnPObCecdL2hyi8B RcrE= X-Gm-Gg: ASbGncsTIDOIQ13r7Q5vvBmj+z38aAVhZvGcY/fu2x1laQKfqBcxODg/64Tu3vH5E/m pKIKvM2lBvSmhpBhQ6FpHxvtWdPR5RcU4BHJMs/S8w4dXKb+pB1/Z/bfVVve8vw2rQdUk7H+yvY mbPa2c6lj+eahW9D6or5sUrbK4J5ad5i5kLQa2Rj1y2u5jBFOkg94cpnWuLC0mFVW3TXUy+zius IvMECdSeIqPzRFkWN6KecUK5+w2iOVA6uzI7zUdNpfHOjSQMbf8owujZbALjr0= X-Google-Smtp-Source: AGHT+IFqCOlKF+JgurAqfIDzDUe6Kfxzp2IGFmzqnl0om3uOgh5intQmV0rvJSEMuErtvRmDnbXxOA== X-Received: by 2002:a17:902:ea03:b0:216:69ca:7707 with SMTP id d9443c01a7336-219e6ebaf4bmr131453925ad.30.1734884689193; Sun, 22 Dec 2024 08:24:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 02/51] tcg/optimize: Split out fold_affected_mask Date: Sun, 22 Dec 2024 08:23:57 -0800 Message-ID: <20241222162446.2415717-3-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885117799116600 Content-Type: text/plain; charset="utf-8" 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. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- 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; =20 /* 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) =20 static bool fold_masks(OptContext *ctx, TCGOp *op) { - uint64_t a_mask =3D ctx->a_mask; uint64_t z_mask =3D ctx->z_mask; uint64_t s_mask =3D ctx->s_mask; =20 @@ -1059,7 +1057,6 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) * type changing opcodes. */ if (ctx->type =3D=3D TCG_TYPE_I32) { - a_mask =3D (int32_t)a_mask; z_mask =3D (int32_t)z_mask; s_mask |=3D MAKE_64BIT_MASK(32, 32); ctx->z_mask =3D z_mask; @@ -1069,6 +1066,19 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) if (z_mask =3D=3D 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 =3D=3D TCG_TYPE_I32) { + a_mask =3D (uint32_t)a_mask; + } if (a_mask =3D=3D 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 =3D z1 & ~z2; + if (arg_is_const(op->args[2]) && + fold_affected_mask(ctx, op, z1 & ~z2)) { + return true; } =20 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 =3D ~arg_info(op->args[2])->z_mask; - ctx->a_mask =3D z1 & ~z2; + if (fold_affected_mask(ctx, op, z1 & ~z2)) { + return true; + } z1 &=3D z2; } ctx->z_mask =3D z1; @@ -1709,8 +1722,8 @@ static bool fold_extract(OptContext *ctx, TCGOp *op) =20 z_mask_old =3D arg_info(op->args[1])->z_mask; z_mask =3D extract64(z_mask_old, pos, len); - if (pos =3D=3D 0) { - ctx->a_mask =3D z_mask_old ^ z_mask; + if (pos =3D=3D 0 && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { + return true; } ctx->z_mask =3D z_mask; ctx->s_mask =3D smask_from_zmask(z_mask); @@ -1777,8 +1790,8 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) =20 ctx->z_mask =3D z_mask; ctx->s_mask =3D s_mask; - if (!type_change) { - ctx->a_mask =3D s_mask & ~s_mask_old; + if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old))= { + return true; } =20 return fold_masks(ctx, op); @@ -1819,8 +1832,8 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) =20 ctx->z_mask =3D z_mask; ctx->s_mask =3D smask_from_zmask(z_mask); - if (!type_change) { - ctx->a_mask =3D 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 |=3D MAKE_64BIT_MASK(len, 64 - len); ctx->s_mask =3D s_mask; =20 - if (pos =3D=3D 0) { - ctx->a_mask =3D s_mask & ~s_mask_old; + if (pos =3D=3D 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old))= { + return true; } =20 return fold_masks(ctx, op); @@ -2843,7 +2856,6 @@ void tcg_optimize(TCGContext *s) } =20 /* Assume all bits affected, no bits known zero, no sign reps. */ - ctx.a_mask =3D -1; ctx.z_mask =3D -1; ctx.s_mask =3D 0; =20 --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884847; cv=none; d=zohomail.com; s=zohoarc; b=ZdFzzL2UMHwdidqUHOnVIBo8KjS8DT/uvBMAiCX319+fbPla+w7swIyI+b3QPBkkUoqA5fZJUmc/NXDSWqxHXy/x1GFKPN+F6pHOvVPNlYB5aE0/izHmhuggOyKv8YZB/8yA51XoVt0k1N9xfhALy6o7ucF35O/229rz7UDAzOU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884847; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kwAmrbK+z6InFUYOYJQouqu9jlEe2zkE3MrW95sabRA=; b=lp9AlXSxQSlpQroFaNkO1LIKfQ8GbOpBRA5RkKO5uZmYXoCZMGyuKbCSSlPzw2iUl7O7oTGwewQ0b53RsYrkFqMOBZVNDoyB3kuuYPHfZBHQZwQSHnWLWHx7F/Xhueuz98nW0opRHZJWQE3roMcWEMIcxzlOa6SY/VzlO0Kn3fY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173488484786994.47510250289713; Sun, 22 Dec 2024 08:27:27 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlf-0002b4-43; Sun, 22 Dec 2024 11:25: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 1tPOlB-0002YN-RP for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:55 -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 1tPOlA-0002wi-Bi for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:53 -0500 Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-21628b3fe7dso29192365ad.3 for ; Sun, 22 Dec 2024 08:24:50 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884690; x=1735489490; 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=fYTVu4TJz+3vY/6jNfN8D2IixErJFfeGeQpR8BQykX8dxwdkBD2FLivxExmlXmotTQ adv0/Q/nmtp68yOto5VSH4PpuoTpfbSfvjhYZUlvwrI7HUVZZuJuwswKPJZ37Yc583Qv tm9tIuYBn/O3W081wtXXdq0vxbq+ziz889fbjccnQwNqxkwnvZMu40U5QdOZNb5xTwhI EeLYyzOyXdVc+oPklshjWcxPIcAGZC+KCg1mnnzxx4mD/jFPq6NPHH6ew86IgpX3tepg BgZI/FFLRlRRD7aH92ChzmqCev7AI2APb6qGPV+GgtGKSy2ui/dXGLwrO52UfGDXhK1f YWzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884690; x=1735489490; 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=BDGdlaJ5xTbncO6jSS9+m9jEUHkjl7fssZboHRtfhcyVaUDnhcuapa7EyEfSdguzvS skm6vd4wKMgf1gCSx+iFJ/xNYJPclncnFO3d82c4q/TYSqAuKO68cs9TwM/z+ZwaXwH3 DPSqrYuNnuO7NgeD1fOmNWVK/vk7KmvgbxkAkxm47Y+WTw24GHZCariaeH6F10O8uNHl gtTJ3IAF0kUCHGS7RaFQAoj4oFdq6jEid2pzuZmO0S1DzFsOa8VEu+1b+cLhts88Rywp k0y67FguBeOD+FX7Z7ok2tMB02FrBlJyejU5vpgoRuj0iD8fEC5oUeEZjlZHHseaQehP ZRkw== X-Gm-Message-State: AOJu0Ywrdl3VAhnPXrkkOgvXUOj2EknLs+8bFA4Ly5GNDhOdbsVUhIc+ 7pKJ3MtvNb7MMKzkNV4u/pvJnk0mukNkmqlnQzazb6ZEhDQ7MvKnQGFMbBmG8ihQf4JojDHn6Ck Fln8= X-Gm-Gg: ASbGnctDOoE1hhjVrfFKWvyrC2WRuD6OeO/ALqVaGPS+W+RV0QUhULUcG0Op1DXWWiU GhrDYLJ79CAW1a5RvsOyoSxcOaT5ZXw8Bi3uYgiYA/oJg0y27gXz/7X2e1d8MoNvv6PcB7Azjwx K9CsMKfPlN6IuKdMdV6/mvVD1kHCLYuaaXKAKxN3Ovbm4H75od6tfMUIufsH8S/YYFST3VFY6Qt gHUj6rJKMi0131ZaAQerPO7OAuodk1VOd/e9p7fduH+xsV60LqIqnarWKDjI0Y= X-Google-Smtp-Source: AGHT+IFk0auuOSEMGnciND4l2mz9+cZddel/KBLfaVzSvurQUP+Dtfp0ANxD1pOywstqQU+3WfbhGA== X-Received: by 2002:a17:903:947:b0:216:725c:a122 with SMTP id d9443c01a7336-219e6e9e0eamr161030895ad.19.1734884689869; Sun, 22 Dec 2024 08:24:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 03/51] tcg/optimize: Copy mask writeback to fold_masks Date: Sun, 22 Dec 2024 08:23:58 -0800 Message-ID: <20241222162446.2415717-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884848503116600 Content-Type: text/plain; charset="utf-8" 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 =3D ctx->z_mask; uint64_t s_mask =3D ctx->s_mask; + const TCGOpDef *def =3D &tcg_op_defs[op->opc]; + TCGTemp *ts; + TempOptInfo *ti; + + /* Only single-output opcodes are supported here. */ + tcg_debug_assert(def->nb_oargs =3D=3D 1); =20 /* * 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 =3D=3D TCG_TYPE_I32) { z_mask =3D (int32_t)z_mask; s_mask |=3D MAKE_64BIT_MASK(32, 32); - ctx->z_mask =3D z_mask; - ctx->s_mask =3D s_mask; } =20 if (z_mask =3D=3D 0) { return tcg_opt_gen_movi(ctx, op, op->args[0], 0); } - return false; + + ts =3D arg_temp(op->args[0]); + reset_ts(ctx, ts); + + ti =3D ts_info(ts); + ti->z_mask =3D z_mask; + ti->s_mask =3D s_mask; + return true; } =20 /* --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884817; cv=none; d=zohomail.com; s=zohoarc; b=GXJF+HUArpxYxleVG1d3vTicFdhuosxKgvlzdK6VRCMeNXb8FyqZIWwoJzpiH340qGOiCTQ9a16SOqgSI15DSbV8vaSwtwh5sACgWIi/iwQY+8pplHpih4sg2Iof0kIVjn2FcWPJcU9J7cc7amHmt4VrJK8nOMI/Lr9HnL+9k60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884817; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6O0RsWWKqdEinIh2H96IW4WRMj9sIUVKDwhRVVNpMf0=; b=Dkew9tXAIWdibbJmkgMxCCQOKoeu97xLNjHt+XAYCbV6i3Uy7U/QuG/w/SZtmCGckhBPz/lRDHt6nDPKNmiYhCuOu7XtIPP+PWkl7sy770xVg7b/9YFWLxdmyzOu3vhTTq3ynKNCMIdDjnh2YQZB/56iu0F+IsNIXbERpGaIICY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884816996138.53038732196114; Sun, 22 Dec 2024 08:26:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOm1-000316-MO; Sun, 22 Dec 2024 11:25: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 1tPOlB-0002YM-RV for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:55 -0500 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlA-0002wn-Br for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:53 -0500 Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-2163dc5155fso30200205ad.0 for ; Sun, 22 Dec 2024 08:24:51 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884690; x=1735489490; 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=6O0RsWWKqdEinIh2H96IW4WRMj9sIUVKDwhRVVNpMf0=; b=FVPh8Iv2Sg8PEu5mfDuiOFlPZ1B8eJe6tsxeIEid1Nc8rvgh3nKuOaBdwHNWABGjcf IoLC/fTovAmwz7CGlK+EMZXeTcPX3wppbHArqXepB7e4YmW9yhiZ49wqargXWX13NvDz 1+n/+uKgXkandK+qbf6RhxCitKrnY0TN87muT/ejOePeFHHDxP1yPJQ01OeHfDKBdz91 QKHHuygJurbD+QvbD/hDkgMc0kJ+ItUDOjSwyVR3FS/ysoAD744ifPCGhVjrYMtWaQc+ 3jZaBwEXC4kLezGtQn3EFKb9rpnjucL3yMkGCuBYrI13hi4XUgonfoHlhnxgT8MPOk7b kBaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884690; x=1735489490; 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=6O0RsWWKqdEinIh2H96IW4WRMj9sIUVKDwhRVVNpMf0=; b=iyxZ8eGIz6Mk4/Gz50hLron5LnyEWHZIlH/s3Ir9FM5fz2tzoNVvxXfpSYRBQiMoZe k8zHHZUEnaQlWgUMHK5Zf4IefaF9C0S6Xuf5dzTMhiaTDnrUHIHXvpJFnH8YDAzKLGA4 5J2CIDMSHeA6ia5MqCYsvbGY8MCjZU6pAcvpgxD1/8wYbRcutV9RnTlSFbr0hEVQGEZG jxq1hXd1W7Uf9Fqnb8l9RPuTygKzIGUuxdTrtIV3HZRRcS0Q1AOb/Tp52T7NRNNcLf7J B4SYCD/ae6wG3pf7otCOeGMR80cTAW5ZA2vNXPDE5iBrjEeafkPARznjfYoHY1y1kC6l QtAw== X-Gm-Message-State: AOJu0YwiKubbyqRhxir/1h8APXfkkYuc9+En4UX6AyBPohSamdhjy7zT /7qXYYhMsMByFbBBECgYueteCcYG9TbHf+eb57n7097OS3CQxSryuQEhSPvHhbkCMUgj2mEZuNc oeLw= X-Gm-Gg: ASbGncuOrB3WWbfV4xGZd4mpgT6AfzNOwkcZZwgKmY/uTcHhdAxpq4YhFWdfQqbIQxz F8Xku/HCWbFVVwOmHgyd6ZGBHaWr0H9D8ftyAPFnnfkDwKkDGCU2/27otZaNY7scQWZHdchAQLE vsktLb3wFRAZTUvSNwtMaR635+AN6s8/OIvsV50DrTobr6BEdGJ6JkIK5TSXiclaXlQtrBTy72L pItlJCJrTuj8ElXarsU4DuAfxyiGBRiffMKzdjTg6lqwEaRd7VYnKHrkkvXaC4= X-Google-Smtp-Source: AGHT+IEc6hDUoFWmkxyNVnOD3rodUfLlRVpMHmEJDtXc4ZIywwrVlAFBmoT5a+ZU15MePMWdKEM1nA== X-Received: by 2002:a17:902:ec82:b0:216:3466:7414 with SMTP id d9443c01a7336-219e6f133eamr132772495ad.44.1734884690568; Sun, 22 Dec 2024 08:24:50 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 04/51] tcg/optimize: Split out fold_masks_zs Date: Sun, 22 Dec 2024 08:23:59 -0800 Message-ID: <20241222162446.2415717-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::633; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x633.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884818367116600 Content-Type: text/plain; charset="utf-8" Add a routine to which masks can be passed directly, rather than storing them into OptContext. To be used in upcoming patches. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- 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); } =20 -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 =3D ctx->z_mask; - uint64_t s_mask =3D ctx->s_mask; const TCGOpDef *def =3D &tcg_op_defs[op->opc]; TCGTemp *ts; TempOptInfo *ti; @@ -1080,6 +1084,11 @@ static bool fold_masks(OptContext *ctx, TCGOp *op) return true; } =20 +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 --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885119; cv=none; d=zohomail.com; s=zohoarc; b=Jikgzwel6IRXRe/7fUr8ufZ4i7KjwJZb0ezyB0JEE4URpKy02o8W6uR4Kk5beXSX4LIfZefbI79A5YsWOMfFgbaFl8eGwoLttZ7MnnsSAiqKjm1xlouCR0EqtYdq6YArn/KH/iTrfLgtBDezE3WhR22B3YEoafPxTwMDOxLj844= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885119; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0XbbAA6tPaSy58TXvgA24Kz1zz5lDy83D/6o1p8rm3g=; b=ZqST2hc99eGmmBelUK0Yu/h72G0OmgRFs1NlzxZaT4p6eujPHt7vCKyjjy3e/UuXCADRTmeyXfHkPZInm4w+CKxxN3dpDV1mpGK3SlSPW+82GjUgEzC8+A6WXjBI+oJhrrT5E9VTC1pDLCDk3aO14ZYbi4Yb9ilZIBm4pjyeCok= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885119970151.94240175484356; Sun, 22 Dec 2024 08:31:59 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlt-0002vC-Mz; Sun, 22 Dec 2024 11:25: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 1tPOlC-0002YO-HM for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:55 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlA-0002wu-Iz for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:54 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-21644aca3a0so36717695ad.3 for ; Sun, 22 Dec 2024 08:24:52 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884691; x=1735489491; 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=0XbbAA6tPaSy58TXvgA24Kz1zz5lDy83D/6o1p8rm3g=; b=rZK5jRYlN/Vgzlcx0BJWFazwuuPnecBgIqX4nM2Q1NE2X8nzhYd+L86ICBfO4qy6/n qzVM3C0S7lxRkgsKCkcyUMjR4y35tw5qgKc2vBH2wd5WSrrRcFtLOTYYIV2xGQgYWP/w 7KvBgFvolUtWaexiZBLYsoaRXrTIHX4QdywfCBcJ2RRoFXPAgK1wmVtSvLaM+itEVD4W eQDgvpJHKvqkeW1OI7DCaZFE+yX+2gCPJ5g0lEKs6fblIiYtiiXaYsqit37po9sKbmeR IM8anrxYZeE/czAuP5WwGzS4DoLb6qBe8uoURrMyY5oy/GMeCn7e5AMZ+pUk5Usjv9Xc HqIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884691; x=1735489491; 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=0XbbAA6tPaSy58TXvgA24Kz1zz5lDy83D/6o1p8rm3g=; b=LZPqIw3wUi4hWjFOjEmbGHd0RECPCjcywq/i55di7tqidi1KVXhoIRYlMK6tdGZd43 p2RG+q34Goa64kgbL6yK8PQEWd7+15gHGEnBQOa+IV++FBb32LQo4jd9lsGaa01dwY17 PZd7XHZGwdzWrgTDkip4SdV2o/We0WKmESOuuci68AgxVUX4KO7GYiMqLA3vtReaIGAE KhWxucKYKqpGNLi8H/q671kef/zLemTj8Z29RKhZI5SVySYGqdwJQeyTiQyCi/WZGIN8 8cFXK6gt/tLqAI5Ih4ZJW0bhzFRWg7dDTh17JyjmxTCttWNwrAOBP9gqdMCmYxjG6Dpd JDxA== X-Gm-Message-State: AOJu0Yww//OU/a1j4aT7iCKfE8zI+M6qvuzJeNqCfgkTOA5nNeQD1XbT R4J5VV50Vdj24OsR2bKXeRSqPNKhcUL5qPwjQtunELUXFMBqX6E4KKNuDnEuZHgTCI9K2z/MkMx mY/M= X-Gm-Gg: ASbGncsNpWgEVWy3rUSwIW3iw7x8SeojPyrbmdnow9Gs72fiQN7VSLbgEBb4HHY25ju EWxcXXe9AmU1cwC/LAHl2Z2cIMX5BtLmBqe4WqsCnJDPvbx/zK70AMqqtmHnxeQs3IOWydAwAES DqGATRB3NbxJcycWpT9XQqEYfLmTnuQsDZbuv3XS+gfvZZeWaSHGke/qSyJbL/gMzJt9gcV6jYt cwwPL7shr+VbYa+qAu+GdfQ06Ywc+PB7TXtBWW3csPrg6jkPYis+qdr/yPjHQ8= X-Google-Smtp-Source: AGHT+IE0SKwje3F08HzFL/roL7IaqRNRIwnXvbkD3eISG/gjtSAYkn0Qg10+Ikln8dEz1c4xW0/g+A== X-Received: by 2002:a17:902:ce86:b0:215:a57e:88e7 with SMTP id d9443c01a7336-219e6e89215mr98982445ad.3.1734884691191; Sun, 22 Dec 2024 08:24:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 05/51] tcg/optimize: Augment s_mask from z_mask in fold_masks_zs Date: Sun, 22 Dec 2024 08:24:00 -0800 Message-ID: <20241222162446.2415717-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885121760116600 Content-Type: text/plain; charset="utf-8" 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. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index d70127b88d..d8f6542c4f 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, =20 ti =3D ts_info(ts); ti->z_mask =3D z_mask; - ti->s_mask =3D s_mask; + ti->s_mask =3D s_mask | smask_from_zmask(z_mask); return true; } =20 @@ -1519,8 +1520,8 @@ static bool fold_bswap(OptContext *ctx, TCGOp *op) default: g_assert_not_reached(); } - s_mask =3D smask_from_zmask(z_mask); =20 + s_mask =3D 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 |=3D sign << 1; - s_mask =3D 0; break; } ctx->z_mask =3D z_mask; @@ -1605,7 +1605,6 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp *= op) g_assert_not_reached(); } ctx->z_mask =3D arg_info(op->args[2])->z_mask | z_mask; - ctx->s_mask =3D smask_from_zmask(ctx->z_mask); return false; } =20 @@ -1625,7 +1624,6 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) default: g_assert_not_reached(); } - ctx->s_mask =3D smask_from_zmask(ctx->z_mask); return false; } =20 @@ -1746,7 +1744,6 @@ static bool fold_extract(OptContext *ctx, TCGOp *op) return true; } ctx->z_mask =3D z_mask; - ctx->s_mask =3D smask_from_zmask(z_mask); =20 return fold_masks(ctx, op); } @@ -1851,7 +1848,6 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) } =20 ctx->z_mask =3D z_mask; - ctx->s_mask =3D smask_from_zmask(z_mask); if (!type_change && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { return true; } @@ -2116,10 +2112,10 @@ static bool fold_qemu_ld(OptContext *ctx, TCGOp *op) int width =3D 8 * memop_size(mop); =20 if (width < 64) { - ctx->s_mask =3D MAKE_64BIT_MASK(width, 64 - width); - if (!(mop & MO_SIGN)) { + if (mop & MO_SIGN) { + ctx->s_mask =3D MAKE_64BIT_MASK(width, 64 - width); + } else { ctx->z_mask =3D MAKE_64BIT_MASK(0, width); - ctx->s_mask <<=3D 1; } } =20 @@ -2354,7 +2350,6 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) fold_setcond_tst_pow2(ctx, op, false); =20 ctx->z_mask =3D 1; - ctx->s_mask =3D smask_from_zmask(1); return false; } =20 @@ -2455,7 +2450,6 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) } =20 ctx->z_mask =3D 1; - ctx->s_mask =3D smask_from_zmask(1); return false; =20 do_setcond_const: @@ -2649,21 +2643,18 @@ static bool fold_tcg_ld(OptContext *ctx, TCGOp *op) break; CASE_OP_32_64(ld8u): ctx->z_mask =3D MAKE_64BIT_MASK(0, 8); - ctx->s_mask =3D MAKE_64BIT_MASK(9, 55); break; CASE_OP_32_64(ld16s): ctx->s_mask =3D MAKE_64BIT_MASK(16, 48); break; CASE_OP_32_64(ld16u): ctx->z_mask =3D MAKE_64BIT_MASK(0, 16); - ctx->s_mask =3D MAKE_64BIT_MASK(17, 47); break; case INDEX_op_ld32s_i64: ctx->s_mask =3D MAKE_64BIT_MASK(32, 32); break; case INDEX_op_ld32u_i64: ctx->z_mask =3D MAKE_64BIT_MASK(0, 32); - ctx->s_mask =3D MAKE_64BIT_MASK(33, 31); break; default: g_assert_not_reached(); --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885118; cv=none; d=zohomail.com; s=zohoarc; b=JakULLi6skJiAMV/zFvzslg5B5drMwWOUqdC8v/q6t29RpTgNwgNkOdy2GRKTzDUwWyUNuf8WVNqTbMJOoiuRwTjxiyHWOdrY1L/gWmFhdDK3c4VhgeQUEjk5lDaimmIojj3alDn/rWWYenT3NJyyQfnn8ydilZQOg+EwJUl8/4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885118; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=xb4e6w7ahnBB6mbpBKhRckqM5FrOSeMfN/028Rd+wf0=; b=lAgjCIMYwWRsiIOy+fLHInQGp4hPbEHxjx1TRY+dYoq5IIwB//BB03d+L1WrViKDeGm4LdJV3ta7MgDap95qctQcZJB0aq/Q85s0AxhkV2lgeCKZ9skpE1i2TltrMZweHX0ouRBJIK1OWm9PSzb4M47c6yiTY9E8FVdVsX7B65g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885118891569.31296104782; Sun, 22 Dec 2024 08:31:58 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlp-0002qR-3E; Sun, 22 Dec 2024 11:25: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 1tPOlD-0002YP-Hy for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:55 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlB-0002wx-F1 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:54 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2165448243fso36704645ad.1 for ; Sun, 22 Dec 2024 08:24:52 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884692; x=1735489492; 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=xb4e6w7ahnBB6mbpBKhRckqM5FrOSeMfN/028Rd+wf0=; b=PMDvGyBfyIcl7LkXgz1NSfTl5ajUpRnXEGytqKtqvZV8KFmkwNS+56k33uwalpMoTi fvC9QjLb8WlkeZv519lzm7wJINuWat0uhKOEVHMyP+ebkzjcTvrjzdg5bVsJProCQta9 jc0m61O8emHwcrb+7DEn9F/difoO01wC/0/CWilEcJxyhSP5LAnBaxvDlXqI8DS+1joJ o34+/2NGmfqzTP2wdCIHDp9NmGq6x5WnZtIio+QW7Cid9+PQzA/rCkPAb6q0TyPBqole 18ct1Pggz1kBeZA3aGUMY+YcVhLlyc6it36SFmSxlrjR9bDnAIcLnhYzMlqip8XBVeKe dHag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884692; x=1735489492; 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=xb4e6w7ahnBB6mbpBKhRckqM5FrOSeMfN/028Rd+wf0=; b=hnhUGERzel8/3k//K2q/J9V+zoAdSeKpggsm2Z9ZpJvP2xAPiOlskHoFOT2qz7JR8X SOu6E02Z1VnQGhc3bC9mv73OiZP0AoDAQ0IwDL8Zzy3eYJw/MwRL5gllQ46IPEEQOxCG WmmJ6P0eAe8X3Vv7aRcCiD9CPrjHTVjE5gmO7MTKr7ZTNZp0Fdn1sg/A5H8kQWTYsB7Y Ed0Ux9LF2svASBVOW/xsHnQdp3rsBKZipwfykd5dNy+VbKNA3Vv1vf5Y7GsmbuLorTpk H2Lxvau6mX0hD4/Gi4FiIqH5Qte3uE1HQpOPs91BGASUC+X0s1L/fFDsK3VRObQGX2lC Zuxw== X-Gm-Message-State: AOJu0YypN6aqxzvXaVDqSsS/VhltzpuxvrpxC9W6FVrm9Q5sXFVcOGJJ msdQujg8J+1ohqi9waMXIVjp9k2bMJELwX8IJx7E0ztd0WqvfVSETu/IpKkONUWXGMbb7Ys45Wq rU3w= X-Gm-Gg: ASbGncu29h5/+l5HoOx4ovYOnwVcm54eWg1Rzy1mYhxxq5ZVgVOaVX7XRa7uoCNbsw/ qIB3fhuW9IstVZaWMmYTH6s7ruD2Lsp4b9uI5TerlKt1vsKZo33qDiFwrPmYmGC5ilKfJshF1RD sIx3IvKTw12ms8KyXOSBZqIz7idm0CnICosqtGdecXP+vDnAocLCaid4t+0kcam+N2vf8bNboTe 7x0tvBLfO0AT8qOZ3QT5K0zOMTYS5Jf9U9JFngBb7T1NpndO8AgdCYnVB7VPdc= X-Google-Smtp-Source: AGHT+IE81Y9K/sz/GNPeJy1IP876tC8o0oSTBkDsNgIMeZOnywmdDRLlBJEdI1L2SnIstynheovESA== X-Received: by 2002:a17:902:e892:b0:216:73f0:ef63 with SMTP id d9443c01a7336-219e6f284e4mr148748365ad.49.1734884691781; Sun, 22 Dec 2024 08:24:51 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 06/51] tcg/optimize: Change representation of s_mask Date: Sun, 22 Dec 2024 08:24:01 -0800 Message-ID: <20241222162446.2415717-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885119891116600 Content-Type: text/plain; charset="utf-8" Change the representation from sign bit repetitions to all bits equal to the sign bit, including the sign bit itself. The previous format has a problem in that it is difficult to recreate a valid sign mask after a shift operation: the "repetitions" part of the previous format meant that applying the same shift as for the value lead to an off-by-one value. The new format, including the sign bit itself, means that the sign mask can be manipulated in exactly the same way as the value, canonicalization is easier. Canonicalize the s_mask in fold_masks_zs, rather than requiring callers to do so. Treat 0 as a non-canonical but typeless input for no sign information, which will be reset as appropriate for the data type. We can easily fold in the data from z_mask while canonicalizing. Temporarily disable optimizations using s_mask while each operation is converted to use fold_masks_zs and to the new form. Signed-off-by: Richard Henderson --- tcg/optimize.c | 64 ++++++++++++-------------------------------------- 1 file changed, 15 insertions(+), 49 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index d8f6542c4f..fbc0dc5588 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -52,7 +52,7 @@ typedef struct TempOptInfo { QSIMPLEQ_HEAD(, MemCopyInfo) mem_copy; uint64_t val; uint64_t z_mask; /* mask bit is 0 if and only if value bit is 0 */ - uint64_t s_mask; /* a left-aligned mask of clrsb(value) bits. */ + uint64_t s_mask; /* mask bit is 1 if value bit matches msb */ } TempOptInfo; =20 typedef struct OptContext { @@ -65,49 +65,10 @@ typedef struct OptContext { =20 /* 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 */ + uint64_t s_mask; /* mask bit is 1 if value bit matches msb */ TCGType type; } OptContext; =20 -/* Calculate the smask for a specific value. */ -static uint64_t smask_from_value(uint64_t value) -{ - int rep =3D clrsb64(value); - return ~(~0ull >> rep); -} - -/* - * Calculate the smask for a given set of known-zeros. - * If there are lots of zeros on the left, we can consider the remainder - * an unsigned field, and thus the corresponding signed field is one bit - * larger. - */ -static uint64_t smask_from_zmask(uint64_t zmask) -{ - /* - * Only the 0 bits are significant for zmask, thus the msb itself - * must be zero, else we have no sign information. - */ - int rep =3D clz64(zmask); - if (rep =3D=3D 0) { - return 0; - } - rep -=3D 1; - return ~(~0ull >> rep); -} - -/* - * Recreate a properly left-aligned smask after manipulation. - * Some bit-shuffling, particularly shifts and rotates, may - * retain sign bits on the left, but may scatter disconnected - * sign bits on the right. Retain only what remains to the left. - */ -static uint64_t smask_from_smask(int64_t smask) -{ - /* Only the 1 bits are significant for smask */ - return smask_from_zmask(~smask); -} - static inline TempOptInfo *ts_info(TCGTemp *ts) { return ts->state_ptr; @@ -173,7 +134,7 @@ static void init_ts_info(OptContext *ctx, TCGTemp *ts) ti->is_const =3D true; ti->val =3D ts->val; ti->z_mask =3D ts->val; - ti->s_mask =3D smask_from_value(ts->val); + ti->s_mask =3D INT64_MIN >> clrsb64(ts->val); } else { ti->is_const =3D false; ti->z_mask =3D -1; @@ -992,7 +953,6 @@ static void finish_folding(OptContext *ctx, TCGOp *op) */ if (i =3D=3D 0) { ts_info(ts)->z_mask =3D ctx->z_mask; - ts_info(ts)->s_mask =3D ctx->s_mask; } } } @@ -1051,11 +1011,12 @@ static bool fold_const2_commutative(OptContext *ctx= , TCGOp *op) * 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) + uint64_t z_mask, int64_t s_mask) { const TCGOpDef *def =3D &tcg_op_defs[op->opc]; TCGTemp *ts; TempOptInfo *ti; + int rep; =20 /* Only single-output opcodes are supported here. */ tcg_debug_assert(def->nb_oargs =3D=3D 1); @@ -1069,7 +1030,7 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, */ if (ctx->type =3D=3D TCG_TYPE_I32) { z_mask =3D (int32_t)z_mask; - s_mask |=3D MAKE_64BIT_MASK(32, 32); + s_mask |=3D INT32_MIN; } =20 if (z_mask =3D=3D 0) { @@ -1081,7 +1042,13 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, =20 ti =3D ts_info(ts); ti->z_mask =3D z_mask; - ti->s_mask =3D s_mask | smask_from_zmask(z_mask); + + /* Canonicalize s_mask and incorporate data from z_mask. */ + rep =3D clz64(~s_mask); + rep =3D MAX(rep, clz64(z_mask)); + rep =3D MAX(rep - 1, 0); + ti->s_mask =3D INT64_MIN >> rep; + return true; } =20 @@ -1807,7 +1774,7 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) =20 ctx->z_mask =3D z_mask; ctx->s_mask =3D s_mask; - if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old))= { + if (0 && !type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_= old)) { return true; } =20 @@ -2509,7 +2476,7 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) s_mask |=3D MAKE_64BIT_MASK(len, 64 - len); ctx->s_mask =3D s_mask; =20 - if (pos =3D=3D 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old))= { + if (0 && pos =3D=3D 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_= old)) { return true; } =20 @@ -2535,7 +2502,6 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) ctx->z_mask =3D do_constant_folding(op->opc, ctx->type, z_mask, sh= ); =20 s_mask =3D do_constant_folding(op->opc, ctx->type, s_mask, sh); - ctx->s_mask =3D smask_from_smask(s_mask); =20 return fold_masks(ctx, op); } --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884909; cv=none; d=zohomail.com; s=zohoarc; b=JMqP7YptOz8meURtz6nu685vNTCAGgJbnOp2nwWamTQwH6vq4BLJjY6WnTBbU7rpVpD22nfiFrJDn8g/UMMgHdGVZIFYMquy1wV/HlmFKfh0HMSMBl2eDH+CqOn+UlzxfAsxpS6k5XXJYr7Q5R3wdd6CgTW3Brj+jsQ+L2ST4kM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884909; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ntKzLXVCf+dfdJqwHevl/7NkCe78JheCkwV4PXcpwhs=; b=USTorT0FkKltSu7JDmukVgPQfJiNtWMhZOuaruRsq6K4lFtZsHUPmTJMiVyb69OSfcxhR/hfbQNHs3xAk+IP5SwPbf8s02iSrco7o57dQLFnuyXy9/3kPW2sYXr7yxv4j/0vl1lkc6BlxiW4YdNPN53l56bd0fPcfIGbG7D4GaU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173488490961266.19084835069714; Sun, 22 Dec 2024 08:28:29 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlq-0002ta-57; Sun, 22 Dec 2024 11:25: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 1tPOlD-0002YS-M7 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:57 -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 1tPOlB-0002x9-RR for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:54 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2165cb60719so32160405ad.0 for ; Sun, 22 Dec 2024 08:24:53 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884692; x=1735489492; 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=ntKzLXVCf+dfdJqwHevl/7NkCe78JheCkwV4PXcpwhs=; b=bHhGP9vmreempbHsWTza/aPrecf6RZDTlIJNaU8j3C7Htu1a93Tc5lXST5yYVKBZn0 DUXKCKFV24QPaN6f3mOjrlilNL9IiL1jz1le1ZXVA8ChdK0s5P6YItUhoODI8S0DSk0k yfP9BpNGJXIb4yRCUFB38QHIcYTe10jW4A9yRSLYitZZGe3iHntvmXEQZX4a0ZeivqCZ bPBMRNPlyCsUUBu4n9BdUUqfO9zM55wMoiHFHP27Y/yUJfG9fJQuOq/C2+6nAidtR9j3 ptIouQllOklo3mS0B4Ib1XIh+z46qZsYqNxvh608SUyXLOS0gZ5TJQfzWUeGYIQv9vf1 INcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884692; x=1735489492; 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=ntKzLXVCf+dfdJqwHevl/7NkCe78JheCkwV4PXcpwhs=; b=NOQ/gu5b5CfL1U1NLkaTPH2dXHO/XvEY/GMUxNMfkwDj9B5wNNEWs5USLNqLRdmmNi DOuXmRIlhmYKi3WV/aUyHcNfDNmFq12zyW9Hkd46XUExqE3w+yzvg432NNVbNRT6Aamy 6zmUot3Eecl2XJyqrUfozdclF/I+r/8QvTFiSWewkdQoEPsslD7hNlHS3bYuwQKMNJei 7GRbFb9OBSSR+cdwTJMD9TxWjs+j1In6+X39rfjb6gPBDY99U8SOeRR6tybcabdDwUBk svojayH58g7bFdI9f6OLSQnuCyZYzwsGk8EqsSF4T0qfNRPeyNjRF3eTo4ii1aZK4w+y DN+g== X-Gm-Message-State: AOJu0Yzska5c4RCFK2eeNeLDoG//cXZ3tGektm92BSW7U4gkCtFAfeAp ECbNjxoL89TZAGD0bAdzj4/AFzbf750pZGovZESkmqDMwIqzcUrSiPe4iSrWty44Np0w67V6Jl3 VBuA= X-Gm-Gg: ASbGncvynezSyjQ7p3RjXlXyqUvYjxivQwoQUqETIH/vM68mlT9/PggWpg64DocLYaJ ZOYEwvp1laUeZlPHROnlzfVC1AyTKGEvrcrT6okDqJcfFZm+6mG1qx62irpWl5y7T35JJ8/nNe0 lfKOUZ2xJkY2HfdKYKnAQ5K3p+CxiFByrb1MMqhRpyv0Ny4FbkKaBEplZuTGv0LvL4OGFR2HCR6 ebtjSgqrCAXX32H/XfmdHfnSEp7A3ZgmGAmE8IOvC/XamUOvMWBwXuEYRY6bdg= X-Google-Smtp-Source: AGHT+IGg9k4kODKC+SHkjrke7dH6Yky+/n/O9a3qBwCp6TN/SXc6sXkWIRquGKZn4nxYZzhGsO8Hyg== X-Received: by 2002:a17:903:2cc:b0:215:8d49:e2a7 with SMTP id d9443c01a7336-219e6f25d2emr125800395ad.50.1734884692385; Sun, 22 Dec 2024 08:24:52 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 07/51] tcg/optimize: Use finish_folding in fold_add, fold_add_vec, fold_addsub2 Date: Sun, 22 Dec 2024 08:24:02 -0800 Message-ID: <20241222162446.2415717-8-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884910749116600 Content-Type: text/plain; charset="utf-8" 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 fbc0dc5588..26d1c5d4a1 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -938,7 +938,7 @@ static void finish_ebb(OptContext *ctx) remove_mem_copy_all(ctx); } =20 -static void finish_folding(OptContext *ctx, TCGOp *op) +static bool finish_folding(OptContext *ctx, TCGOp *op) { const TCGOpDef *def =3D &tcg_op_defs[op->opc]; int i, nb_oargs; @@ -955,6 +955,7 @@ static void finish_folding(OptContext *ctx, TCGOp *op) ts_info(ts)->z_mask =3D ctx->z_mask; } } + return true; } =20 /* @@ -1188,7 +1189,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); } =20 /* We cannot as yet do_constant_folding with vectors. */ @@ -1198,7 +1199,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); } =20 static bool fold_addsub2(OptContext *ctx, TCGOp *op, bool add) @@ -1265,7 +1266,7 @@ static bool fold_addsub2(OptContext *ctx, TCGOp *op, = bool add) op->args[4] =3D arg_new_constant(ctx, bl); op->args[5] =3D arg_new_constant(ctx, bh); } - return false; + return finish_folding(ctx, op); } =20 static bool fold_add2(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884788; cv=none; d=zohomail.com; s=zohoarc; b=HTyAOX3MgKLqhhpn3dZNOkU57LtkwxmcaPpwoQAOwCeAjIZiYBjqWXx0WpIp0GXebMiX6kalsw1DvX+c4jD5kuTlyE9udjDKLbg9iLqqG/S6nv3PtViYN6h1P5Ed8VOUV+gBxwlYrXQR/Kbf1XyglBkMAsFnE1iUiRggkPXF17w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884788; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5yLoYd7LYlkkdyNtb51Sc6VhwN2eeW+RxhkgiIYD3vM=; b=lUGyAv6YBPXCzYmDkeRf6q1zVfOnJRE3KAA89DQJCSRTf7Y9WyNDfFbRWYeb1SMJlvS9yZPC52fWYBHJytkTFlu4hY3d18C6Bdo3KHt3CjPwGt0i3X4d+t7YtNGaNawJq4HiyckzJn85hfG/YQB6L2qemPEe8/MtWTQhf1b6C8A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173488478859271.81780726268414; Sun, 22 Dec 2024 08:26:28 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlu-0002vK-GM; Sun, 22 Dec 2024 11:25: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 1tPOlE-0002Yy-UT for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:57 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlD-0002xJ-As for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:56 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-21644aca3a0so36717845ad.3 for ; Sun, 22 Dec 2024 08:24:54 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884693; x=1735489493; 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=5yLoYd7LYlkkdyNtb51Sc6VhwN2eeW+RxhkgiIYD3vM=; b=pXOYd8VLfy4SHYNlWyGYkEaRR1phCt7/hVueowTmBTqxY+N9551CdHzrz1nmH2o7v7 l0FDaq0seffcRtPsJFhN0UnNMGjRXOO5l8waKOYde0VQXQvaiusqQ6FI1bYXAC9Rnv8U VcyV3ANGCKo9xK19hmudEnrGN30Tlk6/tGjDtnSli4/n67YF4Crck9cT4BWrspJRgzYq mKZ66We+JxzkUV4LCUcp8LIPeDQIrzcprHzZvdKOBjsNzeLqbAQGHTY8NnKtWZf5IqvN syZXqXqScjm3Kdq0bXJr8hc3gxOc7U85Ya20VVcHZHaiLW5Ib1HYJeTYOVkRtHU5cQ7O n4JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884693; x=1735489493; 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=5yLoYd7LYlkkdyNtb51Sc6VhwN2eeW+RxhkgiIYD3vM=; b=PIVHCQzcIdTjHYrZbaFletILClfwJUiC0qgnJ93HJ2uIFwQ40WWMA0jlzcQt5j88dx wjraoZst95wqo544HDV+pvpfFwLCdUrQeNNqplbdKeDzWZCJzyIiR6RfvBnTxNyRRMgI tJJ6YDC0GeAadmf2hqP4U91tO3bvCGax3f74PcCNW/jbose1jgK28AUTKj/u4kPb0Q1d gJJIre2FPFeiPhXFSey1dWfq4k0VCGI27ehmrOrGqCHEPM9SPatLpB/6Vm8cm4jEuAVn fNnjxQu5VxeLpSOJFhWmaJfspKG7sZ+B3kA6yvG93MqjoxEAeai12IxWW6CZdJw1fiuu ss7g== X-Gm-Message-State: AOJu0YwSMytQKtQ5Ajr9AE5zJxQMDY4Xa1YTODCN8lVkBPl1ioKYYwTc XUOX4uhC2xlxNJ47je0Tg7htr5UnG1jcTPCChKUqNt4vdDxqZGtkazofmnZgGrslevyUAb60Tjl xW1o= X-Gm-Gg: ASbGncs4UcOx2msxU84w9OEUujiG+tS6215YC8VLw8SljovGfNs6yfrD1lhddkyuo0w v22DwQa1yMZchYGizSZ7ink3M4MZyr1v7csXgWBaVDUR5ypPefEjRmUyhgN1gCPVfPnyh1nqD8B 6zWLZBB2gVASX+/TbdW+VI8dD50UrViErKmatYvZfzTYfJ9YH+9YI+O4WXnTShjdu7ZZeqwGiVw UfMWRySQL3l09dml1D2Yo+E0om9VDPZFmpu55xUC5G8GBcn98w7ksfhO+/OZLY= X-Google-Smtp-Source: AGHT+IFSXKO1tP+uKpttRTsBt/qtD2RQedyw8gBiKFlRAawotquFTW6jJBFdhG2z1kl1Ff1N5T0o/g== X-Received: by 2002:a17:902:d2ca:b0:216:1543:196c with SMTP id d9443c01a7336-219e6ebb776mr104820525ad.27.1734884693006; Sun, 22 Dec 2024 08:24:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 08/51] tcg/optimize: Use fold_masks_zs in fold_and Date: Sun, 22 Dec 2024 08:24:03 -0800 Message-ID: <20241222162446.2415717-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884790343116600 Content-Type: text/plain; charset="utf-8" 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 26d1c5d4a1..8119447c89 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1280,7 +1280,8 @@ static bool fold_add2(OptContext *ctx, TCGOp *op) =20 static bool fold_and(OptContext *ctx, TCGOp *op) { - uint64_t z1, z2; + uint64_t z1, z2, z_mask, s_mask; + TempOptInfo *t1, *t2; =20 if (fold_const2_commutative(ctx, op) || fold_xi_to_i(ctx, op, 0) || @@ -1289,27 +1290,28 @@ static bool fold_and(OptContext *ctx, TCGOp *op) return true; } =20 - z1 =3D arg_info(op->args[1])->z_mask; - z2 =3D arg_info(op->args[2])->z_mask; - ctx->z_mask =3D z1 & z2; - - /* - * Sign repetitions are perforce all identical, whether they are 1 or = 0. - * Bitwise operations preserve the relative quantity of the repetition= s. - */ - ctx->s_mask =3D arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; + t1 =3D arg_info(op->args[1]); + t2 =3D arg_info(op->args[2]); + z1 =3D t1->z_mask; + z2 =3D t2->z_mask; =20 /* * 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; } =20 - return fold_masks(ctx, op); + z_mask =3D z1 & z2; + + /* + * Sign repetitions are perforce all identical, whether they are 1 or = 0. + * Bitwise operations preserve the relative quantity of the repetition= s. + */ + s_mask =3D t1->s_mask & t2->s_mask; + + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_andc(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885075; cv=none; d=zohomail.com; s=zohoarc; b=VpiXuk0JBnJALzcCHtevxyiKdxGjS0h40Ykff3PnbZt4etrQSo/8aBlwcX/rQzL6+ZVK7EKeV9QsqeRzJCKKlwtIRRfW3eqWV1kLlnWxgKl594XipKFY8PN4Ayub3BSHHuHFJhnShDEURCqBpBGHZiZNKwuKtRFY7sN8a4v7iEI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885075; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KyHPZLWqRAnz8460OAnK7qtdUZNjSGM1FWV/QTJHNlw=; b=Iu2aYFaab4jBI5VtO08NFuCzfMN7xIuh8vGukzRnB5PfESRkgu1b+pw/zbJ2GFeB1J/Z3+94TVIPUFzOKlU6P0zjT80M0rJZyJXCxkgmdHCLsAS8wTcwKdIsOiaRr5dDuxrqJ1Gle8oUfMHrK/p8u0/PHhvqtAcIZRb8LgRT1dE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17348850755821001.3512214970038; Sun, 22 Dec 2024 08:31:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlq-0002td-55; Sun, 22 Dec 2024 11:25: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 1tPOlE-0002Yx-Sx for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:57 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlD-0002xc-BI for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:56 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2164b662090so27973705ad.1 for ; Sun, 22 Dec 2024 08:24:54 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884693; x=1735489493; 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=KyHPZLWqRAnz8460OAnK7qtdUZNjSGM1FWV/QTJHNlw=; b=q/qWBLn7NtIvbB/Qui1LzLffg+YCKNNRtM7P6bua3Dhch2QUkc260tUDPfv0hlLp6+ Agk8w0STzFGUMhebr+SxTEDXGkunKYRB5ufauIEweHLbduVkG5rFoUuK+z7VwjpW/cIp UisOUNSKtVIQ4oyPYOu+5fPyNv42RIqx3Qfd7KFNN7V60co8ONiOQVmcghPsQTlszAf2 kYF4M2dqIwLoq9Yj7i2njm/LAXJphQ03lM6XgWDP2+1qCGtSbCzuDDRSol7P3Lrqmc41 3yxjffyMvizkXHT0HOV29QY7lv55u6zry0bteZ+blA4mFicobTaRbaoDJnXcuQMxEQtw 1TDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884693; x=1735489493; 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=KyHPZLWqRAnz8460OAnK7qtdUZNjSGM1FWV/QTJHNlw=; b=sZnKyiKpiOssOhKNvCtb0BdDAPp+cswIIjxDMORUm3sfqFYzBWh8q7rHkzQdmxKNKc uY16J1LD243NH38omFqfFHM52YmYcuHUnsSbpcYbn+X4W5oM4kF5BHEPVbqIIan0n8sH jed3MVSTVqJPv2F7HFaffC7fw1aBHl4O54pkIhYEDY22Nz6SM1KUT5ZBOrfbzeAdtgLV ah2Ny0pxppUkQB7HQaNV9WkisfHOw5ksyPJO8YegSJU9JLPLa/3gw5jHpmqcS8Brbygt h8p5OU0DGCJ/LPIOFhaViA6c+mliWWAhSYQYZR20IZxS8EaxGB1M/ZmSflrp2XR7pi4D 3pTw== X-Gm-Message-State: AOJu0Yw96KlB5XiUQ8t8S/FgT+IslSX3JT1KRyVgZ90J7ykcNXT6aN5j Mg7e9/bcg0cL4MFHzPUZ0L4lKtmBxccgfkY+wLO5Sftg/3IUQ2aETfSlSGK9KzGBKwvHUVG/U87 fguk= X-Gm-Gg: ASbGncsQA96ZnIzrfZfLISTSupAHTIX88+CoH197oUUJqJjBnlNpVvATTKGtcnrZB4O Y2cEwlfgyC+vA6qM7p8oLtP+qgSLFEwQjb0QPjyZDOcYZGk9lwSNHT/jvsEM+qADzer1stXMJEl 1GY5zxBsHN6+AXv2++5MeQFzZ12PBHNqQrF+snlmaotGW0R0+2mrNwgWSYg9tabetRfMmEIdG0U 8P6RLq4CNXP/9G5dNKsRseXqsobz7tuVaSvsamUoUh/xK96h9n2nyrtP7rcBjM= X-Google-Smtp-Source: AGHT+IEI5TS+34zE/LgG719xAA8Jy7YyFmzC8BFSZhLLb96OIO0CU1VoApIGJStJyr4YEVCt9RFJzg== X-Received: by 2002:a17:903:22c6:b0:216:59ed:1aa3 with SMTP id d9443c01a7336-219e6ebc78bmr113506525ad.27.1734884693618; Sun, 22 Dec 2024 08:24:53 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 09/51] tcg/optimize: Use fold_masks_zs in fold_andc Date: Sun, 22 Dec 2024 08:24:04 -0800 Message-ID: <20241222162446.2415717-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885077508116600 Content-Type: text/plain; charset="utf-8" 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 8119447c89..d13001e53a 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1316,7 +1316,8 @@ static bool fold_and(OptContext *ctx, TCGOp *op) =20 static bool fold_andc(OptContext *ctx, TCGOp *op) { - uint64_t z1; + uint64_t z_mask, s_mask; + TempOptInfo *t1, *t2; =20 if (fold_const2(ctx, op) || fold_xx_to_i(ctx, op, 0) || @@ -1325,24 +1326,23 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) return true; } =20 - z1 =3D arg_info(op->args[1])->z_mask; + t1 =3D arg_info(op->args[1]); + t2 =3D arg_info(op->args[2]); + z_mask =3D t1->z_mask; =20 /* * 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 =3D ~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 &=3D z2; + z_mask &=3D ~t2->val; } - ctx->z_mask =3D z1; =20 - ctx->s_mask =3D arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks(ctx, op); + s_mask =3D t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_brcond(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885153; cv=none; d=zohomail.com; s=zohoarc; b=IDAhZQgWp0CktgN31XwNNfv0DJg5M0y9wayQn4M2zD/GlRk6hkt9/GlCuB0MV/3ze3844g6sVUPISVGOjwCNwqhw0R0EUbWqnNnTEY7GsNIsCLzmLHWJYiNq1TuwGfeHyRpbHAbivcf+Nni8LMSmp6CRHLCXOfmm6zjzBSlQ6lM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885153; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MtPJbyi6qGACA18TCvDtHVp8Rw/uvIg0oIMOG458ijo=; b=G0hI8ehfIpcEjRgpwPo3m4jOno/DvvJ+LQ7xCMTUHOHdKdTt88FMBh4MuUDuEp9kGGyMyKgBD0uuuh0PAwBIGLiAKM3ClB9xPNOYqsZO5f4BfUXH5+mYZryoWsMG6+M+NV4DaJ2b8rXPDDNnOGyHW55Whxd0kArd8q2EjfeIWrU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885153956785.6211242417205; Sun, 22 Dec 2024 08:32:33 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlr-0002uL-0F; Sun, 22 Dec 2024 11:25:35 -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 1tPOlG-0002ZU-1i for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:59 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlD-0002xm-GE for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:57 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-21634338cfdso44205305ad.2 for ; Sun, 22 Dec 2024 08:24:55 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884694; x=1735489494; 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=MtPJbyi6qGACA18TCvDtHVp8Rw/uvIg0oIMOG458ijo=; b=KPp54ctJVAC1vayLELyB3sRUc3eRmxdSH7f1kGP5ff3kMGpNFKYe43teV/7iEdIW+9 h556M5wW8v5UO8KjGrtFyV9FZC+A3Vg0EGLRcynWQ4LrbHrPC2gXro3VW/56X1oj3fAe lAjvz3vuw0Y/s5XsfRsxXo1eJJyiwztmqm4nC2OKlw8Msp9yGrBEqPEpJK3MnMab3Wv2 oRLApYPRGAA+E8XqItNs1LZBKaRc2VOzwW0cD1rj9w5gK20tOZ1aFy3OEHWrvrUu00GZ wGP8wn9d2QVxig1RjT6u4Wi8kfUftijsybY6a1iEqBxp5b62h9hRoV3YPFWjO9YP6+6N jbLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884694; x=1735489494; 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=MtPJbyi6qGACA18TCvDtHVp8Rw/uvIg0oIMOG458ijo=; b=ayX9PkVR1AAv100VuZ363MkFa2cPa25XmxbASYoXyQTW4ki5KTszziSEGi2OuWbdOw lV8Fz2zTG+OHIUM1EYCyE7SGBMqvG/oFAQYi2NloYflVjXGFG5jAoL2Ih0RYLrFf+JXf /NJXYlj62DTZBdcOcaSfEVmTW8tmBTIxzfG6CG3S0hiYea0VawHMypIpKcMPQl8uVELd KfLz2nPrnWT89ZpfSpL3Hbte7fQ5rm8JZk57HxxcbuSn+z+RZrwUTD2iQGPXX5Bl4FzI wddHUPWdClBzLcV9Ru/RUenyi/JxWKcu538XrbN4o0Nke6XU2ZI1fTjBUCMmS1BazShC 5CcQ== X-Gm-Message-State: AOJu0YxJjAMEJAQHLtMmg2+0LzYewiogoXhhS0dWWFYXuTKAv69Dtq8A GOFyqzG+IQRdzTl7kKq9QJ4mE3S2mWIP8dB+Emi2I4i3vLoPax1sGL0vZFo8Mu5+b3QPn++Xt7d MawM= X-Gm-Gg: ASbGncukCvtnw7EhpYKctgc17+sHWev0W2uhDGRcOuXk64qFxkf0+n0ypAjNm9ctuSG j/ct2RKU1o/YT9p1uEfyvsppC0qWTBV08DO//U/EYdqvvoPzz57vjibdEs3SzmG3eNJD7deBzBY qYM7QjvW4bRB6Rm6L3dfSvB7xTQKY5WFYaDxzSyZGozY9UTJ5/9HFMIwZW75ajujcKbaSZcZf2t PKxAzvd67zAhv3WSS3F6coUSdLxQRyIFn3ZTseKvqV5x3JdxItpVWVzl/QXoTE= X-Google-Smtp-Source: AGHT+IHB1Al7nn/N2N5s/BBiN+AwB81HNL2BXL17v571pOKppCXEGG7PzbEOA1ORAIOPAzjkT91RfA== X-Received: by 2002:a17:903:181:b0:216:66d2:f172 with SMTP id d9443c01a7336-219e6f4a86bmr118280835ad.56.1734884694198; Sun, 22 Dec 2024 08:24:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 10/51] tcg/optimize: Use fold_masks_zs in fold_bswap Date: Sun, 22 Dec 2024 08:24:05 -0800 Message-ID: <20241222162446.2415717-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885156243116600 Content-Type: text/plain; charset="utf-8" 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 d13001e53a..27b8f90453 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1462,16 +1462,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 =3D arg_info(op->args[1]); =20 - if (arg_is_const(op->args[1])) { - uint64_t t =3D arg_info(op->args[1])->val; - - t =3D 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])); } =20 - z_mask =3D arg_info(op->args[1])->z_mask; - + z_mask =3D t1->z_mask; switch (op->opc) { case INDEX_op_bswap16_i32: case INDEX_op_bswap16_i64: @@ -1499,18 +1498,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 |=3D sign; - s_mask =3D sign << 1; } + /* The value and therefore s_mask is explicitly sign-extended. */ + s_mask =3D sign; break; default: /* The high bits are undefined: force all bits above the sign to 1= . */ z_mask |=3D sign << 1; break; } - ctx->z_mask =3D z_mask; - ctx->s_mask =3D s_mask; =20 - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_call(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885191; cv=none; d=zohomail.com; s=zohoarc; b=K3Gx4VNrIUASuQlGAV9W5KJD8OHVj9magwoZTEUrrRPbVHZuZcocHQ9Mv9anN7bbguEhdKo+bZD0125byaXSaitiBlbqdV53MifbLWBSH1ILiNhKWLJMzFbIG2k42ONd3vMJ9IobtoV3rphtu71gPR24KkIDr96kxmCmL0oP+Pk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885191; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=v0/++pnX2KVVLLQdhBqnyliWML+d0h3zcBmgp7ILjk0=; b=ctLurGU9Ua6V2hfGTee3gnUB7yOP/n3tcZcpcacTvYx7RsRtHzyqYxbsm2JsBfvrfHpTobXMvVfGOU8+46jT+cz7T1/zoUR+dsRc8srqDqsQ5bnLLmsf77BOzsTizpWtU0TbGW5U2nTilH5KFWTe3IXIrokJMPVu1MmtfGtT8dI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885191762696.8593604188612; Sun, 22 Dec 2024 08:33:11 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlu-0002vN-II; Sun, 22 Dec 2024 11:25: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 1tPOlG-0002ZV-59 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:00 -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 1tPOlE-0002xr-7v for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:57 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-219f8263ae0so3323925ad.0 for ; Sun, 22 Dec 2024 08:24:55 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884695; x=1735489495; 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=v0/++pnX2KVVLLQdhBqnyliWML+d0h3zcBmgp7ILjk0=; b=xRG2uLHJUxPICh8zQMtyh4UUrZ3q0wb8/LHckpkdMVPkgYtL74W0n9+fT6+XOyu2lM KCPsWlpQeWS8TWy9FqeBnxuu59NzvGEbYmVIGHK+MQQVHH+rtzqkJ01vhsQzJyCXgpPp jniovhCf2coM24hPmY0q5DdCRDHZnUuzfUluF+aFfC4Qn3wAJ3ekVTaUOmi/QAeTxRPp cU3UZuVoCVOrFgWFcK/5JpVeK3RPqmEIvz/mph1LwxaFzecqcI27Asstw2yX9K00Mq6J 5kxN2NR072CNlbt41m4CTOB5hAbuFElj5Oeag3YO/NyPwlzFzv/ORcsMTkh9Q0HCQOJz G1xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884695; x=1735489495; 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=v0/++pnX2KVVLLQdhBqnyliWML+d0h3zcBmgp7ILjk0=; b=OaJbHF90IMlSC2Rpf3CWbtCsedHcuLnYFJD+90imVDwXACLUFQZujiOGpcTtpbTIvn 3lpPdYRLGqQ2BfVttBmPA4Ri8HYTxqjh/K+4ID1oluDGdN3pzeCpJaAGkJKnzYfumBT8 1k0zedYFTqLT4oS2lkascTGwao+sJWzaRuqITUlvkwwIYP8n/n0+brUYqigvCk3hGsYe vJhqihNcPNMjbnsyurmV36UdnXsvGgTZzZMpV3AiHR4euKPFOPh2KTq+wj8PNpvbJ4YH LCittokqYtvbVrF1WSnvCoV/1odPfHOG7BGwp1r/8JSQUn+4HTVLnDUpIickcw1r6VO8 zV1w== X-Gm-Message-State: AOJu0Yxf+SAhut2qChzdTVeYH5EIW7+bFIzGb5A14EVZ6T1096IcMkVc jzxWesTDWc5MB3JQpdGPxGUj6PcY7X+dVkIkPZ/X+ok+reHkCMVRbsDM65FI9iLe0X3tYcHSUoy ocos= X-Gm-Gg: ASbGncsjt6XXen3wJ2TdxPAfD7w9cmcw3/SzSV5ci9TTmnnmpWvmG8SseEDyscrOxnE iDPBv6PoHSGvunm3z8Hv/HARpydLyC4YWJVYBpKcfdaugVJEfYb7c5gbNY6YBEzJ5bR7tG1bVWW DC5RZ+/P7zNy6x04q4XTwwpBVD5xe5eikzQnCuqTbKRsVdbrkbE8wLYBHVY8TkDNw/XU24sjrS9 MiehrRLU32TDO7GAZkSBhl8ULHjF14I4J9uA0Pn7PqqHpaki97gU0OGgBpeR4o= X-Google-Smtp-Source: AGHT+IEs2p2zrncpMSuodhhrLmlLyiC6eqyYqYz/3Etg2itNsj2spFXHRXlrT2wYlxCSJYVR+qMJHQ== X-Received: by 2002:a17:902:ce83:b0:216:5b8b:9062 with SMTP id d9443c01a7336-219e70dd21cmr147196835ad.54.1734884694773; Sun, 22 Dec 2024 08:24:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 11/51] tcg/optimize: Use fold_masks_zs in fold_count_zeros Date: Sun, 22 Dec 2024 08:24:06 -0800 Message-ID: <20241222162446.2415717-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885192146116600 Content-Type: text/plain; charset="utf-8" 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. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 27b8f90453..b98597f500 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1550,10 +1550,12 @@ static bool fold_call(OptContext *ctx, TCGOp *op) =20 static bool fold_count_zeros(OptContext *ctx, TCGOp *op) { - uint64_t z_mask; + uint64_t z_mask, s_mask; + TempOptInfo *t1 =3D arg_info(op->args[1]); + TempOptInfo *t2 =3D arg_info(op->args[2]); =20 - if (arg_is_const(op->args[1])) { - uint64_t t =3D arg_info(op->args[1])->val; + if (t1->is_const) { + uint64_t t =3D t1->val; =20 if (t !=3D 0) { t =3D do_constant_folding(op->opc, ctx->type, t, 0); @@ -1572,8 +1574,11 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp = *op) default: g_assert_not_reached(); } - ctx->z_mask =3D arg_info(op->args[2])->z_mask | z_mask; - return false; + s_mask =3D ~z_mask; + z_mask |=3D t2->z_mask; + s_mask &=3D t2->s_mask; + + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_ctpop(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885230; cv=none; d=zohomail.com; s=zohoarc; b=KyOKRVnRjktwAo/7viu7gVvd2UUwKBc0JrDsAfzmdfSZJmK5DNTIXvGw3U5DwwBEDFIJp9Ty7ZlKxZiKdiPf/TC1YJTu+g4JQEPrNzT4tgeTFYa+xuMC+IjiOtLQCNhzAMCnKtK/Nev/etFzAN7JJncxxHiaNRkAXgpdUiOodv4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885230; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=orGIi3JyNJ61WgKl0adLXiU5mTOG/lWk8OxYIjK5OkA=; b=n8YheWjuFrreWOqdkeo8QDrdNpDrY4ogFeSSZo0cS+DDmH23mgC4a8VXVW0fj0P1lbIc3wHC0xkHoJwilqwImIqBx4zbXy/R36puNbsZIJrPJ5f79kzwGJ1Nhpg6KZKAZIahcfypOX1IQK2TxBJ6NFSQFdjhFnduEm7S47zRXYI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885230439289.2115468412326; Sun, 22 Dec 2024 08:33:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlr-0002uo-VZ; Sun, 22 Dec 2024 11:25:35 -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 1tPOlG-0002ZW-Ee for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:59 -0500 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlF-0002y6-2C for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:58 -0500 Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-21628b3fe7dso29192525ad.3 for ; Sun, 22 Dec 2024 08:24:56 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884695; x=1735489495; 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=orGIi3JyNJ61WgKl0adLXiU5mTOG/lWk8OxYIjK5OkA=; b=iBByO94ECgcN7fCiU2EGhtWYs8u6uhUjibaPwlOjIu0mpzmR22y7IWDL/ChUa2DcKv RueOO1InWF1x0enySQj9XFjXOE5xfTQRInTmobxwWQqvAPZpn8WHW3WjJdQttdXxgu7t 5D0nIgFoi7xC5uGfVTMu2r9x9uCJZ8EMcA2xUCGYBnJFAmtT6433n9kYp1r/yUpvNFB3 pscKOPL4AcX1ROv0xYm7rHZOhTbES8M4N1k8N1HcoSE3GYrquFIr+gJwZChnFw58kbfL NdboqiNF1Hpg+LwoIwDwNR/i9BNQFEYrOXgf0MpF9SM00WtNFKeljpL9ix42wSY2pOsV ACIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884695; x=1735489495; 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=orGIi3JyNJ61WgKl0adLXiU5mTOG/lWk8OxYIjK5OkA=; b=U9Wc++mXIFHyNsMpXNYlrCf6hvRpvl5gWpDi+pSz1oMcu7HvMbuGhTrsk0zl/hzB1t JWFxyBAKXnmZSHpcNoDi3ICAZLB/WIA8tpN3sykRmzX/0ul2L3TaljQ1xeRpTnIBBRhj WvxZLLwYiJfAQTCVysWXbWmyfUk459E6H6wnuSUsiK2Qlacvp6ntRbjtKwkG3hQNuZ3w ODQQz19vUKQ47Kc5UsK+X1M1VROW4N2dAvJXu0gIkmfBOftWrVtLtQCaO1vYPkGxH4Xj GKJVwrWbrZWtJJu8hKWlFWg93ysmkB/x3ezpi0NoqjgzAyZTRupiuwAqsZaFYH8uvUQR G0Jw== X-Gm-Message-State: AOJu0Yyj8722Nw4JvcbP40IGUaK536I0u+clbCAdowBdw3o8SPhYa3kh AA0Rj+RNrG8Ep5uLekyC1nDkOApRmyplUeW4Nt/t31WmwQb8gLJWKw5GWcEP9CoBiz8wPSXQ6nr +TrM= X-Gm-Gg: ASbGncu1M78YI5j+A3Th8S9JaLJlT9h4gKnufdgMHjTzbZiU1ea4efZvRBCovl3EKux TvpYC49tjpajO5S41gkkXgIhXK2aaQydGELg2uAfzxNMTwi7o6emt3nhXRK5fxsLltAuE1Icg3l MfNFakgshvETr0/AJKgn8VV5g9/0k7Z009VNAuqs6iYED6Tx5Hs8qEnAePocvMrhLix5Dn4C03X vuIWOEYA1F9BrTKZnv/cEcFUEyLkmACOSa0lnKtAKWAGCaC2w9anmL0PX+CV74= X-Google-Smtp-Source: AGHT+IEHEkMSptmQvtQPnxpjfa5aPeIVrgeYwEWalrb4GgkQTxcDp07XdEKK59fhDDNSwczGNAAUEQ== X-Received: by 2002:a17:902:cf09:b0:216:7175:41bd with SMTP id d9443c01a7336-219e6f10aadmr152414445ad.39.1734884695510; Sun, 22 Dec 2024 08:24:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 12/51] tcg/optimize: Use fold_masks_z in fold_ctpop Date: Sun, 22 Dec 2024 08:24:07 -0800 Message-ID: <20241222162446.2415717-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62c; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885232235116600 Content-Type: text/plain; charset="utf-8" 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 b98597f500..eb982b73cf 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1053,6 +1053,11 @@ static bool fold_masks_zs(OptContext *ctx, TCGOp *op, return true; } =20 +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); @@ -1583,21 +1588,23 @@ static bool fold_count_zeros(OptContext *ctx, TCGOp= *op) =20 static bool fold_ctpop(OptContext *ctx, TCGOp *op) { + uint64_t z_mask; + if (fold_const1(ctx, op)) { return true; } =20 switch (ctx->type) { case TCG_TYPE_I32: - ctx->z_mask =3D 32 | 31; + z_mask =3D 32 | 31; break; case TCG_TYPE_I64: - ctx->z_mask =3D 64 | 63; + z_mask =3D 64 | 63; break; default: g_assert_not_reached(); } - return false; + return fold_masks_z(ctx, op, z_mask); } =20 static bool fold_deposit(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884807; cv=none; d=zohomail.com; s=zohoarc; b=UT7XxH1u4/H/qUCnRgEfw4dZsss10caGlYwNzmSbz+kf4unFiulgVwKuxlnhqwZH5oiDNeLvyP6/aUDINmyhPMpcjMr8D0md7/Hdzzo3tHzcIvJtXhwVFF6xGDbDoxB3nYQwgiYVPxf/WwXlMo+V97C0pXoNKVXORgle6O1mqpw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884807; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=d99LqK671C6w5tPD0zg6x6YjwgfiTJxRHrOGZhb4WRw=; b=JabyaBrfDcMmYnCyfYEUFRtt9PNWSMOTCLpDQDG+Kk0R4cp5dv/iYCz8/F3H/z+Lv9ka0Nb9U3P68vyWFqLQNxkA+3LB8vMSOp3KfDK2WPncE+mL0oQDOUlxRVNQIqryIJhvTv95VRtAnnLtgrcBYTRUa65Auly/EBJbfhMG+oU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884807849947.6878138228576; Sun, 22 Dec 2024 08:26:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlq-0002uC-TI; Sun, 22 Dec 2024 11:25: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 1tPOlH-0002ZZ-Dd for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:00 -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 1tPOlF-0002yG-D7 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:58 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2164b662090so27973845ad.1 for ; Sun, 22 Dec 2024 08:24:57 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884696; x=1735489496; 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=d99LqK671C6w5tPD0zg6x6YjwgfiTJxRHrOGZhb4WRw=; b=TluxT5tkv0ckPsei4m9v1sjRKusagz21Jy5fJKJ3vDpNXO8TWYu3vtc+IAwV7qPclo 4dGaUWTfIhUp3Z2V5VHegmEoC7wC1q/rma8PidmdY2ZRv6tlPy1qmICdLlNBAk+VLyiv uOuI6bAhKUj38elpCe6SQGn6VkGu4nz9OkulNCT3RcAoTAd5xsVWJSPjam20xmAjiwev 5WPHuTrkidPv/M/CnYjrpawSF+olffjTuXoLeya/kifgfi0xnA1fCzW8+sdD82pnWAag bpBtLuWTcHBo+8zaV8U91QJDdCaoPChjeugA8Ue/9WN3I6haBTlcSDRKS0vG4xWXwimo ax1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884696; x=1735489496; 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=d99LqK671C6w5tPD0zg6x6YjwgfiTJxRHrOGZhb4WRw=; b=xHPKqd8k8WQShDu7++q+uj+yMAZfyOnDBzoltwZTQ2e6QccIHDs7W4dCWA7ts09s+1 U/DwZ4v4yFwN03BqfLcEa9tXyIIlhu/WDLDTJ23YDJTWgeSJ8JL5hdPTJ7wzYU5qavdR 78Hqf7o7X0d3P4fG/DdjENXllnEL0L2fhFXUChzjCry+vquBBE0LNOV8qEDtc4RsTC2U apkIU2yY5TIfg3SXz0ojpzH5rwqOGic5lRM0FtYDjHVymd/mvmGnq+GM1aaowGQNnNxY tAkSR52PVKYCT9vanMT3W5FJJGkm+iLXoNSkB8bXvv8OewmLxMF3vNeJKEkr/hBn7gd9 j+fw== X-Gm-Message-State: AOJu0Yw4ckcxzfSn2tVAC7kR7TmbJs4pOpOE0z4D1sh9Ent4K6WAZ1TD CrnCF/hfAREy40pzomSAtcd1w/QdMcJaCz1SsoivA45biAa8Mebir5KwpqyxHH887liajmBL8JS zvzk= X-Gm-Gg: ASbGncslvlcRaPJhTVt7rwdnOvXOnrBBE6b2rP+ITMFRn8dVYZsUkgi8KQGGJnXmk71 FEXJ4+UCN0YKLANIgvo2M19+KcRygDNBQ+OITtec6Li7IaTSEK8FqWVSMkmeqiT2IuUmol59bdR feIR3OnWj/gWn5w2V/+w5UwK3/wFyGoZD69xKFFwKEGb0PUFytxK/J/s7IuaXBjXR7uVBxOo947 Nx8wiXhq+iy7vazLx19Li3sgMFT/8imyoZVuRCkqHN8ZCvdaTYU9I00Ei5p9N0= X-Google-Smtp-Source: AGHT+IGAsABuC1q8p8a2SDkAWxq8FX5gKvyyNuzaJkQSi0njqe1hw7JTrUVtF8mBs7+z4aKCYwxR8A== X-Received: by 2002:a17:902:ecd2:b0:215:89a0:416f with SMTP id d9443c01a7336-219e6ebd0a4mr116786005ad.30.1734884696112; Sun, 22 Dec 2024 08:24:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 13/51] tcg/optimize: Use fold_and and fold_masks_z in fold_deposit Date: Sun, 22 Dec 2024 08:24:08 -0800 Message-ID: <20241222162446.2415717-14-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884808380116600 Content-Type: text/plain; charset="utf-8" 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 eb982b73cf..0f7c2c810e 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1609,14 +1609,16 @@ static bool fold_ctpop(OptContext *ctx, TCGOp *op) =20 static bool fold_deposit(OptContext *ctx, TCGOp *op) { + TempOptInfo *t1 =3D arg_info(op->args[1]); + TempOptInfo *t2 =3D arg_info(op->args[2]); + int ofs =3D op->args[3]; + int len =3D op->args[4]; TCGOpcode and_opc; + uint64_t z_mask; =20 - if (arg_is_const(op->args[1]) && arg_is_const(op->args[2])) { - uint64_t t1 =3D arg_info(op->args[1])->val; - uint64_t t2 =3D arg_info(op->args[2])->val; - - t1 =3D 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)); } =20 switch (ctx->type) { @@ -1631,30 +1633,26 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) } =20 /* Inserting a value into zero at offset 0. */ - if (arg_is_const_val(op->args[1], 0) && op->args[3] =3D=3D 0) { - uint64_t mask =3D MAKE_64BIT_MASK(0, op->args[4]); + if (t1->is_const && t1->val =3D=3D 0 && ofs =3D=3D 0) { + uint64_t mask =3D MAKE_64BIT_MASK(0, len); =20 op->opc =3D and_opc; op->args[1] =3D op->args[2]; op->args[2] =3D arg_new_constant(ctx, mask); - ctx->z_mask =3D mask & arg_info(op->args[1])->z_mask; - return false; + return fold_and(ctx, op); } =20 /* Inserting zero into a value. */ - if (arg_is_const_val(op->args[2], 0)) { - uint64_t mask =3D deposit64(-1, op->args[3], op->args[4], 0); + if (t2->is_const && t2->val =3D=3D 0) { + uint64_t mask =3D deposit64(-1, ofs, len, 0); =20 op->opc =3D and_opc; op->args[2] =3D arg_new_constant(ctx, mask); - ctx->z_mask =3D mask & arg_info(op->args[1])->z_mask; - return false; + return fold_and(ctx, op); } =20 - ctx->z_mask =3D 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 =3D deposit64(t1->z_mask, ofs, len, t2->z_mask); + return fold_masks_z(ctx, op, z_mask); } =20 static bool fold_divide(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884731; cv=none; d=zohomail.com; s=zohoarc; b=ek44gyRiVdff60DL2U4N2WW0dhMX85h01XaBGnhUtIX/H/HZfFxyjc1DgiswMuRHOQxnnj8FeFuFf8STFa1RwlrFrMPCXDdHSyq/pTgLIMYWG7AdpL+GplqM9wPUqeVIMCGElMX9gAYLtYoOerPcmZNEt7jp5j8arLGXSbh7nws= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884731; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=0oaZkc61YjhIqFxlOS5XCCj6BwBkqMgp5zn8nsQHErI=; b=Pm7PIFoiYafrNa7b8EwMsqDlSKLPufudCjFti8gZHAngSUUUQXa4HaWpkZ3Q/TFglVpTk5ZEWnjykQLvBeTnSKJbVM94BNzGmle2nPWvSj+K/KCA9ISekNXxPrIzxUsLol+UbNVtVdXKSWuxjKZdAcw7hrndXf9khpIFP0TN98w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884731819791.651941523399; Sun, 22 Dec 2024 08:25:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOle-0002b0-Q3; Sun, 22 Dec 2024 11:25: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 1tPOlH-0002ZY-DR for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:00 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlF-0002yV-Va for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:24:59 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2156e078563so30100815ad.2 for ; Sun, 22 Dec 2024 08:24:57 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884696; x=1735489496; 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=0oaZkc61YjhIqFxlOS5XCCj6BwBkqMgp5zn8nsQHErI=; b=B3vLcZfGfGs9I+0/ZsCzS93rA50Kso4hsoWwP3aGVt6dMtY/U1DTKj7ORM/BZNLk1q 1gNBl3+AlaxGRcmkpLVgHbjalUjcwJ+U6Dd63chB9/S1W0msDVcfELhHr4lAQ8X7st9z 4OS1MZrFhJRq3bGHxWkUxFW62o9SnXhACzoJQG9L6R3W7Trj5Q9qBPkDrTET8wbDORZp goCqyuKFhj3mqZ3PgpbbbktHD+7hDAERl0a204nZwePIVq2eE6esgvbx4Obt4/FLiphx Xguwo11J8R6nNZLU4g0yiCCR7RB59Sn7zq0N6UXmTf9BnKRbseDst1rtb77o4pKjAqQD UTUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884696; x=1735489496; 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=0oaZkc61YjhIqFxlOS5XCCj6BwBkqMgp5zn8nsQHErI=; b=E/ipBDdNvtaimN4ZGpjsNNXQILcfDKV379RPRq7MuHXLUGf+8KU940AZx59dqR8a84 QxVIZAORCR8Au0xgGXcS5NLFdMyz0IEYByFpdtd9SZzj1z1wH9MXAs2Ci42WkZpdY8fH RHqDk7Rhx77vX+dnlKTRXRXJIKWwH15CWW093xnPTdKtqrDXq+XfEvIRmII29QZ1fezE BmeqtM9PztVKGBNX2HOdDxKO8IMq99e455gMEL4OOxzbPOUWlLpn22SHVBGDsSXrvRsy V2rCIcFYiVFWcb3mRMmpvcP26NnuR75l3KEg3pEx6JlRUDgxzbqhp4sy75L94FFwb9Cx AwGA== X-Gm-Message-State: AOJu0YyyIGrBdzJ9T/q2AkxxRM8YpmfTeZbI6iqSbyD5uDL3WmUdYeoa oOX58akf7elCJK4Q/4j4ViVX6XAzRyO6cmFaI0H+wh4z2WemEBukEHvQrQL3oTAQP/argf1xJpZ BhFs= X-Gm-Gg: ASbGncsC+M9kXN2XLTRxvNVm+rgWh/SSmd2jhVHmbLZVWEXBM8rW/7fDCEsDaen9X5J KyenZ5JaLn+88/OK0Q/c8BrksWXKWCwu/RqV1PRiVXHkii+VKHxYBswowVDYr27eQHLn3Yew8Eb p3k2qiJb5ctUeHKp+W0+qDAm9979Q4PzaaCeK4LbDaa6Wzi+eNvJLGyTUwjJKDHz4CRA9TFV3Do yD8srQdGhDfuMy5RORyEFLAPuy/Bm+eohpFc2+K8kVw7bUaUZD2gHc/ndKsduw= X-Google-Smtp-Source: AGHT+IFgxIKD/q1JF6tKdo0zJUG7yTlWth6Aa1grNjjeL3gbh/HhG+YHTcH1R/g+C01oZmERIWymqg== X-Received: by 2002:a17:903:94e:b0:215:96bc:b670 with SMTP id d9443c01a7336-219e6e9df70mr131406885ad.18.1734884696678; Sun, 22 Dec 2024 08:24:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 14/51] tcg/optimize: Compute sign mask in fold_deposit Date: Sun, 22 Dec 2024 08:24:09 -0800 Message-ID: <20241222162446.2415717-15-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884733992116600 Content-Type: text/plain; charset="utf-8" The input which overlaps the sign bit of the output can have its input s_mask propagated to the output s_mask. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 0f7c2c810e..b6a0bfe64e 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1613,8 +1613,9 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) TempOptInfo *t2 =3D arg_info(op->args[2]); int ofs =3D op->args[3]; int len =3D op->args[4]; + int width; TCGOpcode and_opc; - uint64_t z_mask; + uint64_t z_mask, s_mask; =20 if (t1->is_const && t2->is_const) { return tcg_opt_gen_movi(ctx, op, op->args[0], @@ -1624,9 +1625,11 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) switch (ctx->type) { case TCG_TYPE_I32: and_opc =3D INDEX_op_and_i32; + width =3D 32; break; case TCG_TYPE_I64: and_opc =3D INDEX_op_and_i64; + width =3D 64; break; default: g_assert_not_reached(); @@ -1651,8 +1654,15 @@ static bool fold_deposit(OptContext *ctx, TCGOp *op) return fold_and(ctx, op); } =20 + /* The s_mask from the top portion of the deposit is still valid. */ + if (ofs + len =3D=3D width) { + s_mask =3D t2->s_mask << ofs; + } else { + s_mask =3D t1->s_mask & ~MAKE_64BIT_MASK(0, ofs + len); + } + z_mask =3D 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); } =20 static bool fold_divide(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885154; cv=none; d=zohomail.com; s=zohoarc; b=RVuIHKw1rJssIlDc7KKJsGouAT9hDqFK4oEv8dGlreCNEWDwe0g/SFTRJgbOtHlA+ZMnLgNx1lGbOBILZz9u4e9KCmcqvOXkoFFk5Bz2uYLYJoHz6A6wemc46ixETSc9eyT2hq0CQLDqVl4GNr7WY0LRsNhAei2TGMNLNPcFQrQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885154; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=RsMsu+KnHNOz8xxBzxsDdOwYFyA0SvaPufxN7cNRIvc=; b=MkRYHJkUmEIU6j9NyCKCZ+aLV6pu2eyNnM0LmUxEkbL/qQnp6agEuxsGSm1OmRELc66uIoMm7x3bXVBw7b6Z4v3pBS262sifO+lcwNwybnGm28ZAczMfaeAsQe72QIvJF356IScn7mS6pOo6McVU9Rp/HsklDgYm3H+6cWT+a0k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885154499380.820234267264; Sun, 22 Dec 2024 08:32:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlt-0002vD-Mz; Sun, 22 Dec 2024 11:25: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 1tPOlI-0002Zl-Hi for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:01 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlH-0002yf-6H for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:00 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-21649a7bcdcso31420735ad.1 for ; Sun, 22 Dec 2024 08:24:58 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884697; x=1735489497; 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=RsMsu+KnHNOz8xxBzxsDdOwYFyA0SvaPufxN7cNRIvc=; b=HbJXVLZbywVN0IfF/7pwqWvL8hlFVs7n8yceDmJtLrS6cQWK0hL8+0Xdo8IBL1+l7t gSErmt3TAy4xQZENlOo+0GpGLdylIPyO28myESGh/CIEn/rOlgjHsJx9WaIvvw15GUcP DG3IDJFMtXHSaa2vBK/3DYMqnTVD6HlwD1DAsTm3coKM/UDKuV+5mN+AivKPo58OtM6f 4NAwnhW53TEvs2u3pTjmajuwgK2l1x5/IJUGKkJFKniETiuODmaXJtoCaADryoDYhV+Q SlEGcKBpD5Xop2iHQXY2FGzQFn3P9h9jgn2I+PE5O1QWyPGbvwnnyva53cnwE04PGB7J 2ZKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884697; x=1735489497; 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=RsMsu+KnHNOz8xxBzxsDdOwYFyA0SvaPufxN7cNRIvc=; b=WlzQwvWC/oSyYBv2zbVrwBPtyVAiRTbZvdmOPneVvhXW6oNg9pG217+db5/uv/fyMH NYhWFsAnfL/rqLz2gA9iYRd7Uf1jE/TOXTBsQXD6PgSsgZnu/dT/1KtuB0KPWY0NCvKR uxALWl5uttWTDO0CM3+F7nAyQl8nPT/lSTg0xxVqEURjUwapSdN0WHdaPlcgPQEXBoF1 IYB4K/CA4frJLmVJzC09sZbZ7Nr2BDbpFtgg3czxXGXrMDufTmPptSMeIaz0H33XyIy6 u5Z4wTgeSCPqUopgHKMRKoEV4QM2NNJY1KJRTir1zwR90mlnYgHtkxXGvZJHG65ZgUjG eYrA== X-Gm-Message-State: AOJu0YzLu81ukUgdXl23QM13yBy+Rs6MLsh2ZsPIw2lKqUk095MOMk7m ttMKUjVen3oPDv6svEW4ytqT4kmVNS133VPX5DyI/Hdi4z4xwuqYtna0iw/YUpTpZSrEbIVotL0 IYhc= X-Gm-Gg: ASbGncupVhNO6drPlKT4SswP08P97vmFofGmbbbZL9NN45+1iPNtV3VTxl316jgNrc8 tfM3+0mPQh2aGyyi5swOKX+ODK05cWdzBYMScx8Lpjoih8sGJiw/WRwbX3ErOMAe+YDYH7kxmtm JVueyAU/UGBXu5M+yrKczq05cQxtJImFMCQVqjZ8jqG1ZaobMu+8py0vQMurcoANXHR0h10M0Mf WeALS4xSq9udy2gmRUjB0+Rkv4n5PVRhBd9cYsvgLQUG6CDq9Hj1qXobvWoKFA= X-Google-Smtp-Source: AGHT+IHQz23cjw0h5HqEzc1qsGoJnUuhLf1HqqkNLMafCn69E5DqUEn2ejrIBxpDh6MkQKwLhzi0WQ== X-Received: by 2002:a17:903:234b:b0:216:527b:5413 with SMTP id d9443c01a7336-219e6eb6273mr150857265ad.26.1734884697312; Sun, 22 Dec 2024 08:24:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 15/51] tcg/optimize: Use finish_folding in fold_divide Date: Sun, 22 Dec 2024 08:24:10 -0800 Message-ID: <20241222162446.2415717-16-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885156191116600 Content-Type: text/plain; charset="utf-8" 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 b6a0bfe64e..0a617bac71 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1671,7 +1671,7 @@ static bool fold_divide(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 1)) { return true; } - return false; + return finish_folding(ctx, op); } =20 static bool fold_dup(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885231; cv=none; d=zohomail.com; s=zohoarc; b=iEXapG/Qb8deYCr5EvD72735nbp7Fyru8AO985Y9+JMJT1GCaWFzf/dOLPAl7n40J2aVZAU1NfPosujFFuxTV7ISACWDvaIq8GOvm5Q3K1YLqSTTHZ0ZWZEy+QjaPX/OMagiT2v98ENaQdisvTZF7av/jtFkaAYx9aKE4m/busM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885231; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=HA1Cia3WD3D79+EBDaM7JZkJcsoJHEjvRS4SeBS9TIk=; b=Ll53MMNeq6SqAmLkLhiXNXhrRgSmI/BpmpjaHMEU8bFe2OwHIiyP87M8472UVpi2ceaD9WuePrPs8zFkyzYMZ5Kq1AZPOznDCN3aUMvE+9K30G3XleI+7dIEyCfkEK7VpFrXb7KQOfhFauKQgBAUbuzE3Aq/2agWeEpKb+WoW/c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885231862595.8155993355696; Sun, 22 Dec 2024 08:33:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlr-0002ul-MI; Sun, 22 Dec 2024 11:25:35 -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 1tPOlI-0002Zm-Hs for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:01 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlH-0002yy-6S for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:00 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-21628b3fe7dso29192665ad.3 for ; Sun, 22 Dec 2024 08:24:58 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884698; x=1735489498; 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=HA1Cia3WD3D79+EBDaM7JZkJcsoJHEjvRS4SeBS9TIk=; b=OHov2nlr+XllWv9lXIBM92CKcuKFSdReXNEEX0eGiuIgn/aGbtWkG7ZUhRcC+3nV9B Yv8m2kg5QjXGyz8oIvO1rplMrWtH+S6D+cQ+qFAlN8MRsW/Z/SABWSdbVHuZ8e/1d7Di lcb01HBwT+RaiU3q7sZMsb/nubaYlVLlDSHD2odV2zZqVXpKWsJX/I5YRxoDd8fME4lK QPYyefLHThbmJ6nMLYH25B+XDOJKj3MpNAEjPPcmSMd6S4WQkTuI8CVVJ0ppDn508LAq QnXnsDLnVuT6omunSDgiMgkZaX/jb/BXTWvBIxwKlpbR269R5Q7H1YKtZNeg0oAYngtz MNBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884698; x=1735489498; 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=HA1Cia3WD3D79+EBDaM7JZkJcsoJHEjvRS4SeBS9TIk=; b=wWSO6TS0JHBOJxSazq6uHGEnOc/13TBtkuYo1StougU3wi4C7ZwcKy7Z4V/WResIkB qhse4DKERfWOtttdKBsaaxm9DWvnFNhSGh8dQFHLVHUu/+3aAbK5qJy5ZGC3WHyUYgB/ KN3dd1NUUZur3HAjyW1KbkvF1QoD0ynd30A4bDYbPKeK6+SCgemqx9zPSrP0g5tw7xl0 38ETb8ZmhhCz8xq9okjWWTJJ4uC/euBemBOBBp7jXMaZq4/pIgjC9wNXn8H8Z0y+m8rX N45JfbFanVsrZsHGWYBM1VYpJIW22o42DBOQvQ2oa195KoDDRtGf1TCJXE4Fdcg6pg7R a0tQ== X-Gm-Message-State: AOJu0Yz2rOiRUyum3P/IoUzieKPf3PGF4Zg6XjiAPBTiV7+CHctC2F5l bptxaoHmnkJSrg8ULu+sI7RyKW5tF/G7L0rvMrq85EPE2GcRp+/yJuVEavbK5SWRqEZyPcDiBFj OV1U= X-Gm-Gg: ASbGncs7N7riyzR+PVzpjMFoaJiCBTeTgsCORB3b0ANoo1/g99IcyscfjhA1EeayThC nP106kT7Ie9LUtfwqncc/3woQpMniKW6lpPeM0PyBHjHnziiXnd9aPTXzIXEoxdtS890jnkYxjG OQ2ginz2q4IlLI0/sRvb4WtBd6bqm0c4QI4sHP/5JATANELOlXFJ7y2VKey5BGyEW1LjZ380/fR Bbqe4QML8ZVGmtrL4TZ2OvizVvKG+eu98NuPgiMCDQsxWuDdC+lznxFiBnFcHE= X-Google-Smtp-Source: AGHT+IGmQ7fLyPE+oU/60OBtLMopMzcqkut61c/4xm+tCMVa3han6qN09TyoZU4E8Edp+KdIMDmPJw== X-Received: by 2002:a17:902:d582:b0:216:282d:c68c with SMTP id d9443c01a7336-219e6e9dff9mr151480545ad.23.1734884697928; Sun, 22 Dec 2024 08:24:57 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 16/51] tcg/optimize: Use finish_folding in fold_dup, fold_dup2 Date: Sun, 22 Dec 2024 08:24:11 -0800 Message-ID: <20241222162446.2415717-17-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885232213116600 Content-Type: text/plain; charset="utf-8" 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 0a617bac71..9906f370de 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1681,7 +1681,7 @@ static bool fold_dup(OptContext *ctx, TCGOp *op) t =3D dup_const(TCGOP_VECE(op), t); return tcg_opt_gen_movi(ctx, op, op->args[0], t); } - return false; + return finish_folding(ctx, op); } =20 static bool fold_dup2(OptContext *ctx, TCGOp *op) @@ -1696,7 +1696,7 @@ static bool fold_dup2(OptContext *ctx, TCGOp *op) op->opc =3D INDEX_op_dup_vec; TCGOP_VECE(op) =3D MO_32; } - return false; + return finish_folding(ctx, op); } =20 static bool fold_eqv(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885196; cv=none; d=zohomail.com; s=zohoarc; b=GEorwqOCUcNthTrTCHjqMnxCRttY8H1OC/O5tOuyCoMDM0uH5CzoK8RU5rRoYCqLys2dMqNLJUgUjlenVDEFgaJZbE3HVTEHpJQUOhOp8h3eVx50F+1emro3xW8m9KUGaRFPeZN4lQBAXwnIpXl5B/T4ncFqmf2b/xvAl9eo0CM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885196; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=QQvwlGRTQIrrP2cNu/4FfpMBStYCT1hRoRZv9KuG4DI=; b=LHPtgXL6cbO0yQgjikskyuFWt6S466PJgyXyu2EoUs9RpXIeh5uZJZUmVK7g3LodV+gm/qE0DohA5DoHvLUHlhi0uHSqo9Ei/Wmo1A7GMzakoWuZsf8U5NV/h6krsNKYbtjoleN8GHGr99u+5+nCasVmP6JIsfr1CyFFNwwHdic= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885196620388.6221968449362; Sun, 22 Dec 2024 08:33:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlv-0002wB-AK; Sun, 22 Dec 2024 11:25: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 1tPOlL-0002ai-6l for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:04 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlI-0002z2-92 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:01 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-21649a7bcdcso31420805ad.1 for ; Sun, 22 Dec 2024 08:24:59 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884698; x=1735489498; 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=QQvwlGRTQIrrP2cNu/4FfpMBStYCT1hRoRZv9KuG4DI=; b=cMMu4335/5ZKXKAVIwO0p3GGilGP20wnGmFsypeNWLEzcNvHe6EvaSGpz5J3fGU8lZ NUxY2TSjVrBj/4ht6jQTKTHD+BW+XT6vc0rqa22zCPPtVXyU7jn43D+6+dhApWNefOzT PSZ1d8zC6iM28nb2gu30Ahx1mOPH4iXVoJiA0XcUEIg9m+W0ZPaxoq2dNJi9KB+TkCFB MLfsjoVtMDxJSf9CUeRW7XzHixdHOMJQG1689gm22I8OC3WPCBl85xIzYIIJzBS+ro6s TZbbJS+rAY20kxqeHPZXsRPOBdmLygJc2LU8Idu51BoZcJqB82CVNN/H6B36suyCvCcq fG9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884698; x=1735489498; 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=QQvwlGRTQIrrP2cNu/4FfpMBStYCT1hRoRZv9KuG4DI=; b=IwMt6a5+0BqXMj7HMn7he9L3ACqPEKHi5e1CG+8+Zb2f3+Z0gTUfyJFPgF3LQe4O9m d9uv0ep5mfcl8T5zIsNDvGgIYMCj26a14d+AGEsQUqUlUQHDfGUP4/tQOKWCWSdaMef7 6Th2AGlYDDAbhD51Q3PRFuPLNn/D0Z884icLceZLCokBvPeW2d5qSYk6C2cfVPFkFne/ /zKp7dNxOu4/Ut5zwiHYgTGng+AuTdvt+MPZe/qV5aH6pneX4jckqtGMbMGsdQRse8W3 FY9wm5StA6D5x7IdmXrEbkP/T6gMu66iBDbahLkLoMHfbzRf5kMYoWNYlNgbXG23hMGh /o+Q== X-Gm-Message-State: AOJu0YxKKWGhYaAGN52E1QmLowpJx61OrvmYurRw9f9Ul3egIHQNvwIA VLrEfZ0RVEowviCLd5ADY6EWeFsYDCRQleckozGutub/p2xI1yNs97lrlvVDDmojY5CkymOGdty AwJs= X-Gm-Gg: ASbGncuVIw2wHRlXNG7CGPO3lDlTFfQNAzjCo1ElIwuhp35NvmmEdZ12MT3hAFhSWD8 lgWIR4lnpuPrAFYrqBEx+K8Hv7CDoqpMmtunRB2wAmc9PYVS7CtC6NDbKoVGC4IOnT2qb0obfV6 W06PD2cTHLUUy5TeW2gWAg19mK7ZnUmSmg8V7/6CmFYy8iJQEdFH7jefV593RV2cWPBSZKb/V2Q 70C1rm/AIKHJypTdGC/C5daHBbXbfF8aVrIP5Eb+vfLbxHlEtoTn0YAX4ESsbg= X-Google-Smtp-Source: AGHT+IFJaKT2Nldicfday1K6xrYaCJy6TaCtO8yoJ3+D21ExiD4PLt2pmFwPsyVU3bKDIppHGrz2Pg== X-Received: by 2002:a17:902:ce83:b0:216:5b8b:9062 with SMTP id d9443c01a7336-219e70dd21cmr147198925ad.54.1734884698551; Sun, 22 Dec 2024 08:24:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 17/51] tcg/optimize: Use fold_masks_s in fold_eqv Date: Sun, 22 Dec 2024 08:24:12 -0800 Message-ID: <20241222162446.2415717-18-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885198083116600 Content-Type: text/plain; charset="utf-8" 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 9906f370de..9c1fba00fb 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1058,6 +1058,11 @@ static bool fold_masks_z(OptContext *ctx, TCGOp *op,= uint64_t z_mask) return fold_masks_zs(ctx, op, z_mask, 0); } =20 +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); @@ -1701,15 +1706,17 @@ static bool fold_dup2(OptContext *ctx, TCGOp *op) =20 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; } =20 - ctx->s_mask =3D arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask =3D arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_s(ctx, op, s_mask); } =20 static bool fold_extract(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884751; cv=none; d=zohomail.com; s=zohoarc; b=TElmleaoQIZs1EOS0MRRsukIzSZx9b/0wbwhm8o+DMjKBICx+Jb/Hdiin3s+WwiYwhEw6Z6QGALJbo+4mPEkFK7nwDryt5DLGk6LrspGfqLj0RPjdRwNScZteICcAM6E+GG43eOPHjVUW0yRcQ+YS/QpZ5HjDHoq8bzPYeWDKlo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884751; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=NUfpXkC8dy7CkOQ8+W7y3UlGToz+fRAfXgFSmgORkTU=; b=k7NTnpsMjF0AWoA+AXztlAmJUa1Qn2ZpFCe84os27JRjhW55X1+jUbf6z7no/dLmmnjUQj8cfRjHbbGs61Hf1zlmC31vJYGnhuuqwALNvvXNRL4h4m9hh1jCMmibyaph5jdNHlJImPOVLcNLzbPIKDvAtdduFx4inGcHMsGW+cU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884750992183.99548608133455; Sun, 22 Dec 2024 08:25:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlv-0002x8-VT; Sun, 22 Dec 2024 11:25: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 1tPOlN-0002ap-93 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:06 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlJ-0002zH-2R for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:04 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-218c8aca5f1so37023425ad.0 for ; Sun, 22 Dec 2024 08:24:59 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884699; x=1735489499; 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=NUfpXkC8dy7CkOQ8+W7y3UlGToz+fRAfXgFSmgORkTU=; b=uy0+mv2n05BPimnAeKgrtgsnrDjOLTeOQDISCH3kZEX/qgHYnwpMVbPFOjtZrzc6pa ojHNuELATZ4S5OAHtLn/0ipUQw0/v61P3njnkNnkd+afkq2og96qQXf46vJQRc2FHkYV ryckcBPzy90MxamR5Jd7gYOD1jsuBeI/IMrAtk6xRFKpyKo0M81D2JMQwZlAKtOrlJYw 3aMRiSBTADwppjO5JI98oYF2wHXj/HBNyOq7t9vBd0nVHSz2i9HqFvcOIxdNmZRAcBZ0 kM4Od5kX2t7YB52eXQwB8Fu5+NKyaKg4v/edBFG4Top8qDaCTfRUZO4VPt5ScgY+Mr0n R0iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884699; x=1735489499; 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=NUfpXkC8dy7CkOQ8+W7y3UlGToz+fRAfXgFSmgORkTU=; b=oyqTbweY+FRF71vslVTu4rrPee2NK3ldKeH64YBp5SvRj5CppV/1esmeOQka9WrL05 GoXKM71jgm23d+dDSdPHyFLotZ1pFL7d4KKYSUfrv8asv/J84MDqIMGyyl/hG/eyea8E 64hTe9OK5yAU/F7pGyeBPQjRfPVw1D/qwq5zSwPvAbcW0fakJ6/54mxdewqVnpIn4hwQ QyWDofIOIRCcoWuwOlfgfDSvinGUJrD/tVybI22KuyqqxLlwwA5LzviqKNNhRvh+l5Dd ToMjFLjw/w6SfjAhxK9BWyHFjNNtoxOAfuao4GJgRf3TNkQW5MP+Zi/6k6r2zwRZSG3K 5iZA== X-Gm-Message-State: AOJu0Yzhfkjct4dy6qfc+Rol9K4+wRlgwwGmjnABtLx/S/QL2azGXGL+ 9pxPhacVzRQB8d5VrVFYggp6VMd3OAyyD8sXxSWO3YVWiRNX3uSm1isQJ7c1gYtNvOGtSqpYhJR 2mWo= X-Gm-Gg: ASbGncuRZV1sUS9fWSyKTmVLQTB5TlCS2cHr8HrVyttCyJoyQTNRWuUFcwuHgNqI3Ai NKIIc1qdaZdUl7r4tKOi8b5V0fHfrRVqAZxuhr2WcIUb9U20HibU2iwofBBaHI7Y3JSuR4dnk1Z NHQqe7OklYKQXPjx9670rrB/65Dc6+DpQU4Y+CSbiX+qYTOd60ZR2U9O1AJwzCDo2LUi2fA6nKx NfkFSpPnZ7YmxbdFDa1kv4PYyaoLeK9H34nU5kyOb4l2aaMTXh8D5Cf9GzoiaQ= X-Google-Smtp-Source: AGHT+IG0BWfMY9U2zRS0hyYUKOhdxYMn1w6P3zGX0DrMXby8iG/cC2+JgEQYnnvWGJYwqZLT2sJ/AQ== X-Received: by 2002:a17:902:f602:b0:216:3c2b:a5e5 with SMTP id d9443c01a7336-219e6ebb682mr129995655ad.27.1734884699199; Sun, 22 Dec 2024 08:24:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 18/51] tcg/optimize: Use fold_masks_z in fold_extract Date: Sun, 22 Dec 2024 08:24:13 -0800 Message-ID: <20241222162446.2415717-19-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884752147116600 Content-Type: text/plain; charset="utf-8" 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 9c1fba00fb..5aca1b3c38 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1722,25 +1722,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 =3D arg_info(op->args[1]); int pos =3D op->args[2]; int len =3D op->args[3]; =20 - if (arg_is_const(op->args[1])) { - uint64_t t; - - t =3D arg_info(op->args[1])->val; - t =3D 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)); } =20 - z_mask_old =3D arg_info(op->args[1])->z_mask; + z_mask_old =3D t1->z_mask; z_mask =3D extract64(z_mask_old, pos, len); if (pos =3D=3D 0 && fold_affected_mask(ctx, op, z_mask_old ^ z_mask)) { return true; } - ctx->z_mask =3D z_mask; =20 - return fold_masks(ctx, op); + return fold_masks_z(ctx, op, z_mask); } =20 static bool fold_extract2(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885047; cv=none; d=zohomail.com; s=zohoarc; b=N6r4oWpO+jcoAB5/Ex3WSn49zYXO/W+JBsHU9xBlHx5ptZJIKoJSW4YR15PwRJF64R8N0Vgjb/rL2b2CKJHNIemTEFcZx0P6uAyblP6VcUu+bKQssL8XXKVZ5yR5aJr8SrTcqRVtz2VcAnnGUOR8RwXYK4Cm+D3WbCgEKLpGm8Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885047; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=BCm15DE2qtNbKxdOHIXv3FqNquf+1a5gHmhQWuS932Q=; b=X1mFQapPGN0SGUsLWTAwOMffaeM8l/fKpfb9YauZwii4FSIiBFz84zSrLPEqTitwMMwHjZoQ03W8lUnlHeliGSy4i/pL2N0c5zCx/fLsM5lhb80GOXfZGMjmMcdZX583ugrvl5XKBvCpwngYyFs4u1iO/E5Owey5x9YYtkxAX4k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885047048551.7163200830311; Sun, 22 Dec 2024 08:30:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOls-0002uw-OF; Sun, 22 Dec 2024 11:25: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 1tPOlN-0002ao-8Q for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:06 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlJ-0002zO-2X for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:04 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2163dc5155fso30200855ad.0 for ; Sun, 22 Dec 2024 08:25:00 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:24:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884700; x=1735489500; 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=BCm15DE2qtNbKxdOHIXv3FqNquf+1a5gHmhQWuS932Q=; b=gV4LJjHhI1l/mdy2b1nNL4ELQSaIN1p2crEEtsaA+s8U6IBVlvAavaNEFsAkbaGAgO GOf0J9qBh9e1GcjsZRFy5APKoa0I9FuJoI6yaLP0Q78Z2RLRvExH97rETSXHILT+Wwni q1AM0ILPUWVUQ+/xBSjqjLnhfiomNwMkXao96gnSCukc+EW/ax8pGfgciiQWnRqbnuRW GMssGQDovzdHUEjh6ZHYEMbVApyrAAgfDx9N2KxO59W7CfEpU4wBj5IEpfkHn3jjxD+R Jkjw31z0Uyt3VcKxbpbccWyst7XFfz6bJO0zxNrJIdRyORHJR5bXdV3rRMkaN6B7/Oe7 2H5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884700; x=1735489500; 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=BCm15DE2qtNbKxdOHIXv3FqNquf+1a5gHmhQWuS932Q=; b=xI1gqItgIQVAhOLiMrdIvXN0hTYfJI1VnsJQwD7ZWywe3txKRKP+bAyMbyKeqIGMg2 dqoflu2/oOkrQjtR2ufCkI+mBdGhAJtuplSqLhxhRVVO0eCYjlMW/HYjb40g5G4V2Cfy GkoqQxMuE7zjysj6JPp2VydOhKBY6dm+7wrbtY2cdPQUWJ5+QaZJmsKpnOlf5TXcSbjH 3XLAvJJgLohNjuImMQWkB70/uNxC3eabUHgJO/d7I6A62SAFv8mNdDmh3LvSUWAZKs2I VFNsyLYaJACBZYKex50UOWzAABDVEjYr/k7jIdiTDSpXFHLQUyxX9vDew72uThwmKXja wjuw== X-Gm-Message-State: AOJu0YxAtKQuVL5VAZ9CtgujOmhfRLfgJ9BF4szzLfhbaEdW+S++6k/A 2Uphxu/ahPGrWPg5/Lx4OwIOyRk29GJI5ctfLMDLuCg6yj10FkoBhipTkTv0PIuDM+WCmXn7zu/ 2xsY= X-Gm-Gg: ASbGnctuln0x6ZCuoHCbZX68Fsca7h4H0BupFpaM1EqPQcl/YAT31vUwCEKmKMhLOvX m7D7/DyhfKJ8doEi34HbG1/XEZwahYiLldiKDRLGiTqI+1HKGPdgZ/NWUPVWC7zIjPTjTUh7jii qvuhZPRbSybarRJEfkEIinQ0vzkssVpbXAGELuJ8gIWgSx7zBU28NNV2kfhEhXRXcEqnSM40M43 i+H/riMayoN9fRI6mjbnR/Rl0AnBro/f7554K6BZA5b6rPL+Dv0Z6Je279rui4= X-Google-Smtp-Source: AGHT+IEvMNNCjYSBH15pV8uUzEmUPKgGPSbeiEp58ekwfGOSHPDek+HlzntN7AJLAwkLUV8WZFvJvw== X-Received: by 2002:a17:902:d2cc:b0:216:1cfa:2bbf with SMTP id d9443c01a7336-219e6f12dbemr132085575ad.35.1734884699746; Sun, 22 Dec 2024 08:24:59 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 19/51] tcg/optimize: Use finish_folding in fold_extract2 Date: Sun, 22 Dec 2024 08:24:14 -0800 Message-ID: <20241222162446.2415717-20-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885047276116600 Content-Type: text/plain; charset="utf-8" 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 5aca1b3c38..f05110cb9f 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1756,7 +1756,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); } =20 static bool fold_exts(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885195; cv=none; d=zohomail.com; s=zohoarc; b=eyTtgnqzPciVxfIt+jpTbDxJXomHFLU/kcWZavwqmPX8hHMydQbEczkJE6uRdcg42i5dIxSyjq/lxN7t8Z9kW9JxGI8iCb7nE7cz7hlRjMzHBXg/03M8j4IMio4r4re1Qf8gx8aFfQU6+B7zkSUuuNzFCV1e+Ri4gSAHbBcoqhs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885195; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=sLGJPFNJ8wfTFpeecaPk1zjZBnM4p3X0KbI5v3Dflro=; b=DoChS+P5qxxm8sCDt20RvYlonbLPDBVl+ekdOcMeL1LApOKkkT/0fyDxKM6QIwi5G+NKa5+tP3KKVQWoNFvEjL427G+hxxQOXKYGfDK4ymY/QI5IqoLPgXIXX5vWB8ouFXWq3AGAldDysKmB+zC9hBPRZC58WA2tqBOa3xobkic= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885195352217.1397690341115; Sun, 22 Dec 2024 08:33:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlv-0002x7-Ul; Sun, 22 Dec 2024 11:25: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 1tPOlN-0002at-Qg for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:07 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlK-0002zb-Tj for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:05 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2164b1f05caso31193415ad.3 for ; Sun, 22 Dec 2024 08:25:01 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.24.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884700; x=1735489500; 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=sLGJPFNJ8wfTFpeecaPk1zjZBnM4p3X0KbI5v3Dflro=; b=K0/ojJkQEkya+EeYiQd9Dyh0H8rWlD/Kx5Jg0OpkSuqcpKrj0rG4cwdL7NMdpkjFqD JlGXF9A9urmIQOderlQOX3dXkGUQQkz0k71Y6r9LDed1wTbMxglz5jBC1w/10IOk0eTa tL6XgZF4Ixh/+S58LzPkBve3DIxyILuLbi+J/MBFnnAiTAB80GEJl2NcdsPiDbtdP/Ow s1EVYaD1H2ek8CZ1T/y6xSsbCptU2et81W1Oa1vi7r4YpBPoi25v/WaHOzvEyXzBIYUw G9LAqIfDvX/5FC/4nNoQS5llOmtT7/ZrVTOdTx+3pw+612TMLNC5aVYnv8zR2T7mIScG ytlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884700; x=1735489500; 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=sLGJPFNJ8wfTFpeecaPk1zjZBnM4p3X0KbI5v3Dflro=; b=Dhv0x3zwkJEfT2dPvqCllPFAsEGya0/CnR8MroDBjdDKitUPybsmt2wuPI3vSTNpab IBzKBnHm0r1VsB675V+KStb9/Wb/F7VkEW4XXaCOfnbvSSJuTg0FxU39dWSzQwGzO82W JYpCtHqxEvCbqKAQKTI+N9xoDmgOzZwzKxOM9HUjbsaLKrPc9C6QhhnXQ1giTJTLV49w OsprtjAlwbpaT93KE4hSpqQtzBtGkmmOYaA/dQKkRzXNHypURsINki8nj2bB/k2ES3Ac hO83ftwX++oZPTAt+B6XvjuCHpgqVB59JQ4EdR8+gPIhfzQ/sqHtO2LFlUvfLXPGyzTr V8Dg== X-Gm-Message-State: AOJu0YzNktWd3mwCFqllX58eDJHpxs/2DhRXBhmXTkOcCNbNLyz0Kzx0 3cjskQvW8tnfNTKhbGNcGHGHV8ZPOG8REO/FlW6qM7F/ZOWlge4C3VigDm59EmDC+mfSl6NBGZF Cr4Q= X-Gm-Gg: ASbGncsFgfRfoKIKtMMQORBVgwnb0/4RAdwgdWrDggLIp/oeQCSL5Lzm9C/joTiCet4 1vmUbf3wSsLuZ9GAiLRqa4Rl1Nyi1yKQNMdUgOIuHua2B1z3yG6dUstOqPUFD/5lR+LkjF1gDFb AN7jnwRRYPz4PPrrgml4U3UryAka9d7BLjBtcQfJuSYR0eKs7WGYKoiZUofetdkwy0b1yj/kRwJ bPIuJ6JihCzrYK7nNbK3GlQg2AplNTxwmvpy/QzjbXINnFtItl9jo8vuQh2Uqo= X-Google-Smtp-Source: AGHT+IFrHHCyrpFZor2XjwfNfbEC9XbWKndCgMUhow00wBV0vq5d/s3OEqQJe+Djuws72NWkzju0Yg== X-Received: by 2002:a17:903:41c3:b0:216:69ca:773b with SMTP id d9443c01a7336-219e6e8c3d6mr146715085ad.5.1734884700332; Sun, 22 Dec 2024 08:25:00 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 20/51] tcg/optimize: Use fold_masks_zs in fold_exts Date: Sun, 22 Dec 2024 08:24:15 -0800 Message-ID: <20241222162446.2415717-21-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885196083116600 Content-Type: text/plain; charset="utf-8" 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 | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index f05110cb9f..ab8ce1de2a 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1761,49 +1761,44 @@ static bool fold_extract2(OptContext *ctx, TCGOp *o= p) =20 static bool fold_exts(OptContext *ctx, TCGOp *op) { - uint64_t s_mask_old, s_mask, z_mask, sign; + uint64_t s_mask_old, s_mask, z_mask; bool type_change =3D false; + TempOptInfo *t1; =20 if (fold_const1(ctx, op)) { return true; } =20 - z_mask =3D arg_info(op->args[1])->z_mask; - s_mask =3D arg_info(op->args[1])->s_mask; + t1 =3D arg_info(op->args[1]); + z_mask =3D t1->z_mask; + s_mask =3D t1->s_mask; s_mask_old =3D s_mask; =20 switch (op->opc) { CASE_OP_32_64(ext8s): - sign =3D INT8_MIN; - z_mask =3D (uint8_t)z_mask; + s_mask |=3D INT8_MIN; + z_mask =3D (int8_t)z_mask; break; CASE_OP_32_64(ext16s): - sign =3D INT16_MIN; - z_mask =3D (uint16_t)z_mask; + s_mask |=3D INT16_MIN; + z_mask =3D (int16_t)z_mask; break; case INDEX_op_ext_i32_i64: type_change =3D true; QEMU_FALLTHROUGH; case INDEX_op_ext32s_i64: - sign =3D INT32_MIN; - z_mask =3D (uint32_t)z_mask; + s_mask |=3D INT32_MIN; + z_mask =3D (int32_t)z_mask; break; default: g_assert_not_reached(); } =20 - if (z_mask & sign) { - z_mask |=3D sign; - } - s_mask |=3D sign << 1; - - ctx->z_mask =3D z_mask; - ctx->s_mask =3D s_mask; if (0 && !type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_= old)) { return true; } =20 - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_extu(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885075; cv=none; d=zohomail.com; s=zohoarc; b=lXeBo/mtV0mYBGks+CmowF6WrllHDWT8Sm1m3j5AHxVafReGQF8Vq6510FxzrG4zdFRO71FTL+UWJXxdx9+VuqfaVGCiYgvikRU3PwEbSa+m//d9JtBPe9PS1wyBldBfv9wZ1mU1VF3oP4QQuqW2rYPb6guQrsYu7HwYZF2EaTM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885075; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=9yQbUQ8bYZFaAZlXpe/VATGLlMOZ864dh+CLTc76xc8=; b=Y2GWygDfcSxfQRXL4PFt9AXQ30jHVRg24ay3Jn8AS/t3RHO/91jRhiknn+UiPVDlkzUZV3BkJNJB22ey3FRLMtoXiT/09//RoWFKgiWjGJ0R5w+ACMx1TyNPRmyTDRLD0epEXfvVfgyHqo4qhw5osfgmbz5lJGgzkMmGENpYJ6g= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885075587509.52239846799637; Sun, 22 Dec 2024 08:31:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlu-0002vL-IK; Sun, 22 Dec 2024 11:25: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 1tPOlN-0002aq-Dz for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:07 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlK-0002zi-Ts for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:05 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-216395e151bso22288995ad.0 for ; Sun, 22 Dec 2024 08:25:01 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884701; x=1735489501; 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=9yQbUQ8bYZFaAZlXpe/VATGLlMOZ864dh+CLTc76xc8=; b=MesmPP913zu/CD8VjdCBKRH20knttS4wliGX9ZhMkcnmmWXeoP0OSNiK2XWRnyMo4e heGQtrqd1RDzHboI1pl5spv6v7RsEbMjFtOlSpB9QBUNP+eOtwmvyN0J9spLjnMIZB57 2ws4AaaK0S8nJscAs/A0va/aWqhEzj2oN5EUW+ppI9rtYGt7oWZ1kaNFQtMxuAUEsWUF gh3kvSRNGzcciR7qenY2HmXuDisMNKqSfvGzhpXwKPGGKDYEXcXVjamLW74rLR0vjaEZ g9Hug3Ka9T5I87rg4E48XUtC3DnEa9osXmpLswhGE1voYExKDmtdOOyEjxHvtJuB7L5E uZnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884701; x=1735489501; 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=9yQbUQ8bYZFaAZlXpe/VATGLlMOZ864dh+CLTc76xc8=; b=SYxaeWr3wORmg8QOwIZoPyRBuxT3+5FpoPI+WMiZ4cvjze5CHOMO6p8LFfFLRo9A0v IcFu6a1pOC0plU6wQGkzYSynAmVH8T+p5xV/cZL/Gx4mWmpHpIIEkDW2le3cErdAa0lK XH0AKfQyd8c9VhXi08Wo1AMEN3AhaCivjsLeP+Dtc+ECamgRvHKft5T+Sh+CirIzicD+ eIQhK7apKBYHfhMyioSmacj0ACTGufOqAZ1v7k9ecw78Lw6Y0UFoZ5XvU21HrcUfUHCi Lbs7pZv+ar0fibZsxMsOULWiV0te3g+MN8gf7aj3TLM8aH9t99bTHKs6zXU2P8LT5v7j LnWw== X-Gm-Message-State: AOJu0Yw8zOJYT6ranZ5PkLaknHl3Q5xzJznvwdbMXcyXFc8fVvTf1qtx hO72WtTOTb5mCf3/oou1gcIDOuXy+xbnI7d/FmrNUMBDOvxEU9opCoILzV6cRCXTvhDVhXokiOH oNOY= X-Gm-Gg: ASbGncuB5KVhS2ODe0bL9Jgeu8SSNFnoq+uCsU4s5c3r+UgLLAUvXXJQCIjz26F/JMU u7JjHSOIpoGFftX4D2qSpON/p01RSx2SehirMfYkB+3JmsR6Fo2JJfjcd/elYTThcTCiw9ssOR5 3lSiMP64lhPYlmk+l+AqhuCEo+NrvXfe+GROZI8YDvII40vcgCmTO4zAwk+xLLVHOg+dLymo1h3 hVfrm8IzcAfZ3gjLK6gFmpX2CwpVipomjtceXB+PsG2X8vrHrjYUsgSWj5YIo4= X-Google-Smtp-Source: AGHT+IG0yM5xEekAMP5a2FLMSdPW1XE1in4V5weSGM+scgpxRFOlnc+TtGIdAEi53FszAyVSaorCfQ== X-Received: by 2002:a17:903:2cc:b0:215:6c5f:d142 with SMTP id d9443c01a7336-219e6d5997dmr147840015ad.20.1734884701028; Sun, 22 Dec 2024 08:25:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 21/51] tcg/optimize: Use fold_masks_z in fold_extu Date: Sun, 22 Dec 2024 08:24:16 -0800 Message-ID: <20241222162446.2415717-22-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885077454116600 Content-Type: text/plain; charset="utf-8" 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 ab8ce1de2a..bdf95d1924 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1834,11 +1834,11 @@ static bool fold_extu(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } =20 - ctx->z_mask =3D 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); } =20 static bool fold_mb(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885200; cv=none; d=zohomail.com; s=zohoarc; b=Ulc3SMo2nWpYXXWa+o5exf2n6EDbJzfqYy1Xb5J8y15zGJn4j81kE+57SG2RzB5sBh9dtR8X+R7fdyEWvjTLeU9VY/3jxWob8TevSHTarvwPqPGM2TCKKti7SJrAt3rwC5OMoPQghq3BUrjNyfcDgxmmZ5sUoOckMJ0yo11i2Ko= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885200; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=o/XI5+6+/p9fAbunFiFtbRIOPmiLtR1oJMv0H9QNNE0=; b=iVrZHUWTvLx30MGRir8VNAs4VvjLf4oCn5EduBfp1wbX18RsbdzqPie/CPu8mBsxL6p39S8Vjn03f/cwdDAubRPN8zlpmlZl1gZrw6FPfD1OQL0kINUCWa0IdbHYdVLfUoEhA/sdIJ3qTVI3t90Og3dgAHLPctibPF+DUfL1UWE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885200815808.1190493070451; Sun, 22 Dec 2024 08:33:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlv-0002w8-7N; Sun, 22 Dec 2024 11:25: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 1tPOlN-0002au-Qi for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:07 -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 1tPOlK-0002zy-V0 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:05 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-215770613dbso22805165ad.2 for ; Sun, 22 Dec 2024 08:25:02 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884701; x=1735489501; 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=o/XI5+6+/p9fAbunFiFtbRIOPmiLtR1oJMv0H9QNNE0=; b=NbSahlZ58ljPaFlRmCcfot2V0RkOo04SxlDVhd10A85+b7HD0y/ndCFwMLWnoce/1m ZCHTNB7RUoD+smVsnCCTo0DAiWRkN/R0EmsqOQh6hK4bxjeGSTzqDec4Zi7VliQkA05G gIejB+5PpOMbvhS6hu1ZsqkEaaEmdp1QdirKm+EXwADjb6GIe2ENYTW6dpl5Q8PqY4RC q68O6bSPra9buAhioCPgkdc8It5sHIXWPxDaWT27RulfV+6FhRRrc65VLc0dGFlujX8w GGQGtNu9okc6tyWWHsxy/B5ZC6BoweeXxxWp6icTSEN/2HCpWZQ9YQv8txc1ZxbVw/Ir 68gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884701; x=1735489501; 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=o/XI5+6+/p9fAbunFiFtbRIOPmiLtR1oJMv0H9QNNE0=; b=X2wgkxtfxC5Hh3Z8gKYZ9w0lio25qTwbVYGfaNBOb93+jDs7+Z7xfH1CI6q9Zk0Z/S 8bgFHkC/8OA6/FbaVA4Vyvx3YNExg0dA2R4PmRXdK+liPW6taxNzb+UrFPxLpv+Da45+ McApXJHNVgFe7N1nuJCX9H0Gz58UKpQAUr/97JTwfFNL3lL2d39BXVEWaJiP0PIbRQIi cbnns9W/Q+qKcmFviZM6X12z1ZLOnGYbUSC7cauzdfgTbKzQWJSHQ1oerqB8f2Jehjyv GKJa0kLuR6YCRyE4Mr0EIUhQz6koOmBsm7rV2lreVAPXqqdHIexoyifFykrwuDlSmEjo jMFA== X-Gm-Message-State: AOJu0YweelzdVpmosw4mjdeq10iXw52JSK+Xi95jvdDG6F0ZEeRR4tEf Jbtv7ZW2fmLAnlimUZLc0DnBG5Qkv6Vy/IJnPiBb5K1437n0Nr7Ihb3QvyHW8IOLut6reclX/ox s6vM= X-Gm-Gg: ASbGncvyQh4Pry8yDqBrr6OGve5vtKCJIytP9/6w9RlcOLtSYb3tOT0Pkouq6Sf075c EX4j0Z/M9vIgJyq8arqZBZ+Goe/LVcu+QV5QECrXiMvZSwAt8dzTOTUz5DrNNkHIcpmK2/L9b7U QBuTG1xJtafYPjixSoUe3bEzWMamtLvZwogl5YAaxlkaXMt1zGXNnuRKwgnqI3duIGXL2n5+szC LuZxdUkgtg0G+eAf9aFPhGGQZdfa+0wLpTuFNC17a60ploOdwHv2RFPAMcTsqk= X-Google-Smtp-Source: AGHT+IFFu6gkvoS2ssf097/bmNQd0R+9N+rmHS/zomr+xmJTDLze4BCdx+fLRcZNYMoCpt1BYpcu6w== X-Received: by 2002:a17:903:94e:b0:212:68e2:6c81 with SMTP id d9443c01a7336-219e6ea0223mr153789065ad.24.1734884701601; Sun, 22 Dec 2024 08:25:01 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 22/51] tcg/optimize: Use fold_masks_zs in fold_movcond Date: Sun, 22 Dec 2024 08:24:17 -0800 Message-ID: <20241222162446.2415717-23-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885202116116600 Content-Type: text/plain; charset="utf-8" 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 bdf95d1924..5493d76ceb 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1872,6 +1872,8 @@ static bool fold_mov(OptContext *ctx, TCGOp *op) =20 static bool fold_movcond(OptContext *ctx, TCGOp *op) { + uint64_t z_mask, s_mask; + TempOptInfo *tt, *ft; int i; =20 /* If true and false values are the same, eliminate the cmp. */ @@ -1893,14 +1895,14 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op) return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[4 - i]); } =20 - ctx->z_mask =3D arg_info(op->args[3])->z_mask - | arg_info(op->args[4])->z_mask; - ctx->s_mask =3D arg_info(op->args[3])->s_mask - & arg_info(op->args[4])->s_mask; + tt =3D arg_info(op->args[3]); + ft =3D arg_info(op->args[4]); + z_mask =3D tt->z_mask | ft->z_mask; + s_mask =3D tt->s_mask & ft->s_mask; =20 - if (arg_is_const(op->args[3]) && arg_is_const(op->args[4])) { - uint64_t tv =3D arg_info(op->args[3])->val; - uint64_t fv =3D arg_info(op->args[4])->val; + if (tt->is_const && ft->is_const) { + uint64_t tv =3D tt->val; + uint64_t fv =3D ft->val; TCGOpcode opc, negopc =3D 0; TCGCond cond =3D op->args[5]; =20 @@ -1939,7 +1941,8 @@ static bool fold_movcond(OptContext *ctx, TCGOp *op) } } } - return false; + + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_mul(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884923; cv=none; d=zohomail.com; s=zohoarc; b=aaE9RNSn7tsy1s8vICFOmPuJOgZLDFGfYXI5uPNWZkpypZ82Him2ubyrH84KICbuQJgkjwYiLiUCwAIWgQJCAz2t9Cu3M0blL5asKy7rPn6vh5y3v16MU4vFPgGbifXGbsOeybNu0PygQdhb07amG6HFpnYp+vuFwL749Sa3MFk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884923; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Ups559X2JSn0eiwBpjRnVVsSX3OoK0AYX8hamX615ho=; b=QX/UDye2ZHTcKynQqXkw3nMy9X+pECF2hnwob8mztPhENKYXZFKmnCMW21xSdP/cu+YnovHxBU0iGyBSZ5Pe2zUk0559wRjbDRq8zq2BsKYCek8rI7dg5/SEMdlQQIsJfPT14X485EdVPS1zZCeTl8J8bO3ktT8YDzCnXg33BcM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884923128151.09752611124713; Sun, 22 Dec 2024 08:28:43 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlx-0002yO-MD; Sun, 22 Dec 2024 11:25: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 1tPOlQ-0002bC-6l for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlL-000308-KO for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:06 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-215770613dbso22805265ad.2 for ; Sun, 22 Dec 2024 08:25:03 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884702; x=1735489502; 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=Ups559X2JSn0eiwBpjRnVVsSX3OoK0AYX8hamX615ho=; b=U8jfovs3HD6OWKJ3TpkRITcfOLDPLoKuzhMmI5YUJR2+7g4lsYNus6qVUoLfoI23n+ D2QPQK8gXP2tl7NukXbhV7spxNYdiZmIM5bV6tTpAUBAQhJ+q6gtXWN3yFGv0skkRSYi gn/7iRYyz9tynj6dYUAia6sE+SS01Cb0UGS2jdjoSAlvBErJWmP6l6wqfj8f1VwijKGU PrB2E/IFJwa7zzKyzu8lPlskfCz9qbImGD29T5zfm0S7FNY7b0pZVY2SEw12CamajywZ FNF/0oNTxnGjLgKcSA0VVq6B6cajki/IskCztGbFniiWMWRlqB0TGt0+EDkCKx2RhlpK 0c6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884702; x=1735489502; 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=Ups559X2JSn0eiwBpjRnVVsSX3OoK0AYX8hamX615ho=; b=Tw4YVBfPuqq2nFvoLwVwNwa69ZSy3PVbY5CeBKXLGO19FV56q3k7Y0CVpfgR0XLhut M8+EZmo/6qnUJlqQ5ZM788o9QYMdyCdNmOOnvKlx6v0aieuL4uhF03qZBnXsiph6RfRT xVhk6oTBWgdDaVojYLM2MA8psYWZYjiaN7NBkRgGVkQoN0o/1iqL0RfdMDcxMoiM6WxU KS7ATpoERkG3f0iH7g2Xm24Q7DNouNmXbkwY3cpqaZ8ccme2o8SiA+qordvIPEWYPkDR cJPr77mIZ9MHCP3jSAFQ4HLY2+xHZpXkZduoYZv/UW3S+oEH6U69B0nc3nyiMli/kf17 HH+A== X-Gm-Message-State: AOJu0YyCK+JOVC2tQK3hKyRPwHzn+emDy7N4T7n90QlAYJJW+F3VdjFI 0vgxTLm8d5XjrRYiIMVRtc6pTuhhNJajZA24qzOtqiGnUSuAohkUEqALDZSB/VNLvaYJIezZIq2 O/PA= X-Gm-Gg: ASbGncsOXdyO/tlMl4xi88aW526MwkmtyFUw+0EL4muc3XJYqdwgcHppiMjrnIIYJpd Lw3vcI+1iWLtNrC7tgzQbMO6j8ss/kOV6gH53wbfzgKcJPBt3tcXyB0Aj3C5BmZWbmeq0O6i/N7 Nt510kFwFhDlzH/0tdB0Tghr09fjlzd5/zeIZGi8WPtXdR1IFQjPhYH7QnE6PCSF6MN9IXJeInM 5GPkd158CDSVEe2Th0FSUXqJ70lnOGjqtAuKHrbH98KRbV2APza5my1zH2bE/8= X-Google-Smtp-Source: AGHT+IFgX+iOn0GbgahR/YB/Y/52nLlwxQ/Z8SD5HB+hsCz2uFE7hxruSE3nYkJpch2I8Ye7gGccYA== X-Received: by 2002:a17:903:2acb:b0:215:6b4c:89fa with SMTP id d9443c01a7336-219e6e85aacmr130268435ad.8.1734884702183; Sun, 22 Dec 2024 08:25:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 23/51] tcg/optimize: Use finish_folding in fold_mul* Date: Sun, 22 Dec 2024 08:24:18 -0800 Message-ID: <20241222162446.2415717-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884924790116600 Content-Type: text/plain; charset="utf-8" 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 5493d76ceb..93e0f30249 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1952,7 +1952,7 @@ static bool fold_mul(OptContext *ctx, TCGOp *op) fold_xi_to_x(ctx, op, 1)) { return true; } - return false; + return finish_folding(ctx, op); } =20 static bool fold_mul_highpart(OptContext *ctx, TCGOp *op) @@ -1961,7 +1961,7 @@ static bool fold_mul_highpart(OptContext *ctx, TCGOp = *op) fold_xi_to_i(ctx, op, 0)) { return true; } - return false; + return finish_folding(ctx, op); } =20 static bool fold_multiply2(OptContext *ctx, TCGOp *op) @@ -2006,7 +2006,7 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *op) tcg_opt_gen_movi(ctx, op2, rh, h); return true; } - return false; + return finish_folding(ctx, op); } =20 static bool fold_nand(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885136; cv=none; d=zohomail.com; s=zohoarc; b=JBQtt7j0SXD0Ha7TE+mbOpyp1g1sGduKEkqBDsbFw71HcZMotbAQGWFqwWWyIjOLOKlzAn8lQF1vrr5iqgmfgQZSkB2hXDOgKqRF5Jc8oegXY8tAqgzF7/UABcPsViie2mxdsOMXk2ZNf47U1eekVHWSXBwrKZadjKcGxh3X9gY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885136; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=GvuX1N9asvoaUrVFs/iIciZyDLibu0peq1RS16B2DH8=; b=H3Nbld9tqZa6y/LMCN1EUwJxTXg5TsuN9GO7AzFM70jbakNgFYmBgrNOHzoI1Avj/SQe/3PC1XfYPff9+uCflcq8wMJ3ETgTKbzXiWo6HOtpm/c5wgIF5Kwdtu2+Nh0QlepuksZTaRPZeM/Y50pOGNLAbW0LOkYxcy6BSVN0+aY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885136729350.0583215172775; Sun, 22 Dec 2024 08:32:16 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOls-0002ur-JD; Sun, 22 Dec 2024 11:25: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 1tPOlQ-0002bA-6c for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:16 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlM-00032c-17 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:06 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-219f8263ae0so3324335ad.0 for ; Sun, 22 Dec 2024 08:25:03 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884703; x=1735489503; 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=GvuX1N9asvoaUrVFs/iIciZyDLibu0peq1RS16B2DH8=; b=kPz0SC2JeCIVDN5zZ8MviWYaSr72xMO5nTBx0aLWpIPPV2QtOQdX578O+EjyYQLg6p BWdDluEiaSoOOpwdKKJ2iDmDL5d1y/AOJWi6F+lGJgIDJJpN9Imeuy26jQZfjTQtceiu u+BOswPMPttQrcR8HvEsRFbsZpKtQX/ca2sn6qwkCBPF3Ge/xmY84k2axvNtAHZtTE6v 4psqFcqe6kiwe/VHza9ItpZAuga8c3hCG8Xn48nWOlGrX7qH6g9mX/E/yMLxTv+2YmV7 1NngjtoLk/gRi0zUPInG13V2BcJFpy8ZlgCe08/BiwrvU38L3S0N+J4LfK497FacGUEp wj9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884703; x=1735489503; 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=GvuX1N9asvoaUrVFs/iIciZyDLibu0peq1RS16B2DH8=; b=eqM1zbz+KM1flCQ/t48/LZXZZKUGWuDGRgvZXnbprbYQivA93DDbfifCDDFucFHOyJ 5LWNdqphMewxpzolsL9Nb/GNQTwHcdH3jNCbwoD3ZR2/kAan15upVH0bicN8i8mI4V4M aeG9LSUSHiSnG8CKxDaFHQ7tzJVM/oFb2nEDFeKNsARXC+9nLTT1IykWfJvLy8sWvNW/ +MzgRz2tZv8QzoFsbV4eLDDruJyyRvHq69Pma+A1Ypi/rfdoesaQ/j/uYPkx9IsXur+5 Tjj19N4cN6z2ztQztFZosYbFyg1gXfpGXnwz+X1X5VKFnOc/m9PQDvS7RIxif/MNBvHn J4aA== X-Gm-Message-State: AOJu0Ywhg8F6IFQOTrqRveKCptlK13/b8ZYp7Aeix0d7DiciWnYqpSCJ iRg51HcDoIglp90rgWZlX/kAJrV2ykwSI8vGXx0O2D8N5HBbsK9rr2Q9rPK5MF+kVE56+v/TWGs C5R4= X-Gm-Gg: ASbGnct96/auYF+t4YrKyLilDKlZsE40H/N9e7DtsiUlSwzcCumzaF96vjP1HlR4XIA Q3UFsKiBl5EMmGt3AtrWbpuhStLlAF35+WuboB1JI4VMUg54tdaQ9h3tqN+mFfIfr0eqF0I9Z9D k3qcxCGDuzf1IS3VoICPiBpQx0CFhSpI8EQ9qICrhMqtvlOHUkzkjfkgUA73j17DULkFUInMX9v BHaUMpGtH+r4eKGECz8FBnUTOrgh6I1gT1iJ0ZGdG1eRMiKnE7ytjSwTujZU5M= X-Google-Smtp-Source: AGHT+IEzjh55uPg5G+mkIkQDqiOwrGoC1Tek3gcXCJrIUfJA/jXUZSoV8NFBOL27svrvI+gxr0B2sw== X-Received: by 2002:a17:902:c951:b0:215:a039:738 with SMTP id d9443c01a7336-219e6e8928emr142125015ad.5.1734884702777; Sun, 22 Dec 2024 08:25:02 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 24/51] tcg/optimize: Use fold_masks_s in fold_nand Date: Sun, 22 Dec 2024 08:24:19 -0800 Message-ID: <20241222162446.2415717-25-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885137833116600 Content-Type: text/plain; charset="utf-8" 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 93e0f30249..c634c20ce7 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2011,14 +2011,16 @@ static bool fold_multiply2(OptContext *ctx, TCGOp *= op) =20 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; } =20 - ctx->s_mask =3D arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask =3D arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_s(ctx, op, s_mask); } =20 static bool fold_neg_no_const(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885211; cv=none; d=zohomail.com; s=zohoarc; b=k64Jc90bQ357a4Cl2tfpTniAbSMiYW/IRz2iwmrZ2Lu58X5d0Cu1s7/iFDxPk/rhpFqbcgKhaBXjDBIIGLlyLN8ZmtH2ZFCXdaeeRD2xHy5tQbRfvpPH1Sj2mgMawQh4gqRdQzfzHqyAYeMe96Thz8Yii38BrzSQKmdaTie4aBQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885211; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cTlZDQEbmCnE/q3tfirQVkn/D4rnwzelc/2JDrq5zIA=; b=WcZTObW22soboSiJ/OBRR+mI1yI5PUL7emOs8q5+k+bQejeu/u3Rpcbc8nigquhXAYAdIH5pge7ftG7xb2UsYIM6ZSdznW+eFik8qgeXuf2eb5TodYQuMRwct7RtHYdPTv167CeJ1RggkV7sHvppsG/0uG4Q5mhUmvImOYlLSMM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17348852117013.451692391244592; Sun, 22 Dec 2024 08:33:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlv-0002vw-6S; Sun, 22 Dec 2024 11:25: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 1tPOlQ-0002bB-6y for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -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 1tPOlN-00039S-1B for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:06 -0500 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-2164b1f05caso31193555ad.3 for ; Sun, 22 Dec 2024 08:25:04 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884703; x=1735489503; 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=cTlZDQEbmCnE/q3tfirQVkn/D4rnwzelc/2JDrq5zIA=; b=wCRZHSs4sGoaycnQSLFbLb8XDWKSGBmbGgfTdyU3/eKSOEQgh/i0jAk6/owa279hoa pK+gKXF4hxu3qZ4Bfej0sx+l5juiGxEnMUmU6mBgXJwlF732T4RTbnvR+P+Y+V3MuUi5 7aR6TmG4c7Wvdyu6IzY5y5Y36ddKr8tjcN2NJAY1iMyDVqS7g9wO09ft+GlPZwlTP4Rh 78aSSs9gNkcPw0k4HZrjbLxLc88aLmHC6pLPRTvpZw/MVbOtdEF6VAmXJ8xxPap4jCuq 5ZpsypvQRJ8hYWyFEBXcjMI+jTZ2xC0ZFBQNwfpXr0D6+EAr0C5+1PRhmnVoCoPyoR0n ryPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884703; x=1735489503; 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=cTlZDQEbmCnE/q3tfirQVkn/D4rnwzelc/2JDrq5zIA=; b=m+q5hWP3RaWQHDpvlXDGmfvO1n/JpX7CKAFH05jH3yI7UmVgh0hiSGp6TeJtOe26qu spc5f1uFjDRIznDZXl+aIX9mz6HnI512SU6Jb5CRx4kiVV7bHFlZoVssPTmX/K/OyRDj PO9iW4oDMYbQsek2Gq6Hw4Kc/WwCcCXKPIFszFmKCcLgL0ocwvcUWjwNflxFZJrCUj46 UkQh0oY5H3rawPyaROcB2kT7ak6RjLVun2dfbzfQLJHesSWe29fQlQEgH2a11p/DQjdu x7uW9cw2G2RtMj5lciwh5krChNWOYaF1KqWylzqbfsU3l936rygjIKnMz3upTANr6J4M wiZQ== X-Gm-Message-State: AOJu0YwhQeFOd2AYTFdoXDTRPietAWyag2lbqesDnWMp1XeJ/vFpqfns U+QAaIErwQu2VSLY5M8Aoky7w22PX4sYNGByAds5VPhv2+JK60+ev99BxI+BxCsIKHrpAyK5sAg huSQ= X-Gm-Gg: ASbGncsOM1v+i5YQxU3Y54WU0W8e2Mc6BEJuLE5m1xsEOx9bmfxrI3GyEPxc789wkH2 oKjGihsuOaXCBn9KG+YsAfl/tbZxCZnHsEvHX9fAz53Z2CbKVI/hgkU1aC2lVMdZSu1GLTqOyPU JZ2Nf/5UGEWmjuF6KWPS+FNLM4j/LGVtI91BcvbdUv+2lzFRH30IcUaAmOhONzysVQU2yDyhZWo WSpfe7dl1KzmsAryLmnIKqqEuJDQAqvu+lWXfFXyjlnYdXQhobSZDg8xW3G7lw= X-Google-Smtp-Source: AGHT+IE+/7Mu2zjHIn5XmeswryAZYAbFX9ZPI8kCvnbhqJpPs2vVwo4p67FpbBuVcQqLQnF4Bx/uog== X-Received: by 2002:a17:902:e806:b0:216:410d:4c53 with SMTP id d9443c01a7336-219e6f12d6emr142794875ad.41.1734884703435; Sun, 22 Dec 2024 08:25:03 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 25/51] tcg/optimize: Use fold_masks_z in fold_neg_no_const Date: Sun, 22 Dec 2024 08:24:20 -0800 Message-ID: <20241222162446.2415717-26-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885212148116600 Content-Type: text/plain; charset="utf-8" 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 c634c20ce7..98fc5e02a6 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2027,14 +2027,9 @@ static bool fold_neg_no_const(OptContext *ctx, TCGOp= *op) { /* Set to 1 all bits to the left of the rightmost. */ uint64_t z_mask =3D arg_info(op->args[1])->z_mask; - ctx->z_mask =3D -(z_mask & -z_mask); + z_mask =3D -(z_mask & -z_mask); =20 - /* - * 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); } =20 static bool fold_neg(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885215; cv=none; d=zohomail.com; s=zohoarc; b=RY73CGN7pJtqTLJel89dabPxDbQtIdAb01/UlynZiVitOrU4AOi5n+CkXtBizGdybcTAcMHlssfOZShDRiRrkqM9ckSMhcjlA3soxpexCYk2zy9DUb0y3tERJ4WaXMOpkwSS5IS8ZahkA8nsHqbmoxG39z3vXGzhh/h+hwOe5uk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885215; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=kE0P1VyOBIABwqO8UKTPptAdEwwVsrua/XfTwHmi5Ao=; b=QwxafAFhIM56h9CgeVy1t7omp12LHUxdBGYp0dof7uyQ0EfMduDilQwJ0/wy8dA9EdUdHcfSeEnnB1xQwu3VLV399DQBxjfj3hFv84cU25/Ffpoo4cj0gw4E8qAhnRDvm05CBkQQYAurEYCavT6jQl049nf2ahDdtONRX2tL2u0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885215100411.12474567461084; Sun, 22 Dec 2024 08:33:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlr-0002un-Qh; Sun, 22 Dec 2024 11:25:35 -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 1tPOlQ-0002bD-87 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlN-0003BN-JN for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:06 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-21669fd5c7cso31883525ad.3 for ; Sun, 22 Dec 2024 08:25:04 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884704; x=1735489504; 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=kE0P1VyOBIABwqO8UKTPptAdEwwVsrua/XfTwHmi5Ao=; b=I8dpLu/8Jm/zPD73odW1f8Cr21W14KBYjb2WH39rTl4VK88Fq9psMYasxF5CW5Wg62 WgfxuxzUGSZI7L2OPZ8SJgqNqNI+7IpsqHWipAynyb43C3KXW/qjqSk984agNl58X4c1 +1NHh2ObQOfYMzjFp3VJEi7vzzQoHLtSiS66bhtV+mNnMfqw++s8bwJXMP2JkH/Xtnf5 qgYeme39kdKr+sdExw9kqUt184FH+pzJ7UY5kPV6ULayES6C/VvFBrK2lKh49SQWqFZV MYVjqLQnlMuXJNszWUEwxm8DcO4wQuPmZ9fq1rgAg/dpdPvszk8U+Hvu+Q6Ux4Rd2uSa vPHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884704; x=1735489504; 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=kE0P1VyOBIABwqO8UKTPptAdEwwVsrua/XfTwHmi5Ao=; b=NxOv/BoVxiLlcDdmTJW6qfI3fNuS2Nqd1tL41TaxJ5dHl2mOVL/NpUe2sxj/Astf4n daKyHmkPmZYGduRmI8jkbRd7rZeh5StMVbpv9kVmnYRGOxwZoAUmy75mUuA+1xyMpclw Xx88dWhxLNIzPcuqgtYykSUwjXtjh+sqEOEvi/2y/PEBPOagtozmbOtk9q90Bg1gjDOU 0HS0GMAFkhdSCvUk+I0AJOwOHzzLjBr7z4CTfJvXWV55X4neLtEvT5ebQvjMJB3ftchp 8XbST4+jp7LSpO9p4uQ0avc1+bzxLHpzAGE39qjFkkG1yoBgMt1cGLoIsImjzLb3KBlO TUVQ== X-Gm-Message-State: AOJu0YyOGk/zUV97NMWIIbbE0a1p0ZDKYR9LVagyBwrh4ja+N1cqjadk ovpOBJ+r8P6EI9JOXD0/tnveb+xhlBKjpCchUKmt7Ri+eUt9NX0Bd66F4Hr0B58DxKcBuRuqhqV Bn/Q= X-Gm-Gg: ASbGncuyi6lmKk6DRxS/9oNYVfR3m0ClyHO7EowJJmup8HiqKtihzlXCvYoIx1BKyOE Ytmjbnvv3Ar5IXs5kOkTDUjhENPJFQQMJtGiBIc1DdjZzB2ANI9GUNHqn3lMC1cJmcihaz6gyC+ 5rOZcGTiMF6nTmhS7cnLDTdsfW101x/YwuhbxF+YBb0t0G0QTbIUgdUDSaQ5XXxUmTmDPjNPELy eH7gGPBgY5l5QLjjpGY7cAlWaah0W4o24Moy7h/cAFjUyQSfbh2Pu6GhG6rlUM= X-Google-Smtp-Source: AGHT+IEPfkprDV8EhQM1Do7DMI8qiyExjsecgLcr88s6EtLjwrxKLkGZPw29xRMU13fJb1/LoSskog== X-Received: by 2002:a17:903:11c5:b0:215:aae1:40f0 with SMTP id d9443c01a7336-219e6cd8c7fmr166855465ad.0.1734884704062; Sun, 22 Dec 2024 08:25:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 26/51] tcg/optimize: Use fold_masks_s in fold_nor Date: Sun, 22 Dec 2024 08:24:21 -0800 Message-ID: <20241222162446.2415717-27-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885216164116600 Content-Type: text/plain; charset="utf-8" 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 98fc5e02a6..4196de9e16 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2039,14 +2039,16 @@ static bool fold_neg(OptContext *ctx, TCGOp *op) =20 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; } =20 - ctx->s_mask =3D arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask =3D arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_s(ctx, op, s_mask); } =20 static bool fold_not(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885039; cv=none; d=zohomail.com; s=zohoarc; b=Hw44KbkcZW96oyA7xXfxdgGpQB6C/lIfWPFFpjAl8QwHGerBhuW0y1WKn4sVur5IZqTExALndp6QRAp3pP8msz2K3IQQyO3QnrT4vd7Ln+usgI/WtmN/wOUQ7mDbHLOyzWA2NH4UGw9nZBxOJQkgGVjWqwmdm8cFdkLN5KfCjGQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885039; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MHMMCbrUVSen8mtbKytkDiC9qapK9hvp01hmIO9UtbI=; b=ZsAEcq7Fg9ZNPU0VOKIw6N11ju4k9k6Xnewe2uyJi9a739pBMyLGcFKfpKXPTBjq0e2M36TgykWbgJlR+vxURp2Ji5bIp6WYf5BDEMl8WkItt9B0QpVmGfd2vPl7Mwm7IBJEZya1rm5sHgLaUk5jMizL5+KEGG4DvQrvSzqtwVY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885039587327.9224414416941; Sun, 22 Dec 2024 08:30:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOls-0002us-LJ; Sun, 22 Dec 2024 11:25: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 1tPOlR-0002bG-Jl for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlP-0003Bb-N5 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:09 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2162c0f6a39so39760345ad.0 for ; Sun, 22 Dec 2024 08:25:05 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884705; x=1735489505; 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=MHMMCbrUVSen8mtbKytkDiC9qapK9hvp01hmIO9UtbI=; b=vgeEprtI1hGF6jV8uoNRev5/ZcMv9PzeHcY3pmD/Ylnt5BOkXpg+IYW2dm13oFUuNm z0VBno/wLc0EVq9aWr863xT+f5kiKuoSEAK77EPgyaLdF/NipsxXxhqiUABPtuVodCPz vKuR8V7nDi6BTRwH23Vr4/oQd7I5tvAiY72c14PDZSzpGX5zV39CjtVVt0bSSijDvO0p A1UfqzvLFj5LUddeYqRy8yWmLfrj4miblQs5AbkzS55QpDJdC3RI7ndMSsuwgptsyEuR cF5ApZ0FZE585AEnUgAxouZng6z41QL10t38+/k8pX5V38E13zOrRBlVCfo+jCs488hY r67Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884705; x=1735489505; 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=MHMMCbrUVSen8mtbKytkDiC9qapK9hvp01hmIO9UtbI=; b=I7Wjq9t8nrdoJ4/OPzeZHlEZ3NB8LyjTbTGLwS9cob326znn+dPGsBxdk1j8eYWmTu 7W+gGwSqFhvkuTKhFdB48kfnG2sgEc5O/ZslL9XlnlaDkpnb4dm0oa9awE2UVN89Cwte tMpvzdAK+WbrYLc6aIbKbHrV2PqZB7SEFrnopQr9WbHXTrgOFnsCV4KIhycxYgSuuSdy adbmhKsWsC6c/t51ngcIlEpaVfvvtekcLabaEMjoERWscjy2xEHhCqtYgS7QGAUVS/L8 tcJNCVoY87rwFFnBbah79Apyo+mfwREPLETU/yZ5akD0qrzNuMV37nkKy1fUEY8bSw5n Fzaw== X-Gm-Message-State: AOJu0YzZ9PuytKoCwnUGbm08j7AtNdJvczDbRw+71OcCrJo3gVFKM7Ec 8i/vFmlgLrBW5Q1HTjCEPkrkxjauGidcL602LD7khd8uEZ3+3I6TvjiQRtBcLFVUlu8Eu96MGKc DupU= X-Gm-Gg: ASbGncvQZtbVFF8IwIXuqKxGMb+yL4aTml7Hc4yhe4Dd6MuP8dVSer6bAeNvxT8FHOV mDMY4wVzu2juj9hvVqBBrjiJ3nkgujNzH0cWSYMVfDzq8um3vavtAuB3x3IMapbZfB3CEjY0Ycg 5BEW277rwIjZPV4j57xoPnXj5cKZY6/zLkDNe51aOf+yq+BaGyvtwt9nV0FeqvpXQx08ZTiUELM FTgHJJ3dVwScG/dHVi7YpG3m05P56W0R0lHEvgnT5r4D6h6JRWDEBZOlJDGVQQ= X-Google-Smtp-Source: AGHT+IGqzlh7r+rNzIykgpQubOjpHr4wSjr/b+PvlgVJZqkZ/EdO/ULRinS+vd7S2llI0MJBvwBPKA== X-Received: by 2002:a17:903:41c3:b0:215:8fd3:d1b6 with SMTP id d9443c01a7336-219e6d6a221mr154542285ad.23.1734884704696; Sun, 22 Dec 2024 08:25:04 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 27/51] tcg/optimize: Use fold_masks_s in fold_not Date: Sun, 22 Dec 2024 08:24:22 -0800 Message-ID: <20241222162446.2415717-28-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885041238116600 Content-Type: text/plain; charset="utf-8" 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 4196de9e16..e0cb9bf6bb 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2056,12 +2056,7 @@ static bool fold_not(OptContext *ctx, TCGOp *op) if (fold_const1(ctx, op)) { return true; } - - ctx->s_mask =3D 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); } =20 static bool fold_or(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884784; cv=none; d=zohomail.com; s=zohoarc; b=Y+egD/Xzx+GuUDET+ZzvB5tigFxp90iUyFZpj84018lVyrpqpsEj5luEhAyipv/D7DdcXcHDuXmJqrwJFysE1Qpt2Y1hlv+pLynbw+rRZvfN03qU/0XOM2dxPRvsa4nEUAQegBp7rN4SV1M5t3jO+UFq/iHsixyjIXgBpUUG1AY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884784; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8/dcJQr0rdJI2Xiobzyir7j9GYDvdzEIMpyigbQ7PkI=; b=bx4wefm7J7g2DMnouZqID/rXWWqJUJgNn99N6CunFk4KGrSu+pbKZ3QED48W0iWlIh5PT2N1bGw14kfrLQWz63sUzIu/i97BxA0Esu2CrwLEdmDZzy8872F6OrwUtGK1jO0X4shL9HXrF9lC1I3uXAQKARBjfRO8eK9F+thixDM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884784548751.7895374127929; Sun, 22 Dec 2024 08:26:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOm3-00032L-Vl; Sun, 22 Dec 2024 11:25:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPOlW-0002du-BT for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:20 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlQ-0003Bs-27 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:10 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-21654fdd5daso31032385ad.1 for ; Sun, 22 Dec 2024 08:25:06 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884705; x=1735489505; 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=8/dcJQr0rdJI2Xiobzyir7j9GYDvdzEIMpyigbQ7PkI=; b=b3ZpPYsZkp30yZh8gPyyAmfchT3wyUhJNtlp7SzLC932glCSBS6AVbZirQ6Zsk6N6F RZXGkpVniaDm7xMFaIwwV+xxYLudBXgbF/XYPzuUhkF6DibMRveP1MJRaXNXXO7R5FTG 5tL7VorI0xwuHyGYAmYuKur4deud3ZUBRdPSIHhE7IncHtgpnt/Zn7hG1EwJH1K4OIP/ dc2AGd29kGBlQBmNIQmUt0H0EHYHR1smaHe7CtPmcBQKE4rPK6ID6Nv8kaWQLVech99Y VJBZwXi7ea1Sn6iBNSwJ23h4GiU1RZu5eMb5faoT2CSo5Pawj+ItZhrTQcYUR9/zEo7F HFvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884705; x=1735489505; 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=8/dcJQr0rdJI2Xiobzyir7j9GYDvdzEIMpyigbQ7PkI=; b=Scb1r9PnaVLmVQ/389alK8VdBYGE6QhhZq+r4qdhEyM1kVQBYxO8mXN/Rq4dzg+OLk ocq9t038exDw0Kz2XnP/u59qBetNxNkxzffPol6fuoLRVOX4TxjzY3qJRrWCLJIFW2h6 aYmHXvlleT1zOBwz6blXgIbJ1WTE1bW8bLaPOomp8uEv6fHiRi6lpce0QnUdgUY3xv7G MUJNI0Aj+y/JWNdDOiIBpuz/qSnrUFkAcEv4dDcl4p6pjqzusEBbRUcWj+eDUSdAuCat ND1bTvF5LFm9OnWwEkXhP9mN40sJtH8b8Ue8y6S7AR4cuv8JsMHSCpICaf7wRQv7viSR 3Q/g== X-Gm-Message-State: AOJu0YzLUPKRfRyNPXsBixGbK7xMEGmgfyatkzGdMjjHNA2M/fZsvx90 +jrnpS2F7wUsXEUKQwnWl+JMoWDe0jAJ6xsWCBaf9lTC++WcJAbWKVPlrpQGLLA0cTahaiS42dr UZAw= X-Gm-Gg: ASbGncuwMalY+1fWu38j9MTRX51kI69DQ6Mmc9wci3Foi52P/SbIi6ltmlHkgzhPxgF /RPjPqvn4nllh4LG7hF2ZumeFc/7WbvGuBdSUD5nWnspgk/4bxiqd+PVMD8TQjCSf4sPpCpkbyX n6s+xThBFxWhNiAuag+jY2a8pJlFjtp9mFmaGJxJE1n9XDI3qF2etk7UlRwIk4YjCKKPM+6OQzP kMXwylFos0eBU5qI/jzWlaOoW5OOFlO7l5afylxoKZ5CAH6mRICYycCe7HB+Zs= X-Google-Smtp-Source: AGHT+IHyNeKgF8uf7+S5RCxz88KqEQCg4swOnI/rfK8U7H6ytB2oFZil375FWd0K/Qyhk04o/+C/Tg== X-Received: by 2002:a17:903:2346:b0:216:3eaf:3781 with SMTP id d9443c01a7336-219e6f2eb9amr150603135ad.43.1734884705266; Sun, 22 Dec 2024 08:25:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 28/51] tcg/optimize: Use fold_masks_zs in fold_or Date: Sun, 22 Dec 2024 08:24:23 -0800 Message-ID: <20241222162446.2415717-29-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884786214116600 Content-Type: text/plain; charset="utf-8" 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 e0cb9bf6bb..060d7153f8 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2061,17 +2061,20 @@ static bool fold_not(OptContext *ctx, TCGOp *op) =20 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; } =20 - ctx->z_mask =3D arg_info(op->args[1])->z_mask - | arg_info(op->args[2])->z_mask; - ctx->s_mask =3D arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks(ctx, op); + t1 =3D arg_info(op->args[1]); + t2 =3D arg_info(op->args[2]); + z_mask =3D t1->z_mask | t2->z_mask; + s_mask =3D t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_orc(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884783; cv=none; d=zohomail.com; s=zohoarc; b=b7hT9NKzHdXMqIHq1IpN8AKHAJeriuKCkRiJZE4MTJM6VOmSLXj7pcMEf+b6gb9JD9mzGrweE0TcgbxuYuxigyK8XQ8X1Sg3rRZHebcVn3LoNrazGOsqZf8QGWf5j4fR8FCApmNNxNbqCCcqKj+V8eouxbR0Mfz3/mZ1l/lCekE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884783; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fmhbhKUJPod0vBWmwZkZZRj8BUKwUG33IfyQB/0gkVY=; b=NkE5yYMxorTMcZdDexZ0fdgPcxERvgDWLXeSJUVUIN9vQyZwctjHkMz+WE/kJBK42pC72alvH3ybRin6OyF1Q0589UrxNqKnqOKCUXO6McMDZf54HDFFzxrS72p+aCCpNouAuqbGytWYgoNJz6Z+utB5rV7HffCQKJSegfUFMMA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884783078573.2507626367767; Sun, 22 Dec 2024 08:26:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOm2-00031j-KH; Sun, 22 Dec 2024 11:25:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPOlW-0002dv-Cy for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -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 1tPOlQ-0003C7-1z for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:10 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-2166f1e589cso37250775ad.3 for ; Sun, 22 Dec 2024 08:25:07 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884706; x=1735489506; 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=fmhbhKUJPod0vBWmwZkZZRj8BUKwUG33IfyQB/0gkVY=; b=PDRLUG46HnHXGsRbJCauvkMU4MS70Dm7tZL/q/8zxI57QLMF30atzHHdXDgo5/rC1F DbOTL2dkT4ZzpDtyDECU+7IRtI8RmlwpAh2wCjmGZI/U/XoZfEspw8qKBs7RAKornsEw x9yEVLWxRWiGORroJjaPaZr8qsLMub1+XRQM0cLEEpu02uw7GO5BfFL64awBBf15GlJe p5Omvm2pjycN5VZBNLm7k0ysBMVPrXS9Jqo3sKWf7skvJrYwHnIrzuqH6hxtKINltoXw R4zyNgCXcwrZVVdIcDWuDKruHlxj/YNVQD+yPvFKDognf0dUOAp7ti8Gh/+bkl6XqVqT aYMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884706; x=1735489506; 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=fmhbhKUJPod0vBWmwZkZZRj8BUKwUG33IfyQB/0gkVY=; b=ioHmNneIMhPngdav6WXXM/mZ8MLxcuRCT5Ly1IR0SjjRHd+FvAzoUVJO/CkuPuZ0SA Eiw1GL1SM93SwycE1XiskbdIJLsYcjLN6VWv9pD2TqgN+oyLpJqxN+VyjidVSyBMj1mq tFXknzIC5RekGU+wVSboNjpccZL/tyA511v7eEd2HkkJvfN5wT0SzgvYf07klRF5fXqa qclFA3c075cF8oRug40TUGEYKFnnu4i/dEn/zQv3abbqx638niw5g9r/zQ7zSHhxWSA3 ETR6ZOhczaPJR7KW48NyV0YO7+0wZgOAFC+KtLSnTvr9xcyjexf+vIMwsGhlInMzvenC isew== X-Gm-Message-State: AOJu0Yw4jfkWQTq5lASdfZSmBiowHoqVzDo4BC+TxrTqpdnQp9ZwdVK0 Zw6toHeebOQz5hi63ACHRSfIUgQR6R3mUbo/OdR6d0sXvweDXoIUBlghanziDPOsNmFDwL8MZxJ 4mT4= X-Gm-Gg: ASbGncsLNey+KnVtjSknoWQ5vj5/ptNEhAgNksmbLtTJT3uCnTwXtCF6DkVizxbhG/u O+1eCnSgS6Jb1/YWXTwgqwpgTnHAAXvJuH95OKVA6j8oHEngaF58uCGBi5fysKsRse4JghMmiPj bHGn2yJhnRRG8w9qJLBMQWAVp2eXL09U9Gzy+QxGXyRytOsNtPqUrZs4JTcatLAAT93L5SXX9pM 8yaOMY7Y4kroRM2l3KUz+33CJKJp2CuqfELUIss+vWNGu9N2DXyaJmHhsTqN4c= X-Google-Smtp-Source: AGHT+IGrM3ak8uRrtY38pCgKW+7syEDdAgMZA19obxsc1C8xgJy1ARQmFiaIlM/tmp5OjeP+inKjuw== X-Received: by 2002:a17:902:ebc9:b0:216:7cde:523 with SMTP id d9443c01a7336-219e6ed39d6mr156213035ad.32.1734884705910; Sun, 22 Dec 2024 08:25:05 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 29/51] tcg/optimize: Use fold_masks_zs in fold_orc Date: Sun, 22 Dec 2024 08:24:24 -0800 Message-ID: <20241222162446.2415717-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884784245116600 Content-Type: text/plain; charset="utf-8" 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 060d7153f8..c1305e9eab 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2079,6 +2079,8 @@ static bool fold_or(OptContext *ctx, TCGOp *op) =20 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) || @@ -2086,9 +2088,9 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) return true; } =20 - ctx->s_mask =3D arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return false; + s_mask =3D arg_info(op->args[1])->s_mask + & arg_info(op->args[2])->s_mask; + return fold_masks_s(ctx, op, s_mask); } =20 static bool fold_qemu_ld(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885083; cv=none; d=zohomail.com; s=zohoarc; b=Y+N5iIsw+wJFvhtPARGrL8UDb87ieA8RRNh/LJykxfZXYQ7MCNgzQsNfyfE2jAgqO38kl/fY6NgIgf9XjaLaBvGGgJQSyRaVReXWkFjF3Gx0U5gMEsGSVlpb1dX+G3CuXu4zdSD8tHvPnhLGQdg5ocLY9gHockDNCcio12fdypo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885083; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=klMxP8/nueO2LoUasMDvvsH0HmT8kwTeat8aAub+VXg=; b=Mr8tEXjtrWATTF4dRgH1vrwqL4sjrNI2JzEx9kJ4fUdzSAYOEWe+aFKXMJpW2O7WApmd2A4MKu3i7MU6LIJ6SFR6xOKTY9kTuC+asv/xxnk2dEXS+oxpjg47bOJ5MB5MA3nchiDHooZFbl/ZTm+13nTl0to0xfms9tNxx5+5pgc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885083665639.6681983135642; Sun, 22 Dec 2024 08:31:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlt-0002vB-MP; Sun, 22 Dec 2024 11:25: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 1tPOlR-0002bH-Jq for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlP-0003CE-Vc for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:09 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-21636268e43so39251525ad.2 for ; Sun, 22 Dec 2024 08:25:07 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884706; x=1735489506; 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=klMxP8/nueO2LoUasMDvvsH0HmT8kwTeat8aAub+VXg=; b=YesKbA++hU1jN8rouZyiGTx0yQxwNozKiDjEFX51at37MyJ9dZd+JnVX9nOhSs7kwS FzvHlGNCNNgFz/anRB1ROFUjJWgUC5LwjKFK5YWg7hRoMRrR2rGd4M6yeMgHBUX6yujK FxNcR9lLRodDpa84yYY77PArDaFG5C0C+HBgQhGwkoy4Q3t7GffpEZ3p0A25aJ0KLUKw /6wqqK85MTE2QF6Iuan/pK9L3l0TlI1QYLLnzGRVt7iTz9ojUuLM5L0c2FIyMw/UqRWO Fdq0aEcpKEL2rk5vBMs651A632QkRKBhZUzbJAFlaYqUI01ju8Ec/HWSWpvZFy4tbhIU Bkgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884706; x=1735489506; 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=klMxP8/nueO2LoUasMDvvsH0HmT8kwTeat8aAub+VXg=; b=SJ3paayBf+HbKbH8TAP/ulEWT/Gwt9i4qE/dZTizHhNWJMUJAEqqtIIKRG6h9S3AsT aP81nNlF5dnnzRfk9htHN8FUR9YMs2lWh4OnoXe5hszcTlGsK96Wr7Lef930So8KUF// XkjO7aNl94gQqI63bMo53v17uQq80VfbZUUYP4Bj+LIWtKCPcQ3SUK/ePKkiK9BtAQ4Q OuhVuVO6QHYlA/Ozf8EmZo5YHBZ+vaPOQobKHcZNtmLXl7fD8oa/T0P+bQU9KcIJapPT y1z6kRm3Mv5D1NvMIWbvMjTqhnEuMDH0K+uZ9L9nfDrfbzUF4O5BVB1ihScp3F5uxzYC d2Nw== X-Gm-Message-State: AOJu0YyrBG+kXGdPjzO5BrL8Y5msi5QvA2TriUBj+GfSkk9k8AD32Nu0 /WKR6MBH4EgFZubGWnjyjPFxZCTHxwFEGYjdH8c2hsSBz7t71VdTHVLMJJypTEnP5RUdgLD6en+ B7uI= X-Gm-Gg: ASbGncvkNIi+Yz1VQYZqpoLNMsXjYbvBwcJOfQ02L0D+YqKPsnI4a8vTbHcoRNkgSc0 3EHLZ4v1uVhwVPZwc72c6W+8/Is5cgIpczyz88spvRqkMycUDO0agO88Qq4dPz03pibJYsR3VXz 6EUh1Sz95FgVYRMF96GXrp586BcoXdN1MO3UZy8Za+KTc1mkBkFq/sy8LBFcmCcM3o8fNh8ZNrV EH4Vk33QP20RtfoWsVWXCfR/kFmaRaHetkhtHcOSt9iWE/fk7S8PSnudlF/ecQ= X-Google-Smtp-Source: AGHT+IH2CFjtOlhmGZVT12QWM/jpkYdW2zC93s3Ohv/mDbX0CZUADNwKH6QtsstDN3JqJyOw4iSJiw== X-Received: by 2002:a17:902:ccc7:b0:215:94b0:9df4 with SMTP id d9443c01a7336-219e6f283aemr156292645ad.54.1734884706590; Sun, 22 Dec 2024 08:25:06 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 30/51] tcg/optimize: Use fold_masks_zs in fold_qemu_ld Date: Sun, 22 Dec 2024 08:24:25 -0800 Message-ID: <20241222162446.2415717-31-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885085623116600 Content-Type: text/plain; charset="utf-8" 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. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index c1305e9eab..0eeff6c6b4 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2093,24 +2093,33 @@ static bool fold_orc(OptContext *ctx, TCGOp *op) return fold_masks_s(ctx, op, s_mask); } =20 -static bool fold_qemu_ld(OptContext *ctx, TCGOp *op) +static bool fold_qemu_ld_1reg(OptContext *ctx, TCGOp *op) { const TCGOpDef *def =3D &tcg_op_defs[op->opc]; MemOpIdx oi =3D op->args[def->nb_oargs + def->nb_iargs]; MemOp mop =3D get_memop(oi); int width =3D 8 * memop_size(mop); + uint64_t z_mask =3D -1, s_mask =3D 0; =20 if (width < 64) { if (mop & MO_SIGN) { - ctx->s_mask =3D MAKE_64BIT_MASK(width, 64 - width); + s_mask =3D MAKE_64BIT_MASK(width - 1, 64 - (width - 1)); } else { - ctx->z_mask =3D MAKE_64BIT_MASK(0, width); + z_mask =3D MAKE_64BIT_MASK(0, width); } } =20 /* Opcodes that touch guest memory stop the mb optimization. */ ctx->prev_mb =3D 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 =3D NULL; + return finish_folding(ctx, op); } =20 static bool fold_qemu_st(OptContext *ctx, TCGOp *op) @@ -2995,11 +3004,18 @@ void tcg_optimize(TCGContext *s) break; case INDEX_op_qemu_ld_a32_i32: case INDEX_op_qemu_ld_a64_i32: + done =3D 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 =3D=3D 64) { + done =3D fold_qemu_ld_1reg(&ctx, op); + break; + } + QEMU_FALLTHROUGH; case INDEX_op_qemu_ld_a32_i128: case INDEX_op_qemu_ld_a64_i128: - done =3D fold_qemu_ld(&ctx, op); + done =3D fold_qemu_ld_2reg(&ctx, op); break; case INDEX_op_qemu_st8_a32_i32: case INDEX_op_qemu_st8_a64_i32: --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885146; cv=none; d=zohomail.com; s=zohoarc; b=OGbwjr89MfqtJH08ZwxO1Jd5wLND7xP1AjOGLEy/jc53aDbHSzEQnVbU1wCGqWsq+zr2NV4Kby8cnPVeWVnqtVGbMfoSmdhOZeG/OdPNVux7ETDHFXidfPO//oiGNevL/kdXuRGGJf3epVvdx7PEYYJ/2KCrfuhEyyxOeAVD+2w= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885146; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=dR1ZJoylRY0HbnfbKvrZnityRIGONMEzA8Dkw7xL+N8=; b=S3+FaVmXKFWhSe1dNb0iTisd9Gfq7kR6LorfWJB5/azsbXN6ZN6UU6RYHUetv/5DaBGXcFs450S/epEVJ0mJ2ReadKoc81rcPwB0foBo117z8sIinDgensy5y04Xp7Z/nNVayWvtbGpdnHs9RI/3BaHvrSrv4m2vYUowH6mUGAc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885146074222.89972564054972; Sun, 22 Dec 2024 08:32:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlx-0002yP-Mj; Sun, 22 Dec 2024 11:25: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 1tPOlW-0002dw-Dk for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -0500 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlQ-0003CK-O9 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:10 -0500 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-2165448243fso36705735ad.1 for ; Sun, 22 Dec 2024 08:25:08 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884707; x=1735489507; 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=dR1ZJoylRY0HbnfbKvrZnityRIGONMEzA8Dkw7xL+N8=; b=hfsFOujuquOPOnOzFcRlIlUeuEJ0Q38MBlB2Z3cKoif5w2cmWCkoexshlBBUZd/AlT n6Tk9+20oy9QY6rvXse2A56dlYpJBUwvpWBVETylBXyutEXTtMM/nB9KuEJZ2+1emX81 2p8VvChCkmyYBdXkC1IABF7mIegUFTRrqD5u6i/jZA3gHm8VriaHpKD5zYQt9VOum1jw mP8Y9DHZTGSYfgJ8AkS1JUU5UY8/9lXitqJkCPUXJv5tR8CCYaEKZqrVXZ0rNOQz4wow YxPwDdbAbNGpX8dDgNExYwnJNpXjywUG8bOWC4v/R4rYLdfLr1EGoWw6jxD8e031/dbL Sj4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884707; x=1735489507; 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=dR1ZJoylRY0HbnfbKvrZnityRIGONMEzA8Dkw7xL+N8=; b=cS1HjMfj4v8QezCOmfESe9vQjBQct2E+kHFklJ3iJ46OtI5VnBWWcHHs6NxPzmUfPT a2xVXDfsdVo2ZCD/bvCE+gracbgKaHB2iioPc0jQhfcqnWNYPin2Atw30Etsp4rBBxZD 1bG9nDwZTWvxjx17BXjUSNKgxDE4izG+YFL3MjZi6mKzqLS6doJYFaZdXxNjnULaRdgC E0GWa1fvXWYE0rbsP9C5544JuLPkmc0kHG9ipBH9Z6Su9S2LAs+mzA2gebqDq9yESvVn ofARws19jYVa1Rlae0iY+tuxsz1VwDtL3YJz5KH50AFU2VZ6Eh/9eoW4/n6r1cus0cet MB/A== X-Gm-Message-State: AOJu0YzpXeFOzXkbFjfPe2h+RYoFx/qQGA+MUDbkJZ4DjjtmStPn8J46 6tgnBkUgVjFjRb6XESCGatFlFk/NyKVtW/HQR0lRXheaQK2KhvilSIWWu90+pBrX6xGEQgR5RFG m8Mg= X-Gm-Gg: ASbGnctkzlDmNqb0yr166ZgkdkrzxYXaAW0oMJaTJ+yo885R5y63lPgBWs7eM5Bzrvr P0ssoFCMSXD5ovuyvE2D4dk3Hd3UDSd/KXSjLgiuAIWhSC7FNLC3LRmJq+H/X91dqN2ZLVc4NWS bs5jxc88UPhN9SD2dcG7nIXsGilDMTAJf4iCFEh9lsL8nsfCfYh1m+e8aTwSYEl8m6VQ6CTU50J v373vNm98Ulq6907Qd39K9UX1MGueB37vgfwCH/ZZHDJtcyQGbreIeHolnFWbQ= X-Google-Smtp-Source: AGHT+IHL2DZO0S++edcls+HpI1TqtVaxaDIdp1Pr+WYYDSBFZmUBYpXoNnOP3rFpM2KcVjTBix0OWw== X-Received: by 2002:a17:903:2cc:b0:212:5786:7bb6 with SMTP id d9443c01a7336-219e6e887d0mr124235135ad.3.1734884707433; Sun, 22 Dec 2024 08:25:07 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 31/51] tcg/optimize: Return true from fold_qemu_st, fold_tcg_st Date: Sun, 22 Dec 2024 08:24:26 -0800 Message-ID: <20241222162446.2415717-32-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::635; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x635.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885147961116600 Content-Type: text/plain; charset="utf-8" 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 0eeff6c6b4..dce68ff2cd 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2126,7 +2126,7 @@ static bool fold_qemu_st(OptContext *ctx, TCGOp *op) { /* Opcodes that touch guest memory stop the mb optimization. */ ctx->prev_mb =3D NULL; - return false; + return true; } =20 static bool fold_remainder(OptContext *ctx, TCGOp *op) @@ -2689,7 +2689,7 @@ static bool fold_tcg_st(OptContext *ctx, TCGOp *op) =20 if (op->args[1] !=3D tcgv_ptr_arg(tcg_env)) { remove_mem_copy_all(ctx); - return false; + return true; } =20 switch (op->opc) { @@ -2713,7 +2713,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; } =20 static bool fold_tcg_st_memcopy(OptContext *ctx, TCGOp *op) @@ -2723,8 +2723,7 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGO= p *op) TCGType type; =20 if (op->args[1] !=3D tcgv_ptr_arg(tcg_env)) { - fold_tcg_st(ctx, op); - return false; + return fold_tcg_st(ctx, op); } =20 src =3D arg_temp(op->args[0]); @@ -2746,7 +2745,7 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGO= p *op) last =3D 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; } =20 static bool fold_xor(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884881; cv=none; d=zohomail.com; s=zohoarc; b=nS+7kTfFROat6LCofKVL0udykXiR0LaXK8ltJ3Mdsp1AG26PYbJ6I/QHGADT1W8ykIJ514dyyN6SF45MS/FVXmK4aKIeHHUsUBfID1ur5gurKu/ehohjVtEOY/Qk1Lye55EiXql8E/0ywlgY3fFOuAN5MrJ9ZLELcVgyvcpWxTE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884881; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=VUYADiY3+WTGRvCL/U/4AVuD6yzbpDWFFsVQejGxj8k=; b=JfEihSNV5H0JJmOXi5byKHft7POOjRKbxtqHc4IfarfqmapEilI0pxPy/8W3tL2AHsw5wQFLCF+uziw/ceS5b841IGEI/sJ55nwWEFAa1mqHfmOD93LKWIO1lOFxoW49ijNL/zg2LriVx91yxAsvkXG9Sd9F4yCmA1sm61tInuE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884881041506.86785069567816; Sun, 22 Dec 2024 08:28:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOly-0002ze-RU; Sun, 22 Dec 2024 11:25: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 1tPOlW-0002dy-JR for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:20 -0500 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlR-0003Cf-CF for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:12 -0500 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-21634338cfdso44206715ad.2 for ; Sun, 22 Dec 2024 08:25:08 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884708; x=1735489508; 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=VUYADiY3+WTGRvCL/U/4AVuD6yzbpDWFFsVQejGxj8k=; b=LMQfckOasfIFv+UiEp8m+NXgs0Sj4aUg7uDCIyKeen4FRBjlug4yIoe8hbCET7aPeI UxByj+VT76hqdoasZ2+NJFtMU7fKEol8JHFqk4m20tQN9usDOawVUC8aJqD8O3Gquth5 4rYhnUIj5A6OkpBzK2mlKIeaUJ3sdE4rl43nAEurIMCdqX0+Qlu7QgZpi4U2K4kN1B/W 3SrIsse4olVFgnHMnnZ3pfmePGx+x30ZS/btil/aM7lNtTg+ewBH/aoS7L1OBhVGNFYG 0Rhd1nn3WBmIjirKK0RkjBw+qeyzZ61colZyfJAa2Xwx8E31rLYtpncIvQT5DBMkms/k ca1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884708; x=1735489508; 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=VUYADiY3+WTGRvCL/U/4AVuD6yzbpDWFFsVQejGxj8k=; b=uR1K4FnY9cWlrr94+3FKTrDTnn9AabGQkM1MbAY/OQFOwj21wsccpXmG/MXuGU7D5/ wqXlCjotu9N/NhaXKX+WyygC6Jt/ELVnFHN5PqMI0zcBrcpzF6wCXY+JSLXkjSvZIgMO 72CWGkme9Pqo11hNTxa9xo5/KZM3bXJvaVSMGlvYq/d7Gy8gKx/192HdXF78X4rx0JsU p7d9HWvSFS8SO3Cd92vJyZlcJ2FVDXTtW9AR8pR38smnSI52weX+4gQ564hi0PFNsUsx eKb2fvSStDtH/TRqg5YXJ5Q9GQ/d2iClKbanGDH4hqb4VnWFzATnlS7s9kGoKckkBxsU Qjvg== X-Gm-Message-State: AOJu0YyU/JAfMVe6ubiGFP0nCF5Hzq1XN67yhMON+GfzyWJLnRWNuBzx /I+VVhswSCBPDavC4g7XE/M+oq05if1n/hcpZgvSAxNHk2hO5mKtlkHy8kKLTQYzeg7U92Djtfc +gx0= X-Gm-Gg: ASbGncuYg8ywAmy4T+nfDgmn6KZwiYpqhTcgYbJUfvSRXAUORGCMmaA0PGaW+yT7jPf TJyyMCN2bMIpLb8/nXThc5WgowBOkAe7nbjBTuXvnLNyPzg2lnMBeirZ6yMhbnGPzZjrEMkDrNa KQ4mGIausZjZ4cubDXFX/Eu+dG2IDtpw0mo1D8S0fueq1aU4/hDm4Ti/B2nSKwJOm5B00VNNUJe QfkS3R/mLUM36sf7pdy6ZuMnyB9VGXu8CaWqlX9vI16d8QrI1p1d3Gipe266OM= X-Google-Smtp-Source: AGHT+IGiI91iCt3xVyQiwBGeonJBl1If8r9zgeV7ydn5l6dXhYSPI6p1fO/4bINLNKi+gbmLuychug== X-Received: by 2002:a17:903:120d:b0:216:5af7:5a8e with SMTP id d9443c01a7336-219e6ebdc17mr141166635ad.26.1734884708146; Sun, 22 Dec 2024 08:25:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 32/51] tcg/optimize: Use finish_folding in fold_remainder Date: Sun, 22 Dec 2024 08:24:27 -0800 Message-ID: <20241222162446.2415717-33-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::630; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x630.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884882616116600 Content-Type: text/plain; charset="utf-8" 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 dce68ff2cd..c44356cf73 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2135,7 +2135,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); } =20 static bool fold_setcond_zmask(OptContext *ctx, TCGOp *op, bool neg) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884817; cv=none; d=zohomail.com; s=zohoarc; b=jN0sjabwDw+HADCvpFw2CJ/Nc+PI2zyzy/QnW3aAmkLXihcIccWhqQJ7zMtVt0Wzrf71Hm3JkgRFSTi6gH4kvvyz/MOWsRUCpUz/rWZI356AImfjXwYDG0XlTtGxZRPOQYSNXgBc8ACa1xBSObSToOsNN3YskEBhArhD0/IuQPA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884817; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=4BtN01qHf4NStr5HfnCgLN4wWtjyN28d7bH0qA/vFoE=; b=RAyPz2n1he9OsM/TTscdksB8B8LLNhBD6pXn/7poOxrk0aYFcVHEX5ZBZHTMZkORtRD9tOvDhqjtDd8+e68+cAC7LBJ7uDkYH1aslWSDgPIrb5lacIsTJA33L2BPb0QRM5JcCGT7K/bfsSoBUWSXfU91+nCNMHuHBnVlPIKtS0w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17348848179641005.166075940697; Sun, 22 Dec 2024 08:26:57 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOm0-00030o-R5; Sun, 22 Dec 2024 11:25: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 1tPOlW-0002dx-GF for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -0500 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlS-0003Co-3A for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:12 -0500 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-21644e6140cso32702085ad.1 for ; Sun, 22 Dec 2024 08:25:09 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884709; x=1735489509; 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=4BtN01qHf4NStr5HfnCgLN4wWtjyN28d7bH0qA/vFoE=; b=FuSoE+23Jmwwi8Uk0VsqhCjWo1k+JZru3SXVGiKY9a3+tW4WnqEQA3FbNLQRmOMDv2 qTAHCDGMCHGRZn/En5dDxmenxddcbF/1d5FiZ1i5+vYOl8VbYf6cf7mmKbroaQbIT7nM zZL9giDj9Iq6yAXO0gDtrUNd6mMHkC1XNcH9l6dgK1SdZy1Lih3mNHdcl9nccemxV//w 2e1O2tE0khtK5XxdIDX71Bw2V7ZylM7lMcnwfEdTFY90VHn7HeHmtJGy4f0pBzGSLE5L QUQBFgpE5Pk0qKzWdgwE4N7qNI6ajB5IfR3Bil1PUxQNoGlGt9X7eU7L9B/Qvi/xAYu/ KhNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884709; x=1735489509; 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=4BtN01qHf4NStr5HfnCgLN4wWtjyN28d7bH0qA/vFoE=; b=cfuIE/m9oR3CXD/fXDx50I6doA5Qj7RyeuICKI4M/PnaFNX9G10lJ+B2Ijrv3bqysU XD9uiwOL3Xi0i+Jtk740knyD+wgG2r1Z6w19pUHv189zyO8hoETlTUmn7Wvm22mIK8Dx cM5wZex3Fu3VjRXAo55LJAxvj0QZS3evX+lcauHcAu55MQMkcf2FSGTYxus7+RtlWwUp K0Nei87k8hHWK9Q8KjOwr6xxGZxGbvpud8kwJxKBp4zC9hd85HkTQ6lO6ycE0EbHnVtD 8Rw8bJtSioDGDigiTlCxC8j1/o8S5X8ipeZK5Qp/rK5s7wXOz5px2domM4sGVUnWcNF8 iviQ== X-Gm-Message-State: AOJu0YxXlCKwkCxUFdM81QWp43Jjx1Ff+d/B0SIINSZgpe5Iw4fQySdv aHL2vV86F72SylFx654Vat0jpu+qSYCS1xDxPPGefPCui1Us8O4zK7M+jh9GDXREJ3OTqHGpc69 hy6w= X-Gm-Gg: ASbGncsEW/CYXM0yAMsBCVtF87753gMt5tdQjEo+vyLBqM7NcQhR+W6usAWcfIMki3F Vt1jJ+VNwZblN5n9NMowrzcNbbLY1sngunGQUkl7vsDb8MgPfWCQqgkN1stx7BXT6lSIDtYWgZw ONe5P9teiia8BdvGBRnA1mCXTMYG41ttVxEo4CA0LzdqhnzsB3FSn2h5TtMUYwIgvrAU/fi+pT0 0etk/NboqNO8Fw2JjUlErEjVJFvQUG3VyT+VDjFLla0LB4TtiSHY1PzefJpErg= X-Google-Smtp-Source: AGHT+IH/5/Yjj8yZqPNviJpNCz1qXYJq5tSJ2LY0w09UCqmFJJUr0uyLHw/zpYrc3Oh4Nfn7bp8Rsw== X-Received: by 2002:a17:903:3203:b0:215:5d8c:7e43 with SMTP id d9443c01a7336-219e6f497b3mr137446965ad.54.1734884708780; Sun, 22 Dec 2024 08:25:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 33/51] tcg/optimize: Distinguish simplification in fold_setcond_zmask Date: Sun, 22 Dec 2024 08:24:28 -0800 Message-ID: <20241222162446.2415717-34-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884818379116600 Content-Type: text/plain; charset="utf-8" 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 c44356cf73..b401287ce1 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2138,7 +2138,8 @@ static bool fold_remainder(OptContext *ctx, TCGOp *op) return finish_folding(ctx, op); } =20 -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; @@ -2233,11 +2234,10 @@ static bool fold_setcond_zmask(OptContext *ctx, TCG= Op *op, bool neg) op->opc =3D xor_opc; op->args[2] =3D arg_new_constant(ctx, 1); } - return false; + return -1; } } - - return false; + return 0; } =20 static void fold_setcond_tst_pow2(OptContext *ctx, TCGOp *op, bool neg) @@ -2342,10 +2342,13 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) return tcg_opt_gen_movi(ctx, op, op->args[0], i); } =20 - if (fold_setcond_zmask(ctx, op, false)) { + i =3D fold_setcond_zmask(ctx, op, false); + if (i > 0) { return true; } - fold_setcond_tst_pow2(ctx, op, false); + if (i =3D=3D 0) { + fold_setcond_tst_pow2(ctx, op, false); + } =20 ctx->z_mask =3D 1; return false; @@ -2359,10 +2362,13 @@ static bool fold_negsetcond(OptContext *ctx, TCGOp = *op) return tcg_opt_gen_movi(ctx, op, op->args[0], -i); } =20 - if (fold_setcond_zmask(ctx, op, true)) { + i =3D fold_setcond_zmask(ctx, op, true); + if (i > 0) { return true; } - fold_setcond_tst_pow2(ctx, op, true); + if (i =3D=3D 0) { + fold_setcond_tst_pow2(ctx, op, true); + } =20 /* Value is {0,-1} so all bits are repetitions of the sign. */ ctx->s_mask =3D -1; --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884851; cv=none; d=zohomail.com; s=zohoarc; b=gi0/5DUXHW/GUU5YvzVxtxcQowOaRX4FVsLo/ZlH6tvyirFufo1xA5KofgzQqhZQITGTBx2Uz2aQyZcv3VdGVa/5doWX37O5Ao8YVdY3t1rhEymZk0IKVYb4pDIa7zx4uhCPTwGwesyHroJ8Nz4l/+4zoTP4SpRtwVMQjRKHMGE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884851; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=6hWcsFdWHMNsqmzeIjMIP3d8ROfJVABrtxubsRYeHio=; b=csdx9FJO4PpOPTTdMb9VfFgNw7S4h98pIQLTL0Tm5N2gKP5JEEs2WUkHtiaEYU9+5SpubyouGdYEmvLsZOTHKoA6YcjylHM6U3PGcoEzQZlb538+WHOjdvn+3Nfz6hDG4OCQ7gXDSQuDNqAoKbwxkhHUYhqN6RjZQ5pdi9ukjUM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884851852398.3621441877972; Sun, 22 Dec 2024 08:27:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlz-00030X-QF; Sun, 22 Dec 2024 11:25: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 1tPOlX-0002eI-Jv for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:20 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlW-0003Cz-2R for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:15 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-21649a7bcdcso31421435ad.1 for ; Sun, 22 Dec 2024 08:25:10 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884709; x=1735489509; 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=6hWcsFdWHMNsqmzeIjMIP3d8ROfJVABrtxubsRYeHio=; b=bkmvbxZVnQ/j4Efq69bq/mQ0XFuuIk4jkzaQnRh3icSGIoGcq226WnvDZv8cncfp+F 1IE6CLAqNzgOCU9xGjt+z6zfqIZiRLgBhXNE7k2vHj+IE+yg7QefgQHf/tZwJ5vBNf3V 8QigDaZlIoY53ng2eibG1lSmIVBKRRz6AXi5wbkQHZ8zxspiSk+9Pqpl4P1upz7ab2mi fBkeQqxn+XevIvtt4AzqKd7+a0KdZR/bRnfMabB497qKim9YUzn9NjYh0Epfx12rek8O Le5biqNp2GdbyQ2OF0AeKRuMj3j98csoJVyqQokyQx4CTE97x5xaTdjGtxvhpSYahDtS vjGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884709; x=1735489509; 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=6hWcsFdWHMNsqmzeIjMIP3d8ROfJVABrtxubsRYeHio=; b=bv6hC1dW1urzavUnrNpuNB502dBOErKte0wo+OtJy0rmRE071EiwbFohaJAi0JsOi7 usU6ivUyPS8rfOxpuZPITupxAh+ILkJvHhNGzK/UNWVgFN/0kRN7ItUTk5eN4kb3+ajo y4MtTKM+/30gwqzcszEj/lrUPnlNlw4edRRmewoG1YulnhfpXhqgs2dlInuyVjMC9jAe QuGnBTFMIHlFua9CH+rn00fmRg2QGJ0ex8TlxzFjJDePRyOue5E06HctNz9FncYIbN+9 HJVKnuqila7EcRmDFCEYQ6X7oNYCsb6ynuuhAaklRBom+kQYCGpEmTPT647cHFDAFfTB PtOA== X-Gm-Message-State: AOJu0YyrjNz9JJvudCHs/mk5EZRls8Fv0IyENUwrZumkt1Lu3CtPdJZv avG5Rg/PQyl5ApOH7x3t1EE13h69BUlxVCCKcAjqPHiOFAEQ6rQbe3T4VvZZukiHKb7SZHnf7PB EWpM= X-Gm-Gg: ASbGncuFe1M/HsBt/xZ4icedQs7Cr90Qp4mYqH48/4OpNB49wkWSA2s4UswZb3ATm9G sTZPQXhs/Wc/933w6qFRc3n+ZLzsM43/ODUoXw0XlYzJTZF+qvlITUsSO14cFXB/bC25PS6VKnP slfQAL3pikstLGvLprgRQ0gy+9RaLjw8z/hMlwjhEf/kxYQhbtWzdPwDJmMLqJ+Z8s5QWRuxNYO ZyEdZX7wYjdj2ZjVEtKuJFoN1UY3Cln9kREVUjgrzqzob/zRaGgfrQYFFS5wQI= X-Google-Smtp-Source: AGHT+IG+JDbOBZCK+JA5SPIuCKvcuc4AdwkAjcSmXvlPGPNAJ7jUj7Jz5vDlYLOPP6mYpehty39Jqg== X-Received: by 2002:a17:903:2a8c:b0:215:9091:4f56 with SMTP id d9443c01a7336-219e6e9f997mr146443195ad.14.1734884709376; Sun, 22 Dec 2024 08:25:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 34/51] tcg/optimize: Use fold_masks_z in fold_setcond Date: Sun, 22 Dec 2024 08:24:29 -0800 Message-ID: <20241222162446.2415717-35-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884852513116600 Content-Type: text/plain; charset="utf-8" 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 b401287ce1..b6911faca2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2350,8 +2350,7 @@ static bool fold_setcond(OptContext *ctx, TCGOp *op) fold_setcond_tst_pow2(ctx, op, false); } =20 - ctx->z_mask =3D 1; - return false; + return fold_masks_z(ctx, op, 1); } =20 static bool fold_negsetcond(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885200; cv=none; d=zohomail.com; s=zohoarc; b=ACcWajy+UVmHDQ7Ttq+yzxYHFxus1nWI+jiz3rEW4Nfn1dirVE0evO1N6C6bScsXp+fVmrhFwHANa8M/SjPtuO46vODVINm9CcHGNi42Ld9xtQzchNNqtAZjDMT7p+S9eNTD6WVpBKKckz6feCC7L3XxvKFRUXOUWF0sg4Ws/sU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885200; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=iAElw8y3osLr1ZWh87G2zmGy/BBYjBbHdrU8XQRvtTQ=; b=jqbzhmaQb7C8ccSPJAEqq2fJoBxeg0R/UnZzWRhQ1ummg3GaVzuEAz2KgMrcJHHZwlR7f961mRKNTnKf2bfmhNXmAsXXhjmLFnaG4Ui8AdmxlrBe+zTWSmg4FeybdWcwSWRdWR+wuwRD81Kh9/CBGvmiG8eLaODL5f+wbDVOBlA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885200789244.82522487559845; Sun, 22 Dec 2024 08:33:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOm0-00030n-Qs; Sun, 22 Dec 2024 11:25: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 1tPOlY-0002fw-RT for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -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 1tPOlW-0003D8-En for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:16 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2164b662090so27974505ad.1 for ; Sun, 22 Dec 2024 08:25:10 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884710; x=1735489510; 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=iAElw8y3osLr1ZWh87G2zmGy/BBYjBbHdrU8XQRvtTQ=; b=FZaoFQmAdtd/jLksM9tym5rIxOCVV2+xXN7A/ktdWhOzQt17W0qUnmlGyNm9ROW50K /BHYz7AjY0LfDDfjFyVMM2qaM3a+hsHPlEAXe+RgkXtbAKP/y16vecsSciBVfZDbDe53 JtkwFI0I/75ihuNAiHq6qqKMtisJFCgPEV6OPviGN7WAXzMCwTJEJnd5kAgbQTSPDARj 0KeMkNH/0udJyWUoIXgHdjuJBmdNm4/WZlQzVmtIcBkFT4aB+4rAjtbTtLAObBrGEVtF GTE/RwElgPvRx+m7sKJJFQoyDxmQzJPl1E6xOmU3YJ6rOkZ72jmWJXmBoEZXqyvq9HPU eAOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884710; x=1735489510; 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=iAElw8y3osLr1ZWh87G2zmGy/BBYjBbHdrU8XQRvtTQ=; b=piSnxoASD8lKp7YgZ0pcDopE+4Jp6OCXvoXP7zgJOILvb3X5V41vEO6bni7DBYUG/1 PRxlyUynTk4vBO2qf2MfDByCo/WF7Ao/Jf4HNpVxYe1XNbEHSgj2dM2j0arLvhnJbDJD 3qugJkLti+xikbVLtjnrISR7TYYz81xLC/PGP5hUMhQzxcx0CYNYK9yO6WSWlwr6Vfh/ CwH2mk7V1COGaW4Co6E4Ke6W0ynnIEkzzKXRsucq98jWM0rEEJdKBKm06QuG2gJiicHx 0tnpH1EnpVg9cCEbTVheETXgASKrH0itHtPQ06oWzcyIle7LGG5A17TfpV9CvSyl+fRS 3p3w== X-Gm-Message-State: AOJu0YxqCGoOSOgkIBpSHXZVGr3GwykgLs7cJp19M53961AK+X3nweLn REllnFQtAXVEcBA7KRzy15wuV/PfK5XRi7xD4uQt517NaTR3T1q++kayRppHIoUyCVzYiEP6PKG Iklo= X-Gm-Gg: ASbGncvXnWuEwvBwyY3xufMPRMTmaOswGAzDirU0iIPEwyP8IUGUaYzVSh6/ZwGf0Al 7paMK0H6g650lfzeHWBJJJGFRH5ehkQ886kfYkEm7wl7r+cSuF4OfYcYADX81rj/lQTthz7TniN Qjku25Qb8nGpNBguKMRfdwsEimVX/tyxARa8z1+CZvzDt/NJnvyedPjo5P1qG4PC1iVzuW7DlBt AozzLzYmAwimikiWBEFUyNj83qtKIHRHrf7JSyLVIaZgo6Gp76/4HejLBVx8Z0= X-Google-Smtp-Source: AGHT+IGJ4PZruBQrTtWH//tHw7r7WxZra2frGR0PGNWXdSeWJwQysH8CgGsE7rh3yvrnw6xfcU3nVQ== X-Received: by 2002:a17:902:ecd2:b0:215:89a0:416f with SMTP id d9443c01a7336-219e6ebd0a4mr116791965ad.30.1734884709993; Sun, 22 Dec 2024 08:25:09 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 35/51] tcg/optimize: Use fold_masks_s in fold_negsetcond Date: Sun, 22 Dec 2024 08:24:30 -0800 Message-ID: <20241222162446.2415717-36-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885202140116600 Content-Type: text/plain; charset="utf-8" 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 b6911faca2..16c1192a91 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2370,8 +2370,7 @@ static bool fold_negsetcond(OptContext *ctx, TCGOp *o= p) } =20 /* Value is {0,-1} so all bits are repetitions of the sign. */ - ctx->s_mask =3D -1; - return false; + return fold_masks_s(ctx, op, -1); } =20 static bool fold_setcond2(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885020; cv=none; d=zohomail.com; s=zohoarc; b=b0axs8PjvIaWESw7ACGV+O/oujMU02dY3ezYXwReKJopXr6Mz1/S7jq0/moM9AVk32smerax97WDJjXIsUt8k9wBjLB6qvQy7IryLMn6ot4aXEn9JTnPKgvNrXKrPzQV17UQH4OUfPF7EHO9pFpavOzI5lPET715ty3GHYQnKWw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885020; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=R53s1jpecraivE/LK2pORQ4hHiE79PLfdQdBIIfi/Eo=; b=cyZz0sgPkvHOv5ghLKX5GM6mG89IFyvhd4GQJkjc35RwIqc28RXvVAbrrZ4HLAVmlf11RdyRoMBElYWwaIWNSJ+JT+kyeJW5uzRv1U9ZNgb9aWEnWhdvj6KMt40/Jz2B3Gzp81Lb0YqxZ6Ynqd7lwpM7SE446RBY6FE+msRqw/Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885020320754.5909906022346; Sun, 22 Dec 2024 08:30:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOm1-000315-LB; Sun, 22 Dec 2024 11:25: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 1tPOlX-0002eK-Mg for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -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 1tPOlW-0003DF-4M for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:15 -0500 Received: by mail-pj1-x102d.google.com with SMTP id 98e67ed59e1d1-2ee786b3277so2261254a91.1 for ; Sun, 22 Dec 2024 08:25:11 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884710; x=1735489510; 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=R53s1jpecraivE/LK2pORQ4hHiE79PLfdQdBIIfi/Eo=; b=b0ExlUkYkryloOYcqnIEuix0nKknc1SGNGQxBgHynMu9NN9ZgX36+dkDVr0z/d/clf Vv8cR3F9wjuPt8++XzjGtzKkolhyqV5eCX/0XrtJfSEFcjiJfpp/GT8B499/FAZY86iP cNd15wJmHNujkta5VYM9PHMG1DDTqcFacwux0Z3f5BSdUK0UYu5HK+s6bvYPek/HtmWX 2ZTb646sVpTa4jxRLh2hXkd11Yjf4Sj8CzSaHOy7lGm86GlEYh0qfBptJm68iygxHCyc jVDq3/jIae4Qihm0VdQLAoObsRNTRJfywV90KHba5k8DlWuLqRPirRckhxmZ7zRk/U5V jNNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884710; x=1735489510; 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=R53s1jpecraivE/LK2pORQ4hHiE79PLfdQdBIIfi/Eo=; b=N4SXY3KI5KkNefjcMfm+B0pmwUTWLyxk+bqD2htf5kLfpJ0wQL/izyyMpNIPzXdjQe ByUCc1Gbh4mn7IOeW9GPwcAyOZEf4PPM2doA2GfMuG8MRVckMptnc3Ncy/qfJYxxiDcD kU4ygXQautnyNicStZTlywSd0Yok1Cqiilas1roBVHslHEulZWwgteG0sfUdJRtA2dEh gNgsv754epIpIghqeAx4vBtin4NvvR2JXVuOFkN4xjSQkHi31HimhtWuwyr0egY6+B1w dGFxI0ufXa7TtR2MluXg4njW19jYRr9/YHM9bKuPg/DI/WyUPO1RkNugRSr7OePYs1bw 8InQ== X-Gm-Message-State: AOJu0YzDbyTxDlhUGtYaKsJ3t+P+L1TS6XV4RZPCTonbB69AvGx4mp0W GHzQIPdJaEbcPnxagMRBW9t8+ugidkDrvSC9vHn03DmWCqmVoSgMeqoWJUe24MHDoIqWKo3p5QZ DGkQ= X-Gm-Gg: ASbGncujbgu/urJAydA2hBw18nsb/tX0cgoE0HDY3ThaDhKWQ0T47GwMMdkw2ZixnZu /Do2SVr8D+xnJhfi0XzXU+PuuMPh7yQ/15tKP8w0msK0uxP909CB5kONoOQRpXzzxS9dO+2eOZx 9QbbGIMlUOTzT4AsVFYrXevrpPxRHLxADvV/ot2ZKqFxHNAQzQJvB+YGQlg1cYcBXBskGhOsQv/ u0yyNTEF1FH+MjJF3ODuKcZ/lFUIwqh9h+6UMxsPBd07AFVYt9TJVoMLZRuOB4= X-Google-Smtp-Source: AGHT+IFcQ3mLT8yy5N3Lql3Fs4D84JyLSElzdDVsA43DPikiEB/5zpcfouiQq1sDZjbd6Av4xsLX0A== X-Received: by 2002:a17:90b:538b:b0:2ee:5bc9:75b5 with SMTP id 98e67ed59e1d1-2f452dfccf6mr14700662a91.4.1734884710547; Sun, 22 Dec 2024 08:25:10 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 36/51] tcg/optimize: Use fold_masks_z in fold_setcond2 Date: Sun, 22 Dec 2024 08:24:31 -0800 Message-ID: <20241222162446.2415717-37-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885021206116600 Content-Type: text/plain; charset="utf-8" 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 16c1192a91..e5c46dd6e2 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2451,8 +2451,7 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) return fold_setcond(ctx, op); } =20 - ctx->z_mask =3D 1; - return false; + return fold_masks_z(ctx, op, 1); =20 do_setcond_const: return tcg_opt_gen_movi(ctx, op, op->args[0], i); --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885047; cv=none; d=zohomail.com; s=zohoarc; b=FMofT48LvFjbEHQwamKFIL7+Vz8CnGq/5f8SrDEKDU/hxSrOHY5JksMeWb72ZWB5a79UHxkQ6UMT7WmGRyz2txtgpQLRVt4AzQmzTHCIouXumOv3O8xUxXm+D3i+CAzCklwK0Uwkjo9ReNZcqlN83m7PTxEFidibJ+726R97v5k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885047; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=5lUoYR6nKXENDg58VCViQ5sw+cgNSYq12wwtR8MB1B0=; b=UjzhN8xIgXbLy6gawqwXNo+23jsWtAYDYRHeSV5jMQEbp01Xg1bZH9oMduxP7oTF4BX5zLwJ7RtobHlcKvHsVzESQb27rbppPpb5NXd30mUPI8r0SbHJVFa4yu8ZFm6W+REZlKfEti3Fy4lZttw3VgLbaSUAFLCMiCZ4gQgc8CM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885047045781.9155975748415; Sun, 22 Dec 2024 08:30:47 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlx-0002yL-LH; Sun, 22 Dec 2024 11:25: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 1tPOlY-0002fl-Ms for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -0500 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlW-0003DK-8h for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:16 -0500 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-219f8263ae0so3324755ad.0 for ; Sun, 22 Dec 2024 08:25:11 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884711; x=1735489511; 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=5lUoYR6nKXENDg58VCViQ5sw+cgNSYq12wwtR8MB1B0=; b=xzb9w1D8lQTndSxX/Zp6nAAwluLR5coLpncX9zGKlaXE5qAeNaMPjOUyly2XZSYD+o q1hJnE6x+B/tuoJhc+9tehaaAXDIA8Rf8ybi4NtehJd9FNJEcDklQgNFfAtVOopzTNx6 AC/zKUeU00RoaKd/T0g+lWlONT4GRAKUo0QYDkNzyeypN0w3gwWC0m+qLpJxrvfMq9Ze L449HwuDUp1k1FoMrNeVWwjHjZoILqgg96L9eJs5qswPa9EWxtMCUfxGRF0v4u+Ksf1N WJljhNEarKG2o5c2/gEXvAEIX1ka6zf6BkingUdhCy979Zs5Ib/LQGBsnLyrDA36NqmC 6g3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884711; x=1735489511; 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=5lUoYR6nKXENDg58VCViQ5sw+cgNSYq12wwtR8MB1B0=; b=XeUGJPAnenjNKuA2ZvqEgkJu+A5FBxCE9AlxmwFd7HQgpPlNITY4RP/+wAH3W0SjKl lB0s3VdyYVZPBxV4pdDgx0mPlKcBDiY5q3V9QEek99l2vtLHiyAQjCsOmU4l80qdW3mf uNZkSuQM5KkdsiT73ZzUKwVqto7K7qMxhYvAqRsHBdHyWY2tng9PKl/KVv2UmEh8K2Uo M1cz8n4zPEyTj3m+ojq7taeQY92tUWo9vvsMu6Yerh0laGNXreqSLGlnzErjs4IbQ5qp sIdubaXadBYpXaU5os1XDsrNVxxjPZB9mcUjQap7S4sYPOF5zwSIlxGMz61LBsC2psIr 5z3g== X-Gm-Message-State: AOJu0YzLooKjyk3GLu85EEyxkrfp9UAoQcMdggiTxtPjVMFyXaEQpom/ xTXtqYOTZEFU/sHUKwUxUgdVX3OENF0pbDsNdd2Ex9B6dt+xfcwGvnrJ5ATL5Epo6au7VFYcXc6 k4F8= X-Gm-Gg: ASbGnct8eitKFgyTiree0Gkoq9iBDwv2JsScFACiCH0OtC0pLzgegRYEA79ar+uLpiP k9Gy6viSC9Bw0RNYEEZq4iE9gE2Tu3mZkZ7Cv/rhBUtpoUgImpl+S5Qh+vKQBbv7CKADNMDIufu Cwdrc56bkwOJxD56O5YUbtsXrbqEVFD3K+jSyuzDNf3Qv7BVDaOSW8eHOGBdFgurAHNm63vXN97 F0X37ad1jWBdSMSToZK9rzZ0ZDqZ85LSl0qEul3eKiHJ0CvzR9Uf9Cp6lhN5wk= X-Google-Smtp-Source: AGHT+IFiGlORJK6dhlUGRLMcnAhqHn+dDK/KrN5KPUIxAdRkDs5vNdYRxoxuOhZ7LXU2IjtnK8+AGA== X-Received: by 2002:a17:902:ebc9:b0:212:fa3:f627 with SMTP id d9443c01a7336-219e6e9f9a2mr141309185ad.16.1734884711136; Sun, 22 Dec 2024 08:25:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 37/51] tcg/optimize: Use finish_folding in fold_cmp_vec Date: Sun, 22 Dec 2024 08:24:32 -0800 Message-ID: <20241222162446.2415717-38-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::636; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x636.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885047300116600 Content-Type: text/plain; charset="utf-8" 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 e5c46dd6e2..db26cc347d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2463,7 +2463,7 @@ static bool fold_cmp_vec(OptContext *ctx, TCGOp *op) if (swap_commutative(NO_DEST, &op->args[1], &op->args[2])) { op->args[3] =3D tcg_swap_cond(op->args[3]); } - return false; + return finish_folding(ctx, op); } =20 static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885154; cv=none; d=zohomail.com; s=zohoarc; b=NLx9msQ+rPQKs4fmdOdbugXa/OMttN0kEnNgjkvgZeqTNm74IviHFE9z/mrsEGDilFdno7qLD+7EQXQwnIRzBkjl+keV1i6XJT0O+56zVF1mv0hVVyM6lT1PcdVrcu9n+wf6go6veeCEMX5RDUnVKopkJRV/NIUGxgDhW/4MfDM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885154; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ZsTmh1MyHGCEig3rcyfPdQfk7lv1k6OuIXFBy9oIfbw=; b=jl4oWAC/RJZZslwagUEiqh9/VwDxPBhp6GME7ERk4HLM3EnpvmRef68LmiIb2KS6o1A+ZAXSI17QsBfhKBdoMpNgS2AwfyQjyy6yOcuykofIeQdr5/AOtDBUUstdaWONDLcRZDpE0OiDcoA85zKmeE2oodFZmcj1PN8BYzJ8IOQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885154257561.3152518713699; Sun, 22 Dec 2024 08:32:34 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOlv-0002x5-SF; Sun, 22 Dec 2024 11:25: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 1tPOlY-0002fv-Qz for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -0500 Received: from mail-pl1-x62e.google.com ([2607:f8b0:4864:20::62e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlW-0003DS-9X for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:16 -0500 Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-21644e6140cso32702305ad.1 for ; Sun, 22 Dec 2024 08:25:13 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884712; x=1735489512; 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=ZsTmh1MyHGCEig3rcyfPdQfk7lv1k6OuIXFBy9oIfbw=; b=Sq6IRpgsEtaszmnsxknWR/KCPJFZdFKizhbziI5YzXB9t3KHtvPtoW+wi/+4ahaDTD w//DkbJtVga9WYLCSC1mFVESFqs3P/pAG137pYIXUQINDM2CRYuFOo4Wh+jaR4TN3JPz q9HmE6sJo/GWlnxZS4hf4mMA4rvbB45VBGDF7FxhRIDTO2yDmrURdetmjXM8cJaTvg6x 32uKrlOgPZseuzG26mmn8WVBnHjHTsuleMCxTSjalLGHFlKKJziT/1Jjv2LfbaIfrMng Dfi5i+J3fPHzxaJR5TTyMdvx8CRhCzCI3o7DFCbusPJy2TxfWMw5Ei7JEmGjDX8yQYVz QPKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884712; x=1735489512; 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=ZsTmh1MyHGCEig3rcyfPdQfk7lv1k6OuIXFBy9oIfbw=; b=UjgmiipJS8k+bPUwDXxMtguuBSLAEei233lkanObUtstxUvxGvpWCRSGWRGe4Rk0Ba 3zh2NkLQcS/UXj/bkIoJqRUszUvHt9TyHll8K+bc1ssTGchM1FS/nbD911eRwf1Y3/wT BtdYwu4ej/h+s3UGMPZVSM0nIcsc8ccEmFwwhF16yMQ9s5emchVx40rpPmbda+af4w5h h2VtVnEUP8aj1wce3pIPX736wpqJmdK2snHE+yLW9XAkF+iQcMWvzjYH4fSdN1p5mn4Z zIWQUXPoLRTNwgzlujVu67khUcJ110Cyse/NEjWSMX+cs7KzLD68sfmsEeGMoxcOKmGJ oOxQ== X-Gm-Message-State: AOJu0Yzgbw3PEsModSax5UH+PlmM/PQpxucfEPp5M6EpXg4oQkfoFIns pwC9R3meyv2ZGwQIU2IG34QlkTcC+q67oElSdeTynBzXjavNnXg2BEjS5LHJSr9VR2xy6qM6a8d PH7s= X-Gm-Gg: ASbGnctanpVlk1cCcal8gVV1r6Qxyh7bwAxO3rOie6E0uGXQSJd9mMAWvV18LJIXywu zdELkGAMl6B9FLVItvzbxW075/7BavAIEX0lhY0Z6H7QxWkcU4xCJdcCWmwctpS67+hVGPcRRWK yH1ONiUK9d8wjyaN9/NfIZNehWVFfplOOaDpjUQEsgiYFKh2LsXMqhx1TH5jsPYPNVFnk2kcJ6C DxkUlUIjHgJCc24EF9yzNHqBr32Iq9WLJEkYS9NvV0r2U6FVVXwzXqV9IeFYn8= X-Google-Smtp-Source: AGHT+IErfQQWtx4eDt+bXh38P0mumkijc1Z+DEXT/eOekOIr7BZTKJRywreH1dhgzsVZkWGD8qKxog== X-Received: by 2002:a17:902:dace:b0:216:3732:ade3 with SMTP id d9443c01a7336-219e6f25fd1mr128915725ad.35.1734884711877; Sun, 22 Dec 2024 08:25:11 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 38/51] tcg/optimize: Use finish_folding in fold_cmpsel_vec Date: Sun, 22 Dec 2024 08:24:33 -0800 Message-ID: <20241222162446.2415717-39-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62e; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885156228116600 Content-Type: text/plain; charset="utf-8" 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 db26cc347d..3f601e43a7 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2484,7 +2484,7 @@ static bool fold_cmpsel_vec(OptContext *ctx, TCGOp *o= p) if (swap_commutative(op->args[0], &op->args[4], &op->args[3])) { op->args[5] =3D tcg_invert_cond(op->args[5]); } - return false; + return finish_folding(ctx, op); } =20 static bool fold_sextract(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734884855; cv=none; d=zohomail.com; s=zohoarc; b=ISJAZA+kCOij4YwPO7sKk8g4GD+FQuzhhh60TNChXNh428DhHtxpc2FyswSY2Ju1xQhr7jZ/PsuudUdcsh7syY5UljScJdWaWz8iXcrFoE0bI8YS/6/7WKlVamqykE/cHQBJlBw5Y9jtoiMr4bdtlJc/H3hMN9FTUaHF3yeW2yw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734884855; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xOK1W28MXShqpCuXbYvbzRblX4YwEbVma4mzsJO0bMk=; b=NoK1n+i1PjOwEkssx88uaBNpfxIKkD6h2czN/9fh9gNGKc8SQ53cPuN0G7qB/xPdwRASXHY1goIrfPS/BZ+N44wZ3mK1lyn+Wi9pEq/5Iuz7N9rBL0KwWZOYn0APrKEt5buoKbD/MYDAHYO1nYeZxnR3gU1l7t3uC5fmCj+78yg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734884855038890.0965169929834; Sun, 22 Dec 2024 08:27:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOly-0002zd-Rg; Sun, 22 Dec 2024 11:25: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 1tPOlY-0002fx-UV for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:18 -0500 Received: from mail-pl1-x632.google.com ([2607:f8b0:4864:20::632]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOlW-0003DW-OB for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:25:16 -0500 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-216728b1836so27148535ad.0 for ; Sun, 22 Dec 2024 08:25:14 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dc971814sm58461385ad.79.2024.12.22.08.25.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:25:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884712; x=1735489512; 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=xOK1W28MXShqpCuXbYvbzRblX4YwEbVma4mzsJO0bMk=; b=Qxa7HyRAAoEW10ptDqIq7g1XQ3O3ILk9jpqGL5bGlRS7bwhBNB1hmbaLLsEtXNewXO /DTgXthZ1p1VqMlGeY0QJyFuAiwUOl5c1pyfBz2oE+bZ085eqa2LC+dHSlCTbC/oZSFA EZ80Bp1a4adaYnPlg3E0z4d8TX4VGTOtviIQje3i5Gz00/N2ox2pV+/KO4DoASqS1XIq aLrq5axv3llW8IYf/xLgcYRT94hTx97RbtGJ9OZQ/dVegdDwOnc2G0XR89q/7WPTsvqg VBWn92FWbOC6YEnFhj7t4ur2cQGmTyjXwFg4ZwtEROvv6q+PPT/k8Eux3MQLzj7r8HCP 84SQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884712; x=1735489512; 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=xOK1W28MXShqpCuXbYvbzRblX4YwEbVma4mzsJO0bMk=; b=lit2qKATmj8Tz1xEy0IXS/MXowtFyjXojvZsf36fHcIJGlMU1lO6DztwphTTO46lPU JIOzXfAGqX7tji0vTukjJa7BjAEz9Azgebe0jkZ4MI2BFHIEkL9ZuoF2KAYirrDQ5n2l EhreOw/tlu65l7AXrBama+H3AWz2OYuooA6sIKyU82qvf829J004u0/LLfuPhXYXSaov SRqWJt3uEN/YFZ0OXUssdR9bQFNb1stbmxJ157AuKIylSIG2jfv4f00N88Ja4CK98hgj Fc+uzdMw1MyOiZSs7qDHCtzHknZcXwAvalsxjiH3+OklLYu9PnekFu1JXsz2b8S54f5O vRIw== X-Gm-Message-State: AOJu0Yzm99Wr1+hsP/iQaGwicBe2rrPfV9w0TOcolm7xcwfEas5X/qP9 ERv4bSD63nLr4fwGXSUZTdt5bXiBNNrlcuwVaPONxw+m6x784fin2XkU2RRDDZ1seBY6dNg32O7 LseI= X-Gm-Gg: ASbGncu7BPGdrVb96tpvd5PgIKGY53QAWo1RfGjwBhW2Cgp15U8AB3zTOvASVPaOHu7 1pjnR6hl78siCjaIAwacWI/Vm25xlbIO1CcWWqm6jTOlbTSaQY1CAe/UtbLuZGs0AVZBA3vAObc vR8EZm8h8UC8nQJc3uTJYa9XmYq/ON2vZLfCp8G003pGNFEdJ945gEFONFChzaJALtXAi13+UaO llKNlxsQ24o8XCzz6Lc2GQ50TUoE1PMoYlVJWuvWnTWCpxdAN0cS94YjRmZ19c= X-Google-Smtp-Source: AGHT+IEFGwPUvJ55YSWK+wkSvRh1lsEpdO5YjjcWq0pIfa98z0+241ZEov3DVG3+tmYAUJu2rmOsQA== X-Received: by 2002:a17:903:946:b0:215:a2e2:53fe with SMTP id d9443c01a7336-219e6f2f10cmr179599245ad.40.1734884712473; Sun, 22 Dec 2024 08:25:12 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 39/51] tcg/optimize: Use fold_masks_zs in fold_sextract Date: Sun, 22 Dec 2024 08:24:34 -0800 Message-ID: <20241222162446.2415717-40-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::632; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x632.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734884856601116600 Content-Type: text/plain; charset="utf-8" Avoid the use of the OptContext slots. Find TempOptInfo once. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 3f601e43a7..6bd73f6afa 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2490,31 +2490,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 =3D arg_info(op->args[1]); int pos =3D op->args[2]; int len =3D op->args[3]; =20 - if (arg_is_const(op->args[1])) { - uint64_t t; - - t =3D arg_info(op->args[1])->val; - t =3D 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)); } =20 - z_mask =3D arg_info(op->args[1])->z_mask; - z_mask =3D sextract64(z_mask, pos, len); - ctx->z_mask =3D z_mask; - - s_mask_old =3D arg_info(op->args[1])->s_mask; - s_mask =3D sextract64(s_mask_old, pos, len); - s_mask |=3D MAKE_64BIT_MASK(len, 64 - len); - ctx->s_mask =3D s_mask; + s_mask_old =3D t1->s_mask; + s_mask =3D s_mask_old >> pos; + s_mask |=3D -1ull << (len - 1); =20 if (0 && pos =3D=3D 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_= old)) { return true; } =20 - return fold_masks(ctx, op); + z_mask =3D sextract64(t1->z_mask, pos, len); + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_shift(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885166; cv=none; d=zohomail.com; s=zohoarc; b=gVTzueKTRz7Im5giaKwQCBvDLrAFBMYLZ7qQY49veD17tHdOlucoTMRzoSxcFqH7OZUYeimjXr/3vaOUuywCSfYRnVKNn1XtYfpijeGvuHrVM0KG4uHcWvqlf2WIvstCIK1iDWJYsDc/n1K0WW4vfWIZyqVDwQ90jqgOsfVhHUA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885166; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PX5Dl1hPMaEJqac+jWE42VLP1j3W8vlrf8LICpuBVgo=; b=ZeJvX0wCwpjgEwBDCmSWmt9fvO/6qVn+U/2ic4Z7Kk3J9Od377QB2sF9t4mXbMZMojFkkKhlPxTMmXflV6GWgZt3jOyVv9839zszd4Mao694DEZgHNKyfU8IBgNBASZlIYWqAg7dI7Cl7qhcFYRjr3LOrZqIPH3wxQ1ZfFUaass= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885166105294.87728875135053; Sun, 22 Dec 2024 08:32:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOox-00058P-3Y; Sun, 22 Dec 2024 11:28: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 1tPOoT-0004oW-Tl for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:18 -0500 Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOoS-0003ib-9A for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:17 -0500 Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-72764c995e5so2110254b3a.2 for ; Sun, 22 Dec 2024 08:28:15 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884894; x=1735489694; 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=PX5Dl1hPMaEJqac+jWE42VLP1j3W8vlrf8LICpuBVgo=; b=a1WqJpeiu5095KzbRWvSi7Q71sFLyQD1NYFMDN/xms1Na+PZ1ZF004VsWA419VdaOM s1bPOHT6147yZbP7YjOrW34FuXPcwvK2YaBztJ1gpTAWf9oO79sbib7DZDHq7opswtST tu1TT4NKZU9luzc8OKrMSs5+Ll9kiktNxeOWSX7jle16pvRccmgzroC0Fbww32Tu39ns Y5ztmoyk1wnejhhYYWwunxh30+H/rsIuTjjxMBZ1pOcgpq3gIYlFbVGGs3bFb5lEDx+Q 42iUdGFF4DbEndEoPOqQxfXkTc5Clh7zmRHEAlbSw8UqLUTMXA8V220lLdCcuIRvmARI uG4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884894; x=1735489694; 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=PX5Dl1hPMaEJqac+jWE42VLP1j3W8vlrf8LICpuBVgo=; b=GHhkc04g/cYp8/YB30YwwwrZihWejHqQDUbCfho4OLQxk8tUlpaMeh9PxiuEO3SEP0 nF/FKzGd6tTZKmPxWzGDCGXwrPt4Cq+LQj3mi6+tQIgqKRHHqBICoqG7btclLxpJ8iWp 76VumtHuyYOvWkCdOrMjtpX+X6jAxlt8Xot4foYyDGY9bNA5LejceAHmyiBi4k7j+KiT qAZEMDKWFaEyyK4Lywp3YdCL2cVl1wPcXvE2qZ0dhWqTZ15vwo/lZk/jS1EOyZlo+l/1 a+F0V+U5FLOJG7NKjZnh5cfoLL6IRAvR5tPap4+0CyS5hq9G5Br1OuspDmhZxI0uvdya ohkQ== X-Gm-Message-State: AOJu0YyTwL01AWUo0yNkXfj+frX1ffIAFdgIOHCpenYAY4HDa/NaPzgJ 8DqzXdqips9D70ZSoqxeoDe0ytlkhLi3c3CEAB9HJuvw8sgRVg+T8BPovBYZ1h7ClE0fF6JletJ WA5Y= X-Gm-Gg: ASbGncsh/X7/d7Q6aBejKPBFAscS3RmJIhTBouBd6sT1zlON7RyuDZVgDQb48igGclV CpBPmG9Vpu7lqygk8vWv4HDlKk7fpVSDor6bac1AX41rBa0UeL+8C67bh+eNIqUHqUR3tNglaaX cJRJQvf5WSYv8q202wYla1cR42yPGw9gYGmhVljsQwi3pyMR083HV0hRxnIIcj807GKAYLP85oU JtDAdY8HH7jx4swnsuhX3nSv95TG0C+3h5Eg6sFEAturmB2eDMtP7ktVLdxRvE= X-Google-Smtp-Source: AGHT+IFlYPGY7Nk+OxDLAfjlTxGT1JpRMZUPOWD8sn+s/cB6m/hwWwViFtA2qy1Exft118xjBKN9jQ== X-Received: by 2002:a05:6a20:6a1d:b0:1e1:aba4:2095 with SMTP id adf61e73a8af0-1e5e07f9019mr19253069637.32.1734884894136; Sun, 22 Dec 2024 08:28:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 40/51] tcg/optimize: Use fold_masks_zs, fold_masks_s in fold_shift Date: Sun, 22 Dec 2024 08:24:35 -0800 Message-ID: <20241222162446.2415717-41-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42c; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885167982116600 Content-Type: text/plain; charset="utf-8" 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 6bd73f6afa..052b5a060e 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2514,6 +2514,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; =20 if (fold_const2(ctx, op) || fold_ix_to_i(ctx, op, 0) || @@ -2521,17 +2522,18 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) return true; } =20 - s_mask =3D arg_info(op->args[1])->s_mask; - z_mask =3D arg_info(op->args[1])->z_mask; + t1 =3D arg_info(op->args[1]); + t2 =3D arg_info(op->args[2]); + s_mask =3D t1->s_mask; + z_mask =3D t1->z_mask; =20 - if (arg_is_const(op->args[2])) { - int sh =3D arg_info(op->args[2])->val; - - ctx->z_mask =3D do_constant_folding(op->opc, ctx->type, z_mask, sh= ); + if (t2->is_const) { + int sh =3D t2->val; =20 + z_mask =3D do_constant_folding(op->opc, ctx->type, z_mask, sh); s_mask =3D do_constant_folding(op->opc, ctx->type, s_mask, sh); =20 - return fold_masks(ctx, op); + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 switch (op->opc) { @@ -2540,23 +2542,22 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) * Arithmetic right shift will not reduce the number of * input sign repetitions. */ - ctx->s_mask =3D 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 =3D (s_mask & -s_mask) >> 1; + sign =3D -s_mask; if (sign && !(z_mask & sign)) { - ctx->s_mask =3D s_mask; + return fold_masks_s(ctx, op, s_mask); } break; default: break; } =20 - return false; + return finish_folding(ctx, op); } =20 static bool fold_sub_to_neg(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885115; cv=none; d=zohomail.com; s=zohoarc; b=JeDjkw1+xBKlobBRAyRnq/Py27ASG9pOnOl7VikoAd21rM8H+AakSRIOW50iy4vB0h+q/7CIKQXAg0CvBwgXTCNv5a/BVLKh/JpoEz/vzgWQDOkX5jVFpt86BT8mmopuGC6spJRm8DlvxOWy0bmarGpHvFGei4m3GkoCFghKS7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885115; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=rGaisTWn6CCAvd5l9eh9fSq3ae4swEAtCSXmPrNxbdQ=; b=FqyTJpEQANhQXOt7H04PS3xqjdNJ2j92z7c4CvdW2nTj995lEB2XYo7Z40BdSihWL+OCb2S6pqfb1htDqw3/DZjjpGzJ9fCUszjW1v1anCJB+LA0x/bPS/g4gzHVYYJdDCmn0gAY3C1/FFRarp9NQxN28c5Sbu0EstLiU8K4pMA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885115781244.23501799393352; Sun, 22 Dec 2024 08:31:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOoY-0004sz-0Z; Sun, 22 Dec 2024 11:28: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 1tPOoT-0004oV-RA for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:18 -0500 Received: from mail-pf1-x42d.google.com ([2607:f8b0:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOoS-0003if-9C for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:17 -0500 Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-725ee27e905so4253091b3a.2 for ; Sun, 22 Dec 2024 08:28:15 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884895; x=1735489695; 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=rGaisTWn6CCAvd5l9eh9fSq3ae4swEAtCSXmPrNxbdQ=; b=yMpELYTbGDEy8dq7HlpmvyPsBEW0p6u4eYfCSxDg94wSyeuSo/9/WMj6VuHwL/DrgE kNbN4fIbDZq31gC5TYSngVr3YDMSzSC0BZC7QLoUJ94XwcqpTarho1GPl+ooX99obtCZ T0aRQb5WxI3PcKzqM5Jk52lod5z6X+CeZ2XwpsHCnPayB5/mfR6yYljEHHfbjz+jcXMI KxP7rl+bZbO7KMofUW5vNgCk6a4mXJ+xD21LOYiyhrAwQHieADng2EGbWLcUHmIy1VDO Qpqu/T1NTt2Udthgd8eHTX/zvfB92GvcIm9uyKvxWTSA3+bUJ/Ia6BimJA5p6TBE02Sx wuig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884895; x=1735489695; 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=rGaisTWn6CCAvd5l9eh9fSq3ae4swEAtCSXmPrNxbdQ=; b=juf2nWPhTuydp/UdnOCSJdyNmgWrqqha7yZ9rcwiYfhaFfdulet/voYr/dPgSbIsdB QV2R04oNpNfRKyhqx42uJsmquuezTPiFhzaOjFt06ncOpY7HIEklV/QliY4tagWNsson BDg+b7IGkZuTVLkeo5tpxS2QqWYA3XoSHQc1fI7MS8seUgRt5hfje3yB3rgQLS26bCpn rCYf3CejjW4ARibl5s77ZUkq1Lpxuu4fMtx1aKUThWrwh7t7irbiQRzPZiZLKokXEFG2 Zq9iEduCjlGOCVV/kXKokKkJnyc28r5bvlvWLUeEAsqR4+k/wyGB6hgRAbgPXJXqOn8x Z4Bg== X-Gm-Message-State: AOJu0YwbRY3bIxpUw6v5QfvKLPN0K4jQOJ8AWc0PD0r3tv0P+jY78w1x c/pUxKms7WAXbFMJdy2Zz8iMPR+N5Ck9r6oiLi8vyWapwzvxxpJLszbwzUouoP7A2nZ1W8FU6vC kQUw= X-Gm-Gg: ASbGncvrAd4I+Kox1G6+gov04GSCwGYtmaCFxY7M3Ydr6uAGo5mDtJAm3paodyBm5an u02yvkqo6czhDtsW0yeAFGbmaZt3Xz4UCaTad006IwbkbHSu9xcMo/QJTpVcQ2wqwwSxI8C8nHI Uvuj7Nzrg1r/LwdlGIcO4nrEy9PmX9gTGCI6DeNLoYSkzN+7io4CbZZ+WIQf2vsrdDB5KMGXKpl AqN0FtQzC0L64X0UuQVjp5WjjxZadASvJa6fMPxs/yPKlY4VXM1dxNhVq/1Nic= X-Google-Smtp-Source: AGHT+IF/rj/Ln3Y/V5FfNuWwfOyKZc2IxsI2aIniLL8KQytwNf/LL5NUwsuEEnu89rdUF1Q2JilFNg== X-Received: by 2002:a05:6a00:3cc1:b0:726:41e:b32e with SMTP id d2e1a72fcca58-72abdd3ced1mr12744599b3a.4.1734884894729; Sun, 22 Dec 2024 08:28:14 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 41/51] tcg/optimize: Simplify sign bit test in fold_shift Date: Sun, 22 Dec 2024 08:24:36 -0800 Message-ID: <20241222162446.2415717-42-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42d; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885117705116600 Content-Type: text/plain; charset="utf-8" Merge the two conditions, sign !=3D 0 && !(z_mask & sign), by testing ~z_mask & sign. If sign =3D=3D 0, the logical and will produce false. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 052b5a060e..e53e6b6969 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2513,7 +2513,7 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) =20 static bool fold_shift(OptContext *ctx, TCGOp *op) { - uint64_t s_mask, z_mask, sign; + uint64_t s_mask, z_mask; TempOptInfo *t1, *t2; =20 if (fold_const2(ctx, op) || @@ -2548,8 +2548,7 @@ static bool fold_shift(OptContext *ctx, TCGOp *op) * If the sign bit is known zero, then logical right shift * will not reduce the number of input sign repetitions. */ - sign =3D -s_mask; - if (sign && !(z_mask & sign)) { + if (~z_mask & -s_mask) { return fold_masks_s(ctx, op, s_mask); } break; --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885206; cv=none; d=zohomail.com; s=zohoarc; b=hW78OK7cD3Owb5GuauJvNCdfNwKbJX+fA4rWSw4LfkrTy5pH64CrBNstikaxdmxd/MZUUH60epPDgBnB7jmSxoV2r/9rnDZe/L8DmfzPpHWkkyCnUquElE8Adnfc5429ivARzaeSREY+/B0YgTQA5vcP8x6ChOrSqPTTjZMlfL0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885206; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=Iq5WjGEeXV0oMIGl3lea1fV+HUTEzwYMRPJeFRmjgrU=; b=R1AHeJd5M+fHACF4GIHH7u29iVDfUjyQeNhZk++bPn9gsZEUkueiyYis0locjQQm35/XU5xBv95Fabv0tsAu5hxwOoxc7Y5OKKBTr4dzMQArDq3H+XCCIle5t0uaNQIn9i3zT+kSmRzrmJlDaG6UayW7Iz6uk+W3gTq72TTTrxc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885206472229.31169319309743; Sun, 22 Dec 2024 08:33:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOod-0004yP-Kr; Sun, 22 Dec 2024 11:28:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPOoU-0004pf-UT for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:20 -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 1tPOoS-0003in-SE for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:18 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-728e1799d95so3905796b3a.2 for ; Sun, 22 Dec 2024 08:28:16 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884895; x=1735489695; 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=Iq5WjGEeXV0oMIGl3lea1fV+HUTEzwYMRPJeFRmjgrU=; b=SEMUGdOVr3RfoMZOQmyr5UoqNFgyXGWkmwYOOhcIRmDsKWtvHhLCG5l77ZpdY/DByl o2cE2a+RprLEc8UBPFc0tXTSAXdDquEBGnbLn35bgAwG/RIpRBckFGaB34ySIYqlE++i Wa45vTCFPYQkLL8Wr7nOnqqMovcUNXUWmM37NudJkCJ+rRSMJGpqSjO0GWhPrIG9DWMU drwE+iJ4f6dGGYbQOVD9YqehlT1/8n0d0ADNhSjsvO7siAFsTXr0/tzXfUZp4VkAldyf kU2wOg6IiWJyKQm8QAIkhA1jgZgUe4kh3HGa5GSUaj69M+ZOB7bwv1mEN8CwVoqwWRKt it/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884895; x=1735489695; 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=Iq5WjGEeXV0oMIGl3lea1fV+HUTEzwYMRPJeFRmjgrU=; b=bsNKYFUbxrCzlTu3d6OwMepGtWWneua9gG+ayOixKIQZ9LUyswyZCZsYbvx3jBi5YB DHhif4+EDl8uE4au5nKYGye90eMMCEA9CBTtOqVVjpmE2lpGE7Omsn9iw1q9OUxQnMUf DKCYIZ1AAD5Aw90f06avn0fIatvbgNGtvCi43wQ+GkfYA8rMwHQCtvLDGDfUS1U0SUam C3A6s07tdmC2UmCiVyqfOXFImOefRf3Q85Ulc4VHAWg3Zv5lEp5EwAWTDP3O/XOmSu2w fIJzxU463MpJpTHi9Bio4QPpNoYV8MbO4LQimSNQrMWJy50LNb/FjfBuvtdSRW00sedV v+vw== X-Gm-Message-State: AOJu0Yybux3odGXwHavOuh1JuvXGjXMXxA4yfFXRZgbg0V+/wjJm+b5N 55CULUe6mCBYI20sAsF+/gHFDfTqz7XbMHnbwXwNdNnYIZbK+0FhRPLXgOZyFUU+0Ao61rR3fvQ J5Mc= X-Gm-Gg: ASbGncu6he+FqJlkGq3IMl6Kv0r25dRQ/1vwI15GokPhqJm0+FexVjt4fq0+ug/UY/y odls66roZDEYbiiUJfm93mqfAsVEO+qfG1Fi2mXiaWXSa0rhh5gLtynwfsRPmiDazYKt6E9BNF3 xfaMOgHu+Vf58tM3KpySCZzx2eK7rMSXtGJ72QvfrAc/kDOGRYDuKadNTyvYuSePgDVIlGtzWAp AMqyUQBcWKIuK2UDXM8DhfDF4DuhbRzLhLAL924Hgrj+SZHdHL9M8UaTXmDtD0= X-Google-Smtp-Source: AGHT+IGdAnwcm/gSfTwgoBg/sMVBuni0+GnKprII4UdHSUCMJXt7irC0VmxLhH7pjdSmTiAzNtxAMw== X-Received: by 2002:a05:6a21:3a8e:b0:1e2:5c9:65e0 with SMTP id adf61e73a8af0-1e5e07f0218mr18512621637.32.1734884895425; Sun, 22 Dec 2024 08:28:15 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 42/51] tcg/optimize: Use finish_folding in fold_sub, fold_sub_vec Date: Sun, 22 Dec 2024 08:24:37 -0800 Message-ID: <20241222162446.2415717-43-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885208118116600 Content-Type: text/plain; charset="utf-8" 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 e53e6b6969..14d3d6253d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2603,12 +2603,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); } =20 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; } =20 @@ -2620,7 +2623,7 @@ static bool fold_sub(OptContext *ctx, TCGOp *op) ? INDEX_op_add_i32 : INDEX_op_add_i64); op->args[2] =3D arg_new_constant(ctx, -val); } - return false; + return finish_folding(ctx, op); } =20 static bool fold_sub2(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885226; cv=none; d=zohomail.com; s=zohoarc; b=OIqwymSuy3ajuUG19nRHaHlWAApWCCXuF5kqsEHOLucmHodzBhfeBeLCmMAVi3S7k4EKgtCXg1/nAjqPe+kEgDQQaUyNyEl4sL0/UoHE0Qrfioax5lOQZH7jKY1l6rhKNq57O1Z/a9DAwU16FdN+KnjEfGuuZ5zjwrbMuO7YLNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885226; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=TgcJ7Z7nrgk+v/P/ZXkaQjdlJl1hSkN9qRtEzlqQEjo=; b=ThSBA9e8oirHQE/rKaDHPyvPYTfa2500X51ZCIAz2mqInZWah9sZo81Qeu1AlVQtDRA5KadAXSqIqRIgQEUsMNOIUAiom5iy0vFCQORvArxkiGHvrHgvD6NMwrPJFOh0S1gy3dQ0/E+m0IEFpE4ZXQ7p1MKnNGswG5PzTiYhz3w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885226393809.1231452727013; Sun, 22 Dec 2024 08:33:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOod-0004yS-L3; Sun, 22 Dec 2024 11:28:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPOoV-0004pg-6E for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28: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 1tPOoT-0003j2-H9 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:18 -0500 Received: by mail-pg1-x52a.google.com with SMTP id 41be03b00d2f7-7fbc65f6c72so3098526a12.1 for ; Sun, 22 Dec 2024 08:28:17 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884896; x=1735489696; 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=TgcJ7Z7nrgk+v/P/ZXkaQjdlJl1hSkN9qRtEzlqQEjo=; b=ZQXcirOP+XDiqb8vftlIcUoatVSbb4EjLAD+HItYKEshfzPYJfHbFv7zdJviXoqVeP aaVEmIN1ji9QtYPXA4r8TPfMfW31mE3s3LAj1x5ts1BMhnLHE4qx1FMpeaG6Oj5BgtO+ AjvDfmKgvSWRoCCWKTyn1tmgRR/jUtRIi06JfpaP0Tzfww18eqFYewq0FsE6E91DVW/f /XUR88ZchEmosNG29ajAjj0mz0g6vlol6zjrzcVXc4PE9bU1ElMlhUanDN2hKJjw+nGZ cs9bDjP3CholuRvw9ByZZbFA/ris4efivvu/OxRunRVdZ0F7vyI9001T2Nlhgyye/35/ J7fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884896; x=1735489696; 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=TgcJ7Z7nrgk+v/P/ZXkaQjdlJl1hSkN9qRtEzlqQEjo=; b=eTQx6bYWbOhe60a7ZypO1PbCbfybCPHmY4C6x5+cXDJQ3vNhN0ApTL2K39pO4vV0MJ 4VPRSPiNTF2lO3A9fK9NJJ6iTziwtQ/lne6juw7A6d+mcQxRip5YHcnwSec/5y6LLZCR fGtwG71TPnlrmgwrm08ru1sb1kdlhlhx7VyNW+zUjKBzdE4SQyQcjufSei/ITOWuJVwQ lalYzx6LpD+/CtujrqD3Ahfx4txkG5lK55/+T5cwi3XZGZ1jcqpuel0ATzv9x50TZJnP RqFPVBhuCuf5OR5u8AiE2gWYXIzkxUf0w0gAXIWKQmwU1pMHzlomsbDuyyyssqmKxA70 iKCA== X-Gm-Message-State: AOJu0YxVitYY36tFeWDhsjUvakkzw6xqoRntprR+8lOucrKnJizk3j5w 7yQd3MeNhYBDwrhMzPfVi816siaHbVNXuOQUXcFlP9fXHqsqToPwBg9sRMnq0uOqOFhfgX3YKeT Ie4M= X-Gm-Gg: ASbGncuqVwKHZ75mRBPBG9foG2Pxmc+F052rp7G23If4svhlrvJw1FfqPC5C9SWiojK 1mSeC1vIndjmnhH7HuAGe3Kp0N9ktft8aKFtgNMso6iJMnWNzPqioKuXdAhry8rbTamFBFmKs+M rHEPslB1UR0XB8PmMQ6L1/0RjoC2hzaqCgQ1uHoLXarx9zu8j3B7N0IGr08NTaRvijs3DYSV7cM jzR8bgmHET+zNfEd1N0DgOjYv/LRF3XKpB7j48dk2rXzEnEQCuWgLWHtcRQVo8= X-Google-Smtp-Source: AGHT+IGGEp5De6Iu1Ti+/AVfcJKTn7NlSPyLXyPgZdzFepMLIT8IxhBEi1RnRs2PfmNqhuu0e9LbgQ== X-Received: by 2002:a05:6a20:7f99:b0:1e0:c50c:9842 with SMTP id adf61e73a8af0-1e5e0801cd4mr18919367637.31.1734884896196; Sun, 22 Dec 2024 08:28:16 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 43/51] tcg/optimize: Use fold_masks_zs in fold_tcg_ld Date: Sun, 22 Dec 2024 08:24:38 -0800 Message-ID: <20241222162446.2415717-44-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885228205116600 Content-Type: text/plain; charset="utf-8" Avoid the use of the OptContext slots. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 14d3d6253d..cd12985537 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2633,30 +2633,32 @@ static bool fold_sub2(OptContext *ctx, TCGOp *op) =20 static bool fold_tcg_ld(OptContext *ctx, TCGOp *op) { + uint64_t z_mask =3D -1, s_mask =3D 0; + /* 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 =3D MAKE_64BIT_MASK(8, 56); + s_mask =3D INT8_MIN; break; CASE_OP_32_64(ld8u): - ctx->z_mask =3D MAKE_64BIT_MASK(0, 8); + z_mask =3D MAKE_64BIT_MASK(0, 8); break; CASE_OP_32_64(ld16s): - ctx->s_mask =3D MAKE_64BIT_MASK(16, 48); + s_mask =3D INT16_MIN; break; CASE_OP_32_64(ld16u): - ctx->z_mask =3D MAKE_64BIT_MASK(0, 16); + z_mask =3D MAKE_64BIT_MASK(0, 16); break; case INDEX_op_ld32s_i64: - ctx->s_mask =3D MAKE_64BIT_MASK(32, 32); + s_mask =3D INT32_MIN; break; case INDEX_op_ld32u_i64: - ctx->z_mask =3D MAKE_64BIT_MASK(0, 32); + z_mask =3D MAKE_64BIT_MASK(0, 32); break; default: g_assert_not_reached(); } - return false; + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_tcg_ld_memcopy(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885195; cv=none; d=zohomail.com; s=zohoarc; b=NDBGK3pHK6eph+5OKOrW/TrdJexccvcI+bYwC/3dv4H7hicNpfwVJ75+VkVbjE2KHZkdS9o89YnTtOsER8jnxog470brkWUhGg5uJqJBpsvmpg6o1LAJMQRrG9wtqnRaokXPc+CrVPZ7IoZfQ4gKKHPTC/1Y0e8hicWfqfcNUMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885195; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=SJ/bJ4QtRBGimmagW6AK+8fKAALk7Es9Y22KVQwNalg=; b=WwImXNDpoFmWQlFgbr6e+qTtMyxp/CKBkLbYr63ErrLuroPqbXBu9DveR+xaaFG3CAPjsncdYxKdAw9+BEOCS3EXdbagK+cOM3i9lvbAKVlQ5Ictct9rgqGe5gmW8nVzYV3bgjKWIQXLUrnjxyDqCB8zZci68tWplmmUm8O/l8s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885195545675.4694565058163; Sun, 22 Dec 2024 08:33:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOoo-00056H-1A; Sun, 22 Dec 2024 11:28: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 1tPOoW-0004rf-4B for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:20 -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 1tPOoU-0003jD-FI for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:19 -0500 Received: by mail-pl1-x631.google.com with SMTP id d9443c01a7336-216281bc30fso36608935ad.0 for ; Sun, 22 Dec 2024 08:28:18 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884897; x=1735489697; 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=SJ/bJ4QtRBGimmagW6AK+8fKAALk7Es9Y22KVQwNalg=; b=A1SN7r3Qu7YO7+523yRwv5uth/RRN0GkPoNBX2A43rMuE+WRS9EtUdoMBELFvQ+4rD /4akMU8YQD0ps24R4YlUjYZABOj3b1eKiVCaNa06tZnJ3C8u8l9i5PFvc9WYpNRJH7IP BvbYlQKJafqiM8KMItCnM++aJck3vVybhAJmMw5U/f45GDsHgGcFr+4WENTsGKpmEYkT ij+twVzqF9h05H2AyZhGJvfrFgnp1zrWoQfAT3XgZMybPT6VvUXhucOsPUjmNRIi0fa8 A4lYWqYJ/IpTnM0q9oM7eSI0MyosLnavHvLEFzpfsOeA07HqYkjTwQew8FEvE4kNxfy5 wc1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884897; x=1735489697; 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=SJ/bJ4QtRBGimmagW6AK+8fKAALk7Es9Y22KVQwNalg=; b=lrXLbYON+yuH9D65PZOxsbRQ/CsKrC0I0ITOFl0g3E0I9ofedcUadDa5Sc2ce4+hGq Z1TDZF6LRkOl84ExYSlU/2iKrI2NeabG71FOSawKzEjiw/3cOFmUeowIENTsSiufdkMg EDfjghjLcs6dgJGZji4jbUY63fXQ8EXt6qMBW5A68XoXxjCnL4vBUePo87A+A4mI1G1J 1UeS1shZqw91UbqJ7P/RNJ1XQTJpkIO/cU+WZyxuyg1BF4FOtkRZGG8WKN7iZM1FfBuX ZfdEvy/snAw5UwXcVJ+3dWWhVYjZ/sWEUmdKfuoQZgR3Wdq3jaLstHnsG9+OBnz/DyDZ jJTA== X-Gm-Message-State: AOJu0Yz/R0eXGC2Xsizn2Q1jfD9bWfDN/xloPZt5/U10/PWhFC9YTF2N /MWNqT8U73OV3uDidQeXaM31tR6frOS67i2kUAi9RiSDZY9grBwtWDrqid3iRATtRhL8hsFn3yG rrxQ= X-Gm-Gg: ASbGncukGwkrxsSzQoHhN+d48z144bGWpz7TBmCce83sWw0dBBcu4G9+rxxJjh71RzP yYdFqd7By9kflP9jlAh4IysXvZEHZbu34x3m6r4FHcdpYcgxzczdGpeYtzSrmnkL4w8T4cO/a6N DGzHU5DxofEjvtUpTujU6S7DePBw58Qx6m0uFODB8Y8pZULlARGmbLSClIz4xbJ155GK4frJcZC h1OU3WKSX8DDTFDXKfO/mfIydJhTtp7AtlbpUzTH7P9zxIf/1kFUWq8ZjCRTzw= X-Google-Smtp-Source: AGHT+IFPWADZquWpIhChxtLvPFgnriSnDbeQZUKOkVD++xGaNu/lc/44dIFYd7/iLUvv683FOKOgzQ== X-Received: by 2002:a17:903:3203:b0:215:5d8c:7e43 with SMTP id d9443c01a7336-219e6f497b3mr137544525ad.54.1734884897265; Sun, 22 Dec 2024 08:28:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 44/51] tcg/optimize: Use finish_folding in fold_tcg_ld_memcopy Date: Sun, 22 Dec 2024 08:24:39 -0800 Message-ID: <20241222162446.2415717-45-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885196054116600 Content-Type: text/plain; charset="utf-8" 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 cd12985537..48324f122a 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2668,7 +2668,7 @@ static bool fold_tcg_ld_memcopy(OptContext *ctx, TCGO= p *op) TCGType type; =20 if (op->args[1] !=3D tcgv_ptr_arg(tcg_env)) { - return false; + return finish_folding(ctx, op); } =20 type =3D ctx->type; --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885206; cv=none; d=zohomail.com; s=zohoarc; b=bIcmtTzVlW9Ov58EkRwj5JbucYrL6JE5Yse/zjw2NiovdyxAobp5THC8gBkZgnoBMBAwTsnheegRhCYiLquembYxf+si6a8b81L4q0GxVl7u2GJkTjiRu2nza/oXCabIizVd0Ja7W17t8ZNQ83GfwKf/B/KrSJrE1SFZnv9b4IY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885206; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=XK7HdFgJI1aoovKqrgnwds0J6drlE9NjhtggGFHKYgY=; b=Mhr/BkGwsEU5eyVkKgnmYZGfI5FlfOUYLGfBlXStGn1QxSLF/8U/MyYu9/1qklmLL2rvnrikSw1lPQfWmBjwB7ZdnBkyz6dWYkJ35iAATzVBJMvdkDSljSQncoirhkP2EDp+Mua7OchdxliL8/NcxROhhzxEU74hR/ja77h8Dw4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885206473336.6862515292621; Sun, 22 Dec 2024 08:33:26 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOp0-00058O-Az; Sun, 22 Dec 2024 11:28:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tPOoW-0004sy-Nl for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:21 -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 1tPOoV-0003jP-5f for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:20 -0500 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-2164b1f05caso31209485ad.3 for ; Sun, 22 Dec 2024 08:28:18 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884898; x=1735489698; 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=XK7HdFgJI1aoovKqrgnwds0J6drlE9NjhtggGFHKYgY=; b=m5/9KCZmKC7J5ya7dzFr0BLepydnzgq/7AoWLGXoHm0xoqhlYXO4oBwr6u9tG/PLpJ QsLsTt2khA5XuYte3NlgEA3pGi/uJKkY+pjDSJHUw4WDl2ryXt14i+yg4yzXn8OF3y+V lHad86WVvumVrTDiCQeyrOdELsSUh/OAdw/9NbHrMcx4lT3B+pDRBkLo1kwSB8NZ6i84 zFyA9kGwUTXozbj/s264O1Kbd0jDa+xmnLMWeiFvQKtRYpSR1nmSQGIalWlrq/IqycY9 Zi+/TKvyK11oy2HpvWz56dt736HG+GIDpJ3x+4T7DHSxRvB0BL2ufk3c3l6Q8dSBqj3t QSZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884898; x=1735489698; 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=XK7HdFgJI1aoovKqrgnwds0J6drlE9NjhtggGFHKYgY=; b=Tc3IC4XXhEgLcVCuLuZGxB7Rr1ui4KSAD3GueMPEXtRJkY67VKu5xKISRNqf6uKrVF MOGa144VESb4ZsoYJBoQiICBimQP8+rByO1sfh4PLHbHMKvQuJUbba75Q2Wca1o/Jn5Y GDHOafsBNq6KfdlaF1wJOH35Kx+heAl/4A0QQ9je04OQ2Cy06Imt2waVuQmb9YhTVDsD rdoobxZhkKuzVOM9TVMydUeqryejCiluyrXiqrytPbgo+U6dqeHZ0THd3bmuPDEmQseD JO/5g7Z6edgh/awiQM8ooehsXFveuGVBVxb8WkHGqMBPJcCXLDAcitKIL94YPSMzi+Z5 P/jg== X-Gm-Message-State: AOJu0Yxs3aGoA6KoBhLQEC5f7Tw/fcwJhugCRTQ1xnMZm10NLXdgibwY rmRZ8CYhzgDmQo0jOha5s1PQ9RZryFEEO5c3dj8sibpuZL7d6+Jbw6rpMXotTIO8p7pZa7dE/Sh 7N7w= X-Gm-Gg: ASbGncseCwgNEdAFg/qyNDwABndQ6sUN1JIcVGcR1ihEZJPC4Jm6oMHzPSaUEMrmUPr yXq9N4gJNbwDQHuBoZSR0jxhWPseB6+8CQKwAZFLTDFm93Uqa2apWZrxEKb5O8yV54OhDixTbIk ugLICwN9V3zB1mkF5b5jeghZ5WIFPkNRq/d6IMq0UeaCzI/PaV7Co1Kyubw8B/qs7zlEkFOk0sy wHIh8XF+niLx6JGpPVfpBL0ev2gXGccpu1cZdY+LvQ95aPoZFy8hzGi/bCKWgY= X-Google-Smtp-Source: AGHT+IGiEdWdZUnraBq2kVlozGbMMpVMExMyKeHZCFp4pUBMfJ6BVev8QakyHJm4Do4k5PcKTu3M4A== X-Received: by 2002:a17:903:1c2:b0:216:2c3b:61ba with SMTP id d9443c01a7336-219e6f3320dmr113457375ad.56.1734884897926; Sun, 22 Dec 2024 08:28:17 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 45/51] tcg/optimize: Use fold_masks_zs in fold_xor Date: Sun, 22 Dec 2024 08:24:40 -0800 Message-ID: <20241222162446.2415717-46-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885208142116600 Content-Type: text/plain; charset="utf-8" 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 48324f122a..0cdbd1e262 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1063,11 +1063,6 @@ static bool fold_masks_s(OptContext *ctx, TCGOp *op,= uint64_t s_mask) return fold_masks_zs(ctx, op, -1, s_mask); } =20 -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 @@ -2752,6 +2747,9 @@ static bool fold_tcg_st_memcopy(OptContext *ctx, TCGO= p *op) =20 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) || @@ -2759,11 +2757,11 @@ static bool fold_xor(OptContext *ctx, TCGOp *op) return true; } =20 - ctx->z_mask =3D arg_info(op->args[1])->z_mask - | arg_info(op->args[2])->z_mask; - ctx->s_mask =3D arg_info(op->args[1])->s_mask - & arg_info(op->args[2])->s_mask; - return fold_masks(ctx, op); + t1 =3D arg_info(op->args[1]); + t2 =3D arg_info(op->args[2]); + z_mask =3D t1->z_mask | t2->z_mask; + s_mask =3D t1->s_mask & t2->s_mask; + return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 static bool fold_bitsel_vec(OptContext *ctx, TCGOp *op) --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885215; cv=none; d=zohomail.com; s=zohoarc; b=UbqzEBbS+sQ39nHupVy6vtXz0f+aKdOPlN4IC8oqpy/pps7k0WB2u/Y0awjoA9vk8A/omGHifjMgLm6RZtSzedBafIhn4x2JJZyifneNfzgo59NnhA7NOyds4gzDQhQ+uVE6B8e4CBO2wwg1HrZMnENllucxvC6B9YyO0PIkhSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885215; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=8zVWcITCeVJyEn34BQ871RDWCXs0aBbyojaqRkW2N2M=; b=Yg7OL7HTYGT1sIiLa7aoSBVNiAASJfGuURAsCfg9Jdq0F/PpDEpEQwb6ECIeb1REP513Bt7QDuoTT4POKNhoWTcpt7ui8GAAqRX4/HjAWTwPG3rP28T8frqNxPfihmArKvdsuMr2a18Z8aOPuPCVCGTk8jxWSPlitGnXS6Qv5XI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885215287597.0909534884033; Sun, 22 Dec 2024 08:33:35 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOpF-0005H0-S3; Sun, 22 Dec 2024 11:29:06 -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 1tPOoY-0004tg-6v for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:23 -0500 Received: from mail-pf1-x430.google.com ([2607:f8b0:4864:20::430]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOoW-0003jh-M9 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:21 -0500 Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-725dc290c00so3427392b3a.0 for ; Sun, 22 Dec 2024 08:28:20 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884899; x=1735489699; 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=8zVWcITCeVJyEn34BQ871RDWCXs0aBbyojaqRkW2N2M=; b=y5POr8X1p3NIkJNRgI7xISqANSS51bGyhBk72u7fmDzNwpRjJMd7bIxSmZyYFHzF9Z 9QgctC54l6aDlmrRvDA795ES4/DDx0q57j9PnQzSX7Pj+aA5OaC8B3vcQUGWZsXYiRYO SSAbRKRdgN97Mmcn4AEpzKe/JelbunFSYT+cC5pSVUIIoC4uYHVeNd3x+HSi3FHYSy3Y HqgVhnjAvcZjmUg/synDow0rHt8qrFVd7Qwgahosw4eM15xWs4d3TzZ+pi8YUzuMAaYf UEAc7+CNDPht4u6QHhAceVQlHCV9eCuUnaaAlVsEK86qcBfEoLV/SWDdDENsFQB6TsSm cq5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884899; x=1735489699; 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=8zVWcITCeVJyEn34BQ871RDWCXs0aBbyojaqRkW2N2M=; b=P42st92SGobY6hOJtIJPdcPbnhaFGcRFTBQZIb+0aQqweIvRh6YDsx5gtxtMVTHH2H 0CP0rpob2vCTCIAC6w1EFwSY5asCme4+4w0b2padIuyQ0fTsoFKyg+YnfnMjyKOt7T0X tejvt8Czv6mJdwjPL63ulc4kNvjov23JqKN9uJ8V0hgUsfdCraMYs0Px1Uliq7S+OhmH IQ5IXIEh+Mw5aBSfQGE3I5ko6zDtLa8X/a1h/cwwTuUNnXS/cIan+NEzvafRl9I02PLm pG6ZbWVzOlPhGVs+g+7xze4LMmv1VSr2/Dv6TSzWa3ZvXDuZHP2b79mrpzyj6m8T70aC 9f7A== X-Gm-Message-State: AOJu0Yx9AMlrY59QqTorTssFVvD0XN8DI+9Dj1vZKKj8VsfDNFuBZ5qk z9CGkS4tbNoafJISPVc2EiyZy6fnK8w2HpWCvWJJK3kNXGGCNk4jJmo85qApXjuFn+MckYN6Woo xZIs= X-Gm-Gg: ASbGncsyZhrGAV5M7bWPk62Scbjp0JGutnx+6jkCKJdQbctx020b9xEMW8WBX1SWTkw ZwkQ+lTLuSVM5RvUSo68E6rvryAkHqjR46T6oIVnTvYXjrZ7PcxG+9Hy2/xuf4VP1GlZjb/4njF zVqXlJsIFUEmHbbkc2INbm7679JmS385ZIg3mwK5mE+dlwe0SYZwfoZHU2F5BBu9bhLeH5e9Gpw gITyq42yuGjvEZmJD9Ter/GbbURJ0cOqXXsSo1X7ghexM7ruECfA4arXCVkoF8= X-Google-Smtp-Source: AGHT+IGfX6H9NhqGRq3Z26rznESHhyQP6YFOmP4g7CXhD6tKf+/PDZxNRVlO3a3SouJ8yTScbljN0Q== X-Received: by 2002:a05:6a20:7290:b0:1e1:b062:f408 with SMTP id adf61e73a8af0-1e5c6fd3cd5mr17190220637.17.1734884899122; Sun, 22 Dec 2024 08:28:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 46/51] tcg/optimize: Use finish_folding in fold_bitsel_vec Date: Sun, 22 Dec 2024 08:24:41 -0800 Message-ID: <20241222162446.2415717-47-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::430; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x430.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885216174116600 Content-Type: text/plain; charset="utf-8" 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 0cdbd1e262..3bb208d6e9 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -2816,7 +2816,7 @@ static bool fold_bitsel_vec(OptContext *ctx, TCGOp *o= p) return fold_orc(ctx, op); } } - return false; + return finish_folding(ctx, op); } =20 /* Propagate constants and copies, fold constant expressions. */ --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885083; cv=none; d=zohomail.com; s=zohoarc; b=U+OTp8jO+s7faowU4mW8BHAD+BQ0nl4k60DSguB0UsJgxG2Aj7LJddov01k8euvt1Cp2ZMPFTSSueNcH1WRoqkQ0f62UgIgJ9QhZGIrjwKMRYd/UfCAmzwA/zqAysamrc45uxR2QOr5kKynBVMZ5/H8LxIBtpcu7EQD07rjGL+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885083; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OyI7W7fnkDxR10eAmkTI0DbupaxplDdtdBvj4WSj0sQ=; b=F31VSJD2Ln7xqijPfHNx0nLNUDMFgj9HXXW1mvc0T9e5TW5m50XjPOXdpjD8B9DGlaYThTGh1/8zt8pW+TGeMejhkeZUpPAs1LCdQ5vNz2ZcIRq4hYZG3VACO77SNr0lFLO1hMKMgffqWcFIuYZH3ihAF4nFE/MyTjpPjw2IsBA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885083784352.7603791161456; Sun, 22 Dec 2024 08:31:23 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOpW-0005L5-62; Sun, 22 Dec 2024 11:29: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 1tPOoa-0004xY-3Z for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:24 -0500 Received: from mail-pf1-x42e.google.com ([2607:f8b0:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOoX-0003jr-5x for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:22 -0500 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-725abf74334so2918551b3a.3 for ; Sun, 22 Dec 2024 08:28:20 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884900; x=1735489700; 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=OyI7W7fnkDxR10eAmkTI0DbupaxplDdtdBvj4WSj0sQ=; b=H5k795EQlwdYr9CSkQr/eFB+MFwSUDgKT5y2g1ZpgteeA5tQ+LyNGulgC2wPfr81nc dQusNauNnMgkft+Xm8BHxg+oSorTjwmC7ArDwGXNCnnpCvZ/VFH4WqsGL7punvYA6vqo wd9JFRL4K8LJ1EKdhMJ7wDOu5/mV5AdioAcL2A1DH93SzODF15NIujehVDa4Pq/6xWHo OZ0WXzdUqQnGhPn4cCBzjLgnqaY3lajlRnd07zcDPkHC3YRle6ShID+MW662O4fJ/rl7 RKjTqijH9EwfEGlK9PSKK4E08HDkQgEEj6/9DG4XcWbYkpWAQqUwDKQo6MSsa730PITU Zt+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884900; x=1735489700; 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=OyI7W7fnkDxR10eAmkTI0DbupaxplDdtdBvj4WSj0sQ=; b=DNDTXwYnhCBi0YeOeRyQb3HXbH+ryXkgaCJTNGeny7aywjndxZWpkxZhVhuXtTysJu 98JtYun2UMxVSDDtvwnVXvBQ8mh/ZF2a+jt80IrMuEcIAtcUUAgR63uGU/AxF8P8cTke TEDh7XdFYdVCboTXSgpdi39I5Zv+eWEbtd6dAONYgmOmNG8YWsf4btPKmTCyJ6wlfkEL J1d1eSEpO+Wcc1Ejwe7M5oRs3Iyn3jaNG11PbKhV0AdhZDfdFQ3JweuLZaJTXU2VTdd7 9OJhJrNovhY130L6ddsPi1MSrVpEJtm1EgiA7McKfvvrlRtmR8jczckNkMOoQtLdfjqE kXuw== X-Gm-Message-State: AOJu0YyWFO5idDAgPpve7grWJLVrmJJUOfFV0mrc7PM9lhFkR/OlZBdx zOpBfuxH9B7z2kzBC1vbDrOWOMnwaK8vo/OM+IvjXb55yCMYVxj/dC0jVJ3f9KKNMDfGhOWhVf9 BgOc= X-Gm-Gg: ASbGnctCyOyFXrgE97grdYQVkinBmR+uws4jnS6JPCJ/axVpdX/jo9wPNTYFaqqZ17v lU2Mena//t87IqQe7bWzzuSM0XXPWZOOTd3M79Tv8uoYe5RnEHo+O1a7eTtiGNPFLXikugInMBX j9XKLlHbWju14ijTaddFsycYRiL58u/cNmkl2lYFMeyNoFuU2mV06x2pSkrvCd/FKdU+IRTWdo9 1qGgFsAXBWNvQPdINuMC9sDwobtJen2hsZwPoxNlu43SD47q7w/+UJI2wegI50= X-Google-Smtp-Source: AGHT+IE1NT1qm6O78znsSQwxVHaUoPmHIkxoWPVnkN/JZlPK4TM42sq7jFHcHvBw0FaM6rjlhMjS8A== X-Received: by 2002:a05:6a00:1809:b0:724:f8d4:2b6e with SMTP id d2e1a72fcca58-72abdd2ec01mr14669158b3a.4.1734884899898; Sun, 22 Dec 2024 08:28:19 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 47/51] tcg/optimize: Use finish_folding as default in tcg_optimize Date: Sun, 22 Dec 2024 08:24:42 -0800 Message-ID: <20241222162446.2415717-48-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::42e; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x42e.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885085549116600 Content-Type: text/plain; charset="utf-8" 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 3bb208d6e9..7481b59d59 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -3079,11 +3079,9 @@ void tcg_optimize(TCGContext *s) done =3D true; break; default: + done =3D finish_folding(&ctx, op); break; } - - if (!done) { - finish_folding(&ctx, op); - } + tcg_debug_assert(done); } } --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885193; cv=none; d=zohomail.com; s=zohoarc; b=fo2TmBbdRUCN5+12B6GD6pSLMNQYAmcCX9tcyfUtniCNVMpEtSkg8N2DaR085RHqk8My78laNSDHltNdzCn1Vw4nE2aSX0FVqmwoWvxMHyKDBRcfFRC7hTKXAYMkJ+zDTOjvV9kir3R2iucCOZ9KCuGR7QH0K7zsr071bb29rxc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885193; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=PmhkoZPz1+ScFaHu09NYHBzvHbi5p/B+3zA/reryXoQ=; b=oHxbJ879/Fncxd8BVRvWLsjgLkJVkhU6N2ACQmAwASTkwKoNuOsuiGh4iG4poVow9WMOLbhF8hPTorSGdOcYXwGlrkDUcGc8tnxHCvA7UsBllRD1HESo1gJnAI1xkvjKvnVS93FEuZfohizqt9F/wGWHgxyR6CH1eVufaMGOnxI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885193772583.2161984804482; Sun, 22 Dec 2024 08:33:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOpb-0005Qs-Nw; Sun, 22 Dec 2024 11:29: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 1tPOob-0004yT-BJ for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:25 -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 1tPOoZ-0003k2-R6 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:25 -0500 Received: by mail-pf1-x429.google.com with SMTP id d2e1a72fcca58-725ed193c9eso2995659b3a.1 for ; Sun, 22 Dec 2024 08:28:22 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884901; x=1735489701; 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=PmhkoZPz1+ScFaHu09NYHBzvHbi5p/B+3zA/reryXoQ=; b=XPWuAhTZwn2gm7eoTT3Q0CmKm/ETW/6SjjMy7UoUAdD/9NrGDz1dOINPm10LPtPtz9 Snubpz/37pJKBrX3fLYI6ywXlSQUCxgg/+Z6UkPFAUkFtpf0hj6KerksAVV76kHRJB85 B1peHau/Pln+vlk2xGl7MKbVJBwAaeqq3g/UepUCZ1PfDHyuRVRju8VH7DoJxc2e6wmg oi6D85BETMNc8fAWyHUiKa79LKaiM+TmQDq4lwPCqBv9OBHoKDsTpmWYg+my1lBYJS09 qx1ur/GVmuro4JOEuB2JSdY99bLZoQkEg9FIX6AH4R0vBFEtg/Q68ujv9MqJ7NWKwsYf UHKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884901; x=1735489701; 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=PmhkoZPz1+ScFaHu09NYHBzvHbi5p/B+3zA/reryXoQ=; b=sn1MMIBpWlmZLK9kv2ejCOVkp5Bx+qbUxEi1SkEj/vjBAvzcpP7n4Md87BdeMYQQT/ dkJxkbMU3j2+WB0gwEKkT5+tGbZr60UnsHp37KW/x6kbasvHxN4HI9fbWScbxi5EPFse Ux+J7hpdnRZ2rhA78hQXjsFmsW0XCK+ufMgPML08DFr1MVRCupdVmL0vT+CnN19afTPG Ng7mAZVQ3VvKfRLQZcBi5dn8/b565BHGj6oMl/ZFUQ8x6zwPPTAG/8EIH62Dno6rYqZR vlKd5M6NA99DOSyonRNkyugcDhx0CIKuIUxGTaT6ss9O5dgj3cApEPzWptjNPH8ScdcW uyFQ== X-Gm-Message-State: AOJu0YxmPtbCghe/oQvEdFDcRwr/Vq05wU9tYAhaQ9NYGYZB1Isp+EnR uwTWhMBE13WYHoJOKFzBRVxr10D8mOnQ/Gw+rHgfuNHzpMkKfRikuPSGlUOi9No/XYmBKjDhfNQ JB3E= X-Gm-Gg: ASbGncusnnpIh/NwTFIMKIM0MN1ENMlbm1UYLT3qHM04nY36eGb4x+C6qkUHCP8z29r ngqQTWqnkrBFSNgfpOVqjTYFF1/+txDMuVpFlodIzGyYagKASvihycz5pppqyNW6i1Ke7Vg9gB/ dde9AmySWEJiRoDdRRAB3/ISJzyVSKJ2wDYA0HJoCKcr+1RpAmoNYLhEpwgSzFBbZpIa+B0tiJv h0IwdgiWuaLpn54+8rt6WM0jqfkYc8GIfulEjwYa521y23NG/q0RB9gpW5XE5w= X-Google-Smtp-Source: AGHT+IHhfgYEITaL5zAiKCd+zU55X9257Uv3JUAeRR0eQW4tn5XnKQ2LrKz2lejd5Ty+M7aQzqWxTg== X-Received: by 2002:a05:6a21:7889:b0:1db:ff9c:6f3a with SMTP id adf61e73a8af0-1e5e081c9edmr15300033637.42.1734884901119; Sun, 22 Dec 2024 08:28:21 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 48/51] tcg/optimize: Remove z_mask, s_mask from OptContext Date: Sun, 22 Dec 2024 08:24:43 -0800 Message-ID: <20241222162446.2415717-49-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885194088116600 Content-Type: text/plain; charset="utf-8" All mask setting is now done with parameters via fold_masks_*. Reviewed-by: Pierrick Bouvier Signed-off-by: Richard Henderson --- tcg/optimize.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 7481b59d59..902c219032 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -64,8 +64,6 @@ typedef struct OptContext { QSIMPLEQ_HEAD(, MemCopyInfo) mem_free; =20 /* In flight values from optimization. */ - uint64_t z_mask; /* mask bit is 0 iff value bit is 0 */ - uint64_t s_mask; /* mask bit is 1 if value bit matches msb */ TCGType type; } OptContext; =20 @@ -947,13 +945,6 @@ static bool finish_folding(OptContext *ctx, TCGOp *op) for (i =3D 0; i < nb_oargs; i++) { TCGTemp *ts =3D 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 =3D=3D 0) { - ts_info(ts)->z_mask =3D ctx->z_mask; - } } return true; } @@ -2862,10 +2853,6 @@ void tcg_optimize(TCGContext *s) ctx.type =3D TCG_TYPE_I32; } =20 - /* Assume all bits affected, no bits known zero, no sign reps. */ - ctx.z_mask =3D -1; - ctx.s_mask =3D 0; - /* * Process each opcode. * Sorted alphabetically by opcode as much as possible. --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885226; cv=none; d=zohomail.com; s=zohoarc; b=UL6mViqF5d8bf3sxWlPRjwilLRtsm+7jla1Qf/AoEEo6p5tywAgAiaH1muimNYSEMCvYiC+2+bZMG5oYqy1zNjtMxFu9N9ZqVX432Sf3eZXTI8LLlsjtcmE89Bpy8CLWlXetp2tH//+1zJ26qplvOqkglPALFPx2qmyypizmTJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885226; h=Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=CP2cLUZ8ZQcQ42iAJZyJU72duE6mhG1kg0Yhh0LbfQQ=; b=LZYf607TyNjPa5vQjUylfYmur1JLjAyCCgLG2DEQzJkdCQkVeSmU15qdPxdqqsdw0QynbhLjZTQNl3MzKkGO5lYKmWK0r8FLtJ27fiZIjDYhtR6nRjnA8F46bV4WT843Gv6exn9we00T6w4OjRJcdZsn7YjXVpByHkE9uibzu5k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885226316147.47193262263772; Sun, 22 Dec 2024 08:33:46 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOpV-0005L7-TE; Sun, 22 Dec 2024 11:29: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 1tPOob-0004yU-Bj for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:25 -0500 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOoZ-0003kA-Rz for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:25 -0500 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2161eb94cceso22380735ad.2 for ; Sun, 22 Dec 2024 08:28:22 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884902; x=1735489702; 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=CP2cLUZ8ZQcQ42iAJZyJU72duE6mhG1kg0Yhh0LbfQQ=; b=sl7D8YHog0cy/yRV6AeJmQ3Opv5S34IAVP/9O8dhduBx4StTVGj1Sm61XQAoqC8W3n gJlioIgew9k+/25lmjuVpsE/42kXbqfQuIUGSbVpVhIAAYe5KZczsvufxtBqEcje+peS xcg/W8g4xtChFAmPPbjPozoLEP5gsQ7CtZ/znRv7lktDtQYjtapUo8/+7uKlBCxDsBPm RrmZPlUkjpP8et9wid0IMTk18fRtO41gIKHVkiBYNp+mLThaVbLVH5NNbCmwtSuFenbl qFhSGe5eKHJ7GbspZB8lT+N0uQeCSrfb2kgIbK2VgvDrcG8SCUc15CfkZ7onN8578e/J Ao3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884902; x=1735489702; 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=CP2cLUZ8ZQcQ42iAJZyJU72duE6mhG1kg0Yhh0LbfQQ=; b=wJdtbB/YVPl2zgpAuHpXoX9NnEWxbNMifFHLVodgGGHcU2P4FH5tTr7gLBKUWxQkkp +j7W7rXMVCf2ImSnjtVk8MisXzzCFvjgMGzTjbGDZw2i6ZZ7YjPctpfhOZgjhJ3ZDNjF 3upCYUwTYon2obcxTr/M5vt27GLp++oQAFdhtJd8l81bemtZKeSZnLiI8TJlIeEOs5FX 6fKC2pVWhepWqZUVOk+OqW/aYC4HahpsB6eT/qHcxTCq/JMy7lYemZ8/XW6kzOfU4s6q YzxY89IyYsCEl1f9wV4cfxBG+bU3Ebx61hXSc7XsYu7gqMTZB0PpswgfIsV7ehB5KVpl vedw== X-Gm-Message-State: AOJu0YyiogoqA3rPRErNf50Wq0DxJRybRlQ0szuzi7IfHiv0twLSL5Id Dn1CPkC/R83EguwZwRwYMwr0tP9O0ctnrxWSAYDnjoMwXkfdasvim2AaSeJqk37xHCD0bE4k8jU C4lE= X-Gm-Gg: ASbGncsvOrjb1T0JMqiKmJI9zsSsuE/zfDEIP5lFeDzEuEgCROGDTaeZVLWAfs28IBj xXB16bPoBYOTBAiEgLZeZjOE3MwqlSjhW4MTteZq6Gv6779gyNMW3H45IjPN6AaI4KCNLDuzl88 ZKodsp0TbkGUw5FUBcWAc8CEW/KDEgvoiraHvoyVHV05bFm7jSsfxDlq+tojAMhQlEKzFls6FjI C37E92ipUuURHn7+tbnMZdnaHNoXT510Y9Wi+20zcLIS/DqfwJ+O8iy9Svhs/g= X-Google-Smtp-Source: AGHT+IFCrGYxpxC4eCT9WFefFGUwcOpiv6xwdoRMdLanw7C38mnGNytYm3ZOiH47yQUFw7yxRkcl7w== X-Received: by 2002:a17:902:f652:b0:215:a05d:fb05 with SMTP id d9443c01a7336-219e6ebd102mr163377505ad.32.1734884902086; Sun, 22 Dec 2024 08:28:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v3 49/51] tcg/optimize: Re-enable sign-mask optimizations Date: Sun, 22 Dec 2024 08:24:44 -0800 Message-ID: <20241222162446.2415717-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::62d; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x62d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885228177116600 Content-Type: text/plain; charset="utf-8" All instances of s_mask have been converted to the new representation. We can now re-enable usage. 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 902c219032..607697e19c 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1780,7 +1780,7 @@ static bool fold_exts(OptContext *ctx, TCGOp *op) g_assert_not_reached(); } =20 - if (0 && !type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_= old)) { + if (!type_change && fold_affected_mask(ctx, op, s_mask & ~s_mask_old))= { return true; } =20 @@ -2489,7 +2489,7 @@ static bool fold_sextract(OptContext *ctx, TCGOp *op) s_mask =3D s_mask_old >> pos; s_mask |=3D -1ull << (len - 1); =20 - if (0 && pos =3D=3D 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_= old)) { + if (pos =3D=3D 0 && fold_affected_mask(ctx, op, s_mask & ~s_mask_old))= { return true; } =20 --=20 2.43.0 From nobody Mon Dec 23 23:39:42 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885231; cv=none; d=zohomail.com; s=zohoarc; b=EFqrKqOkrrgTsmKlOCnaCUlNzA+fGOWgI9J4SFayUNEcR0oap0xirTheh3DzmUnefmuRl3DYcPEhsAKR9n0vmDgcze6BihpV210hQXDHhJQmOf2Kaf+IW+sl5ac4KVKxVnbmiQXDmh2PQPCcXZ9hvKKFpMg7WKWKlFWvYdAAhz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885231; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ctuXEQAvjhmDIIWoKLKBiMc6mMChQIOixW2dzl2+Gwk=; b=EjtIIS5lWPYFr96yRPJroXecfoYipjmX8/0a0XDBKEu3/1/hRHB1MeFEuZaG/GVKTA6K5nTqNOYR9kuVEzrQnSlYqoPrFghyY9urijoduvz3Ul5dmMxYYa5mo3BVTT5tMrfeMLzV90cGJ+9PMvmZ0/xTaJQcabcwBiXdGj0LP+M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 173488523103037.86552634798511; Sun, 22 Dec 2024 08:33:51 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOpd-0005YX-AS; Sun, 22 Dec 2024 11:29:29 -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 1tPOod-00051q-0s for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:29 -0500 Received: from mail-pg1-x52c.google.com ([2607:f8b0:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPOoa-0003kH-7V for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:26 -0500 Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-801c8164ef9so2478836a12.1 for ; Sun, 22 Dec 2024 08:28:23 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884903; x=1735489703; 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=ctuXEQAvjhmDIIWoKLKBiMc6mMChQIOixW2dzl2+Gwk=; b=QCmWUtg0tyudFV35HYJc6rG9HTN7pJib/L4uu1iCDt74hvwEynPEzEyfQioUhmRUdm lMoFDxDcog3Lt+vBI6QiA58RJyM6p9CfOWVtwyP5Vz5TPJIzqZPsWcjgUjKFCQx5xNIN Xiv7bPlQ1txBJeRebmgIbiZKubLey/n9A1ET+4vYD8hmMfnEoa/nAJNSkpVXCw4ZG39J RNL+IlaDInfXRH9uQxCtbK8sM5acp7irYemp0lr/3cH1xI3WgXhOtq7L66kRj5XlVRwS K8vfc/1dsOAEb1aQr5xgNMTJFl7x4u47T0TtZmeFWTZgUCumZjMaj831qz8sNUqw+sEe WaoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884903; x=1735489703; 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=ctuXEQAvjhmDIIWoKLKBiMc6mMChQIOixW2dzl2+Gwk=; b=csxbfs+9qhu7Gv1j5SxDK656edjSo3PxMiQ/PoWkbPY+J/EFp1wnnb+71PVaTt3+zF CthWmUL0+r/ltWeSyit8JaRVFFQApGMj1s1iUkwawK+X/hUxH4eApl8w3Ti1XoZmzTae QA4Vk8kClqFHeKJCIxdDiY8AwkywwP204kX55Dj3VLns07vkF9R15R2SelTxlxxW2wt7 UIxpWhA6fInizwnIwxWu27QNjcAgnlsIBYWBw5mSluwDlWIYWoI6LTQKHHmp2+8JqJzl w78aKZDNVPJ1notR4ztWrZAPqy2FqGK6WdzVubufeb2MKSklkTLZqh8CQe717l+Or94e 4j/Q== X-Gm-Message-State: AOJu0YwQ/+vlNRkqd1xG0DgRcuLNmVf4EIHAqWIUTHH4QJNNVUXj5jT9 d97SemnhY+7O5SXcbOcJhmqiITECTGWdE12nbDVFbKAy3nzqv5ngQgVHvgfd4N6LN7CXkUUW4nU j7Gk= X-Gm-Gg: ASbGncvfDBgnv/OCsEkxtM1Z13rSpvz7DJPMatQtGEHP/dye6WH6Phkcajpccb/SQiB kAft3v/y+++dxUrun+DAuPholAYvG4lcWwl/E1XuhPVm23VYx5olBBdoCjkogX4Ic0uYZrr0UQ8 GoCPLs9ri5lMcC91W/8L5bMw0s68DLwbv09DUV4hzSP91NV4zribp1aRuFaDQ/UwK5TOFNbrmr5 m+UVi729Hr8zOpNFzoRbo+e+lY6VTCL9QrN8wrW/CG976aOlCMRtlb5N2ad0jI= X-Google-Smtp-Source: AGHT+IFEXzWxupMqZrC8D49eLIKc0s3byQA23O0t2RoOQ3MiFNVlFDo6rfZO65TfEDLh2zBebMDqpQ== X-Received: by 2002:a17:902:ebc8:b0:216:4b6f:dde5 with SMTP id d9443c01a7336-219da5e3ba5mr223023945ad.13.1734884902872; Sun, 22 Dec 2024 08:28:22 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 50/51] tcg/optimize: Move fold_bitsel_vec into alphabetic sort Date: Sun, 22 Dec 2024 08:24:45 -0800 Message-ID: <20241222162446.2415717-51-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::52c; envelope-from=richard.henderson@linaro.org; helo=mail-pg1-x52c.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885232380116600 Content-Type: text/plain; charset="utf-8" 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 607697e19c..312cbac690 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1179,6 +1179,10 @@ static bool fold_xx_to_x(OptContext *ctx, TCGOp *op) * 3) those that produce information about the result value. */ =20 +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) || @@ -1341,6 +1345,61 @@ static bool fold_andc(OptContext *ctx, TCGOp *op) return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 +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 =3D arg_info(op->args[2])->val; + uint64_t fv =3D arg_info(op->args[3])->val; + + if (tv =3D=3D -1 && fv =3D=3D 0) { + return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); + } + if (tv =3D=3D 0 && fv =3D=3D -1) { + if (TCG_TARGET_HAS_not_vec) { + op->opc =3D INDEX_op_not_vec; + return fold_not(ctx, op); + } else { + op->opc =3D INDEX_op_xor_vec; + op->args[2] =3D arg_new_constant(ctx, -1); + return fold_xor(ctx, op); + } + } + } + if (arg_is_const(op->args[2])) { + uint64_t tv =3D arg_info(op->args[2])->val; + if (tv =3D=3D -1) { + op->opc =3D INDEX_op_or_vec; + op->args[2] =3D op->args[3]; + return fold_or(ctx, op); + } + if (tv =3D=3D 0 && TCG_TARGET_HAS_andc_vec) { + op->opc =3D INDEX_op_andc_vec; + op->args[2] =3D op->args[1]; + op->args[1] =3D op->args[3]; + return fold_andc(ctx, op); + } + } + if (arg_is_const(op->args[3])) { + uint64_t fv =3D arg_info(op->args[3])->val; + if (fv =3D=3D 0) { + op->opc =3D INDEX_op_and_vec; + return fold_and(ctx, op); + } + if (fv =3D=3D -1 && TCG_TARGET_HAS_orc_vec) { + op->opc =3D INDEX_op_orc_vec; + op->args[2] =3D op->args[1]; + op->args[1] =3D op->args[3]; + return fold_orc(ctx, op); + } + } + return finish_folding(ctx, op); +} + static bool fold_brcond(OptContext *ctx, TCGOp *op) { int i =3D do_constant_folding_cond1(ctx, op, NO_DEST, &op->args[0], @@ -2755,61 +2814,6 @@ static bool fold_xor(OptContext *ctx, TCGOp *op) return fold_masks_zs(ctx, op, z_mask, s_mask); } =20 -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 =3D arg_info(op->args[2])->val; - uint64_t fv =3D arg_info(op->args[3])->val; - - if (tv =3D=3D -1 && fv =3D=3D 0) { - return tcg_opt_gen_mov(ctx, op, op->args[0], op->args[1]); - } - if (tv =3D=3D 0 && fv =3D=3D -1) { - if (TCG_TARGET_HAS_not_vec) { - op->opc =3D INDEX_op_not_vec; - return fold_not(ctx, op); - } else { - op->opc =3D INDEX_op_xor_vec; - op->args[2] =3D arg_new_constant(ctx, -1); - return fold_xor(ctx, op); - } - } - } - if (arg_is_const(op->args[2])) { - uint64_t tv =3D arg_info(op->args[2])->val; - if (tv =3D=3D -1) { - op->opc =3D INDEX_op_or_vec; - op->args[2] =3D op->args[3]; - return fold_or(ctx, op); - } - if (tv =3D=3D 0 && TCG_TARGET_HAS_andc_vec) { - op->opc =3D INDEX_op_andc_vec; - op->args[2] =3D op->args[1]; - op->args[1] =3D op->args[3]; - return fold_andc(ctx, op); - } - } - if (arg_is_const(op->args[3])) { - uint64_t fv =3D arg_info(op->args[3])->val; - if (fv =3D=3D 0) { - op->opc =3D INDEX_op_and_vec; - return fold_and(ctx, op); - } - if (fv =3D=3D -1 && TCG_TARGET_HAS_orc_vec) { - op->opc =3D INDEX_op_orc_vec; - op->args[2] =3D op->args[1]; - op->args[1] =3D 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) { --=20 2.43.0 From nobody Mon Dec 23 23:39:43 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1734885205; cv=none; d=zohomail.com; s=zohoarc; b=E2UqEpuly7yvHrMqI5UAx++o4QVehlvFi8DnEuBUAKfecfz22tRAml0hs/FownB5jN1sNG6MD1dSa7S6ZtdcXiLh57GQvfAg12iRV9rZmfmjeBX+9i17osq0vZQc9CYu5wXiYifLCUu8kUov02X2ucsWPP0WuR5+d3xRaotyReI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734885205; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=qQH+PLeOfmKV/hMlw3a5mreXmP+mpfARLWnXc9y+J+4=; b=jdDQwNh6RgUy36ly5VTdxHdJLKkIWmH6ZVC/gWd21ehL2xkEzJ7+GmlKw7VjMaVJKsSYVlWphesjuTE5Ru98scQjfTj+Mdvc2uEI17Jz34wTG11trx8m23ckKk94O0Art/ZD54OA/TwJoUXH6Ca5FpSPls0+u094Y1itojv8qcM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1734885205708453.4998998925794; Sun, 22 Dec 2024 08:33:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPOpc-0005Rc-6w; Sun, 22 Dec 2024 11:29: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 1tPOod-00051p-0l for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:29 -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 1tPOoa-0003kO-O4 for qemu-devel@nongnu.org; Sun, 22 Dec 2024 11:28:26 -0500 Received: by mail-pf1-x432.google.com with SMTP id d2e1a72fcca58-728ea1e0bdbso3145058b3a.0 for ; Sun, 22 Dec 2024 08:28:24 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-842dcaca43bsm5848808a12.66.2024.12.22.08.28.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 08:28:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734884903; x=1735489703; 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=qQH+PLeOfmKV/hMlw3a5mreXmP+mpfARLWnXc9y+J+4=; b=eUvpJs0LE63PL7s3ZJnmUQTBU3wmhe5a5hj7+6oEhpQOvJnRaDW4ov9PEg2ilzvd9Z P2ITmp6+KMEU/80ras5zdSDBCWcO7EHoW5HmxyS5xabCRgNcQxKjemFzQTelzrSYPmxj TEphB5GgGNWpxH0tcW6tJlawD/f2Mv7Mc1WfS9UDS8JoYtahyGAf6yFTxLwj+fZFTv9s 4RbJx5WUqC/LPVwmPsKpSzp3OgL6x6//IyW07xPMBBC8LzYY4kzmLI+Mlhv63QCebUgj CAEOnCJUYYsjMMdUni5C4RNDnOZewpt2j/PFRMBw+mAy0e4q9dN6VXHaSIOzjaXnyB5l k0EA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734884903; x=1735489703; 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=qQH+PLeOfmKV/hMlw3a5mreXmP+mpfARLWnXc9y+J+4=; b=Y8WHzC8CwHl7fT9jFS8LVUIzXYYbEmawuWOCE75n5pDI2/SyLJYy5x2Z79DB7mvx5f ZYo0sFej7YvdnzfEjHs51+Wfm3h/ARWJFEo2xJddxX6jj8MmfMMpXMd1TxyqcK0BkRYZ lHtyKtG+iXNZs6aNWY0YI5B4wx6ScmAaVTbqeK9jCrJHclPT+eFdm5/23oUrHz/6LCtN jmqC78zsdCaz/gqslBfjIX+2uUPPWU/ojEwpdli8msIEjg/B94267csJuM25Pl+q+sWN l9HZZeQz1bqu16XioDGVnUS/tuAMLonz70vNFdeYt2PGU9AW9mkwCusdRtQx22NGmtGh Fdfw== X-Gm-Message-State: AOJu0YwW/7tgcGfX6Uju+63+o6iVKG5OePoSpULPHluBKNQnVNO1csor /61UnfMLXRMOjmoDWOhwSVEiCCj44LcaiBemcG6Zw4AD+qLqXpEKKAG6abZCUyHicP42qGtxq4v bAvI= X-Gm-Gg: ASbGnctoyuPB+BRz95fczdJCf9mQF/dR5GEF+IWcPX2tJL38w7ruHulxnMBDUEP9ko/ e49ZkDUs2Ne8D0/SZaSM4qgtm7mOoBONkcQey3p3iyd1CvlFALU8td1hO8cGpAu2JjZyIzXg2zc ZijQiC35qpFW99eZb1d+3F+NBl/hhbJHvywsczZFybHWutLxGUnmgnT2qrxd6TarAR7czFiLgGi Fe6u3XBb2WSmMxvp/U0huoEHhyhGkqlBxqVp/J5NCztxPaAcc5Wtv1JRTbS/xc= X-Google-Smtp-Source: AGHT+IF0bWbSlEG5YE5v++2YzUlqLdqMq4M2OQX1WDgkIrRID/z1JJOXV7P7r0JP+mEru9PGQhZTVg== X-Received: by 2002:a05:6a20:e68e:b0:1e1:becc:1c81 with SMTP id adf61e73a8af0-1e5e0801191mr18594050637.32.1734884903544; Sun, 22 Dec 2024 08:28:23 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Pierrick Bouvier Subject: [PATCH v3 51/51] tcg/optimize: Move fold_cmp_vec, fold_cmpsel_vec into alphabetic sort Date: Sun, 22 Dec 2024 08:24:46 -0800 Message-ID: <20241222162446.2415717-52-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241222162446.2415717-1-richard.henderson@linaro.org> References: <20241222162446.2415717-1-richard.henderson@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734885206247116600 Content-Type: text/plain; charset="utf-8" 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 312cbac690..2a9c87eb07 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1603,6 +1603,36 @@ static bool fold_call(OptContext *ctx, TCGOp *op) return true; } =20 +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] =3D 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] =3D 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] =3D 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; @@ -2502,36 +2532,6 @@ static bool fold_setcond2(OptContext *ctx, TCGOp *op) return tcg_opt_gen_movi(ctx, op, op->args[0], i); } =20 -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] =3D 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] =3D 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] =3D 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; --=20 2.43.0