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]

[PATCHv2 00/14] Refactor libm-test.inc and friends


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


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