From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 8C45E3839830; Mon, 6 Sep 2021 08:59:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8C45E3839830 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1868XM1W068880; Mon, 6 Sep 2021 04:59:38 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3awf3d9a0j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Sep 2021 04:59:38 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1868YJhB074349; Mon, 6 Sep 2021 04:59:38 -0400 Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com with ESMTP id 3awf3d99yr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Sep 2021 04:59:37 -0400 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1868vMFZ022427; Mon, 6 Sep 2021 08:59:35 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04fra.de.ibm.com with ESMTP id 3av0e98gs1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Sep 2021 08:59:35 +0000 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1868xVIq55050680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Sep 2021 08:59:31 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 804454204C; Mon, 6 Sep 2021 08:59:31 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AFC6A42056; Mon, 6 Sep 2021 08:59:29 +0000 (GMT) Received: from luoxhus-MacBook-Pro.local (unknown [9.200.155.166]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 6 Sep 2021 08:59:29 +0000 (GMT) Subject: Re: Ping ^ 2: [PATCH] rs6000: Expand fmod and remainder when built with fast-math [PR97142] To: Segher Boessenkool Cc: will schmidt , gcc-patches@gcc.gnu.org, wschmidt@linux.ibm.com, dje.gcc@gmail.com, linkw@gcc.gnu.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> <20210903214454.GO1583@gate.crashing.org> From: Xionghu Luo Message-ID: Date: Mon, 6 Sep 2021 16:59:27 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210903214454.GO1583@gate.crashing.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 3rxXZCwrxEJRFofxB4SUplwAm2f4Ijr7 X-Proofpoint-GUID: US5Gobk2vBZoxQFaY0IDTT7qDCs3yrnp X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-09-06_02:2021-09-03, 2021-09-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 phishscore=0 bulkscore=0 suspectscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 spamscore=0 adultscore=0 mlxlogscore=999 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2108310000 definitions=main-2109060051 X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, KAM_SHORT, NICE_REPLY_A, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Mon, 06 Sep 2021 08:59:40 -0000 On 2021/9/4 05:44, Segher Boessenkool wrote: > 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: OK. > > "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. Thanks. Verified that different calls are generated on different platforms without this patch. P8BE-64: bl __fmodf_finite P8BE-32: b __fmodf_finite P8LE-64: bl fmodf "l", "__" and "_finite" are optional, so is it OK to check them with below patterns? +/* { dg-final { scan-assembler-not {\mbl? (__)?fmod(_finite)?\M} } } */ +/* { dg-final { scan-assembler-not {\mbl? (__)?fmodf(_finite)?\M} } } */ +/* { dg-final { scan-assembler-not {\mbl? (__)?remainder(_finite)?\M} } } */ +/* { dg-final { scan-assembler-not {\mbl? (__)?remainderf(_finite)?\M} } } */ > > Again, thank you, and thanks to everyone else for the patch review > action :-) > > > Segher > -- Thanks, Xionghu