This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Add _Float128 function aliases [committed]


On 18/10/17 18:38, Joseph Myers wrote:
> This patch adds support for *f128 function aliases on platforms where
> long double has the binary128 format (and thus GCC 7 provides the
> _Float128 type with the same ABI as long double but as a distinct type
> in terms of C type compatibility).  This is the same API as provided
> in glibc 2.26 for powerpc64le / x86_64 / x86 / ia64 where _Float128
> has a different format from long double, with the bulk of the API
> coming from TS 18661-3.  All the functions alias the corresponding
> long double functions, and __* function names are not provided since
> those are only needed once for each floating-point format, not more
> than once for different types with the same format (so for example,
> -ffinite-math-only maps foof128 to __fool_finite, while type-generic
> macros end up calling e.g. __issignalingl for _Float128 arguments on
> such platforms).
> 
> The preparation for this feature was done in previous patches, so this
> one just needs to add the relevant makefile and header definitions,
> and update macro definitions of libm_alias_ldouble_other_r, to turn on
> the feature, and update documentation and ABI baselines.
> 
> Tested (a) for x86_64, (b) for aarch64, (c) with build-many-glibcs.py
> with both GCC 6 and GCC 7.  Committed.
> 
...
> +++ b/sysdeps/ieee754/ldbl-128/bits/floatn.h
...
> +/* The remaining of this file provides support for older compilers.  */
> +#if __HAVE_FLOAT128
> +
> +/* The type _Float128 exists only since GCC 7.0.  */
> +# if !__GNUC_PREREQ (7, 0) || defined __cplusplus
> +typedef long double _Float128;
> +# endif

note that this typedef in a public header does not work
on compilers that support _Float128 but not >=gcc-7

https://reviews.llvm.org/D40673

(it seems clang added code to define _Float128 because
glibc headers started depending on it, but this is now
broken on targets where long double is ieee binary128
and thus both glibc and clang has a definition.)



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]