From patchwork Fri Sep 24 20:12:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 45428 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E3F593857C71 for ; Fri, 24 Sep 2021 20:13:13 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by sourceware.org (Postfix) with ESMTPS id EB1223857C67 for ; Fri, 24 Sep 2021 20:12:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EB1223857C67 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: giBI1QOGb4lq6Oke12/nsnSYMDA086nlCb5eXVyNl5k/iDvesq0bI3SzrLJzAB5didCKvk5tdp bADOdXi+96AEbPQPBNU5jblh8CutfevXVyUXiIV//ms9MhANhHVRSxNR1SXcthpApjePlQYX1z FNK1fQicWdy12q+AD7SpqyYVzSsi9b4xUuY6nAivYR/vjW2cfFLSZ5mFpbFa3g9r4E0+yIP6gY /JQn/tUEPuaJyzcZ9uzY/NFD2HtrUBRwBUzcBTlf+3gR7ncEWqGL+VYclKlrAnfqtVvTbB+Pj1 1kMXuQaZM6hLtpIFKHXqzZ/4 X-IronPort-AV: E=Sophos;i="5.85,320,1624348800"; d="scan'208";a="68814336" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 24 Sep 2021 12:12:51 -0800 IronPort-SDR: nidSO4+M3SSmFJ7F/bCFPs3OTTknOspzh3GWJpHK5TG4Sm0QSRznQo6HcCELgzzCjf+QwvJ/N2 j5XbHbeGKqxDWyHblZqxzkMugEMD0QDbJpxJLyUiyKWMUnOcViGj6NC1Y5sAxNTsnNdoxfoL6z B5xWE7iJg+R17/zcPsqUU4BGSzsNavvuONUcc10hLmbggVgmi8S9hw+kmHws4EUPbBbVp7hjT5 /aKKRqZrCORcYd5oiacbZ+BRfZsIdTtFfstlNQrtPwMZie5BcbEqSee7fKPmdZJNimZ6K44Gdu XUU= Date: Fri, 24 Sep 2021 20:12:45 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Subject: Define __STDC_IEC_60559_BFP__ and __STDC_IEC_60559_COMPLEX__ [committed] Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-09.mgc.mentorg.com (139.181.222.9) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3124.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" TS 18661-1 and C2X specify predefined macros __STDC_IEC_60559_BFP__ and __STDC_IEC_60559_COMPLEX__, making __STDC_IEC_559__ and __STDC_IEC_559_COMPLEX__ obsolescent (but still included in the standard). Now that we have all the functions from TS 18661-1, define these macros in stdc-predef.h, under the same conditions in which the older macros are defined, since support for the floating-point features in TS 18661-1 is now at the same level as that for those in C11 and before (all library functions and other library APIs present, but no standard pragma support). The macros are defined for now with their TS 18661-1 values. C2X will give them new values (listed as yyyymmL in the working drafts until the final standard), at which point there will be the question of what value to use in stdc-predef.h (where it could depend on __STDC_VERSION__, but not on feature test macros defined by the user). My inclination then would be to use the C2X value unconditionally rather than using an older value to indicate TS support, and only have any C standard version conditionals for the value when subsequent C standard versions define further values. (Note that I'm also inclined, when we implement the C2X change to the return types of fromfp functions, to make that change unconditional much like the change made to the types of totalorder functions, with the old version only supported with compat symbols for already-linked programs and not as an API for newly built objects. So using the C2X value would also accurately reflect not supporting the versions of APIs in the TS where those ended up being incompatible with the first version actually added to the standard.) Tested for x86_64. --- Committed. diff --git a/NEWS b/NEWS index 889578bf39..9ae04b2f20 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,9 @@ Major new features: - ffma, ffmal, dfmal and corresponding fMfmafN, fMfmafNx, fMxfmafN and fMxfmafNx functions. +* The __STDC_IEC_60559_BFP__ and __STDC_IEC_60559_COMPLEX__ macros are + predefined as specified in TS 18661-1:2014. + Deprecated and removed features, and other changes affecting compatibility: * The r_version update in the debugger interface makes the glibc binary diff --git a/include/stdc-predef.h b/include/stdc-predef.h index e130c462a7..ea9425277b 100644 --- a/include/stdc-predef.h +++ b/include/stdc-predef.h @@ -36,17 +36,21 @@ #ifdef __GCC_IEC_559 # if __GCC_IEC_559 > 0 # define __STDC_IEC_559__ 1 +# define __STDC_IEC_60559_BFP__ 201404L # endif #else # define __STDC_IEC_559__ 1 +# define __STDC_IEC_60559_BFP__ 201404L #endif #ifdef __GCC_IEC_559_COMPLEX # if __GCC_IEC_559_COMPLEX > 0 # define __STDC_IEC_559_COMPLEX__ 1 +# define __STDC_IEC_60559_COMPLEX__ 201404L # endif #else # define __STDC_IEC_559_COMPLEX__ 1 +# define __STDC_IEC_60559_COMPLEX__ 201404L #endif /* wchar_t uses Unicode 10.0.0. Version 10.0 of the Unicode Standard is