From patchwork Tue Mar 12 14:38:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 779751 Delivered-To: patch@linaro.org Received: by 2002:a5d:604e:0:b0:33e:7753:30bd with SMTP id j14csp2056641wrt; Tue, 12 Mar 2024 07:41:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXaNU/wRdxaepe4gsLsi44ln0/VWX+ovTMon1nCituepe5pEW5ynx0ONYb/l9VzubCgbW3VE9eL1OJULkwLUEMk X-Google-Smtp-Source: AGHT+IEytqgjG6eWN5r/AJW9JWL0B2JbhslnhDMaz+ookK0orBh511Jv6OWXdbc9X9Gu1rE85JXF X-Received: by 2002:a05:622a:1822:b0:42f:1145:71f6 with SMTP id t34-20020a05622a182200b0042f114571f6mr18114503qtc.13.1710254509145; Tue, 12 Mar 2024 07:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710254509; cv=none; d=google.com; s=arc-20160816; b=K3xMEs10dZeB2/V3UQzjBuQkxpD5mdHpnUPFg456E/9ge3ZRYpSgFt07nIQPHo02cL bW1ZDg0Vfx76OGrI86OjfDYCcNycA7Um9JdPsmg+bvag0pmuV2sMQqeMipg3VSoIXRmp NuYC9W0ike5kYXGyxaP15x8Rr6bgCxi5JOoHUDEUsxVHYyv6mzxAE3DHPvLBLR1/VLbW fzMCERU7eF/PP68xWVnkEgNDXv6wHQw1PfyWro0oh4yGf09td1YHkMlWbNeiMnUt5IfP fgXu2MN/Wo42uW3ecbgIi3yfghafvsN+q5EudBSoowCRjwJHoQHcRa581/XZsrjB0cuL si1A== 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:to:from:dkim-signature; bh=R0UZa/Kqkq/XhvVg7z6ft3YJNiymrdk7cLXPp9kdhQ8=; fh=PnYt+qEB9tAfMKoqBm2xjKOFpYyFFGPudh5cVIoieJM=; b=RJ3eIXx0MI7dPAUO1soYgFDceVsDL0F638jRLdDaihNRnzfy8JqXzL7nQmMBGBlF5F zA12vuM7xBZhpSbV2LWLxDKu35G3PlZRQOhZ/cNCojrhdYVmrYVPXiBbFZaYs48DWfCL LyB0n7V/0EsrtTBO37FntCZXIrA5qPzkuotGlWD6d+bW7JMYyq6SWD1IqDWA8U+psmYL 5mPdddUh42sMznFiDGhYL61WRbQfqPprALagd8zfrFe9Ed8bnluWBcMkSocjkSJ+T+RF CcdyBSuD4HLnzCV6Ywet870aYh253yzI0PVfzNr6KeUFf5yARYDfNBV5w9lv1RHVoIn1 W9+Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XMiJaYQK; 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 c5-20020ac85a85000000b0042ef166181bsi7708409qtc.635.2024.03.12.07.41.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Mar 2024 07:41:49 -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=XMiJaYQK; 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 1rk3HN-0003VW-0i; Tue, 12 Mar 2024 10:38:57 -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 1rk3HL-0003V5-P2 for qemu-devel@nongnu.org; Tue, 12 Mar 2024 10:38:55 -0400 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 1rk3HD-0007iF-2E for qemu-devel@nongnu.org; Tue, 12 Mar 2024 10:38:55 -0400 Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6e6b22af648so37799b3a.0 for ; Tue, 12 Mar 2024 07:38:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710254323; x=1710859123; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=R0UZa/Kqkq/XhvVg7z6ft3YJNiymrdk7cLXPp9kdhQ8=; b=XMiJaYQKXE7U1o0j3zvC0nec5mmGjYPKjzok/U4Oqug7Df7cDX/soPFn3XfGK5X6bk uiChtZWQ4sPiv87/9uW+O8vWoOyZypgA7xsjD4n29Sr9/buKL++1dT2a/1yT54Oa6/2S g+O/fMinehqvpM2rRg3TrxX5Vd8Oplnlvg75C18jr7VQm3TnxYar7UeWKFt687V0OpJX x1+TzPBVWS36uzTuD/oHCSq6NUc0c2Csjh2+FWQiyWRVwsrceh13rU3ulrMLgbis7bix hLvpnBt51DdFHjcsczp14F6fLA3bhl8MvX8FCDLLR+5msH6dJ2311sRuiKWkcO4R249h FLvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710254323; x=1710859123; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=R0UZa/Kqkq/XhvVg7z6ft3YJNiymrdk7cLXPp9kdhQ8=; b=YM0V2l/j8WpUJqTeFaPvtdXFzet4178fYKDDOFHGUU1XY58G3bbnSXDnyMJ3wVl4bt zG+sw84Mdp7FsuaxL1gHyCT4B5FsszivDu3jgpCpwCXLUyFAIgtI2/n7uDfKVu4e9CnQ ewsI6c8OfXx/bDv+BHtzSfOaGuKUM6hYTdcrsGm+U+hi36KCE4DzEtPc1rIKtYhd7HqU qbweQx7PG640SyLJiaSKQUFtMac5g/XzfbSHcaCwpwqeueYCpZMT3B9nZD0LI7BaOqeo mpbWoF1QYuk3s1hAaJr6BJQGFqMOJTuaHfd0TeGohEc7pwD0pk1eYKSTW/+VFOcPVEiu AY6w== X-Gm-Message-State: AOJu0YwhLebC1X0Mx6/dzZOYLBae/RyIIssG8Yn4k3H8xfjSpjP1dTZo Mlx7rjma870AEJAnxdO1f34Ullsfcjcjmksp/mpPA+3n4TMgmmJUYYT4TZD3ULbnojiA+ixPMCI 1 X-Received: by 2002:a17:90a:f40d:b0:29b:a1de:32d3 with SMTP id ch13-20020a17090af40d00b0029ba1de32d3mr15086588pjb.17.1710254323601; Tue, 12 Mar 2024 07:38:43 -0700 (PDT) Received: from stoup.. (173-197-098-125.biz.spectrum.com. [173.197.98.125]) by smtp.gmail.com with ESMTPSA id jx15-20020a17090b46cf00b0029baa0b1a6csm7492214pjb.24.2024.03.12.07.38.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 07:38:43 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH for-9.1 00/15] tcg: Canonicalize operations during optimize Date: Tue, 12 Mar 2024 04:38:24 -1000 Message-Id: <20240312143839.136408-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::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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This is a follow-on to 6334a968eec3 ("tcg/optimize: Canonicalize subi to addi during optimization"), which I wrote at the end of the previous devel cycle, then forgot about during the current. In addition to sub->add, canonicalize andc->and etc. The early expansion that we produce for deposit does not fold constants well; expand unsupported deposit during optimize. r~ Richard Henderson (15): tcg/optimize: Fold andc with immediate to and tcg/optimize: Fold orc with immediate to or tcg/optimize: Fold eqv with immediate to xor tcg/i386: Do not accept immediate operand for andc tcg/aarch64: Do not accept immediate operand for andc, orc, eqv tcg/arm: Do not accept immediate operand for andc tcg/ppc: Do not accept immediate operand for andc, orc, eqv tcg/loongarch64: Do not accept immediate operand for andc, orc tcg/s390x: Do not accept immediate operand for andc, orc tcg/riscv: Do not accept immediate operand for andc, orc, eqv tcg/riscv: Do not accept immediate operands for sub tcg/riscv: Do not accept zero operands for logicals, multiply or divide tcg/optimize: Fold and to extu during optimize tcg: Use arg_is_const_val in fold_sub_to_neg tcg/optimize: Lower unsupported deposit during optimize tcg/i386/tcg-target-con-set.h | 3 +- tcg/i386/tcg-target-con-str.h | 1 - tcg/loongarch64/tcg-target-con-set.h | 2 +- tcg/loongarch64/tcg-target-con-str.h | 1 - tcg/riscv/tcg-target-con-set.h | 4 +- tcg/riscv/tcg-target-con-str.h | 2 - tcg/optimize.c | 318 +++++++++++++++++++++++---- tcg/tcg-op.c | 244 +++++--------------- tcg/aarch64/tcg-target.c.inc | 50 ++--- tcg/arm/tcg-target.c.inc | 6 +- tcg/i386/tcg-target.c.inc | 20 +- tcg/loongarch64/tcg-target.c.inc | 31 +-- tcg/ppc/tcg-target.c.inc | 32 +-- tcg/riscv/tcg-target.c.inc | 58 +---- tcg/s390x/tcg-target.c.inc | 56 +---- 15 files changed, 393 insertions(+), 435 deletions(-)