This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCHv2 03/14] Begin refactor of libm-test.inc
- From: Joseph Myers <joseph at codesourcery dot com>
- To: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Mon, 23 May 2016 16:02:07 +0000
- Subject: Re: [PATCHv2 03/14] Begin refactor of libm-test.inc
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1463779745 dot git dot murphyp at linux dot vnet dot ibm dot com> <8365176381f9d8abd0c87bd7de3cbd7ae8032283 dot 1463779745 dot git dot murphyp at linux dot vnet dot ibm dot com>
On Fri, 20 May 2016, Paul E. Murphy wrote:
> + INF A macro defining the positive infinite value of the type. */
This should not be needed. Just define plus_infty and minus_infty like
qnan_value is defined, using FUNC (__builtin_inf) (), so reducing the
numbers of definitions needed in the type-specific headers. You can
assume those built-in functions for all compilers supported for building
glibc.
(Well, for float128 you may need to split FUNC into separate macros, since
the public API will be *f128 but existing built-in functions are e.g.
__builtin_infq. But you could always name the functions __builtin_inff128
etc. on powerpc from the start to avoid that issue and leave x86 to work
around the different naming. It looks like you should add built-in
functions __builtin_nan<something>, __builtin_nans<something>, for use in
tests, that are currently missing on x86 for TFmode; I've filed GCC bugs
71241 and 71242 for the absence of such functions for x86 and ia64.)
> /* Sufficient numbers of digits to represent any floating-point value
> unambiguously (for any choice of the number of bits in the first
> hex digit, in the case of TYPE_HEX_DIG). When used with printf
> formats where the precision counts only digits after the point, 1
> is subtracted from these values. */
> -#define TYPE_DECIMAL_DIG CHOOSE (LDBL_DECIMAL_DIG, \
> - DBL_DECIMAL_DIG, \
> - FLT_DECIMAL_DIG, \
> - LDBL_DECIMAL_DIG, \
> - DBL_DECIMAL_DIG, \
> - FLT_DECIMAL_DIG)
> #define TYPE_HEX_DIG ((MANT_DIG + 6) / 4)
This comment is meant to apply to both TYPE_DECIMAL_DIG and TYPE_HEX_DIG.
Thus, the new TYPE_DECIMAL_DIG definition should go here rather than
elsewhere in the file.
--
Joseph S. Myers
joseph@codesourcery.com