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: [PATCH v3 6/8] float128: Add private _Float128 declarations for libm.


On Tue, 9 May 2017, Gabriel F. T. Gomes wrote:

> diff --git a/include/complex.h b/include/complex.h
> index 082e71f..238ecbe 100644
> --- a/include/complex.h
> +++ b/include/complex.h
> @@ -8,6 +8,13 @@
>  extern complex float __kernel_casinhf (complex float z, int adj);
>  extern complex double __kernel_casinh (complex double z, int adj);
>  extern complex long double __kernel_casinhl (complex long double z, int adj);
> +#  if __HAVE_DISTINCT_FLOAT128
> +#   ifdef __CFLOAT128
> +extern __CFLOAT128 __kernel_casinhf128 (__CFLOAT128 z, int adj);
> +#   else
> +extern _Complex _Float128 __kernel_casinhf128 (_Complex _Float128 z, int adj);
> +#   endif
> +#  endif
>  # endif

If you arrange things so that __CFLOAT128 is always defined when _Float128 
is supported (but sometimes defined to _Complex _Float128, when the 
compiler is new enough), you no longer need the conditional on whether it 
is defined here.

> +#ifdef __CFLOAT128
> +# define CFLOAT __CFLOAT128
> +#else
> +# define CFLOAT _Complex _Float128
> +#endif

Likewise.

> +#define M_MLIT(c) c ## f128

I'd expect this to cause trouble when building glibc with GCC 6; don't you 
need to use __f128 to allow for that?

> +#if __HAVE_DISTINCT_FLOAT128
> +# define _Mdouble_ _Float128
> +# define _MSUF_ f128
> +# define __MATH_DECLARING_FLOAT128
> +# include <math_private_calls.h>
> +# undef __MATH_DECLARING_FLOAT128

__MATH_DECLARING_FLOATN, as elsewhere.

> +extern inline _Float128
> +signbitf128 (_Float128 x)
> +{
> +  return __builtin_signbit (x);

Why is this needed?  There should be no public or private interface 
signbitf128, and all glibc-internal calls should be using the type-generic 
signbit macro.

-- 
Joseph S. Myers
joseph@codesourcery.com


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