This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Adding __float128 (i.e TS 18661-3) [v2]
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- Cc: "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, Steve Munroe <sjmunroe at us dot ibm dot com>
- Date: Tue, 21 Jun 2016 13:33:29 +0000
- Subject: Re: Adding __float128 (i.e TS 18661-3) [v2]
- Authentication-results: sourceware.org; auth=none
- References: <572BB6DF dot 7090709 at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 20 dot 1605052236310 dot 24016 at digraph dot polyomino dot org dot uk> <572CD397 dot 2090405 at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 20 dot 1605062118090 dot 15027 at digraph dot polyomino dot org dot uk> <c6fdca14-2c5a-4b9a-8dd9-25630c6a100e at linux dot vnet dot ibm dot com> <14407237-8cae-2c6f-118e-7db707cc61af at linux dot vnet dot ibm dot com>
On Fri, 10 Jun 2016, Paul E. Murphy wrote:
> TS 18661-3 defines a number of new macros which should be
> added to float.h. This is a compiler header, we should
> avoid injecting any of these macros into a user
> compilation.
Once my patch <https://gcc.gnu.org/ml/gcc-patches/2016-06/msg01481.html>
is in GCC, users can get those macros from <float.h> by using GCC 7 or
later (and defining __STDC_WANT_IEC_60559_TYPES_EXT__ before including
<float.h>).
I think it's fairly clear what glibc should do for internal use of such
macros: have an internal-only wrapper include/float.h along the lines of:
#ifndef _ISOMAC
# define __STDC_WANT_IEC_60559_TYPES_EXT__
#endif
#include_next <float.h>
#ifndef _ISOMAC
# include <features.h>
# if !__GNUC_PREREQ (7, 0)
/* Define whatever macros such as FLT128_MAX are needed when building
glibc, if on a platform where those macros are needed. */
# endif
#endif
(and the final part would be removed once GCC 7 or later can be presumed
for building glibc).
(Similarly, everything else in the glibc float128 support should be
written on the basis that _Float128 type names, f128 constant suffixes
etc. are the preferred form to use, with __float128, q suffixes etc. being
fallbacks for older compilers.)
--
Joseph S. Myers
joseph@codesourcery.com