Do not hardcode platform names in manual/libm-err-tab.pl (bug 14139).

manual/libm-err-tab.pl hardcodes a list of names for particular
platforms (mapping from sysdeps directory name to friendly name for
the manual).  This goes against the principle of keeping information
about individual platforms in their corresponding sysdeps directory,
and the list is also very out-of-date regarding supported platforms
and their corresponding sysdeps directories.

This patch fixes this by adding a libm-test-ulps-name file alongside
each libm-test-ulps file.  The script then gets the friendly name from
that file, which is required to exist, so it no longer needs to allow
for the mapping being missing.

Tested for x86_64.

	[BZ #14139]
	* manual/libm-err-tab.pl (%pplatforms): Initialize to empty.
	(find_files): Obtain platform name from libm-test-ulps-name and
	store in %pplatforms.
	(canonicalize_platform): Remove.
	(print_platforms): Use $pplatforms directly.
	(by_platforms): Do not allow for platforms missing from
	%pplatforms.
	* sysdeps/aarch64/libm-test-ulps-name: New file.
	* sysdeps/alpha/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/arm/libm-test-ulps-name: Likewise.
	* sysdeps/generic/libm-test-ulps-name: Likewise.
	* sysdeps/hppa/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/i386/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps-name: Likewise.
	* sysdeps/ia64/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/m68k/coldfire/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/m68k/m680x0/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/microblaze/libm-test-ulps-name: Likewise.
	* sysdeps/mips/mips32/libm-test-ulps-name: Likewise.
	* sysdeps/mips/mips64/libm-test-ulps-name: Likewise.
	* sysdeps/nios2/libm-test-ulps-name: Likewise.
	* sysdeps/powerpc/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/powerpc/nofpu/libm-test-ulps-name: Likewise.
	* sysdeps/s390/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/sh/libm-test-ulps-name: Likewise.
	* sysdeps/sparc/fpu/libm-test-ulps-name: Likewise.
	* sysdeps/tile/libm-test-ulps-name: Likewise.
	* sysdeps/x86_64/fpu/libm-test-ulps-name: Likewise.
This commit is contained in:
Joseph Myers 2016-11-04 16:49:06 +00:00
parent 94bf0b4ac9
commit 799131036e
23 changed files with 61 additions and 30 deletions

View File

@ -1,5 +1,35 @@
2016-11-04 Joseph Myers <joseph@codesourcery.com> 2016-11-04 Joseph Myers <joseph@codesourcery.com>
[BZ #14139]
* manual/libm-err-tab.pl (%pplatforms): Initialize to empty.
(find_files): Obtain platform name from libm-test-ulps-name and
store in %pplatforms.
(canonicalize_platform): Remove.
(print_platforms): Use $pplatforms directly.
(by_platforms): Do not allow for platforms missing from
%pplatforms.
* sysdeps/aarch64/libm-test-ulps-name: New file.
* sysdeps/alpha/fpu/libm-test-ulps-name: Likewise.
* sysdeps/arm/libm-test-ulps-name: Likewise.
* sysdeps/generic/libm-test-ulps-name: Likewise.
* sysdeps/hppa/fpu/libm-test-ulps-name: Likewise.
* sysdeps/i386/fpu/libm-test-ulps-name: Likewise.
* sysdeps/i386/i686/fpu/multiarch/libm-test-ulps-name: Likewise.
* sysdeps/ia64/fpu/libm-test-ulps-name: Likewise.
* sysdeps/m68k/coldfire/fpu/libm-test-ulps-name: Likewise.
* sysdeps/m68k/m680x0/fpu/libm-test-ulps-name: Likewise.
* sysdeps/microblaze/libm-test-ulps-name: Likewise.
* sysdeps/mips/mips32/libm-test-ulps-name: Likewise.
* sysdeps/mips/mips64/libm-test-ulps-name: Likewise.
* sysdeps/nios2/libm-test-ulps-name: Likewise.
* sysdeps/powerpc/fpu/libm-test-ulps-name: Likewise.
* sysdeps/powerpc/nofpu/libm-test-ulps-name: Likewise.
* sysdeps/s390/fpu/libm-test-ulps-name: Likewise.
* sysdeps/sh/libm-test-ulps-name: Likewise.
* sysdeps/sparc/fpu/libm-test-ulps-name: Likewise.
* sysdeps/tile/libm-test-ulps-name: Likewise.
* sysdeps/x86_64/fpu/libm-test-ulps-name: Likewise.
* sysdeps/unix/sysv/linux/mips/sys/user.h: Include <stddef.h>. * sysdeps/unix/sysv/linux/mips/sys/user.h: Include <stddef.h>.
* sysdeps/unix/sysv/linux/mips/Makefile [$(subdir) = elf] * sysdeps/unix/sysv/linux/mips/Makefile [$(subdir) = elf]

View File

@ -48,20 +48,7 @@ use vars qw (%results @all_floats %suffices @all_functions);
); );
# Pretty description of platform # Pretty description of platform
%pplatforms = %pplatforms = ();
( "i386/fpu" => "ix86",
"generic" => "Generic",
"alpha/fpu" => "Alpha",
"ia64/fpu" => "IA64",
"m68k/fpu" => "M68k",
"mips/fpu" => "MIPS",
"powerpc/fpu" => "PowerPC",
"sparc/sparc32/fpu" => "Sparc 32-bit",
"sparc/sparc64/fpu" => "Sparc 64-bit",
"sh/sh4/fpu" => "SH4",
"s390/fpu" => "S/390",
"arm" => "ARM"
);
@all_functions = @all_functions =
( "acos", "acosh", "asin", "asinh", "atan", "atanh", ( "acos", "acosh", "asin", "asinh", "atan", "atanh",
@ -99,6 +86,13 @@ sub find_files {
if ($_ eq 'libm-test-ulps') { if ($_ eq 'libm-test-ulps') {
# print "Parsing $File::Find::name\n"; # print "Parsing $File::Find::name\n";
push @platforms, $File::Find::dir; push @platforms, $File::Find::dir;
my ($file, $name);
$file = "${File::Find::name}-name";
open NAME, $file or die ("Can't open $file: $!");
$name = <NAME>;
chomp $name;
close NAME;
$pplatforms{$File::Find::dir} = $name;
&parse_ulps ($File::Find::name, $File::Find::dir); &parse_ulps ($File::Find::name, $File::Find::dir);
} }
} }
@ -161,15 +155,6 @@ sub get_value {
? $results{$fct}{$platform}{$type}{$float} : "0"); ? $results{$fct}{$platform}{$type}{$float} : "0");
} }
sub canonicalize_platform {
my ($platform) = @_;
$platform =~ s|^(.*/sysdeps/)||;
return exists $pplatforms{$platform} ? $pplatforms{$platform} : $platform;
}
sub print_platforms { sub print_platforms {
my (@p) = @_; my (@p) = @_;
my ($fct, $platform, $float, $first, $i, $platform_no, $platform_total); my ($fct, $platform, $float, $first, $i, $platform_no, $platform_total);
@ -183,7 +168,7 @@ sub print_platforms {
print '@item Function '; print '@item Function ';
foreach (@p) { foreach (@p) {
print ' @tab '; print ' @tab ';
print &canonicalize_platform ($_); print $pplatforms{$_};
} }
print "\n"; print "\n";
@ -226,10 +211,5 @@ sub print_all {
} }
sub by_platforms { sub by_platforms {
my ($pa, $pb); return $pplatforms{$a} cmp $pplatforms{$b};
$pa = $pplatforms{$a} ? $pplatforms{$a} : $a;
$pb = $pplatforms{$b} ? $pplatforms{$b} : $b;
return $pa cmp $pb;
} }

View File

@ -0,0 +1 @@
AArch64

View File

@ -0,0 +1 @@
Alpha

View File

@ -0,0 +1 @@
ARM

View File

@ -0,0 +1 @@
Generic

View File

@ -0,0 +1 @@
HPPA

View File

@ -0,0 +1 @@
ix86

View File

@ -0,0 +1 @@
i686

View File

@ -0,0 +1 @@
IA64

View File

@ -0,0 +1 @@
ColdFire

View File

@ -0,0 +1 @@
M68k

View File

@ -0,0 +1 @@
MicroBlaze

View File

@ -0,0 +1 @@
MIPS 32-bit

View File

@ -0,0 +1 @@
MIPS 64-bit

View File

@ -0,0 +1 @@
Nios II

View File

@ -0,0 +1 @@
PowerPC

View File

@ -0,0 +1 @@
PowerPC soft-float

View File

@ -0,0 +1 @@
S/390

View File

@ -0,0 +1 @@
SH

View File

@ -0,0 +1 @@
Sparc

View File

@ -0,0 +1 @@
Tile

View File

@ -0,0 +1 @@
x86_64