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 2F4983858410 for ; Thu, 19 Oct 2023 01:25:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F4983858410 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 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2F4983858410 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=148.163.156.1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697678733; cv=none; b=QqFC3ZV/X0/EnCptvXMZC//1fqinsHTVYxQq+aD1+++4ZMtMJkqcnPXgcSi2WqSifXPtMcLY16VRz4sxxA4TAQwlEsEDYFnnU0D8iVjd3oTtJUc0nwMJET57ZIzlfpyc15vcolIlwuAKOrFsAZ1XAO9SVD33t7/Nw7hGmoqTlFw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697678733; c=relaxed/simple; bh=pomwCvbiFLdn24FZFAnVeg4ZRHmy8JaVQrRmnUax2OI=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=FP+dE1IYq/aZQnb5FBtFuhHBqFCx84NBrSle14g17j/t2P3GDkJU0lphPgZp0aZLepJ2uQYupFYWqMeO/r4JNvZYNdTCU8elADhhTiVVEfNTt2FqdbFmfeHVryxWzLuONa6hhcZ4WdSQiL0jfX0/XdLJvW3Gj9t57llyee0qpOg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39J1MRuD027288; Thu, 19 Oct 2023 01:25:30 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=tcWkHmPv4w4nyiPVZ+C0+lLRVGFOUczLpz+IVjNOs7E=; b=B8FD2xnjsWmj22pZG6zMeEBUn4uw36d/1SmEYTp5Mt24Te8v38kNhcgvnAKJW4pjzob7 SKk9KsD64iwWdCVr4+WptJx5K5m0opTS1jsLklBAM7JxRJRSR1an8/LL2NbK+hDuYVHm lJukAqwZvEtYFhEstvTt2sAiDKH7+ULJf7syK0KeU5lQ+Tgz1RoiSjbt/c8ytFiesuz1 vtK3CwcsMI6CSOuh4LJOShS+SkPX8EyK/UCKXPO/JBzEYFF2zcXSgsW6F5ssxBUgLWcn IvWdBh1OeotfScoNeX2BrjOsWm7+xh6m01DuJTJnPzEcfGcLmAa4Uehjgg6njd201fB6 Pg== Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tttr0r91p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 01:25:30 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39IMqkYb012858; Thu, 19 Oct 2023 01:25:28 GMT Received: from smtprelay03.dal12v.mail.ibm.com ([172.16.1.5]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tr5pynn1t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 19 Oct 2023 01:25:28 +0000 Received: from smtpav02.wdc07v.mail.ibm.com (smtpav02.wdc07v.mail.ibm.com [10.39.53.229]) by smtprelay03.dal12v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39J1PRc620709930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 19 Oct 2023 01:25:27 GMT Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6641B5805F; Thu, 19 Oct 2023 01:25:27 +0000 (GMT) Received: from smtpav02.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B50555805B; Thu, 19 Oct 2023 01:25:26 +0000 (GMT) Received: from [9.61.148.54] (unknown [9.61.148.54]) by smtpav02.wdc07v.mail.ibm.com (Postfix) with ESMTP; Thu, 19 Oct 2023 01:25:26 +0000 (GMT) Message-ID: Date: Wed, 18 Oct 2023 20:25:26 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [powerpc] fegetenv_and_set_rn now uses the builtins provided by GCC. Content-Language: en-US To: Adhemerval Zanella Netto , Manjunath Matti , libc-alpha@sourceware.org Cc: rajis@linux.ibm.com, Carl Love References: <20230912082730.3951006-1-mmatti@linux.ibm.com> <526f2aac-a06c-d1cf-4c7b-1339846a1711@linaro.org> <866d7459-b031-883b-f356-b05fa2e5ad71@linux.vnet.ibm.com> From: Peter Bergner In-Reply-To: <866d7459-b031-883b-f356-b05fa2e5ad71@linux.vnet.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: OSlWlGubgyhDBhusVZoXN4PEbSIQoZnF X-Proofpoint-GUID: OSlWlGubgyhDBhusVZoXN4PEbSIQoZnF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-19_01,2023-10-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 lowpriorityscore=0 phishscore=0 mlxscore=0 suspectscore=0 mlxlogscore=782 priorityscore=1501 clxscore=1015 adultscore=0 bulkscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310190009 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,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 9/20/23 6:28 AM, Manjunath S Matti wrote: >>> GCC version 14 onwards supports builtins as __builtin_set_fpscr_rn >>> which now returns the FPSCR fields in a double. This feature is >>> available on Power9 when the __SET_FPSCR_RN_RETURNS_FPSCR__ macro >>> is defined along with __builtin_set_fpscr_rn enabled. >>> GCC commit ef3bbc69d15707e4db6e2f198c621effb636cc26 adds >>> this feature. [snip] > I was under the impression that the redefine of fegetenv_and_set_rn and __fesetround_inline > > was needed for architectures below POWE9, i.e POWER8, 7, etc. > > Please correct me if I am wrong. The __builtin_set_fpscr_rn(rn) built-in was changed so that it now always returns the FPSCR as a return value. It is cpu agnostic, so that means it works on all Power cpus, including Power8 and earlier. The only difference you'll see on Power9/Power10 versus the earlier cpus, is that we'll use the new to Power9 mffscrn and mffscrni instructions which automatically return the updated FPSCR value. On the older cpus, we'll emit some extra code to copy the FPSCR value as the return value. The optimizer will eliminate that if you don't want/need the return value. The __SET_FPSCR_RN_RETURNS_FPSCR__ macro allows you to tell whether you're compiling the old built-in with a void return value, or the new one which has a double return value. It doesn't care which cpu you use it on. So short answer is, Adhemerval's suggested change looks correct to me. Peter