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 DF5D93847818; Fri, 3 Sep 2021 21:45:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DF5D93847818 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=fail 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 183Litl9025794; Fri, 3 Sep 2021 16:44:55 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 183Listk025793; Fri, 3 Sep 2021 16:44:54 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 3 Sep 2021 16:44:54 -0500 From: Segher Boessenkool To: Xionghu Luo Cc: will schmidt , gcc-patches@gcc.gnu.org, wschmidt@linux.ibm.com, dje.gcc@gmail.com, linkw@gcc.gnu.org Subject: Re: Ping ^ 2: [PATCH] rs6000: Expand fmod and remainder when built with fast-math [PR97142] Message-ID: <20210903214454.GO1583@gate.crashing.org> References: <20210416071007.78812-1-luoxhu@linux.ibm.com> <6d438971-4778-91cf-451c-a493b0cf9bdf@linux.ibm.com> <4ead69cf-daac-31bb-ddb5-d7b41cf298e2@linux.ibm.com> <2260972d-e44d-f084-69bb-2b7c96c00525@linux.ibm.com> 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=-5.6 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_SHORT, TXREP, T_SPF_HELO_PERMERROR, T_SPF_PERMERROR autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 03 Sep 2021 21:45:58 -0000 Hi! On Fri, Sep 03, 2021 at 10:31:24AM +0800, Xionghu Luo wrote: > fmod/fmodf and remainder/remainderf could be expanded instead of library > call when fast-math build, which is much faster. Thank you very much for this patch. Some trivial comments if you haven't commmitted it yet: > +(define_expand "fmod3" > + [(use (match_operand:SFDF 0 "gpc_reg_operand")) > + (use (match_operand:SFDF 1 "gpc_reg_operand")) > + (use (match_operand:SFDF 2 "gpc_reg_operand"))] > + "TARGET_HARD_FLOAT > + && TARGET_FPRND > + && flag_unsafe_math_optimizations" It should have one extra space before each && here: "TARGET_HARD_FLOAT && TARGET_FPRND && flag_unsafe_math_optimizations" (so that everything inside of the string aligns). > +(define_expand "remainder3" (same here). > +/* { dg-final { scan-assembler-not {\mbl fmod\M} } } */ > +/* { dg-final { scan-assembler-not {\mbl fmodf\M} } } */ > +/* { dg-final { scan-assembler-not {\mbl remainder\M} } } */ > +/* { dg-final { scan-assembler-not {\mbl remainderf\M} } } */ These are negative tests, so won't spuriously fail, but this does not test for the function prefixes we can have. See gcc.target/powerpc/builtins-1.c for example. Again, thank you, and thanks to everyone else for the patch review action :-) Segher