From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id B1C9138582A5 for ; Mon, 1 Aug 2022 17:14:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B1C9138582A5 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 271HD7qZ010771; Mon, 1 Aug 2022 12:13:07 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 271HD7ID010770; Mon, 1 Aug 2022 12:13:07 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Mon, 1 Aug 2022 12:13:07 -0500 From: Segher Boessenkool To: HAO CHEN GUI Cc: gcc-patches , David , "Kewen.Lin" , Peter Bergner Subject: Re: [PATCH, rs6000] Add multiply-add expand pattern [PR103109] Message-ID: <20220801171307.GF25951@gate.crashing.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Aug 2022 17:14:10 -0000 Hi! On Mon, Jul 25, 2022 at 01:11:47PM +0800, HAO CHEN GUI wrote: > This patch adds an expand and several insns for multiply-add with > three 64bit operands. > PR target/103109 > * config/rs6000/rs6000.md (maddditi4): New pattern for > multiply-add. Please don't break lines unnecessarily. > +(define_expand "maddditi4" > + [(set (match_operand:TI 0 "gpc_reg_operand") > + (plus:TI > + (mult:TI (any_extend:TI > + (match_operand:DI 1 "gpc_reg_operand")) > + (any_extend:TI > + (match_operand:DI 2 "gpc_reg_operand"))) > + (any_extend:TI > + (match_operand:DI 3 "gpc_reg_operand"))))] Broken indentation, should be (define_expand "maddditi4" [(set (match_operand:TI 0 "gpc_reg_operand") (plus:TI (mult:TI (any_extend:TI (match_operand:DI 1 "gpc_reg_operand")) (any_extend:TI (match_operand:DI 2 "gpc_reg_operand"))) (any_extend:TI (match_operand:DI 3 "gpc_reg_operand"))))] > + "TARGET_POWERPC64 && TARGET_MADDLD" TARGET_MADDLD should itself already include TARGET_POWERPC64. Could you please send a separate patch for that first? > +(define_insn "madddi4_lowpart" > + [(set (match_operand:DI 0 "gpc_reg_operand" "=r") > + (subreg:DI > + (plus:TI > + (mult:TI (any_extend:TI > + (match_operand:DI 1 "gpc_reg_operand" "r")) > + (any_extend:TI > + (match_operand:DI 2 "gpc_reg_operand" "r"))) > + (any_extend:TI > + (match_operand:DI 3 "gpc_reg_operand" "r"))) > + 8))] [(set (match_operand:DI 0 "gpc_reg_operand" "=r") (subreg:DI (plus:TI (mult:TI (any_extend:TI (match_operand:DI 1 "gpc_reg_operand" "r")) (any_extend:TI (match_operand:DI 2 "gpc_reg_operand" "r"))) (any_extend:TI (match_operand:DI 3 "gpc_reg_operand" "r"))) 8))] (and similar for _le of course). Segher