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 1C2893858002 for ; Wed, 24 May 2023 05:32:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1C2893858002 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 (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34O5PvAV004763; Wed, 24 May 2023 05:32:19 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=pxCHdlI8/LpGDS5V4ziVNE33/LtzsQTpNO2TuyVvbuk=; b=Hx1WmVbCITyoZWEK/Z3warvOvx/uEh7vH5uOEyy/U3mG00RlseEXVY8odaZ3FMRhnzEi 7Td1HNWKWl1EEuV/GKGOt3xRa3YxEqf363Yxbq42XtkHK8CBffow0vkrYz4BtwTGIuAe paR2PCAZ36Yk1fLDbR+chFaChrteDyeBIgb8HzCNbRpX7GfNx3TQfKCGuNPQt4Y+pEAG 1Elg67b/UezrGLIjxbTrmYt1xAMRVYDpPpD2Lf4w0zrPtPalm2MdHNbaGOZWkQEEPHdK 44Et++LFbWiGEcTOJqT0f/W5nEdeihj32sSUZF/WkaBkaK2diewpKXQYkMcVpk84pejs WA== Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qsbfys7r6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 May 2023 05:32:19 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34O2eiwk015458; Wed, 24 May 2023 05:32:17 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3qppcf1fx2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 May 2023 05:32:17 +0000 Received: from smtpav01.fra02v.mail.ibm.com (smtpav01.fra02v.mail.ibm.com [10.20.54.100]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34O5WE4K27460128 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 May 2023 05:32:14 GMT Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B7BC52004B; Wed, 24 May 2023 05:32:14 +0000 (GMT) Received: from smtpav01.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E4F5220040; Wed, 24 May 2023 05:32:12 +0000 (GMT) Received: from [9.177.82.162] (unknown [9.177.82.162]) by smtpav01.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 24 May 2023 05:32:12 +0000 (GMT) Message-ID: Date: Wed, 24 May 2023 13:32:11 +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 v2] rs6000: Add buildin for mffscrn instructions Content-Language: en-US To: Peter Bergner , Carl Love Cc: Segher Boessenkool , gcc-patches@gcc.gnu.org References: <4f1af7ba04999d0258354b8e6794621ee303ec53.camel@us.ibm.com> From: "Kewen.Lin" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Xkw3vkzvNaHCAEGjFKtX7sRCH3hcj0Em X-Proofpoint-ORIG-GUID: Xkw3vkzvNaHCAEGjFKtX7sRCH3hcj0Em X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.176.26 definitions=2023-05-24_02,2023-05-23_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 mlxlogscore=774 spamscore=0 priorityscore=1501 adultscore=0 clxscore=1015 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305240042 X-Spam-Status: No, score=-5.0 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,T_SCC_BODY_TEXT_LINE 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 2023/5/24 06:30, Peter Bergner wrote: > On 5/23/23 12:24 AM, Kewen.Lin wrote: >> on 2023/5/23 01:31, Carl Love wrote: >>> The builtins were requested for use in GLibC. As of version 2.31 they >>> were added as inline asm. They requested a builtin so the asm could be >>> removed. >> >> So IMHO we also want the similar support for mffscrn, that is to make >> use of mffscrn and mffscrni on Power9 and later, but falls back to >> __builtin_set_fpscr_rn + mffs similar on older platforms. > > So __builtin_set_fpscr_rn everything we want (sets the RN bits) and > uses mffscrn/mffscrni on P9 and later and uses older insns on pre-P9. > The only problem is we don't return the current FPSCR bits, as the bif > is defined to return void. Yes. > Crazy idea, but could we extend the built-in > with an overload that returns the FPSCR bits? So you agree that we should make this proposed new bif handle pre-P9 just like some other existing bifs. :) I think extending it is good and doable, but the only concern here is the bif name "__builtin_set_fpscr_rn", which matches the existing behavior (only set rounding) but doesn't match the proposed extending behavior (set rounding and get some env bits back). Maybe it's not a big deal if the documentation clarify it well. > To be honest, I like > the __builtin_set_fpscr_rn name better than __builtin_mffscrn[i]. +1 BR, Kewen > The built-in machinery can see that the usage is expecting a return value > or not and for the pre-P9 code, can skip generating the ending mffs if > we don't want the return value. > > Peter > >