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 9894A384B13D; Thu, 9 Jul 2020 19:25:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9894A384B13D 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 069JPFua011777; Thu, 9 Jul 2020 14:25:15 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 069JPF7a011776; Thu, 9 Jul 2020 14:25:15 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 9 Jul 2020 14:25:15 -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: <20200709192515.GO3598@gate.crashing.org> References: <20200706021757.1118129-1-luoxhu@linux.ibm.com> <20200707001803.GR3598@gate.crashing.org> <66c7b5d6-afa6-53d7-704d-44834ff00311@linux.ibm.com> <20200707213116.GU3598@gate.crashing.org> <66faac54-0620-5ee0-ff48-5609ad9e3fa7@linux.ibm.com> <20200708224334.GY3598@gate.crashing.org> 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=-10.2 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: Thu, 09 Jul 2020 19:25:17 -0000 Hi! On Thu, Jul 09, 2020 at 11:09:42AM +0800, luoxhu wrote: > > Maybe change it back to just SI? It won't match often at all for QI or > > HI anyway, it seems. Sorry for that detour. Should be good with the > > above nits fixed :-) > > OK, if I see correctly, subreg of DImode should be SImode and I used > subreg:SI to match only SI, so no need to consider mask for QI and HI? :) My problem with it was that the shift amounts won't be 32 for QI etc.? > +;; {%1:SF=unspec[r122:DI>>0x20#0] 86;clobber scratch;} > +;; split it before reload with "and mask" to avoid generating shift right > +;; 32 bit then shift left 32 bit. > +(define_insn_and_split "movsf_from_si2" > + [(set (match_operand:SF 0 "gpc_reg_operand" "=wa") > + (unspec:SF [ > + (subreg:SI ( > + ashiftrt:DI ( Opening parens *start* a line, they never end it. So: (define_insn_and_split "movsf_from_si2" [(set (match_operand:SF 0 "gpc_reg_operand" "=wa") (unspec:SF [(subreg:SI (ashiftrt:DI (match_operand:DI 1 "input_operand" "r") (const_int 32)) 0)] UNSPEC_SF_FROM_SI)) (clobber (match_scratch:DI 2 "=r"))] or something like that. There aren't really any real rules... The important points are that nested things should be indented, and things at the same level should have the same indent (like the outer set and clobber). The [ for an unspec is sometimes put at the end of a line, that reads a little better perhaps. > + "TARGET_NO_SF_SUBREG" > + "#" > + "&& vsx_reg_sfsubreg_ok (operands[0], SFmode)" Put this in the insn condition? And since this is just a predicate, you can just use it instead of gpc_reg_operand. (The split condition becomes "&& 1" then, not ""). Segher