From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78063 invoked by alias); 29 Nov 2017 22:27:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 78048 invoked by uid 89); 29 Nov 2017 22:27:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KB_WAM_FROM_NAME_SINGLEWORD,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1316 X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 Nov 2017 22:27:23 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 4F66512407DF; Wed, 29 Nov 2017 22:27:22 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: dje.gcc@gmail.com, Segher Boessenkool Subject: [PATCH] rs6000: Add second variant of adde Date: Wed, 29 Nov 2017 22:34:00 -0000 Message-Id: <1c14d1ae7148d3b01a3441960f90089b13838607.1511994173.git.segher@kernel.crashing.org> X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg02522.txt.bz2 This adds a second variant of the adde insn pattern, this one with the CA register as the second operand. The existing pattern has it as the third operand. It would be ideal if RTL was always canonicalised like that, but it isn't (and that is not trivial), and this is a simple and harmless patch. Segher 2017-11-28 Segher Boessenkool * config/rs6000/rs6000.md (*add3_carry_in_internal2): New. --- gcc/config/rs6000/rs6000.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 20b1581..7e91d54 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -1915,6 +1915,16 @@ (define_insn "*add3_carry_in_internal" "adde %0,%1,%2" [(set_attr "type" "add")]) +(define_insn "*add3_carry_in_internal2" + [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") + (plus:GPR (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") + (reg:GPR CA_REGNO)) + (match_operand:GPR 2 "gpc_reg_operand" "r"))) + (clobber (reg:GPR CA_REGNO))] + "" + "adde %0,%1,%2" + [(set_attr "type" "add")]) + (define_insn "add3_carry_in_0" [(set (match_operand:GPR 0 "gpc_reg_operand" "=r") (plus:GPR (match_operand:GPR 1 "gpc_reg_operand" "r") -- 1.8.3.1