This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 4/5] Refactor tst-strtod-round.c
- 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: Tue, 17 May 2016 21:47:10 +0000
- Subject: Re: [PATCH 4/5] Refactor tst-strtod-round.c
- Authentication-results: sourceware.org; auth=none
- References: <cover dot 1463433826 dot git dot murphyp at linux dot vnet dot ibm dot com> <8968b370018788e6fb7d7249118faa96f2e2ba90 dot 1463433827 dot git dot murphyp at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 20 dot 1605162242570 dot 12314 at digraph dot polyomino dot org dot uk> <5bdcaff5-b5b1-2dc5-4801-63edbc3e2f81 at linux dot vnet dot ibm dot com> <alpine dot DEB dot 2 dot 20 dot 1605171610360 dot 24255 at digraph dot polyomino dot org dot uk> <ebf26298-343e-5f78-d60b-f8e3b4ab455c at linux dot vnet dot ibm dot com>
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