This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 6/6] float128: Add test-{float128,ifloat128,float128-finite}
On Fri, 26 May 2017, Gabriel F. T. Gomes wrote:
> * math/test-float128-finite.c: New file.
> * math/test-float128.c: New file.
> * math/test-float128.h: New file.
> * math/test-ifloat128.c: New file.
> * math/test-math-floatn.h: New file.
The ChangeLog entry needs updating to reflect the patch contents; various
of these files no longer exist.
> * math/gen-libm-have-vector-test.sh: Add support for float128.
Likewise.
> diff --git a/math/libm-test-support.h b/math/libm-test-support.h
> index 0e78144..a57a8b3 100644
> --- a/math/libm-test-support.h
> +++ b/math/libm-test-support.h
> @@ -138,12 +138,20 @@ extern const char doc[];
> #define TEST_COND_before_rounding (!TININESS_AFTER_ROUNDING)
> #define TEST_COND_after_rounding TININESS_AFTER_ROUNDING
>
> +#ifndef TEST_FLOATN
> +# define TEST_FLOATN 0
> +#endif
No, define to 0 in test-float.h etc.
> +#ifndef CFLOAT
> +# define CFLOAT __complex__ FLOAT
> +#endif
I'd rather put that in test-float.h etc. as well to avoid #ifndef.
> +/* Fixup builtins and constants for older compilers. */
> +#include <features.h>
> +#if !__GNUC_PREREQ (7, 0)
> +# define LIT(x) (x ## Q)
> +# define FLOAT __float128
> +# define CFLOAT __CFLOAT128
> +/* The following macros are only provided since GCC 7.0. */
> +# define FLT128_MANT_DIG 113
> +# define FLT128_DECIMAL_DIG 36
> +# define FLT128_DIG 33
> +# define FLT128_MIN_EXP (-16381)
> +# define FLT128_MIN_10_EXP (-4931)
> +# define FLT128_MAX_EXP 16384
> +# define FLT128_MAX_10_EXP 4932
> +# define FLT128_MAX 1.18973149535723176508575932662800702e+4932Q
> +# define FLT128_EPSILON 1.92592994438723585305597794258492732e-34Q
> +# define FLT128_MIN 3.36210314311209350626267781732175260e-4932Q
> +# define FLT128_TRUE_MIN 6.47517511943802511092443895822764655e-4966Q
> +#else
> +# define LIT(x) (x ## f128)
> +# define FLOAT _Float128
> +#endif
Rather than duplicating the compatibility code, use macros from
bits/floatn.h to define LIT, FLOAT etc.
Then, for FLT128_ you want the !_ISOMAC definitions from include/float.h.
Maybe either separate those out into a separate header, or make
include/float.h define them in the !_ISOMAC case if
__STDC_WANT_IEC_60559_TYPES_EXT__ is defined?
> +/* Similarly, finitef128 is not API */
> +extern int __finitef128 (FLOAT);
> +
> +static inline int
> +finitef128(FLOAT f)
> +{
> + return __finitef128 (f);
> +}
No, nothing should be trying to call finitef128. Disable the tests of
finite in libm-test-isfinite.inc in the TEST_FLOATN case.
--
Joseph S. Myers
joseph@codesourcery.com