aboutsummaryrefslogtreecommitdiff
path: root/math/gen-libm-test.pl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-10-25 20:18:27 +0000
committerUlrich Drepper <drepper@redhat.com>1999-10-25 20:18:27 +0000
commita9b5d2eeb1b525235f0137280e1ab73851dae6fe (patch)
treedb1d76ae730bec18d888cea5c017cf257912d584 /math/gen-libm-test.pl
parent3a8e65a0a7914ad670774161c8e0bc781e09500a (diff)
downloadglibc-a9b5d2eeb1b525235f0137280e1ab73851dae6fe.tar
glibc-a9b5d2eeb1b525235f0137280e1ab73851dae6fe.tar.gz
glibc-a9b5d2eeb1b525235f0137280e1ab73851dae6fe.tar.bz2
glibc-a9b5d2eeb1b525235f0137280e1ab73851dae6fe.zip
Update.
1999-10-25 Thorsten Kukuk <kukuk@suse.de> * md5-crypt/md5.h: Remove prototypes for public interface. md5 is used only internal. * md5-crypt/md5-crypt.c: Use internal names for md5 functions, remove weak alias for public names. * md5-crypt/md5.c: Remove weak aliase. 1999-10-25 Andreas Jaeger <aj@suse.de> * math/README.libm-test: New file, documents libm-test.inc. 1999-10-25 Andreas Jaeger <aj@suse.de> * math/gen-libm-test.pl: Only generate a new ulps file when -n is given. (print_ulps_file): Fix loops to not read @tests and @functions since those are not initialized with -n now. (parse_ulps): Set $results{..}{"kind"}.
Diffstat (limited to 'math/gen-libm-test.pl')
-rwxr-xr-xmath/gen-libm-test.pl20
1 files changed, 14 insertions, 6 deletions
diff --git a/math/gen-libm-test.pl b/math/gen-libm-test.pl
index d380bbfe38..1237e51021 100755
--- a/math/gen-libm-test.pl
+++ b/math/gen-libm-test.pl
@@ -23,6 +23,8 @@
# Note that functions and tests share the same namespace.
# Information about tests are stored in: %results
+# $results{$test}{"kind"} is either "fct" or "test" and flags whether this
+# is a maximal error of a function or a single test.
# $results{$test}{"type"} is the result type, e.g. normal or complex.
# $results{$test}{"has_ulps"} is set if deltas exist.
# $results{$test}{"has_fails"} is set if exptected failures exist.
@@ -102,7 +104,7 @@ if ($opt_h) {
print "Usage: gen-libm-test.pl [OPTIONS]\n";
print " -h print this help, then exit\n";
print " -o DIR directory where generated files will be placed\n";
- print " -n generate sorted file NewUlps from libm-test-ulps\n";
+ print " -n only generate sorted file NewUlps from libm-test-ulps\n";
print " -u FILE input file with ulps\n";
exit 0;
}
@@ -116,8 +118,8 @@ $output = "${output_dir}libm-test.c";
$count = 0;
&parse_ulps ($ulps_file);
-&generate_testfile ($input, $output);
-&output_ulps ("${output_dir}libm-test-ulps.h", $ulps_file);
+&generate_testfile ($input, $output) unless ($opt_n);
+&output_ulps ("${output_dir}libm-test-ulps.h", $ulps_file) unless ($opt_n);
&print_ulps_file ("${output_dir}NewUlps") if ($opt_n);
# Return a nicer representation
@@ -484,7 +486,7 @@ sub generate_testfile {
# Parse ulps file
sub parse_ulps {
my ($file) = @_;
- my ($test, $type, $float, $eps);
+ my ($test, $type, $float, $eps, $kind);
# $type has the following values:
# "normal": No complex variable
@@ -508,6 +510,7 @@ sub parse_ulps {
}
s/^.+\"(.*)\".*$/$1/;
$test = $_;
+ $kind = 'test';
next;
}
if (/^Function: /) {
@@ -521,6 +524,7 @@ sub parse_ulps {
$type = 'normal';
}
($test) = ($_ =~ /^Function:\s*\"([a-zA-Z0-9_]+)\"/);
+ $kind = 'fct';
next;
}
if (/^i?(float|double|ldouble):/) {
@@ -541,6 +545,7 @@ sub parse_ulps {
} elsif ($type eq 'normal') {
$results{$test}{'type'} = 'normal';
}
+ $results{$test}{'kind'} = $kind;
next;
}
print "Skipping unknown entry: `$_'\n";
@@ -567,7 +572,9 @@ sub print_ulps_file {
$last_fct = '';
open NEWULP, ">$file" or die ("Can't open $file: $!");
print NEWULP "# Begin of automatic generation\n";
- foreach $test (sort @tests) {
+ # first the function calls
+ foreach $test (sort keys %results) {
+ next if ($results{$test}{'kind'} ne 'test');
foreach $type ('real', 'imag', 'normal') {
if (exists $results{$test}{$type}) {
if (defined $results{$test}) {
@@ -599,7 +606,8 @@ sub print_ulps_file {
}
print NEWULP "\n# Maximal error of functions:\n";
- foreach $fct (sort @functions) {
+ foreach $fct (sort keys %results) {
+ next if ($results{$fct}{'kind'} ne 'fct');
foreach $type ('real', 'imag', 'normal') {
if (exists $results{$fct}{$type}) {
if ($type eq 'normal') {