This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v3 8/8] float128: Add wrappers to override ldbl-128 as float128.
On Tue, 9 May 2017, Gabriel F. T. Gomes wrote:
> * math/math.h [__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)]
> (SNANF128): New macro.
As noted, I think this belongs in patch 4 alongside HUGE_VAL_F128.
> * sysdeps/ieee754/float128/s_canonicalizef128.c: New file.
You shouldn't need this file. The type-generic templates machinery should
build canonicalizef128 from the template automatically when you enable
float128 support.
> diff --git a/math/math.h b/math/math.h
> index 4fc96ac..ed713df 100644
> --- a/math/math.h
> +++ b/math/math.h
> @@ -63,6 +63,9 @@ __BEGIN_DECLS
> # define SNAN (__builtin_nans (""))
> # define SNANL (__builtin_nansl (""))
> # endif
> +# if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
> +# define SNANF128 (__builtin_nansf128 (""))
> +# endif
> #endif
This (moved to patch 4) should move outside the __GLIBC_USE
(IEC_60559_BFP_EXT) conditional (as with the function declarations, macros
added in TS 18661-1 have their _FloatN versions defined with
__STDC_WANT_IEC_60559_TYPES_EXT__, whether or not
__STDC_WANT_IEC_60559_BFP_EXT__ is defined).
> diff --git a/sysdeps/ieee754/float128/s_fromfpf128.c b/sysdeps/ieee754/float128/s_fromfpf128.c
> new file mode 100644
> index 0000000..891de3d
> --- /dev/null
> +++ b/sysdeps/ieee754/float128/s_fromfpf128.c
> @@ -0,0 +1,5 @@
> +#define UNSIGNED 0
> +#define INEXACT 0
> +#define FUNC fromfpf128
> +#include <float128_private.h>
> +#include "../ldbl-128/s_fromfpl_main.c"
> diff --git a/sysdeps/ieee754/float128/s_fromfpxf128.c b/sysdeps/ieee754/float128/s_fromfpxf128.c
> new file mode 100644
> index 0000000..0159ae2
> --- /dev/null
> +++ b/sysdeps/ieee754/float128/s_fromfpxf128.c
> @@ -0,0 +1,5 @@
> +#define UNSIGNED 0
> +#define INEXACT 1
> +#define FUNC fromfpxl
I'd say that for the fromfp functions you should be consistent about
whether the wrappers define FUNC to the *f128 name, or whether you use a
separate define of the *l name to the *f128 name and define FUNC to the *l
name.
> diff --git a/sysdeps/ieee754/float128/w_llogbf128.c b/sysdeps/ieee754/float128/w_llogbf128.c
> new file mode 100644
> index 0000000..f83657d
> --- /dev/null
> +++ b/sysdeps/ieee754/float128/w_llogbf128.c
> @@ -0,0 +1,3 @@
> +#define declare_mgen_alias(from, to) weak_alias (M_SUF (from), M_SUF (to))
> +#include <math-type-macros-float128.h>
> +#include <w_llogb_template.c>
That's the default definition of declare_mgen_alias. You shouldn't need
this file; the template machinery should do the right thing without it.
--
Joseph S. Myers
joseph@codesourcery.com