From patchwork Tue May 31 15:32:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 628297 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rJyDP1DqVz9s3T for ; Wed, 1 Jun 2016 01:32:52 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=rpCFa8lc; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=j6yMUeO5fXG6Gl0cn4Il/PXGizzv4Ezn0RdJKVYSjZNMFp 2xsBw0dHg3bsKiw+dJrS5J7giL0SMpd0pQy0+deel/KfAJfywZTPkp6IWZdxduWY nl4YnCWZpvBZK0tAt9rN9e//+tuTALKzdJ3XfPoeMmMAyJcp5g8WzhzoTHh+8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=jpKNAJnKAh2B6gL/YjxlbyUxjek=; b=rpCFa8lcRTpoa3rn00X5 QOLL9eGXBLojYvjcdgCeIGqbiVenK+at6Yj3QPtyDHIg1TInrDuZtI08MgsN9ro5 tIE6831D0GuWmBCTn5vDV9kXSH5OWlN8TfFI9xN9jbcvXn6Laim1Ro+lAK9m5RHO pHO6SSzAjOY5RiCU6gWOlsY= Received: (qmail 106397 invoked by alias); 31 May 2016 15:32:46 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 106387 invoked by uid 89); 31 May 2016 15:32:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL, BAYES_05, KAM_ASCII_DIVIDERS, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=H*MI:online, Addition, eliminates, H*r:ip*192.168.0.16 X-HELO: mailout10.t-online.de Received: from mailout10.t-online.de (HELO mailout10.t-online.de) (194.25.134.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 31 May 2016 15:32:35 +0000 Received: from fwd05.aul.t-online.de (fwd05.aul.t-online.de [172.20.27.149]) by mailout10.t-online.de (Postfix) with SMTP id B534741E29DC for ; Tue, 31 May 2016 17:32:31 +0200 (CEST) Received: from [192.168.0.16] (ECpDwmZpYhqrmgfGue4LSm0WBFSuuFb2vpZ2XPzhgzW+ySvICNAOdH+m200pvp+Q2J@[115.165.93.200]) by fwd05.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1b7leg-3cfEP20; Tue, 31 May 2016 17:32:30 +0200 Message-ID: <1464708747.15496.5.camel@t-online.de> Subject: [SH][committed] Simplify DImode add, sub, neg patterns From: Oleg Endo To: gcc-patches Date: Wed, 01 Jun 2016 00:32:27 +0900 Mime-Version: 1.0 X-IsSubscribed: yes Hi, The attached patch simplifies some DImode patterns on SH. The force_reg in the expand patterns can also be expressed by using the appropriate predicate, which eliminates the need for the expand patterns altogether. Tested on sh-elf with make -k check RUNTESTFLAGS="--target_board=sh-sim\{-m2/-ml,-m2/-mb, -m2a/-mb,-m4/-ml,-m4/-mb,-m4a/-ml,-m4a/-mb}" Committed as r236927. Cheers, Oleg gcc/ChangeLog: * config/sh/sh.md (adddi3, subdi3, negdi2, abs2): Remove define_expand patterns. (adddi3_compact): Rename to adddi3. (subdi3_compact): Rename to subdi3. (*negdi2): Rename to negdi2. (*abs2): Rename to abs2. diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index 406721d..30948ca 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -1535,18 +1535,7 @@ ;; Addition instructions ;; ------------------------------------------------------------------------- -(define_expand "adddi3" - [(set (match_operand:DI 0 "arith_reg_operand") - (plus:DI (match_operand:DI 1 "arith_reg_operand") - (match_operand:DI 2 "arith_operand")))] - "" -{ - operands[2] = force_reg (DImode, operands[2]); - emit_insn (gen_adddi3_compact (operands[0], operands[1], operands[2])); - DONE; -}) - -(define_insn_and_split "adddi3_compact" +(define_insn_and_split "adddi3" [(set (match_operand:DI 0 "arith_reg_dest") (plus:DI (match_operand:DI 1 "arith_reg_operand") (match_operand:DI 2 "arith_reg_operand"))) @@ -1938,21 +1927,10 @@ ;; Subtraction instructions ;; ------------------------------------------------------------------------- -(define_expand "subdi3" - [(set (match_operand:DI 0 "arith_reg_operand" "") - (minus:DI (match_operand:DI 1 "arith_reg_or_0_operand" "") - (match_operand:DI 2 "arith_reg_operand" "")))] - "" -{ - operands[1] = force_reg (DImode, operands[1]); - emit_insn (gen_subdi3_compact (operands[0], operands[1], operands[2])); - DONE; -}) - -(define_insn_and_split "subdi3_compact" +(define_insn_and_split "subdi3" [(set (match_operand:DI 0 "arith_reg_dest") (minus:DI (match_operand:DI 1 "arith_reg_operand") - (match_operand:DI 2 "arith_reg_operand"))) + (match_operand:DI 2 "arith_reg_operand"))) (clobber (reg:SI T_REG))] "TARGET_SH1" "#" @@ -4393,13 +4371,7 @@ ;; Don't split into individual negc insns immediately so that neg:DI (abs:DI) ;; can be combined. -(define_expand "negdi2" - [(parallel [(set (match_operand:DI 0 "arith_reg_dest") - (neg:DI (match_operand:DI 1 "arith_reg_operand"))) - (clobber (reg:SI T_REG))])] - "TARGET_SH1") - -(define_insn_and_split "*negdi2" +(define_insn_and_split "negdi2" [(set (match_operand:DI 0 "arith_reg_dest") (neg:DI (match_operand:DI 1 "arith_reg_operand"))) (clobber (reg:SI T_REG))] @@ -4480,13 +4452,7 @@ } [(set_attr "type" "arith")]) -(define_expand "abs2" - [(parallel [(set (match_operand:SIDI 0 "arith_reg_dest") - (abs:SIDI (match_operand:SIDI 1 "arith_reg_operand"))) - (clobber (reg:SI T_REG))])] - "TARGET_SH1") - -(define_insn_and_split "*abs2" +(define_insn_and_split "abs2" [(set (match_operand:SIDI 0 "arith_reg_dest") (abs:SIDI (match_operand:SIDI 1 "arith_reg_operand"))) (clobber (reg:SI T_REG))]