From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 80DAB385843A for ; Thu, 23 Dec 2021 17:31:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 80DAB385843A Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1BNGBv2K032429; Thu, 23 Dec 2021 17:31:00 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3d4uyr1s8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Dec 2021 17:30:59 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1BNHS9YK030655; Thu, 23 Dec 2021 17:30:58 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com with ESMTP id 3d4uyr1s6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Dec 2021 17:30:58 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 1BNHMqnr001459; Thu, 23 Dec 2021 17:30:51 GMT Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by ppma03wdc.us.ibm.com with ESMTP id 3d179bd7st-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Dec 2021 17:30:51 +0000 Received: from b03ledav004.gho.boulder.ibm.com (b03ledav004.gho.boulder.ibm.com [9.17.130.235]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1BNHUpIR32375200 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Dec 2021 17:30:51 GMT Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D128C7805C; Thu, 23 Dec 2021 17:30:50 +0000 (GMT) Received: from b03ledav004.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C0BBA78067; Thu, 23 Dec 2021 17:30:48 +0000 (GMT) Received: from work-tp (unknown [9.65.243.99]) by b03ledav004.gho.boulder.ibm.com (Postfix) with ESMTPS; Thu, 23 Dec 2021 17:30:48 +0000 (GMT) Date: Thu, 23 Dec 2021 14:30:45 -0300 From: Raoni Fassina Firmino To: Segher Boessenkool , gcc-patches@gcc.gnu.org, joseph@codesourcery.com, jakub@redhat.com, rguenther@suse.de, hp@bitrange.com, law@redhat.com, will_schmidt@vnet.ibm.com Subject: Re: [PATCH v7] rtl: builtins: (not just) rs6000: Add builtins for fegetround, feclearexcept and feraiseexcept [PR94193] Message-ID: <20211223173045.eqlqbh3lfncgcjfi@work-tp> Mail-Followup-To: Segher Boessenkool , gcc-patches@gcc.gnu.org, joseph@codesourcery.com, jakub@redhat.com, rguenther@suse.de, hp@bitrange.com, law@redhat.com, will_schmidt@vnet.ibm.com References: <20211124234847.tw7xh6pldu5me3mv@work-tp> <20211125211232.GO614@gate.crashing.org> <20211223171643.gaaspvaqcr7lwdg3@work-tp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211223171643.gaaspvaqcr7lwdg3@work-tp> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 8TN0zjaLS03r7zfFzeO9Dsb_GurItISs X-Proofpoint-ORIG-GUID: 6jSZKs1I4bkQ7kXgjfZTp77hyk-G1Ozu X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2021-12-23_04,2021-12-22_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 mlxlogscore=883 clxscore=1015 malwarescore=0 suspectscore=0 mlxscore=0 spamscore=0 adultscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2112230090 X-Spam-Status: No, score=-3.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Dec 2021 17:31:03 -0000 Sorry, sent an incomplete email. it was missing this part: On Thu, Nov 25, 2021 at 03:12:32PM -0600, Segher Boessenkool wrote: > > +;; int fegetround(void) > > +;; > > +;; This expansion for the C99 function only expands for compatible > > +;; target libcs. Because it needs to return one of FE_DOWNWARD, > > +;; FE_TONEAREST, FE_TOWARDZERO or FE_UPWARD with the values as defined > > +;; by the target libc, and since they are free to > > +;; choose the values and the expand needs to know then beforehand, > > +;; this expand only expands for target libcs that it can handle the > > +;; values is knows. > > +;; Because of these restriction, this only expands on the desired > > +;; case and fallback to a call to libc on any otherwise. > > +(define_expand "fegetroundsi" > > (This needs some wordsmithing.) How about something like this? It is just a light editing of the above: ;; This expansion for the C99 function only expands for compatible ;; target libcs, because it needs to return one of FE_DOWNWARD, ;; FE_TONEAREST, FE_TOWARDZERO or FE_UPWARD with the values as defined ;; by the target libc, and since the libc is free to choose the values ;; (and they may differ from the hardware) and the expander needs to ;; know then beforehand, this expanded only expands for target libcs ;; that it can handle the values is knows. ;; Because of these restriction, this only expands on the desired ;; case and fallback to a call to libc otherwise. o/ Raoni