From patchwork Wed Oct 25 07:26:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 737829 Delivered-To: patch@linaro.org Received: by 2002:adf:f842:0:b0:32d:baff:b0ca with SMTP id d2csp148838wrq; Wed, 25 Oct 2023 00:27:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGk25hdSlf1VaaDAhP1pimSTF/k6oIaaGf2o8CPxVUL0y3iQBvRS0iuACBHqIt/R6YP89Yw X-Received: by 2002:ad4:5be5:0:b0:66d:108d:eb3b with SMTP id k5-20020ad45be5000000b0066d108deb3bmr15967706qvc.48.1698218877695; Wed, 25 Oct 2023 00:27:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698218877; cv=none; d=google.com; s=arc-20160816; b=HLIckP1N7JO4Vzj7TxgvxdvhGg1LS4jAcfJ54btJVJtA33Cy8ezjfPl/CeelgbUHSs mdQhDIR2zCuLR9aFZhmhvG3MuzputpWZWwp3En/jgYwNZNwW0RQ1w5utuGK1PHgvaHB+ S4bwsm7ljBJaWJfCTPdqzmypId4gZGDFnNy8D2BdlmBfvaJMfxIXJFe//G9pblUJw+OZ bCFDf0RcH5q3xnXN5sah0CEmmC/eNgqAcJkMNIsoNwAqOSRppxDYZ2kyvZMVi8+qXqwk HdvSSOaBFoVW9zTj0tNM8K63hZLdRL0QpL/D4RkKKI7z7oXSwqpdw7nko2ojGnJiskfi 4/+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=pDzjcVIxfIMvzQDzwDDOFsz7nrty94QwQm/vY13CkFo=; fh=ycigHkwOPieh2u5PmcA89sNk/qPD1ZkdDlL8Mchfvw8=; b=NxBBKcNchyu4iw+umSny8ZAAaJc7A62Voc3JbRZoJ3mNVHE39EAqk+DZ1E83486ZoZ laeKZJ1o1cYg35UDk5XYMoeniHCj3YzpuS0NcQmXpThv1tWbzBj1F0DKLKuU1liBHLgp oSVMajxwfBM2Vqo1ulhKaFrB0cSvIig5m1ODxiGh5GL4A68NPzeBAV3YXwounURbepSg QDLXsQJrChalhgfsehiMISChVBhJJDVnBxAjrWxm+tiBjYXNtewvcBqn5PSr2KaBEH/d /cKvlorjgzkb0rDZ3Mf/UVbU454rAQ1nl9tfxugLOO/mmWszo0wLSJk4X+AioR5XJhgW L1GQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wdV7ZZkC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q3-20020a05620a024300b00775c336a1bbsi7854661qkn.112.2023.10.25.00.27.57 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 25 Oct 2023 00:27:57 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wdV7ZZkC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qvYIQ-00009U-RS; Wed, 25 Oct 2023 03:27:18 -0400 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 1qvYIM-00008H-NI for qemu-devel@nongnu.org; Wed, 25 Oct 2023 03:27:14 -0400 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 1qvYIK-0004dQ-2o for qemu-devel@nongnu.org; Wed, 25 Oct 2023 03:27:14 -0400 Received: by mail-pl1-x632.google.com with SMTP id d9443c01a7336-1caad0bcc95so35992035ad.0 for ; Wed, 25 Oct 2023 00:27:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1698218829; x=1698823629; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pDzjcVIxfIMvzQDzwDDOFsz7nrty94QwQm/vY13CkFo=; b=wdV7ZZkCm/83pUpbmfH2ylIMGuZ2LAl8BE3eiYAdSCocF6OhuPNIkbZGn9s9Ekhd2m MvwSEjLyBAeCj5G6urkiL1LluVVtAS/8zoTEDMFdGWflvhF5k+65OeRq3HDhBjqja964 4S25pUvMA5GLprEukP8VSHq6CAtH8+pwzzxhhqvxMXwi1aA6dVyxuc9UGPq9kn3pgThE yLXjKMwSKtlHPpL8yE1kxIfFg+7NK4hsqLHI4y4NZ0cfJVNy/faNV1svsDbqM+kAUJYe P73IjUBGKnKB07Gc0h8tBguUcJd21bIdbQqeQHY1UDOLVAbm0LNhZObqb5hOEIlv386x jnmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698218829; x=1698823629; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pDzjcVIxfIMvzQDzwDDOFsz7nrty94QwQm/vY13CkFo=; b=tzod/Eq84YVTDugdRDxkLSxrqjv2UIpPI6Pj0s4QTf4ZgDuqRJvY6q1uke6hWdwhav UPMZ46so6IyMRJRBsD4qL2vVL6kWULui58X2b/+0iaDsB5P+B8m6T/PKTszvlcMarv5h Ddx6mbK4WGhpX1Dp3lVpBg+tQ1X99XYhBHmqtRQWdosB0Y81u+moKXwp98QZRDIAGjBd mj1ejSo78hTEG3HSDmZRSd8+Q565H3v3Ol2Knd6ZYLLMn91aIcsg6N4Uo2vSGhr1A+us 80ZTJpKNNsI7m81ukl0K/Jjl9DRUXe11TXJYKtnjwfmue4Gg+J6exlb/RAvYn+W9IqJe qNLQ== X-Gm-Message-State: AOJu0YwWpAZfR4D8QDZwqKbpjpKFDi8/x1Z86fkMNQ6iTdlxDMkzigZe ZFpWwddlbV8A0nHRdF+9Y+/WymXCfMBYVXHVmMM= X-Received: by 2002:a17:902:c94d:b0:1c4:fae:bf28 with SMTP id i13-20020a170902c94d00b001c40faebf28mr12027624pla.32.1698218828738; Wed, 25 Oct 2023 00:27:08 -0700 (PDT) Received: from stoup.. ([71.212.149.95]) by smtp.gmail.com with ESMTPSA id ji5-20020a170903324500b001b06c106844sm8578661plb.151.2023.10.25.00.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 00:27:08 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: philmd@linaro.org Subject: [PATCH 00/29] tcg: Introduce TCG_COND_TST{EQ,NE} Date: Wed, 25 Oct 2023 00:26:38 -0700 Message-Id: <20231025072707.833943-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Inspired by some other patch review this week, expose a pair of comparison operators that map to the "test" comparison that is available on many architectures. Convert target/alpha to use this as an exemplar. r~ Richard Henderson (29): tcg: Introduce TCG_COND_TST{EQ,NE} tcg/optimize: Split out arg_is_const_val tcg/optimize: Split out do_constant_folding_cond1 tcg/optimize: Do swap_commutative2 in do_constant_folding_cond2 tcg/optimize: Split out arg_new_constant tcg/optimize: Handle TCG_COND_TST{EQ,NE} tcg/aarch64: Support TCG_COND_TST{EQ,NE} tcg/aarch64: Generate TBZ, TBNZ tcg/arm: Support TCG_COND_TST{EQ,NE} tcg/i386: Pass x86 condition codes to tcg_out_cmov tcg/i386: Move tcg_cond_to_jcc[] into tcg_out_cmp tcg/i386: Add rexw argument to tcg_out_testi tcg/i386: Support TCG_COND_TST{EQ,NE} tcg/loongarch64: Support TCG_COND_TST{EQ,NE} tcg/mips: Support TCG_COND_TST{EQ,NE} tcg/riscv: Support TCG_COND_TST{EQ,NE} tcg/sparc64: Implement tcg_out_extrl_i64_i32 tcg/sparc64: Hoist read of tcg_cond_to_rcond tcg/sparc64: Pass TCGCond to tcg_out_cmp tcg/sparc64: Support TCG_COND_TST{EQ,NE} tcg/ppc: Sink tcg_to_bc usage into tcg_out_bc tcg/ppc: Use cr0 in tcg_to_bc and tcg_to_isel tcg/ppc: Create tcg_out_and_rc tcg/ppc: Support TCG_COND_TST{EQ,NE} tcg/s390x: Support TCG_COND_TST{EQ,NE} tcg/tci: Support TCG_COND_TST{EQ,NE} target/alpha: Use TCG_COND_TST{EQ,NE} for BLB{C,S} target/alpha: Use TCG_COND_TST{EQ,NE} for CMOVLB{C,S} target/alpha: Use TCG_COND_TSTNE for gen_fold_mzero include/tcg/tcg-cond.h | 49 +++- tcg/aarch64/tcg-target-con-set.h | 4 +- target/alpha/translate.c | 94 +++---- tcg/optimize.c | 444 ++++++++++++++++++++++--------- tcg/tcg.c | 4 +- tcg/tci.c | 14 + docs/devel/tcg-ops.rst | 2 + tcg/aarch64/tcg-target.c.inc | 156 ++++++++--- tcg/arm/tcg-target.c.inc | 59 ++-- tcg/i386/tcg-target.c.inc | 111 ++++---- tcg/loongarch64/tcg-target.c.inc | 56 ++-- tcg/mips/tcg-target.c.inc | 41 +++ tcg/ppc/tcg-target.c.inc | 213 ++++++++------- tcg/riscv/tcg-target.c.inc | 20 +- tcg/s390x/tcg-target.c.inc | 127 ++++++--- tcg/sparc64/tcg-target.c.inc | 67 +++-- 16 files changed, 998 insertions(+), 463 deletions(-)