From patchwork Thu Jun 20 13:34:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1950177 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W4hMC66T7z20XW for ; Thu, 20 Jun 2024 23:35:35 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 39F323895FC0 for ; Thu, 20 Jun 2024 13:35:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 3E2B938930E0 for ; Thu, 20 Jun 2024 13:35:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3E2B938930E0 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 3E2B938930E0 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718890508; cv=none; b=j2/3gToy15CWSYYw0iSweTj/yNBf/xvTfcZrsP3dtDiayLAJT7dyudB7TpgR90ziYCCl1/cJ8xJUmxo8sj618tNKJv4Rp56maMzheZTUHbGl2t0ioN1StUoOQIuHL580tN+6AAXj8s8TtpJ9z82tNFqMvBB8E9icFgJBKvZHP20= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718890508; c=relaxed/simple; bh=5jZLahwAa17noz77+efWOjPHZ719zyPzNA45rB0Bymg=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=teLXDx5pZdG3EGHo0pCgc+jBCCrf8S7bQLnI0bVSI0luOiwisPQ1uPO0UtM9qk6aUXi/3+aJYWpxyI186dHTR+JzmEcui1xdhjX2AYKoUTqo5oXmzYZ2Qi/l2+iRiHeXgiH3ikwLB39PhYGYhJJO8seCDk1hSc36BwmqobauJBI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AB1161688; Thu, 20 Jun 2024 06:35:30 -0700 (PDT) Received: from e121540-lin.manchester.arm.com (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6518A3F73B; Thu, 20 Jun 2024 06:35:05 -0700 (PDT) From: Richard Sandiford To: jlaw@ventanamicro.com, gcc-patches@gcc.gnu.org Cc: Richard Sandiford Subject: [PATCH 4/6] sh: Make *minus_plus_one work after RA Date: Thu, 20 Jun 2024 14:34:16 +0100 Message-Id: <20240620133418.350772-5-richard.sandiford@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240620133418.350772-1-richard.sandiford@arm.com> References: <20240620133418.350772-1-richard.sandiford@arm.com> MIME-Version: 1.0 X-Spam-Status: No, score=-20.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org *minus_plus_one had no constraints, which meant that it could be matched after RA with operands 0, 1 and 2 all being different. The associated split instead requires operand 0 to be tied to operand 1. gcc/ * config/sh/sh.md (*minus_plus_one): Add constraints. --- gcc/config/sh/sh.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 92a1efeb811..9491b49e55b 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -1642,9 +1642,9 @@ (define_insn_and_split "*addc" ;; matched. Split this up into a simple sub add sequence, as this will save ;; us one sett insn. (define_insn_and_split "*minus_plus_one" - [(set (match_operand:SI 0 "arith_reg_dest" "") - (plus:SI (minus:SI (match_operand:SI 1 "arith_reg_operand" "") - (match_operand:SI 2 "arith_reg_operand" "")) + [(set (match_operand:SI 0 "arith_reg_dest" "=r") + (plus:SI (minus:SI (match_operand:SI 1 "arith_reg_operand" "0") + (match_operand:SI 2 "arith_reg_operand" "r")) (const_int 1)))] "TARGET_SH1" "#"