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: [PATCHv2 03/14] Begin refactor of libm-test.inc


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


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