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 175E93858D39 for ; Wed, 24 May 2023 16:32:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 175E93858D39 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 (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34OFCH20022821; Wed, 24 May 2023 16:32:28 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=DSpi1gW83z1gEAlgfIV/+2g5tVh3zlzPWync5qbhYmY=; b=lmRpn1flHMUNVTfWNLTH2HsOlRdQTcXXp2fqh9/IOY0hjMLlzZelCgg0oeGf0SuZDlis x9xbiFsWoGWLhim29DGlDd6j0bcBvuBXG+Nppau3ORUbwMn5KXcFT91OXuZg1feIOG4i D5JU2y+IBqFgEUcolXUIWO+YcBPUPB0hpd0euBYkbOriwX8UEVfXZvXZoRe43EIdnXkT EYn9hG6Z+Vyc5S6fW/ibtdrwG6DHB0DUoi9613ZCC7zdq9CAmj+ZYNmAXNjBTJ2Mw8O+ U7GEhg7Cc3L07ZviSznBJRfRNKpQIrroxKuzeAhmiJJTWCCQAdk03kWEwKiscmYhfbGq og== Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qsn0w24df-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 May 2023 16:32:27 +0000 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 34OG2dBY031309; Wed, 24 May 2023 16:32:27 GMT Received: from smtprelay07.dal12v.mail.ibm.com ([9.208.130.99]) by ppma02dal.us.ibm.com (PPS) with ESMTPS id 3qppdptn03-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 May 2023 16:32:26 +0000 Received: from smtpav02.dal12v.mail.ibm.com (smtpav02.dal12v.mail.ibm.com [10.241.53.101]) by smtprelay07.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 34OGWPP321758324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 May 2023 16:32:25 GMT Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05DA25805A; Wed, 24 May 2023 16:32:25 +0000 (GMT) Received: from smtpav02.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 885FD58051; Wed, 24 May 2023 16:32:24 +0000 (GMT) Received: from [9.61.75.172] (unknown [9.61.75.172]) by smtpav02.dal12v.mail.ibm.com (Postfix) with ESMTP; Wed, 24 May 2023 16:32:24 +0000 (GMT) Message-ID: Date: Wed, 24 May 2023 11:32:24 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v2] rs6000: Add buildin for mffscrn instructions Content-Language: en-US To: Carl Love , "Kewen.Lin" Cc: Segher Boessenkool , gcc-patches@gcc.gnu.org References: <4f1af7ba04999d0258354b8e6794621ee303ec53.camel@us.ibm.com> From: Peter Bergner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: vwb6UxgNfOZV4NsXiXvh0ftgEOgtsqnf X-Proofpoint-GUID: vwb6UxgNfOZV4NsXiXvh0ftgEOgtsqnf 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_11,2023-05-24_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=955 spamscore=0 clxscore=1015 impostorscore=0 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305240137 X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,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 5/24/23 10:20 AM, Carl Love wrote: > Extending the builtin to pre Power 9 is straight forward and I agree > would make good sense to do. > > I am a bit concerned on how to extend __builtin_set_fpscr_rn to add the > new functionality. Peter suggests overloading the builtin to either > return void or returns FPSCR bits. It is my understanding that the > return value for a given builtin had to be the same, i.e. you can't > overload the return value. Maybe you can with Bill's new > infrastructure? I recall having problems trying to overload the return > value in the past and Bill said you couldn't do it. I play with this > and see if I can overload the return value. In this case, I don't think we need a built-in overload, but just change the current built-in to return a double rather than void. All of the old code should still work, since they'll just ignore the return value. As I said, the built-in machinery can see whether we're assigning the built-in return value to a variable or not, ie, the difference between __builtin_set_fpscr_rn (); versus: foo = __builtin_set_fpscr_rn (); In the former case, the built-in can expand exactly as how it does now. In the later case, we'll use the target rtx we're passed in as the destination of the mffscrn[i] insn for P9/10 and for pre-P9, we'll use the target for an additional mffs instruction which we don't generate now. Note we'd only generate the mffs when we're passed in a target rtx as in the second case. The first case we won't. This is all assuming Segher is fine with the change this way. If we do go this way, I would recommend adding a predefined macro that users can test for to know whether the built-in returns a value or not. If Segher doesn't like this idea, then it's all moot! :-) Peter