From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 9B2533858CDA for ; Mon, 26 Sep 2022 05:58:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9B2533858CDA Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28Q4ZPje020587; Mon, 26 Sep 2022 05:58:16 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=/eK8PUbSM7BFk+dePjj5Iv7T5dI/lthrZCnhPJFkAZc=; b=FDLJkNkYtOGKIdaMgcIEMnXOJA85DCXamSBDhBQNj2n5D/g3/Ny3ytjrbrCT/Z75ewaI 0NtPnkU4vUHoYNyGR24h3oZ9YFAoMYrb53F68Smk9GcBX9NNjqbVGWvzwqQ1Q0hWhWiq XoWIPhEJQX/nZmIPREx0eoGYsybUXv7TUYUaNfbh/66CnpuFG2tAoqQu//A7+EUKZMlV P8hjC4EHieeurvqvsegAHllG3p94csORhRelDMjPhFIdix3iMZ4I51dZev8FERFvFujC XQhst9cr+SR2uXvQVBVhpATHf2Xga2KIhMZkdycvTyLFDJdTvP7ZklIjLDxRKR1RjLbg EQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jtbwt2xcv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Sep 2022 05:58:15 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 28Q4sK8S031593; Mon, 26 Sep 2022 05:58:15 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jtbwt2xc5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Sep 2022 05:58:15 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 28Q5p5RE031406; Mon, 26 Sep 2022 05:58:13 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma02fra.de.ibm.com with ESMTP id 3jssh91eq4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 26 Sep 2022 05:58:13 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 28Q5wbRN47120660 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 26 Sep 2022 05:58:37 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 24EB311C04C; Mon, 26 Sep 2022 05:58:10 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48E6811C050; Mon, 26 Sep 2022 05:58:08 +0000 (GMT) Received: from [9.197.236.181] (unknown [9.197.236.181]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 26 Sep 2022 05:58:07 +0000 (GMT) Message-ID: Date: Mon, 26 Sep 2022 13:58:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v6, rs6000] Implemented f[min/max]_optab by xs[min/max]dp [PR103605] Content-Language: en-US To: Segher Boessenkool Cc: HAO CHEN GUI , gcc-patches , David , Peter Bergner References: <20220921215652.GG25951@gate.crashing.org> <2c999590-8222-2879-3fe3-ca69159293ec@linux.ibm.com> <20220922140515.GI25951@gate.crashing.org> From: "Kewen.Lin" In-Reply-To: <20220922140515.GI25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: wmVTCsjIrUOXl4VRpC8cAQB6KwrmKdlR X-Proofpoint-ORIG-GUID: FKRYwHwrtIyklYKsU6a5iT4JzWbCTFld X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-26_04,2022-09-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 spamscore=0 mlxlogscore=538 bulkscore=0 phishscore=0 impostorscore=0 clxscore=1015 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209260033 X-Spam-Status: No, score=-6.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Segher, on 2022/9/22 22:05, Segher Boessenkool wrote: > Hi! > > On Thu, Sep 22, 2022 at 10:28:23AM +0800, Kewen.Lin wrote: >> on 2022/9/22 05:56, Segher Boessenkool wrote: >>> On Fri, Jun 24, 2022 at 10:02:19AM +0800, HAO CHEN GUI wrote: >>> In the other direction I am worried that the unspecs will degrade >>> performance (relative to smin/smax) when -ffast-math *is* active (and >>> this new builtin code and pattern doesn't blow up). >> >> For fmin/fmax it would be fine, since they are transformed to {MAX,MIN} >> EXPR in middle end, and yes, it can degrade for the bifs, although IMHO >> the previous expansion to smin/smax contradicts with the bif names (users >> expect to map them to xs{min,max}dp than others). > > But builtins *never* say to generate any particular instruction. They > say to generate code that implements certain functionality. For many > builtins this does of course boil down to specific instructions, but > even then it could be optimised away completely or replace with > something more specific if things can be folded or such. ah, your explanation refreshed my mind, thanks! Previously I thought the bifs with specific mnemonic as part of their names should be used to generate specific instructions, it's to save users' efforts using inline-asm, if we want them to represent the generic functionality (not bind with specific), we can use some generic names instead. As your explanation, binding at fast-math isn't needed, then I think Haochen's patch v7 with gimple folding can avoid the concern on degradation at fast-math (still smax/smin), nice. :) BR, Kewen