From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26511 invoked by alias); 20 May 2019 21:48:36 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 26499 invoked by uid 89); 20 May 2019 21:48:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 May 2019 21:48:34 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-01.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1hSq8y-000320-Lm from joseph_myers@mentor.com ; Mon, 20 May 2019 14:48:28 -0700 Received: from digraph.polyomino.org.uk (137.202.0.90) by svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Mon, 20 May 2019 22:48:25 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.90_1) (envelope-from ) id 1hSq8u-0007Mf-Rg; Mon, 20 May 2019 21:48:24 +0000 Date: Mon, 20 May 2019 21:48:00 -0000 From: Joseph Myers To: Martin Jambor CC: Tejas Joshi , Subject: Re: About GSOC. In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2019-05/txt/msg00166.txt.bz2 On Mon, 20 May 2019, Martin Jambor wrote: > in addition to the things already pointed out by Joseph, I have the > following comments. But as Joseph has already pointed out, you should > also test your patch on __float128 types, so please make sure your code > gets invoked and works for something like: > > if (__builtin_roundevenf128 (0x1p64q+0.5) != (0x1p64q)) > link_error (__LINE__); ... but with the f128 constant suffix not q, so it works on more architectures (all those with _Float128 support, not just those with older __float128 support). > > +DEF_EXT_LIB_BUILTIN (BUILT_IN_ROUNDEVEN, "roundeven", BT_FN_DOUBLE_DOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST) > > +DEF_EXT_LIB_BUILTIN (BUILT_IN_ROUNDEVENF, "roundevenf", BT_FN_FLOAT_FLOAT, ATTR_CONST_NOTHROW_LEAF_LIST) > > +DEF_EXT_LIB_BUILTIN (BUILT_IN_ROUNDEVENL, "roundevenl", BT_FN_LONGDOUBLE_LONGDOUBLE, ATTR_CONST_NOTHROW_LEAF_LIST) > > ...and for the code to trigger for __builtin_roundevenf128 you have to > define this builtin function too. The easiest way is to do it in the > same way it is done for BUILTIN_ROUND and many other functions, i.e. use > DEF_EXT_LIB_FLOATN_NX_BUILTINS. Also note that TS 18661-1 has been merged into C2X. I haven't yet updated glibc headers to reflect this, but this means a new DEF_C2X_BUILTIN should be added similar to DEF_C11_BUILTIN, and used for those three new functions, instead of DEF_EXT_LIB_BUILTIN. (And for the strdup and strndup built-in functions, also added to C2X, but that's independent of the present project.) -- Joseph S. Myers joseph@codesourcery.com