public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCHv2 00/14] Refactor libm-test.inc and friends
  2016-05-18 20:56 ` [PATCH 0/8] Refactor libm-tests.c " Paul E. Murphy
@ 2016-05-20 21:38 Paul E. Murphy
  2016-05-18 20:56 ` [PATCH 0/8] Refactor libm-tests.c " Paul E. Murphy
  22 siblings, 1 reply; 49+ messages in thread
From: Paul E. Murphy @ 2016-05-20 21:38 UTC (permalink / raw)
  To: libc-alpha

On this second spin, I now fixup the awkward MIN_EXP and MANT_DIG macros
to be more sensible.

Patch 3 starts the true refactoring by defining a set of format specific
macros and updates some of the logic controlling the macros to use them.

Patch 4 replaces the bulk of the TEST_<TYPE> macros with the new format
specific macros via a series of sed commands.

Patch 5 through 10 update various glibc specific constants to be more
readable, less type specific, and more consistent with the other macros
used throughout libm-test.inc test cases.

Patch 11 modifies the gen-libm-test.pl to strip suffixes for FP values
and wrap them with LIT()

Patch 12 removes the CHOOSE macro and remaining usage of TEST_<TYPE>
macros in favor of a fully generated file.

Patch 13 and 14 refactor the auto generated test inputs to replace type
specific conditions with format specific ones.


NOTE: patches 4, 13, and 14 require some extra steps after applying.
This keeps the patch size down.  After building the sources, I ran
the following for PPC64le and x86_64:

'BUILD_DIR=/path/to/build git rebase -i --exec ./path/to/test.sh HEAD~15'

then from BUILD_DIR:

for j in "" "ulps."; do echo "checking test.${j}\$i.txt"; \
  for i in `seq 2 14`; do \
    diff -u test.${j}$((i-1)).txt test.${j}${i}.txt; done; done;

To verify nothing changed during or after these commits.

Contents of test.sh:
#!/bin/bash
cd $BUILD_DIR

i=1
while [ -e test.$i.txt ]; do let i+=1; done;

tests="math/test-float.out
       math/test-double.out
       math/test-ldouble.out
       math/test-float-finite.out
       math/test-double-finite.out
       math/test-ldouble-finite.out
       math/test-ifloat.out
       math/test-idouble.out
       math/test-ildoubl.out"

echo "Removing stale test output."
rm -f $tests

echo "Testing commit $i"

make subdirs=math -j8 check &> /dev/null

echo "Collating results of commit $i"
# Use this as heuristic to verify check
# didn't crash and burn.
for test in ${tests}; do
  if [ ! -f $test ]; then
    echo "ERROR: $test missing";
    exit 1;
  fi
done

for test in ${tests}; do cat $test; done > test.$i.txt

echo "Regenerating ULPS for commit $i"
make regen-ulps > test.ulps.$i.txt
# end of test.sh

Paul E. Murphy (14):
  Fixup usage of MANT_DIG in libm-test.inc
  Fixup usage of MIN_EXP in libm-test.inc
  Begin refactor of libm-test.inc
  Refactor type specific macros using regexes
  Refactor M_ macros defined in libm-test.inc
  Replace M_PI2l with pi_2_d in libm-test.inc
  Replace M_PIl with pi in libm-test.inc
  Replace M_PI_4l with pi_4_d in libm-test.inc
  Replace M_El with exp1 in libm-test.inc
  Add note about nexttoward test cases in libm-test.inc
  Apply LIT(x) to floating point literals in libm-test.c
  Remove CHOOSE() macro from libm-tests.inc
  Remove type specific information from auto-libm-test-in
  Generate new format names in auto-libm-test-out

 math/auto-libm-test-in     |  115 ++--
 math/gen-auto-libm-tests.c |   24 +-
 math/gen-libm-test.pl      |   90 ++-
 math/libm-test.inc         | 1536 ++++++++++++++++++++++----------------------
 math/test-double-finite.c  |    1 -
 math/test-double-vlen2.h   |    1 -
 math/test-double-vlen4.h   |    1 -
 math/test-double-vlen8.h   |    1 -
 math/test-double.c         |    1 -
 math/test-double.h         |    6 +-
 math/test-float-finite.c   |    1 -
 math/test-float-vlen16.h   |    1 -
 math/test-float-vlen4.h    |    1 -
 math/test-float-vlen8.h    |    1 -
 math/test-float.c          |    1 -
 math/test-float.h          |    6 +-
 math/test-idouble.c        |    1 -
 math/test-ifloat.c         |    1 -
 math/test-ildoubl.c        |    1 -
 math/test-ldouble-finite.c |    1 -
 math/test-ldouble.c        |    1 -
 math/test-ldouble.h        |    6 +-
 22 files changed, 943 insertions(+), 855 deletions(-)

