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 1CE553858C1F for ; Wed, 31 May 2023 15:40:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1CE553858C1F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=us.ibm.com Received: from pps.filterd (m0356516.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34VFecLS007096; Wed, 31 May 2023 15:40:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=1Hf/c1ysCcDddS/+x/9HoVwRY2UM4r7o7XJ5+UYrpu0=; b=r7Y3jr0w6oxPx+7vs13efkLC9er8oB6X5D//MiWx2UyngDbMbZsMCw0zG2TZfkdBHlzp bB6u18O24CXyMYH20ia+m1e6geXrjMWBwvtiOq14io4BEx3Mbulf+YyNRiy0cKsdm4PJ VWWuzvueYXm+fCFOKQISsbKMzLUAkzGC/eQb39XAbS9yiSF1D36O+e02LnC8/nVgiwAE zQ9PJUyTWLqC46a+FiJQHWVk4qvCb7nMPXgHBx+x4rPr5f0KiYCXN6UUCw4nQ0nagWDI jqwwiK/UVi6w7ux42KTJxKt3qvinLknGnJEo86IloTZW4Ox/+iUj0WTN+0wnTwj8Qokx zQ== Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qx8vf8fh7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 May 2023 15:40:48 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34VEHCIN019378; Wed, 31 May 2023 15:36:12 GMT Received: from smtprelay02.dal12v.mail.ibm.com ([9.208.130.97]) by ppma01dal.us.ibm.com (PPS) with ESMTPS id 3qu9g6qcgb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 31 May 2023 15:36:12 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay02.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34VFaAOX21365454 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 May 2023 15:36:10 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B39958057; Wed, 31 May 2023 15:36:10 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 032A258058; Wed, 31 May 2023 15:36:10 +0000 (GMT) Received: from li-e362e14c-2378-11b2-a85c-87d605f3c641.ibm.com (unknown [9.163.31.184]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 31 May 2023 15:36:09 +0000 (GMT) Message-ID: <522aa2ef126fd2cc45639fefcff778a8a3737d96.camel@us.ibm.com> Subject: Re: [PATCH v2] rs6000: Add buildin for mffscrn instructions From: Carl Love To: "Kewen.Lin" , Segher Boessenkool Cc: gcc-patches@gcc.gnu.org, Peter Bergner , cel@us.ibm.com Date: Wed, 31 May 2023 08:36:09 -0700 In-Reply-To: References: <4f1af7ba04999d0258354b8e6794621ee303ec53.camel@us.ibm.com> <2fab487a-df28-0a5b-dba8-bed417e039bb@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: NOyyGO65Urqd-ssvioK7OJglScBRlKdG X-Proofpoint-GUID: NOyyGO65Urqd-ssvioK7OJglScBRlKdG 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-31_10,2023-05-31_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 bulkscore=0 priorityscore=1501 adultscore=0 mlxlogscore=519 spamscore=0 lowpriorityscore=0 mlxscore=0 impostorscore=0 clxscore=1015 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305310132 X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: Kewen: On Wed, 2023-05-31 at 17:11 +0800, Kewen.Lin wrote: > > So, there is no need for the builtin to have to determine if the > > user > > is storing the result of the __builtin_set_fpscr_rn. The RN bits > > will > > always be updated by the __builtin_set_fpscr_rn builtin and the > > existing fields of the FPSCR will always be returned by the > > builtin. > > Yeah, I agree, even with pre-P9 code when the returned value is > unused, > I'd expect DCE can eliminate the part for the FPSCR bits reading and > masking, it's just like before (only setting RN bits). > > The only concern I mentioned before is the built-in name doesn't > clearly > match what it does (with extending, it returns something instead) > since > it's only saying "set" and setting RN bits, the return value is > easily > misunderstood as returning old RN bits, the documentation has to > explain > and note it well. > > Looking forward to Segher's opinion on this. I have the patch to extend the __builtin_set_fpscr_rn builtin working. I agree the documentation on the instructions in the ISA is not really clear about that. It needs to be much more explicit in the builtin description that the current RN field is returned then the field is updated with the new RN bits from the argument. I sent the patch, with the updated builtin description and testcases to the GLibC team to see what they thought of it. The goal was for the builtin to be effectively a "drop in replacement" for the inline asm that they have. I was planning on posting the new version if the GLibC team says it works for them. Hopefully I will hear from them soon. Carl