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 55044385841A for ; Thu, 22 Sep 2022 02:28:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 55044385841A 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 (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28M17UiI021917; Thu, 22 Sep 2022 02:28:34 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=MRfdPeGU4DafVl9peQmzwS+nSm6usxE847UYffqaICo=; b=q/j9YQWJ5IuW5zawRb/uE9ntcV2GBwnvrMACAxcm6uMkSQCi1K0Icy+Ts5G1vmyfPWlo TFGEKdaxmnAAjLKwiuSBaZoaolYasjk2nJF42vdesFYIc5Fz8XJ7Gd0/VZGyRvzgdEMZ qIbp+kHzEKdvjAFwM8+ihcnayS/WGPrDIgYIzn+7DOHXNJTCJsdKORiV93Ntn7WTh8iP KBB/0sTaibYnG9OH0Twgnx11b9oDrWpDukV3kxoCGXGm7TU/14zQC4s18L05pqYiCVlG Hh1y0wBOwPg6JOFenyaQzt194htwIP6GOnGzWMJAKy007Drc7Hl6nPRJZmmzmcZK+dE9 aw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jrdp1j1e1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Sep 2022 02:28:34 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 28M2HDBw016959; Thu, 22 Sep 2022 02:28:33 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 3jrdp1j1cx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Sep 2022 02:28:32 +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 28M2L9o2024339; Thu, 22 Sep 2022 02:28:30 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma02fra.de.ibm.com with ESMTP id 3jn5v8vej1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Sep 2022 02:28:30 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 28M2SRdo42205624 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Sep 2022 02:28:27 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48910A405B; Thu, 22 Sep 2022 02:28:27 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 96DF9A4054; Thu, 22 Sep 2022 02:28:25 +0000 (GMT) Received: from [9.200.40.106] (unknown [9.200.40.106]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 22 Sep 2022 02:28:25 +0000 (GMT) Message-ID: <2c999590-8222-2879-3fe3-ca69159293ec@linux.ibm.com> Date: Thu, 22 Sep 2022 10:28:23 +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 , HAO CHEN GUI Cc: gcc-patches , David , Peter Bergner References: <20220921215652.GG25951@gate.crashing.org> From: "Kewen.Lin" In-Reply-To: <20220921215652.GG25951@gate.crashing.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: O44pCPyuI1U6fBPYYpvBT6Sl657O6PcB X-Proofpoint-GUID: aK-Jziz0nWlRNfHdFSD86_OF4agQJ872 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-21_13,2022-09-20_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 mlxlogscore=999 suspectscore=0 mlxscore=0 phishscore=0 impostorscore=0 bulkscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209220011 X-Spam-Status: No, score=-7.4 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: on 2022/9/22 05:56, Segher Boessenkool wrote: > Hi! > > On Fri, Jun 24, 2022 at 10:02:19AM +0800, HAO CHEN GUI wrote: >> This patch also binds __builtin_vsx_xs[min/max]dp to fmin/max instead >> of smin/max. So the builtins always generate xs[min/max]dp on all >> platforms. > > But how does this not blow up with -ffast-math? Indeed. Since it guards with "TARGET_VSX && !flag_finite_math_only", the bifs seem to cause ICE at -ffast-math. Haochen, could you double check it? > > 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). > > I still think we should get RTL codes for this, to have access to proper > floating point min/max semantics always and everywhere. "fmin" and > "fmax" seem to be good names :-) It would be good, especially if we have observed some uses of these bifs and further opportunities around them. :) BR, Kewen