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 4/5] Refactor tst-strtod-round.c


On Tue, 17 May 2016, Paul E. Murphy wrote:

> Anyhow, for those tests, we do have the opportunity to post-process
> the content as part of building the tests.  In that (yet to be submitted
> to libc-alpha) patchset, I updated gen-libm-test.pl to strip C99 literal
> suffixes, then wrap them with a new macro named LIT() to apply the
> appropriate suffix depending on the type under test. With the exception
> of nexttoward and its long double second argument.

That seems reasonable (as in: eventually the logical format of 
auto-libm-test-out would be not to include the suffixes, but by removing 
the suffixes in gen-libm-test-pl you avoid the need for the large change 
until there's another reason for such a large change, e.g. for splitting 
up auto-libm-test-out into per-function files, which is something I want 
to do anyway both to reduce its size and to allow gen-auto-libm-tests to 
be used for complex functions for which MPC is extremely slow).  Of course 
all the constants in libm-test.inc and auto-libm-test-out for integer 
arguments and results should also be exceptions to getting suffixes added.

Presumably you deal with how some constants in libm-test.inc for 
floating-point arguments and results are integer constants that can't 
simply have a suffix added without adding "." as well to turn them into 
floating-point constants.  And all conditionals such as

#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384

need to be rewritten to check properties of the format, not macros such as 
TEST_LDOUBLE which say which type it is (in this case, testing MAX_EXP 
would suffice, but for tests of MANT_DIG, right now the MANT_DIG macro is 
confusingly *_MANT_DIG-1, so a simple substitution does not suffice 
without fixing MANT_DIG and its existing uses first to be less confusing).

-- 
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]