Adding __float128 (i.e TS 18661-3) [v2]
Joseph Myers
joseph@codesourcery.com
Tue Jun 21 13:33:00 GMT 2016
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
More information about the Libc-alpha
mailing list