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 4E4303858D35; Tue, 7 Jul 2020 21:31:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4E4303858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=segher@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 067LVHEj019121; Tue, 7 Jul 2020 16:31:17 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 067LVHbw019118; Tue, 7 Jul 2020 16:31:17 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Tue, 7 Jul 2020 16:31:16 -0500 From: Segher Boessenkool To: luoxhu Cc: gcc-patches@gcc.gnu.org, dje.gcc@gmail.com, wschmidt@linux.ibm.com, guojiufu@linux.ibm.com, linkw@gcc.gnu.org Subject: Re: [PATCH] rs6000: Split movsf_from_si from high word before reload[PR89310] Message-ID: <20200707213116.GU3598@gate.crashing.org> References: <20200706021757.1118129-1-luoxhu@linux.ibm.com> <20200707001803.GR3598@gate.crashing.org> <66c7b5d6-afa6-53d7-704d-44834ff00311@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <66c7b5d6-afa6-53d7-704d-44834ff00311@linux.ibm.com> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 07 Jul 2020 21:31:19 -0000 Hi! On Tue, Jul 07, 2020 at 04:39:58PM +0800, luoxhu wrote: > > Lots of questions, sorry! > > Thanks for the nice suggestions of the initial patch contains many issues:), Pretty much all of it should *work*, it just can be improved and simplified quite a bit :-) > For this case, %1:SF matches with "=wa"? And how to construct cases to > match("=?r", "wa") and ("=!r", "r") combinations, please? operands[0], not operands[1]? Simple testcases will not put the output into a GPR, unless you force the compiler to do that, because of the ? and !. Often you can just do asm("#" : "+r"(x)); to force "x" into a GPR at that point of the program. But there is nothing stopping the compiler from copying it back to a VSR where it thinks that is cheaper ;-) So maybe this pattern should just have the GPR-to-VSR alternative? It does not look like the GPR destination variants are useful? > + rtx op0 = operands[0]; > + rtx op1 = operands[1]; > + rtx op2 = operands[2]; (Please just write out operands[N] everywhere). > + if (GET_CODE (operands[2]) == SCRATCH) > + op2 = gen_reg_rtx (DImode); > + > + rtx mask = GEN_INT (HOST_WIDE_INT_M1U << 32); > + emit_insn (gen_anddi3 (op2, op1, mask)); Groovy :-) So, it looks like you can remove the ? and ! alternatives, leaving just the first alternative? Segher