-- 
2.4.11

^ permalink raw reply	[flat|nested] 49+ messages in thread

end of thread, other threads:[~2016-05-24 20:45 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-20 21:38 [PATCHv2 00/14] Refactor libm-test.inc and friends Paul E. Murphy
2016-05-18 20:56 ` [PATCH 0/8] Refactor libm-tests.c " Paul E. Murphy
2016-05-18 20:56   ` [PATCH 4/8] Add LIT() around literals in check_ulp in libm-tests.inc Paul E. Murphy
2016-05-18 21:24     ` Joseph Myers
2016-05-18 20:56   ` [PATCH 3/8] Fixup TYPE_* substitutions Paul E. Murphy
2016-05-18 21:19     ` Joseph Myers
2016-05-18 20:56   ` [PATCH 8/8] Generate new format names in auto-libm-test-out Paul E. Murphy
2016-05-18 20:56   ` [PATCH 7/8] Remove type specific information from auto-libm-test-in Paul E. Murphy
2016-05-18 21:55     ` Joseph Myers
2016-05-18 20:56   ` [PATCH 5/8] Apply LIT(x) to floating point literals in libm-test.c Paul E. Murphy
2016-05-18 21:34     ` Joseph Myers
2016-05-18 20:56   ` [PATCH 1/8] Begin refactor of libm-test.inc Paul E. Murphy
2016-05-18 21:18     ` Joseph Myers
2016-05-18 21:54     ` Joseph Myers
2016-05-18 21:57       ` Paul E. Murphy
2016-05-19 11:05         ` Joseph Myers
2016-05-18 20:56   ` [PATCH 2/8] Refactor type specific macros using regexes Paul E. Murphy
2016-05-18 21:17   ` [PATCH 6/8] Refactor CHOOSE() macro usage in libm-tests.inc Paul E. Murphy
2016-05-18 21:39     ` Joseph Myers
2016-05-18 21:44   ` [PATCH 0/8] Refactor libm-tests.c and friends Joseph Myers
2016-05-18 21:58     ` Paul E. Murphy
2016-05-20 21:37   ` [PATCHv2 02/14] Fixup usage of MIN_EXP in libm-test.inc Paul E. Murphy
2016-05-23 16:02     ` Joseph Myers
2016-05-24 20:50       ` Paul E. Murphy
2016-05-20 21:37   ` [PATCHv2 01/14] Fixup usage of MANT_DIG " Paul E. Murphy
2016-05-23 15:41     ` Joseph Myers
2016-05-24 20:45       ` Paul E. Murphy
2016-05-20 21:37   ` [PATCHv2 05/14] Refactor M_ macros defined " Paul E. Murphy
2016-05-20 21:38   ` [PATCHv2 04/14] Refactor type specific macros using regexes Paul E. Murphy
2016-05-23 16:57     ` Joseph Myers
2016-05-20 21:38   ` [PATCHv2 11/14] Apply LIT(x) to floating point literals in libm-test.c Paul E. Murphy
2016-05-24 16:26     ` Joseph Myers
2016-05-20 21:38   ` [PATCHv2 03/14] Begin refactor of libm-test.inc Paul E. Murphy
2016-05-23 16:10     ` Joseph Myers
2016-05-20 21:38   ` [PATCHv2 10/14] Add note about nexttoward test cases in libm-test.inc Paul E. Murphy
2016-05-23 17:07     ` Joseph Myers
2016-05-23 18:20       ` Zack Weinberg
2016-05-20 21:38   ` [PATCHv2 08/14] Replace M_PI_4l with pi_4_d " Paul E. Murphy
2016-05-20 21:38   ` [PATCHv2 06/14] Replace M_PI2l with pi_2_d " Paul E. Murphy
2016-05-23 16:59     ` Joseph Myers
2016-05-23 20:02       ` Paul E. Murphy
2016-05-23 20:34         ` Joseph Myers
2016-05-23 21:36           ` Paul E. Murphy
2016-05-23 23:11             ` Joseph Myers
2016-05-20 21:38   ` [PATCHv2 12/14] Remove CHOOSE() macro from libm-tests.inc Paul E. Murphy
2016-05-20 21:38   ` [PATCHv2 13/14] Remove type specific information from auto-libm-test-in Paul E. Murphy
2016-05-20 21:38   ` [PATCHv2 14/14] Generate new format names in auto-libm-test-out Paul E. Murphy
2016-05-20 21:45   ` [PATCHv2 07/14] Replace M_PIl with pi in libm-test.inc Paul E. Murphy
2016-05-20 21:52   ` [PATCHv2 09/14] Replace M_El with exp1 " Paul E. Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).