From patchwork Tue Aug 13 23:06:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 34078 Received: (qmail 62545 invoked by alias); 13 Aug 2019 23:06:21 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 62469 invoked by uid 89); 13 Aug 2019 23:06:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: esa2.mentor.iphmx.com IronPort-SDR: 0Fyc2pNu42oZpBKnXF2jspYcmyTikhaOjJVXLNbIGYPoGs6PvLJDVbsUv38n5eIutU9anLt5m0 TADCBvdFYrpcKZSl4pI3jmAVL0BxqvQpApMO1A9eR/lMySgNRm+N5ujwGAUbo1D93vnspBUTb2 mmtDSEN7/E3FA2hDrtN/KJZukcw2V5fv5v1gYF8/S5eFr4QyDchDIKh+hFc843sw3yQ8RUNJ1f exOqrZifUlmbx30m68b7fouFrc0ZrDGLHOtpDe/n7EmTdPa4kZ2yrFNsOaCbekM4VT7sGJ9883 I14= IronPort-SDR: jQF09Vcvxq8pno6veX5J/xF44XwI2BxhHsVC2pP+zNEwHj1XgJ461vn8VnIfuLrLz/GRHkKllM yZSygHomy64/fd8DobLqbs9Ub2ZC7RrhPloSYs6CmVSBV6QsyA/mbr8N5b7FiReDeC7o0jFe3C reVm5zv26t7jytS7QF+jSeFTJsCZRPhh3gIFCyUvCbeCWsxu3iZqwu9C8BJ5kXtkqhwQ22HjEt mz9hXE2bihNj5q+YlapMqxzvIO9u2LSyGEbZVT9MLfd8r7orLWFelnSHHeBE7cBMSF+kOTR3yE KkM= Date: Tue, 13 Aug 2019 23:06:14 +0000 From: Joseph Myers To: Subject: Declare some TS 18661-4 interfaces for C2X [committed] Message-ID: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Return-Path: joseph@codesourcery.com C2X (current version in git, postdating the most recent public draft available as a PDF on the WG14 website) adds the interfaces from TS 18661-4, other than the reduction functions, as unconditionally required and visible in for hosted implementations; the __STDC_WANT_IEC_60559_FUNCS_EXT__ macro is not included in C2X at all (as the reduction functions aren't included at all, expected to end up in a version of the TS updated to be relative to C2X). This patch updates the glibc headers accordingly, following the same pattern used for 18661-1 functions. As the only 18661-4 functions currently supported are the exp10 functions that have been in glibc for a very long time, this means that in fact __GLIBC_USE (IEC_60559_FUNCS_EXT) ends up being used only to determine the definition of __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X, not yet in any headers other than bits/libc-header-start.h. (I hope to add the other 18661-4 functions to glibc at some point; the main complication is the current lack of MPFR support for many of these functions.) Tested for x86_64. Committed. 2019-08-13 Joseph Myers * bits/libc-header-start.h (__GLIBC_USE_IEC_60559_FUNCS_EXT): Update comment. (__GLIBC_USE_IEC_60559_FUNCS_EXT_C2X): New macro. * bits/math-finite.h [__GLIBC_USE (IEC_60559_FUNCS_EXT)]: Change to [__GLIBC_USE (IEC_60559_FUNCS_EXT_C2X)]. * math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_FUNCS_EXT)]: Likewise. diff --git a/bits/libc-header-start.h b/bits/libc-header-start.h index f2acc5333e..2c7c6e00e0 100644 --- a/bits/libc-header-start.h +++ b/bits/libc-header-start.h @@ -60,13 +60,21 @@ #endif /* ISO/IEC TS 18661-4:2015 defines the - __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. */ + __STDC_WANT_IEC_60559_FUNCS_EXT__ macro. Other than the reduction + functions, the symbols from this TS are enabled unconditionally in + C2X. */ #undef __GLIBC_USE_IEC_60559_FUNCS_EXT #if defined __USE_GNU || defined __STDC_WANT_IEC_60559_FUNCS_EXT__ # define __GLIBC_USE_IEC_60559_FUNCS_EXT 1 #else # define __GLIBC_USE_IEC_60559_FUNCS_EXT 0 #endif +#undef __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X +#if __GLIBC_USE (IEC_60559_FUNCS_EXT) || __GLIBC_USE (ISOC2X) +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 1 +#else +# define __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X 0 +#endif /* ISO/IEC TS 18661-3:2015 defines the __STDC_WANT_IEC_60559_TYPES_EXT__ macro. */ diff --git a/bits/math-finite.h b/bits/math-finite.h index 6141c12537..54cec8f8d8 100644 --- a/bits/math-finite.h +++ b/bits/math-finite.h @@ -67,7 +67,7 @@ __MATH_REDIRCALL (cosh, , (_Mdouble_)); /* exp. */ __MATH_REDIRCALL (exp, , (_Mdouble_)); -#if __GLIBC_USE (IEC_60559_FUNCS_EXT) +#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C2X) /* exp10. */ __MATH_REDIRCALL (exp10, , (_Mdouble_)); #endif diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index 3d1dc07d98..47808a2915 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -109,7 +109,7 @@ __MATHCALL (log10,, (_Mdouble_ __x)); /* Break VALUE into integral and fractional parts. */ __MATHCALL (modf,, (_Mdouble_ __x, _Mdouble_ *__iptr)) __nonnull ((2)); -#if __GLIBC_USE (IEC_60559_FUNCS_EXT) +#if __GLIBC_USE (IEC_60559_FUNCS_EXT_C2X) /* Compute exponent to base ten. */ __MATHCALL (exp10,, (_Mdouble_ __x)); #endif