From nobody Tue Dec 24 12:12:17 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=1734668311; cv=none; d=zohomail.com; s=zohoarc; b=JBmJjEX8p/diqOIOgfbif4L7lphOdDJREkEd4/AkNGlLhiUrapsyeOZhuy2M2V9V0PVbFv1iH2XFolJstkkx4DodH+I7qZTZ9dFhqV1xBBVLby1N77kEVYTHHII68F78J6j36jvuwKTRhSx5EoIKIqi13N42pB682VmhJH/W8Hg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1734668311; 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=Y0pidgR3zAliJqOpHhhNlBry8ChrLsZBHd/pCpZ2Pbk=; b=if9iDdLVMNP7E5U0Nc9btnHmUrIQh4utAHkRnK6cLFuipYYuVSjV8TrcCAP6sfxgqfTWGD6kBPJZQlNc7hlth10rV6hRiEqaPDKmdopMYavHJiVA64dOetJeBGhkpbH8/Fx9ZWmI2hcQ7yyi2RSeKDzBqj0PPY0Op9oFL+H3H9Y= 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 1734668311591558.2649093138857; Thu, 19 Dec 2024 20:18:31 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOUM5-0008LL-HY; Thu, 19 Dec 2024 23:11:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOUM2-0008Jh-Ua for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:11 -0500 Received: from mail-pj1-x102b.google.com ([2607:f8b0:4864:20::102b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOUM1-0006GB-8y for qemu-devel@nongnu.org; Thu, 19 Dec 2024 23:11:10 -0500 Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-2ef748105deso1061362a91.1 for ; Thu, 19 Dec 2024 20:11:08 -0800 (PST) Received: from stoup.. ([71.212.144.252]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f2ee26fc22sm4165260a91.51.2024.12.19.20.11.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Dec 2024 20:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1734667868; x=1735272668; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=Y0pidgR3zAliJqOpHhhNlBry8ChrLsZBHd/pCpZ2Pbk=; b=YgUHrzMzInai9xuc6TdAvvukC/5HyxgPOXxBEc6S252TQe1nqjZOo8RhCbUz0doJZu iIPAvPCL/jB87RAUMhAux1Kj2nfPPetOUot8Ysaqxk1cTdEgXwzBWUWQaPdGLrsBxQUK uHhCEulMlh8m3Lnq9qnfxoz2Jf/mYMPRR5rtw5JgIlxmvt7FyNc7iIhhFx9IzmUTUG7G b0E1T0y7Kd0+W4V5iMJWHqWDHQyHKYw4QkMcHR+u3O/fXUYI/5Fm3rFU8FqmK62X0pPa /VIOL1eugfebX4wQhwViG6s7+65tuiT6fTyPb9AZ10atP9mtEVDaWYaoD/cxGt6Vr2XN JapQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734667868; x=1735272668; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y0pidgR3zAliJqOpHhhNlBry8ChrLsZBHd/pCpZ2Pbk=; b=oG3xBoaso61mGxCf/d1akj4xqbeyfrNzWYvAUIbEYAKgPgQkqsOwPG4hnpG7+0cVkr ImdSVhJoVunWtQiPX9HGT7Pjrd6vqwM4bo87iFXfs21fUDd4kyf95UoOkgKbzBUQah9C TR3wAa9VLgV9ORrjxUAE0SA7Qfhv6ztesiJYdkGVWVUp0QcqpBlNJggWRi0uXWOby60q I61pAnZgh3tDm0+1scDjRplLFTpEtOZ5S7pZukd1dYzv2GMbW0sZNIPxspMFN+T9KT82 /g+pQjmhH4uu/el0OnekMJMNcA146oYuT1Z/AbzKZO02UKHJT9FSk5XjNep6rAbN/gnb AIfQ== X-Gm-Message-State: AOJu0YxONXK+1Z23PEcoImbfWDlNCAxCIaYcTY1YVvyujQhmvObo+A7k nbRHKhVJQlDp/Eo4WVE/5Ro0AcoV84/qtu2xpy2aHKo3AqmoxlbTSOnEeadgGJsvqsime+PoVjg X X-Gm-Gg: ASbGncsDnYC6xRSovlgtjm4lm0PNPfUeeNbwjFK3HDlQIprgwhlkZkLVVQxHUak/a82 coBfU3ZUlW3i/Cwmern6lTLX4tmJBEYRDjMDP6kMCb8+7dZH/ekbvYBJW9Sl9dYBOK6dRNYCYi8 P8XyGMfAxKszqsQ2zQ2gvw3JU3gOp5LtRThx28VA/Ad9opBQrpEY+mdbCCdnW7Mq3uPa3X+SpwU QaKmSexgT3Q0br0sk0UpDDS97+9bFCuIYP/ymUaZ2+hw6Sdgfk8Kvnd6rp2ca4= X-Google-Smtp-Source: AGHT+IEGzYWomHSTtYnhctPAu7pTbkRtoakLz1wcnx+PxlG0YqFLv5bKbMH3+ukJ/YritMmkej5xVw== X-Received: by 2002:a17:90b:53c7:b0:2ee:b2e6:4275 with SMTP id 98e67ed59e1d1-2f452ee7147mr2000231a91.26.1734667868016; Thu, 19 Dec 2024 20:11:08 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH v2 04/51] tcg/optimize: Split out fold_masks_zs Date: Thu, 19 Dec 2024 20:10:16 -0800 Message-ID: <20241220041104.53105-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241220041104.53105-1-richard.henderson@linaro.org> References: <20241220041104.53105-1-richard.henderson@linaro.org> MIME-Version: 1.0 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::102b; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x102b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1734668312061116600 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. Signed-off-by: Richard Henderson Reviewed-by: Pierrick Bouvier --- tcg/optimize.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tcg/optimize.c b/tcg/optimize.c index 2aa57afd64..d70127b88d 100644 --- a/tcg/optimize.c +++ b/tcg/optimize.c @@ -1044,10 +1044,14 @@ static bool fold_const2_commutative(OptContext *ctx= , TCGOp *op) return fold_const2(ctx, op); } =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