[PATCH 4/6] ldbl-128: Rename 'long double' to 'ldouble_t'

Joseph Myers joseph@codesourcery.com
Tue Aug 16 18:10:00 GMT 2016


On Tue, 16 Aug 2016, Paul E. Murphy wrote:

> Add a layer of macro indirection for long double files
> which need to be built using another typename.  Likewise,
> add the L(num) macro used in a later patch to override
> real constants.
> 
> These changes produce identical binaries for s390x and
> aarch64.
> 
> 	* sysdeps/generic/math_private.h:
> 	[!__LDOUBLE_T_OVERRIDDEN] (ldouble_t): New default macro
> 	alias for long double.
> 	[!__LDOUBLE_T_OVERRIDDEN] (L): New default macro to apply
> 	long double literal suffix.

I don't think ldouble_t is the right name here; it could be confused with 
long_double_t, the type name added by TS 18661-3 for a type with the 
evaluation format used for long double.

I think the right name to use is _Float128; that name unambiguously 
relates to the format these functions are written for.  (When we can 
assume a compiler with _FloatN / _FloatNx support, the ideal would be that 
these functions always define the associated _Float128 function names, use 
*f128 constants directly, etc., and may or may not, depending on the glibc 
configuration, also have aliases with the long double names, with 
_Float64x names or with both sets of names.  This series is of course only 
achieving an interim step towards such a goal which isn't possible yet, 
but there should be no problem using the _Float128 name for the macro 
now.)

> diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
> index 08b04e0..15f1efc 100644
> --- a/sysdeps/generic/math_private.h
> +++ b/sysdeps/generic/math_private.h
> @@ -185,6 +185,13 @@ do {								\
>     ldbl-128 files as another type (e.g _Float128).  */
>  #define mathx_hidden_def(name) hidden_def(name)
>  
> +/* These hooks let us override certain long double files using
> +   a different type (e.g building ldbl-128 as _Float128).  */
> +#ifndef __LDOUBLE_T_OVERRIDDEN
> +# define ldouble_t long double
> +# define L(x) x##L
> +#endif

I don't think this header is the right place for something entirely 
specific to the ldbl-128 function implementations.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Libc-alpha mailing list