2017-01-01 00:14:16 +00:00
|
|
|
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
1995-02-18 01:27:10 +00:00
|
|
|
# This file is part of the GNU C Library.
|
|
|
|
|
|
|
|
# The GNU C Library is free software; you can redistribute it and/or
|
2001-07-06 04:58:11 +00:00
|
|
|
# modify it under the terms of the GNU Lesser General Public
|
|
|
|
# License as published by the Free Software Foundation; either
|
|
|
|
# version 2.1 of the License, or (at your option) any later version.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
|
|
|
# The GNU C Library is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
2001-07-06 04:58:11 +00:00
|
|
|
# Lesser General Public License for more details.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
2001-07-06 04:58:11 +00:00
|
|
|
# You should have received a copy of the GNU Lesser General Public
|
2012-02-09 23:18:22 +00:00
|
|
|
# License along with the GNU C Library; if not, see
|
|
|
|
# <http://www.gnu.org/licenses/>.
|
1997-01-20 02:49:49 +00:00
|
|
|
|
|
|
|
# Makefile for the math library.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1996-03-05 21:41:30 +00:00
|
|
|
subdir := math
|
|
|
|
|
2014-02-26 23:12:03 +00:00
|
|
|
include ../Makeconfig
|
|
|
|
|
1996-03-05 21:41:30 +00:00
|
|
|
# Installed header files.
|
1997-06-21 02:59:26 +00:00
|
|
|
headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
|
* math/Makefile (headers): Add bits/huge_valf.h, bits/huge_vall.h, and bits/inf.h. * math/math.h: Include them.
* sysdeps/alpha/fpu/bits/mathdef.h, sysdeps/arm/fpu/bits/mathdef.h,
sysdeps/generic/bits/mathdef.h, sysdeps/i386/fpu/bits/mathdef.h,
sysdeps/ia64/fpu/bits/mathdef.h, sysdeps/m68k/fpu/bits/mathdef.h,
sysdeps/mips/fpu/bits/mathdef.h, sysdeps/powerpc/fpu/bits/mathdef.h,
sysdeps/sh/sh4/fpu/bits/mathdef.h, sysdeps/sparc/fpu/bits/mathdef.h,
sysdeps/x86_64/fpu/bits/mathdef.h: Remove INFINITY.
* sysdeps/arm/bits/huge_val.h (HUGE_VAL): Use __builtin_huge_val.
(HUGE_VALF, HUGE_VALL): Remove.
* sysdeps/ieee754/bits/huge_val.h: Likewise.
* sysdeps/sh/bits/huge_val.h: Likewise.
* sysdeps/generic/bits/huge_val.h (HUGE_VAL): Use __builtin_huge_val.
* sysdeps/generic/bits/huge_valf.h: New file.
* sysdeps/generic/bits/huge_vall.h: New file.
* sysdeps/generic/bits/inf.h: New file.
* sysdeps/ieee754/bits/huge_valf.h: New file.
* sysdeps/ieee754/bits/inf.h: New file.
* sysdeps/i386/bits/huge_val.h: Remove file.
* sysdeps/i386/bits/huge_vall.h: New file.
* sysdeps/ia64/bits/huge_val.h: Remove file.
* sysdeps/ia64/bits/huge_vall.h: New file.
* sysdeps/ieee754/ldbl-128/bits/huge_vall.h: New file.
* sysdeps/m68k/bits/huge_val.h: Remove file.
* sysdeps/m68k/bits/huge_vall.h: New file.
* sysdeps/s390/bits/huge_val.h: Remove file.
* sysdeps/sh/sh4/fpu/bits/huge_val.h: Remove file.
* sysdeps/sparc/bits/huge_vall.h: New file.
* sysdeps/sparc/sparc32/fpu/bits/huge_val.h: Remove file.
* sysdeps/sparc/sparc64/fpu/bits/huge_val.h: Remove file.
* sysdeps/ieee754/bits/nan.h (NAN): Use __builtin_nanf.
* sysdeps/mips/bits/nan.h (NAN): Likewise.
2004-03-15 Richard Henderson <rth@redhat.com>
* math/Makefile (headers): Add bits/huge_valf.h, bits/huge_vall.h,
and bits/inf.h.
* math/math.h: Include them.
* sysdeps/alpha/fpu/bits/mathdef.h, sysdeps/arm/fpu/bits/mathdef.h,
sysdeps/generic/bits/mathdef.h, sysdeps/i386/fpu/bits/mathdef.h,
sysdeps/ia64/fpu/bits/mathdef.h, sysdeps/m68k/fpu/bits/mathdef.h,
sysdeps/mips/fpu/bits/mathdef.h, sysdeps/powerpc/fpu/bits/mathdef.h,
sysdeps/sh/sh4/fpu/bits/mathdef.h, sysdeps/sparc/fpu/bits/mathdef.h,
sysdeps/x86_64/fpu/bits/mathdef.h: Remove INFINITY.
* sysdeps/arm/bits/huge_val.h (HUGE_VAL): Use __builtin_huge_val.
(HUGE_VALF, HUGE_VALL): Remove.
* sysdeps/ieee754/bits/huge_val.h: Likewise.
* sysdeps/sh/bits/huge_val.h: Likewise.
* sysdeps/generic/bits/huge_val.h (HUGE_VAL): Use __builtin_huge_val.
* sysdeps/generic/bits/huge_valf.h: New file.
* sysdeps/generic/bits/huge_vall.h: New file.
* sysdeps/generic/bits/inf.h: New file.
* sysdeps/ieee754/bits/huge_valf.h: New file.
* sysdeps/ieee754/bits/inf.h: New file.
* sysdeps/i386/bits/huge_val.h: Remove file.
* sysdeps/i386/bits/huge_vall.h: New file.
* sysdeps/ia64/bits/huge_val.h: Remove file.
* sysdeps/ia64/bits/huge_vall.h: New file.
* sysdeps/ieee754/ldbl-128/bits/huge_vall.h: New file.
* sysdeps/m68k/bits/huge_val.h: Remove file.
* sysdeps/m68k/bits/huge_vall.h: New file.
* sysdeps/s390/bits/huge_val.h: Remove file.
* sysdeps/sh/sh4/fpu/bits/huge_val.h: Remove file.
* sysdeps/sparc/bits/huge_vall.h: New file.
* sysdeps/sparc/sparc32/fpu/bits/huge_val.h: Remove file.
* sysdeps/sparc/sparc64/fpu/bits/huge_val.h: Remove file.
* sysdeps/ieee754/bits/nan.h (NAN): Use __builtin_nanf.
* sysdeps/mips/bits/nan.h (NAN): Likewise.
2004-03-15 21:44:11 +00:00
|
|
|
bits/huge_valf.h bits/huge_vall.h bits/inf.h bits/nan.h \
|
|
|
|
fpu_control.h complex.h bits/cmathcalls.h fenv.h \
|
2011-10-12 15:27:51 +00:00
|
|
|
bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \
|
2015-05-14 14:26:49 +00:00
|
|
|
bits/math-finite.h bits/math-vector.h \
|
Refactor float_t, double_t information into bits/flt-eval-method.h.
At present, definitions of float_t and double_t are split among many
bits/mathdef.h headers.
For all but three architectures, these types are float and double.
Furthermore, if you assume __FLT_EVAL_METHOD__ to be defined, that
provides a more generic way of determining the correct values of these
typedefs. Defining these typedefs more generally based on
__FLT_EVAL_METHOD__ was previously proposed by Paul Eggert in
<https://sourceware.org/ml/libc-alpha/2012-02/msg00002.html>.
This patch refactors things in the way I proposed in
<https://sourceware.org/ml/libc-alpha/2016-11/msg00745.html>. A new
header bits/flt-eval-method.h defines a single macro,
__GLIBC_FLT_EVAL_METHOD, which is then used by math.h to define
float_t and double_t. The default is based on __FLT_EVAL_METHOD__
(although actually a default to 0 would have the same effect for
current ports, because ports where values other than 0 or 16 are
possible all have their own headers).
To avoid changing the existing semantics in any case, including for
compilers not defining __FLT_EVAL_METHOD__, architecture-specific
files are then added for m68k, s390, x86 which replicate the existing
semantics. At least with __FLT_EVAL_METHOD__ values possible with
GCC, there should be no change to the choices of float_t and double_t
for any supported configuration.
Architecture maintainer notes:
* m68k: sysdeps/m68k/m680x0/bits/flt-eval-method.h always defines
__GLIBC_FLT_EVAL_METHOD to 2 to replicate the existing logic. But
actually GCC defines __FLT_EVAL_METHOD__ to 0 if TARGET_68040. It
might make sense to make the header prefer to base things on
__FLT_EVAL_METHOD__ if defined, like the x86 version, and so make
the choices of these types more accurate (with a NEWS entry as for
the other changes to these types on particular architectures).
* s390: sysdeps/s390/bits/flt-eval-method.h always defines
__GLIBC_FLT_EVAL_METHOD to 1 to replicate the existing logic. As
previously discussed, it might make sense in coordination with GCC
to eliminate the historic mistake, avoid excess precision in the
-fexcess-precision=standard case and make the typedefs match (with a
NEWS entry, again).
Tested for x86-64 and x86. Also did compilation-only testing with
build-many-glibcs.py.
* bits/flt-eval-method.h: New file.
* sysdeps/m68k/m680x0/bits/flt-eval-method.h: Likewise.
* sysdeps/s390/bits/flt-eval-method.h: Likewise.
* sysdeps/x86/bits/flt-eval-method.h: Likewise.
* math/Makefile (headers): Add bits/flt-eval-method.h.
* math/math.h: Include <bits/flt-eval-method.h>.
[__USE_ISOC99] (float_t): Define based on __GLIBC_FLT_EVAL_METHOD.
[__USE_ISOC99] (double_t): Likewise.
* bits/mathdef.h (float_t): Remove.
(double_t): Likewise.
* sysdeps/aarch64/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/alpha/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/arm/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/hppa/fpu/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/ia64/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/m68k/m680x0/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/mips/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/powerpc/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/s390/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/sh/sh4/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/sparc/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/tile/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
* sysdeps/x86/bits/mathdef.h (float_t): Likewise.
(double_t): Likewise.
2016-11-24 18:44:50 +00:00
|
|
|
bits/libm-simd-decl-stubs.h bits/iscanonical.h \
|
Refactor long double information into bits/long-double.h.
Information about whether the ABI of long double is the same as that
of double is split between bits/mathdef.h and bits/wordsize.h.
When the ABIs are the same, bits/mathdef.h defines
__NO_LONG_DOUBLE_MATH. In addition, in the case where the same glibc
binary supports both -mlong-double-64 and -mlong-double-128,
bits/wordsize.h defines __LONG_DOUBLE_MATH_OPTIONAL, along with
__NO_LONG_DOUBLE_MATH if this particular compilation is with
-mlong-double-64.
As part of the refactoring I proposed in
<https://sourceware.org/ml/libc-alpha/2016-11/msg00745.html>, this
patch puts all that information in a single header,
bits/long-double.h. It is included from sys/cdefs.h alongside the
include of bits/wordsize.h, so other headers generally do not need to
include bits/long-double.h directly.
Previously, various bits/mathdef.h headers and bits/wordsize.h headers
had this long double information (including implicitly in some
bits/mathdef.h headers through not having the defines present in the
default version). After the patch, it's all in six bits/long-double.h
headers. Furthermore, most of those new headers are not
architecture-specific. Architectures with optional long double all
use the ldbl-opt sysdeps directory, either in the order (ldbl-64-128,
ldbl-opt, ldbl-128) or (ldbl-128ibm, ldbl-opt). Thus a generic header
for the case where long double = double, and headers in ldbl-128,
ldbl-96 and ldbl-opt, suffices to cover every architecture except for
cases where long double properties vary between different ABIs sharing
a set of installed headers; fortunately all the ldbl-opt cases share a
single compiler-predefined macro __LONG_DOUBLE_128__ that can be used
to tell whether this compilation is -mlong-double-64 or
-mlong-double-128.
The two cases where a set of headers is shared between ABIs with
different long double properties, MIPS (o32 has long double = double,
other ABIs use ldbl-128) and SPARC (32-bit has optional long double,
64-bit has required long double), need their own bits/long-double.h
headers.
As with bits/wordsize.h, multiple-include protection for this header
is generally implicit through the include guards on sys/cdefs.h, and
multiple inclusion is harmless in any case. There is one subtlety:
the header must not define __LONG_DOUBLE_MATH_OPTIONAL if
__NO_LONG_DOUBLE_MATH was defined before its inclusion, because doing
so breaks how sysdeps/ieee754/ldbl-opt/nldbl-compat.h defines
__NO_LONG_DOUBLE_MATH itself before including system headers. Subject
to keeping that working, it would be reasonable to move these macros
from defined/undefined #ifdef to always-defined 1/0 #if semantics, but
this patch does not attempt to do so, just rearranges where the macros
are defined.
After this patch, the only use of bits/mathdef.h is the alpha one for
modifying complex function ABIs for old GCC. Thus, all versions of
the header other than the default and alpha versions are removed, as
is the include from math.h.
Tested for x86_64 and x86. Also did compilation-only testing with
build-many-glibcs.py.
* bits/long-double.h: New file.
* sysdeps/ieee754/ldbl-128/bits/long-double.h: Likewise.
* sysdeps/ieee754/ldbl-96/bits/long-double.h: Likewise.
* sysdeps/ieee754/ldbl-opt/bits/long-double.h: Likewise.
* sysdeps/mips/bits/long-double.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/long-double.h: Likewise.
* math/Makefile (headers): Add bits/long-double.h.
* misc/sys/cdefs.h: Include <bits/long-double.h>.
* stdlib/strtold.c: Include <bits/long-double.h> instead of
<bits/wordsize.h>.
* bits/mathdef.h [!_COMPLEX_H]: Do not allow inclusion.
[!__NO_LONG_DOUBLE_MATH]: Remove conditional code.
* math/math.h: Do not include <bits/mathdef.h>.
* sysdeps/aarch64/bits/mathdef.h: Remove file.
* sysdeps/alpha/bits/mathdef.h [!_COMPLEX_H]: Do not allow
inclusion.
* sysdeps/ia64/bits/mathdef.h: Remove file.
* sysdeps/m68k/m680x0/bits/mathdef.h: Likewise.
* sysdeps/mips/bits/mathdef.h: Likewise.
* sysdeps/powerpc/bits/mathdef.h: Likewise.
* sysdeps/s390/bits/mathdef.h: Likewise.
* sysdeps/sparc/bits/mathdef.h: Likewise.
* sysdeps/x86/bits/mathdef.h: Likewise.
* sysdeps/s390/s390-32/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]: Remove
conditional code.
* sysdeps/s390/s390-64/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
Likewise.
* sysdeps/unix/sysv/linux/alpha/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
Likewise.
* sysdeps/unix/sysv/linux/sparc/bits/wordsize.h
[!__NO_LONG_DOUBLE_MATH && !__LONG_DOUBLE_MATH_OPTIONAL]:
Likewise.
2016-12-14 18:27:56 +00:00
|
|
|
bits/flt-eval-method.h bits/fp-fast.h bits/fp-logb.h \
|
float128: Add public _Float128 declarations to libm.
This introduces the machine-dependent bits/floatn.h to control
the inclusion of _Float128 ABI.
* bits/floatn.h: New file.
* bits/huge_val_flt128.h: Likewise.
* bits/libm-simd-decl-stubs.h (__DECL_SIMD_cosf128): New macro.
(__DECL_SIMD_sinf128): Likewise.
(__DECL_SIMD_sincosf128): Likewise.
(__DECL_SIMD_logf128): Likewise.
(__DECL_SIMD_expf128): Likewise.
(__DECL_SIMD_powf128): Likewise.
* math/Makefile (headers): Install bits/floatn.h and
bits/huge_val_flt128.h.
* math/bits/cmathcalls.h (_Mdouble_complex_): Only define if not
defined.
* math/bits/mathcalls.h (pow10, isinf, finite, drem, significand)
(isnan, gamma, nexttoward, scalb): Only define if not
__MATH_DECLARING_FLOATN.
(nextdown, nextup, llogb, roundeven, fromfp, ufromfp, fromfpx)
(ufromfpx, fmaxmag, fminmag, totalorder, totalordermag)
(canonicalize, getpayload, setpayload, setpayloadsig): Declare for
_FloatN even if __STDC_WANT_IEC_60559_BFP_EXT__ is not defined.
* math/complex.h: Include bits/libc-header-start.h and bits/floatn.h.
Include bits/cmathcalls.h to get the declarations of _Float128
versions of complex functions.
[__HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)] (CMPLXF128):
Define macro.
* math/math.h: Include bits/floatn.h and bits/huge_val_flt128.h.
Include bits/mathcalls-helper-functions.h and bits/mathcalls.h to
get the declarations of _Float128 versions of math functions.
(__MATH_DECLARING_FLOATN): New macro to control declaration of
_FloatN types.
[__GNUC_PREREQ (6,0)] (signbit): Since GCC 6.0, __builtin_signbit
is type-generic, so use it without __MATH_TG.
[__HAVE_DISTINCT_FLOAT128] (isinf): This builtin is broken for
_Float128 type on GCC < 7.0. Explicitly call __isinff128 for
_Float128 type and GCC < 7.0, otherwise use the builtin.
[__HAVE_FLOAT128 && defined __USE_GNU] (M_Ef128, M_LOG2Ef128)
(M_LOG10Ef128, M_LN2f128, M_LN10f128, M_PIf128, M_PI_2f128)
(M_PI_4f128, M_1_PIf128, M_2_PIf128, M_SQRT2f128, M_SQRT1_2f128):
New _GNU_SOURCE enabled macros.
2016-07-20 16:53:36 +00:00
|
|
|
bits/long-double.h bits/mathcalls-helper-functions.h \
|
|
|
|
bits/floatn.h bits/huge_val_flt128.h
|
1996-03-05 21:41:30 +00:00
|
|
|
|
1996-06-16 03:49:40 +00:00
|
|
|
# FPU support code.
|
1998-09-22 19:08:42 +00:00
|
|
|
aux := setfpucw fpu_control
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1996-03-05 21:41:30 +00:00
|
|
|
# Build the -lm library.
|
1995-02-18 01:27:10 +00:00
|
|
|
|
1996-03-05 21:41:30 +00:00
|
|
|
extra-libs := libm
|
update from main archive 960919
Thu Sep 19 21:50:55 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/posix/gettimeofday.c (__gettimeofday): Use localtime_r
instead of localtime.
Reported by Matthias Urlichs.
* shlib-versions: Remove version number for libcrypt.
* features.h: Define __USE_REENTRANT if _REENTRANT or _THREAD_SAFE.
* libc-symbols.h: Define _REENTRANT while compiling libc.
* sysdeps/unix/sysv/linux/i386/sysdep.S (__errno_location):
Define even if !_LIBC_REENTRANT.
* sysdeps/unix/sysv/linux/i386/sysdep.S (__errno_location):
Likewise.
* sysdeps/posix/cuserid.h: Remove prototype for geteuid().
De-ANSI-fy.
* MakeTAGS ($P/libc.pot): Generate correctly formed header.
* po/header.pot: Correct title line.
* po/nl.po: Update.
Thu Sep 19 18:59:55 1996 Ulrich Drepper <drepper@cygnus.com>
* Makeconfig (soversions.mk): Prefer shared lib version numbers
is add ons over version in libc itself.
* sysdeps/unix/sysv/linux/i386/sysdep.S: Include <sysdep.h>.
* sysdeps/unix/sysv/linux/i386/sysdep.h: Prevent multiple
inclusion.
* libio/iofgets.c: Use __flockfile and __funlockfile instead of
_IO_flockfile and _IO_funlockfile resp.
* locale/categories.def: Partly support for correct `era' handling
in LC_TIME category.
* locale/langinfo.h: Likewise.
* locale/programs/ld-time.c: Likewise.
* locale/localeinfo.h: Change comment a bit.
* malloc/memalign.c: Don't use goto, not necessary anymore.
1996-09-18 Paul Eggert <eggert@twinsun.com>
* time/mktime.c (ydhms_tm_diff): Work correctly even if year
is negative, or if time_t is unsigned.
* time/strftime.c (tm_diff): Work correctly even if tm_year
is near INT_MIN.
Tue Sep 17 16:14:34 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/fpu/__math.h (__inline_mathop): Changed to generate
all three versions of the math function.
(__inline_mathopf, __inline_mathopl): Removed.
(__inline_functions): New temporary definition containing all
non-trivial inline functions.
Wed Sep 18 00:25:41 1996 Ulrich Drepper <drepper@cygnus.com>
* time/strftime.c (strftime): The T_FMT_AMPM string may be empty.
Tue Sep 17 20:27:18 1996 Ulrich Drepper <drepper@cygnus.com>
* math/Makefile (extra-libs-others): Use $(extra-libs) instead
of $(extra-libc).
Tue Sep 17 17:09:44 1996 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/stub/fpu_control.h: Correct end of file comment.
Tue Sep 17 05:39:18 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/bug3.c, stdio-common/bug4.c, stdio-common/bug5.c,
stdio-common/test-popen.c: Remove temporary files after test.
* stdio-common/bug5.c: Use `system' instead of `execlp'.
Patches by Andreas Jaeger.
* stdio-common/bug5.c: Create string for `system' argument to
make sure the input and output file names are really correct.
Sun Sep 15 12:46:44 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* configure.in: If $os contains a hyphen add the part before the
hyphen to $ostry.
Sun Sep 15 18:14:02 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/fpu/__math.h (__ieee754_pow, __ieee754_powf,
__ieee754_powl): Rename local variable i to __i.
(__ieee754_atan2, __ieee754_atan2f, __ieee754_atan2l): New inline
functions.
* sysdeps/m68k/fpu/e_atan2.c, sysdeps/m68k/fpu/e_atan2f.c,
sysdeps/m68k/fpu/e_atan2l.c: New files.
1996-09-15 Paul Eggert <eggert@twinsun.com>
* manual/time.texi: Change `range X to Y' to `range X through
Y', to avoid ambiguity in English.
(strftime): Numbers that do not have a range indicated are not padded.
Describe E and O modifiers.
%g, %G, %u: New formats.
%C, %y, %Y: Describe behavior on negative years.
%e: Fix typo (was labeled %d).
%l, %V: Fix typo in range.
%M, %S, %U, %w, %W: Give ranges.
%p: Clarify how noon and midnight are handled for AM and PM.
%s: Clarify leap second handling.
%r: Now locale-defined.
%C, %D, %e, %h, %n, %r, %t, %T: Say that they are POSIX.2 extensions.
%z: Say that it is a GNU extension.
%Z: Wording fix.
* time/strftime.c: (strftime):
%V: Fix mishandling of week numbers near year boundaries.
%g, %G: New formats (suggested by Arthur David Olson).
%U, %W: Use inline expression instead of `week' function.
%C, %y: Handle negative years portably.
%C, %Y: Use width 1, since values can be arbitrarily wide.
%r: Use T_FMT_AMPM format if _NL_CURRENT is defined.
%u: New Posix.2 format.
%w: Width is 1, not 2.
(iso_week_days): New function, for %V, %G, %g.
(week): Remove; it didn't handle %V correctly.
(__isleap): New macro.
(mbsinit): Use arg, to pacify GCC -Wall.
1996-09-13 Paul Eggert <eggert@twinsun.com>
* time/strftime.c (strftime):
If using the GNU C library, do not bother to check for
multibyte encodings, since they're safe in formats. Otherwise:
- Check for multibyte encodings when encountering any character that
is not in the basic execution character set of the C Standard.
- Use mbrlen (if available) instead of mblen, to avoid modifying
mblen's internal state.
- Do not assume that '%' cannot appear as the first character of a
multibyte character sequence, since this is possible when not in the
initial shift state.
(HAVE_MBRLEN, MULTIBYTE_IS_FORMAT_SAFE): Define if _LIBC is defined.
(DO_MULTIBYTE): New macro.
(<ctype.h>): Do not include.
(<wchar.h>): Include if HAVE_MBRLEN.
(mbstate_t, mbrlen, mbsinit): Define if ! HAVE_MBRLEN.
(mbstate_zero): New constant.
1996-09-12 Paul Eggert <eggert@twinsun.com>
* time/strftime.c (strftime):
Use an empty zone if it can't be determined; POSIX.2 requires this.
Use plain `int' for pad and modifier (which now contain char value).
Use plain `int' for number_value, to print negative values correctly.
Use plain `int' for digits; there was no need to make it unsigned.
Initialize subfmt consistently.
Remove incorrect code for %EC and %Ey; they aren't implemented yet.
For %O, if there is no alternate digit, output Ascii instead of "".
Output the `%' of an unknown format; this is most likely the right
thing to do if a multibyte string has been misparsed.
Thu Sep 12 23:23:13 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* stdio-common/scanf7.c (main): Remove extra conversion from
printf format string.
Thu Sep 12 23:01:16 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* stdlib/test-canon.c (tests): Rename structure member from errno
to error, all uses changed.
Thu Sep 12 20:08:06 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/fpu/__math.h (__ldexp, __ldexpf, __ldexpl):
Removed.
* sysdeps/m68k/fpu/s_ldexp.c, sysdeps/m68k/fpu/s_ldexpf.c,
sysdeps/m68k/fpu/s_ldexpl.c: Removed, use generic implementation
instead.
* sysdeps/m68k/fpu/s_scalbn.c, sysdeps/m68k/fpu/s_scalbnf.c,
sysdeps/m68k/fpu/s_scalbnl.c: Replaced with old contents of
s_ldexp.c, s_ldexpf.c and s_ldexpl.c, resp., suitably adpted.
* sysdeps/m68k/fpu/__math.h (__frexp, __frexpf, __frexpl):
Return value must be in [0.5, 1), not [1, 2). Reported by Chris
Lawrence.
(__ilogb, __ilogbf, __ilogbl): Check for argument being zero.
(__scalbn, __scalbnf, __scalbnl): Use second argument directly.
Thu Sep 12 19:59:24 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/libm-ieee754/e_acoshl.c: Fix typos.
* sysdeps/libm-ieee754/s_cbrtl.c: Remove unused variable.
Thu Sep 12 19:59:24 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/libm-ieee754/e_acoshl.c: Fix typos.
* sysdeps/libm-ieee754/s_cbrtl.c: Remove unused variable.
Thu Sep 12 19:56:07 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* inet/herrno.c (__h_errno_location): Fix return type.
Tue Sep 17 10:51:58 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* malloc/memalign.c (memalign): Only acquire __libc_malloc_lock
for actual modifications to global state.
Fri Sep 13 01:21:36 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/Makefile (includes): Add -I$(common-objpfx)mach/.
* sysdeps/mach/hurd/Makefile (includes): Add
-I$(common-objpfx)hurd/. Reported by Marcus Daniels.
* sysdeps/generic/schedbits.h (struct sched_param): Renamed from
struct sched_params.
* sysdeps/stub/sched_setp.c (__sched_setparam): struct
sched_params -> struct sched_param.
* sysdeps/stub/sched_getp.c (__sched_getparam): Likewise.
* sysdeps/stub/sched_sets.c (__sched_setscheduler): Likewise.
Thu Sep 12 23:58:25 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/libc-lock.h (__libc_cleanup_region_start): Fix
syntax error.
* stdio-common/Makefile: Put lockfile in routines
unconditionally.
Define _MT_SAFE_IO if using for libio and compiling reentrant
libc.
* stdio-common/vfprintf.c (__flockfile, __funlockfile): Declare
this always, not just if _LIBC_REENTRANT.
(__funlockfile): Don't use weak_extern for this one;
__libc_cleanup_region_end might be defined and the use of
__funlockfile can't be protected the way the use of __flockfile
can be.
* sched.h: New file. Helper to access posix/sched.h.
Thu Sep 12 12:33:52 1996 Thomas Bushnell, n/BSG <thomas@gnu.ai.mit.edu>
* sysdeps/mach/hurd/dl-cache.c: Delete second copy of file
accidentally added on.
* sysdeps/stub/intr-msg.h: New file.
* stdio-common/vfprintf.c: Include <libc-lock.h>.
* stdio-common/vfscanf.c: Include <libc-lock.h>.
* sysdeps/mach/libc-lock.h (__libc_cleanup_region_start): New
macro.
(__libc_cleanup_region_end): New macro.
1996-09-20 01:58:09 +00:00
|
|
|
extra-libs-others = $(extra-libs)
|
1996-06-05 03:29:45 +00:00
|
|
|
|
2014-12-22 18:45:50 +00:00
|
|
|
libm-support = s_lib_version s_matherr s_signgam \
|
Update.
1997-04-13 01:06 Ulrich Drepper <drepper@cygnus.com>
* isomac.c: Improve messages.
* math/Makefile (libm-calls): Add s_nearbyint, s_catan, s_casin,
s_ccos, s_csin, s_ctan, s_ctanh, s_cacos, s_casinh, s_cacosh,
s_catanh, s_csqrt, and s_cpow.
* math/libm-test.c: New functions ccos_test, cacos_test, cacosh_test,
casin_test, casinh_test, catan_test, catanh_test, ctanh_test,
csqrt_test, cpow_test, rint_test.
* math/math.h: Include new header mathbits.h which defines some
more (system dependent) types and some macros.
(isfinite): Use __finite instead of fpclassify.
* sysdeps/generic/mathbits.h: New file.
* sysdeps/i386/fpu/mathbits.h: New file.
* sysdeps/i386/huge_val.h: Don't define INFINITY.
* sysdeps/ieee754/huge_val.h: Likewise.
* sysdeps/m68k/huge_val.h: Likewise.
* sysdeps/i386/fpu/fenvbits.h: Define FE_NOMASK_ENV.
* sysdeps/i386/fpu/fesetenv.c: Handle FE_NOMASK_ENV.
* math/complex.h (_Imaginary_I): Define correctly. I misread the
standard first.
* sysdeps/libm-i387/s_finite.S: Optimized rewrite.
* sysdeps/libm-i387/s_finitef.S: Likewise.
* sysdeps/libm-i387/s_finitel.S: Likewise.
Provided by Joe Keane <jgk@jgk.org>.
* sysdeps/libm-i387/s_nearbyint.S: New file.
* sysdeps/libm-i387/s_nearbyintf.S: New file.
* sysdeps/libm-i387/s_nearbyintl.S: New file.
* sysdeps/libm-ieee754/s_nearbyint.S: New file.
* sysdeps/libm-ieee754/s_nearbyintf.S: New file.
* sysdeps/libm-ieee754/s_nearbyintl.S: New file.
* sysdeps/libm-ieee754/s_cacos.c: New file.
* sysdeps/libm-ieee754/s_cacosf.c: New file.
* sysdeps/libm-ieee754/s_cacosl.c: New file.
* sysdeps/libm-ieee754/s_cacosh.c: New file.
* sysdeps/libm-ieee754/s_cacoshf.c: New file.
* sysdeps/libm-ieee754/s_cacoshl.c: New file.
* sysdeps/libm-ieee754/s_casin.c: New file.
* sysdeps/libm-ieee754/s_casinf.c: New file.
* sysdeps/libm-ieee754/s_casinl.c: New file.
* sysdeps/libm-ieee754/s_casinh.c: New file.
* sysdeps/libm-ieee754/s_casinhf.c: New file.
* sysdeps/libm-ieee754/s_casinhl.c: New file.
* sysdeps/libm-ieee754/s_catan.c: New file.
* sysdeps/libm-ieee754/s_catanf.c: New file.
* sysdeps/libm-ieee754/s_catanl.c: New file.
* sysdeps/libm-ieee754/s_catanh.c: New file.
* sysdeps/libm-ieee754/s_catanhf.c: New file.
* sysdeps/libm-ieee754/s_catanhl.c: New file.
* sysdeps/libm-ieee754/s_ccos.c: New file.
* sysdeps/libm-ieee754/s_ccosf.c: New file.
* sysdeps/libm-ieee754/s_ccosl.c: New file.
* sysdeps/libm-ieee754/s_cpow.c: New file.
* sysdeps/libm-ieee754/s_cpowf.c: New file.
* sysdeps/libm-ieee754/s_cpowl.c: New file.
* sysdeps/libm-ieee754/s_csin.c: New file.
* sysdeps/libm-ieee754/s_csinf.c: New file.
* sysdeps/libm-ieee754/s_csinl.c: New file.
* sysdeps/libm-ieee754/s_csqrt.c: New file.
* sysdeps/libm-ieee754/s_csqrtf.c: New file.
* sysdeps/libm-ieee754/s_csqrtl.c: New file.
* sysdeps/libm-ieee754/s_ctan.c: New file.
* sysdeps/libm-ieee754/s_ctanf.c: New file.
* sysdeps/libm-ieee754/s_ctanl.c: New file.
* sysdeps/libm-ieee754/s_ctanh.c: New file.
* sysdeps/libm-ieee754/s_ctanhf.c: New file.
* sysdeps/libm-ieee754/s_ctanhl.c: New file.
* time/strftime.c (memset_space): Increment pointer.
* time/strptime.c: Interpret year number 00-59 as 2000--2059.
Patches by Karl Heuer <kwzh@gnu.ai.mit.edu>.
1997-04-11 11:57 Miguel de Icaza <miguel@nuclecu.unam.mx>
* sysdeps/unix/sysv/linux/sparc/syscalls.list: Remove fork,
pipe, syscall.
1997-04-05 00:57 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/libm-ieee754/s_remquo.c: Change algorithm, although
probably still wrong.
* sysdeps/libm-ieee754/s_remquof.c: Likewise.
* sysdeps/libm-ieee754/s_remquol.c: Likewise.
* math/libm-test.c (remquo_test): Corrected.
1997-04-11 00:01 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/fpu/__math.h (__rinttol, rinttol): New inline.
* sysdeps/m68k/fpu/s_rinttol.c: New file.
* sysdeps/m68k/fpu/s_rinttoll.c: New file.
* math/libm-test.c (remquo_test): Use check_long to test the
quotient.
(cbrt_test): Add epsilons for long double.
1997-04-10 18:48 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* locale/localeinfo.h: Update declaration of _nl_current.
1997-04-11 11:27 Ulrich Drepper <drepper@cygnus.com>
* rellnsh-sh: Use explicitely /bin/pwd to find the external program.
* math/Makefile (headers): Add fenv.h and fenvbits.h.
(libm-support): Add s_rountol, s_roundtoll, fclrexcpt, fgetexcptflg,
fraiseexcpt, fsetexcptflg, ftestexcept, fegetround, fesetround,
fegetenv, feholdexcpt, fesetenv, feupdateenv.
(libm-calls): Add s_round.
* math/fenv.h: New file.
* math/libm-test.c: Correct tests for s_rinttol and s_rinttoll.
Add roundtol_check and roundtoll_check.
* math/math.h: Pretty printing.
* sysdeps/i386/fpu/fclrexcpt.c: New file.
* sysdeps/i386/fpu/fegetenv.c: New file.
* sysdeps/i386/fpu/fegetround.c: New file.
* sysdeps/i386/fpu/feholdexcpt.c: New file.
* sysdeps/i386/fpu/fenvbits.h: New file.
* sysdeps/i386/fpu/fesetenv.c: New file.
* sysdeps/i386/fpu/fesetround.c: New file.
* sysdeps/i386/fpu/fgetexcptflg.c: New file.
* sysdeps/i386/fpu/fraiseexcpt.c: New file.
* sysdeps/i386/fpu/fsetexcptflg.c: New file.
* sysdeps/i386/fpu/ftestexcept.c: New file.
* sysdeps/stub/fclrexcpt.c: New file.
* sysdeps/stub/fegetenv.c: New file.
* sysdeps/stub/fegetround.c: New file.
* sysdeps/stub/feholdexcpt.c: New file.
* sysdeps/stub/fenvbits.h: New file.
* sysdeps/stub/fesetenv.c: New file.
* sysdeps/stub/fesetround.c: New file.
* sysdeps/stub/fgetexcptflg.c: New file.
* sysdeps/stub/fraiseexcpt.c: New file.
* sysdeps/stub/fsetexcptflg.c: New file.
* sysdeps/stub/ftestexcept.c: New file.
* sysdeps/libm-i387/s_trunc.S: New file.
* sysdeps/libm-i387/s_truncf.S: New file.
* sysdeps/libm-i387/s_truncl.S: New file.
* sysdeps/libm-ieee754/s_round.c: New file.
* sysdeps/libm-ieee754/s_roundf.c: New file.
* sysdeps/libm-ieee754/s_roundl.c: New file.
* sysdeps/libm-ieee754/s_ccosh.c: Rewritten to use fpclassify.
* sysdeps/libm-ieee754/s_ccoshf.c: Likewise.
* sysdeps/libm-ieee754/s_ccoshl.c: Likewise.
* sysdeps/libm-ieee754/s_cexp.c: Likewise.
* sysdeps/libm-ieee754/s_cexpf.c: Likewise.
* sysdeps/libm-ieee754/s_cexpl.c: Likewise.
* sysdeps/libm-ieee754/s_clog.c: Likewise.
* sysdeps/libm-ieee754/s_clogf.c: Likewise.
* sysdeps/libm-ieee754/s_clogl.c: Likewise.
* sysdeps/libm-ieee754/s_csinh.c. Likewise.
* sysdeps/libm-ieee754/s_csinhf.c. Likewise.
* sysdeps/libm-ieee754/s_csinhl.c. Likewise.
* sysdeps/libm-ieee754/s_ceill.c: Corrected. The mantissa has only
63 bits.
* sysdeps/libm-ieee754/s_floorl.c: Likewise.
* po/pl.po: Updated.
* string/swab.c: Correctly handle array of odd length.
* sysdeps/generic/memmem.c: Update copyright.
1997-04-10 20:22 Ulrich Drepper <drepper@cygnus.com>
* hurd/Makefile (sunrpc-headers): Add clnt.h.
Proposed by Thomas Bushnell <thomas@gnu.ai.mit.edu>.
1997-04-09 14:21 Miguel de Icaza <miguel@nuclecu.unam.mx>
* sysdeps/sparc/dl-machine.h: Bug fix: I was not loading
the proper value from the GOT. Pass argument block to
init function.
* sysdeps/sparc/elf/start.c: Call atexit (_fini) after calling
_init ().
* sysdeps/sparc/fpu_control.h: Fix the FPU constants. I got them
wrong the first time.
* sysdeps/sparc/setjmp.S: PIC code was clobbering a callee saved
register.
* sysdeps/sparc/udiv_qrnnd.S: Add type @function.
* sysdeps/unix/sysv/linux/sparc/init-first.h: Linux/SPARC specific
SYSDEP_CALL_INIT.
* sysdeps/unix/sysv/linux/sparc/signum.h: Remove definition for
NSIG and duplicated SIGIOT.
1997-04-05 00:57 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/libm-ieee754/s_remquo.c: Change algorithm, although
probably still wrong.
* sysdeps/libm-ieee754/s_remquof.c: Likewise.
* sysdeps/libm-ieee754/s_remquol.c: Likewise.
* math/libm-test.c (remquo_test): Corrected.
1997-04-03 18:35 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makefile (parent-tests): New target to run the tests to that
they are executed even if some subdir tests have failed.
(tests): Depend on parent-tests instead of running the tests
directly.
1997-04-03 12:26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Clean up name space pollution in libnss_*.so:
* nis/nss_compat/compat-pwd.c, resolv/mapv4v6addr.h,
resolv/nss_dns/dns-host.c: Replace bzero by memset, bcopy by
memcpy and bcmp by memcmp to clean up namespace.
* nss/nss_db/db-XXX.c (internal_setent): Use __dbopen instead of
dbopen.
* nss/nss_db/db-alias.c (internal_setent): Likewise.
* nss/nss_db/db-netgrp.c (_nss_db_setnetgrent): Likewise.
* db/db/db.c [_LIBC]: Define __dbopen instead of dbopen and make
the latter a weak alias.
* db/db.h: Declare __dbopen.
* db/btree/btree.h [_LIBC]: Prepend __ to all mpool functions.
* db/mpool/mpool.c [_LIBC]: Define all external functions with __
prefix and make the old names weak aliases.
* db/mpool.h: Declare the new internal names.
1997-04-04 23:57 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* stdio-common/vfscanf.c: Fix scanning of hexadecimal fp number.
* stdio-common/tstscanf.c: Add test case for this.
1997-04-04 17:26 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* math/libm-test.c: Fix more typos.
1997-04-03 17:15 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* math/libm-test.c (csinh_test): Fix test names.
(ccosh_test): Likewise.
* sysdeps/libm-ieee754/s_csinh.c: Use sinh function instead of
computing it directly.
* sysdeps/libm-ieee754/s_csinhf.c: Likewise.
* sysdeps/libm-ieee754/s_csinhl.c: Likewise.
* sysdeps/libm-ieee754/s_ccosh.c: Use cosh function instead of
computing it directly.
* sysdeps/libm-ieee754/s_ccoshf.c: Likewise.
* sysdeps/libm-ieee754/s_ccoshl.c: Likewise.
* sysdeps/libm-ieee754/s_cexp.c: Use internal exp function instead
of wrapper.
* sysdeps/libm-ieee754/s_cexpf.c: Likewise.
* sysdeps/libm-ieee754/s_cexpl.c: Likewise.
* sysdeps/m68k/fpu/s_cexp.c: Likewise. Correct handling of
special values. Avoid use of fsincos if all that is needed is the
quadrant.
* sysdeps/m68k/fpu/s_ccosh.c: New file.
* sysdeps/m68k/fpu/s_ccoshf.c: New file.
* sysdeps/m68k/fpu/s_ccoshl.c: New file.
* sysdeps/m68k/fpu/s_csinh.c: New file.
* sysdeps/m68k/fpu/s_csinhl.c: New file.
* sysdeps/m68k/fpu/s_csinhf.c: New file.
1997-04-03 10:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* manual/Makefile (dir-add.texi): Simplify.
* libio/genops.c (_IO_flush_all_linebuffered): Don't flush on
1997-04-12 23:41:36 +00:00
|
|
|
fclrexcpt fgetexcptflg fraiseexcpt fsetexcptflg \
|
|
|
|
ftestexcept fegetround fesetround fegetenv feholdexcpt \
|
1999-11-12 17:23:30 +00:00
|
|
|
fesetenv feupdateenv t_exp fedisblxcpt feenablxcpt \
|
Add femode_t functions.
TS 18661-1 defines a type femode_t to represent the set of dynamic
floating-point control modes (such as the rounding mode and trap
enablement modes), and functions fegetmode and fesetmode to manipulate
those modes (without affecting other state such as the raised
exception flags) and a corresponding macro FE_DFL_MODE.
This patch series implements those interfaces for glibc. This first
patch adds the architecture-independent pieces, the x86 and x86_64
implementations, and the <bits/fenv.h> and ABI baseline updates for
all architectures so glibc keeps building and passing the ABI tests on
all architectures. Subsequent patches add the fegetmode and fesetmode
implementations for other architectures.
femode_t is generally an integer type - the same type as fenv_t, or as
the single element of fenv_t where fenv_t is a structure containing a
single integer (or the single relevant element, where it has elements
for both status and control registers) - except where architecture
properties or consistency with the fenv_t implementation indicate
otherwise. FE_DFL_MODE follows FE_DFL_ENV in whether it's a magic
pointer value (-1 cast to const femode_t *), a value that can be
distinguished from valid pointers by its high bits but otherwise
contains a representation of the desired register contents, or a
pointer to a constant variable (the powerpc case; __fe_dfl_mode is
added as an exported constant object, an alias to __fe_dfl_env).
Note that where architectures (that share a register between control
and status bits) gain definitions of new floating-point control or
status bits in future, the implementations of fesetmode for those
architectures may need updating (depending on whether the new bits are
control or status bits and what the implementation does with
previously unknown bits), just like existing implementations of
<fenv.h> functions that take care not to touch reserved bits may need
updating when the set of reserved bits changes. (As any new bits are
outside the scope of ISO C, that's just a quality-of-implementation
issue for supporting them, not a conformance issue.)
As with fenv_t, femode_t should properly include any software DFP
rounding mode (and for both fenv_t and femode_t I'd consider that
fragment of DFP support appropriate for inclusion in glibc even in the
absence of the rest of libdfp; hardware DFP rounding modes should
already be included if the definitions of which bits are status /
control bits are correct).
Tested for x86_64, x86, mips64 (hard float, and soft float to test the
fallback version), arm (hard float) and powerpc (hard float, soft
float and e500). Other architecture versions are untested.
* math/fegetmode.c: New file.
* math/fesetmode.c: Likewise.
* sysdeps/i386/fpu/fegetmode.c: Likewise.
* sysdeps/i386/fpu/fesetmode.c: Likewise.
* sysdeps/x86_64/fpu/fegetmode.c: Likewise.
* sysdeps/x86_64/fpu/fesetmode.c: Likewise.
* math/fenv.h: Update comment on inclusion of <bits/fenv.h>.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fegetmode): New function
declaration.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fesetmode): Likewise.
* bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (femode_t): New
typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/aarch64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/alpha/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/arm/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/hppa/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/ia64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/m68k/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/microblaze/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/mips/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/nios2/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/powerpc/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (__fe_dfl_mode): New variable
declaration.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/s390/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/sh/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/sparc/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/tile/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/x86/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* manual/arith.texi (FE_DFL_MODE): Document macro.
(fegetmode): Document function.
(fesetmode): Likewise.
* math/Versions (fegetmode): New libm symbol at version
GLIBC_2.25.
(fesetmode): Likewise.
* math/Makefile (libm-support): Add fegetmode and fesetmode.
(tests): Add test-femode and test-femode-traps.
* math/test-femode-traps.c: New file.
* math/test-femode.c: Likewise.
* sysdeps/powerpc/fpu/fenv_const.c (__fe_dfl_mode): Declare as
alias for __fe_dfl_env.
* sysdeps/powerpc/nofpu/fenv_const.c (__fe_dfl_mode): Likewise.
* sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
(__fe_dfl_mode): Likewise.
* sysdeps/powerpc/Versions (__fe_dfl_mode): New libm symbol at
version GLIBC_2.25.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-09-07 16:40:09 +00:00
|
|
|
fegetexcept fesetexcept fetestexceptflag fegetmode \
|
|
|
|
fesetmode
|
2016-06-03 20:44:12 +00:00
|
|
|
|
2016-06-14 16:44:14 +00:00
|
|
|
# Wrappers for these functions generated per type using a file named
|
|
|
|
# <func>_template.c and the appropriate math-type-macros-<TYPE>.h.
|
2016-06-28 13:49:23 +00:00
|
|
|
gen-libm-calls = cargF conjF cimagF crealF cabsF s_cacosF \
|
|
|
|
s_cacoshF s_ccosF s_ccoshF s_casinF s_csinF s_casinhF \
|
2016-06-28 16:06:42 +00:00
|
|
|
k_casinhF s_csinhF k_casinhF s_csinhF s_catanhF s_catanF \
|
2016-06-28 19:28:04 +00:00
|
|
|
s_ctanF s_ctanhF s_cexpF s_clogF s_cprojF s_csqrtF \
|
2016-09-12 22:32:07 +00:00
|
|
|
s_cpowF s_clog10F s_fdimF s_nextdownF s_fmaxF s_fminF \
|
2016-12-07 18:19:11 +00:00
|
|
|
s_nanF s_iseqsigF s_canonicalizeF w_ilogbF w_llogbF \
|
2016-12-15 18:41:58 +00:00
|
|
|
w_log1pF w_scalblnF s_fmaxmagF s_fminmagF w_acosF \
|
|
|
|
w_acoshF w_asinF w_atan2F w_atanhF w_coshF w_exp10F \
|
|
|
|
w_exp2F w_fmodF w_hypotF w_j0F w_j1F w_jnF w_logF \
|
|
|
|
w_log10F w_log2F w_powF w_remainderF w_sinhF w_sqrtF \
|
2017-05-16 16:34:34 +00:00
|
|
|
w_tgammaF w_lgammaF w_lgammaF_r w_expF e_exp2F
|
2016-06-14 16:44:14 +00:00
|
|
|
|
2016-06-03 20:44:12 +00:00
|
|
|
libm-calls = \
|
|
|
|
e_acosF e_acoshF e_asinF e_atan2F e_atanhF e_coshF e_expF e_fmodF \
|
|
|
|
e_hypotF e_j0F e_j1F e_jnF e_lgammaF_r e_logF e_log10F e_powF \
|
|
|
|
e_rem_pio2F e_remainderF e_scalbF e_sinhF e_sqrtF e_gammaF_r \
|
|
|
|
e_ilogbF \
|
2016-08-25 22:25:40 +00:00
|
|
|
k_cosF k_sinF k_tanF s_asinhF s_atanF s_cbrtF \
|
2016-06-03 20:44:12 +00:00
|
|
|
s_ceilF s_cosF s_erfF s_expm1F s_fabsF \
|
2016-12-07 18:19:11 +00:00
|
|
|
s_floorF s_log1pF s_logbF \
|
2016-12-09 19:08:14 +00:00
|
|
|
s_nextafterF s_nexttowardF s_rintF s_scalblnF \
|
2016-12-14 00:42:51 +00:00
|
|
|
s_significandF s_sinF s_tanF s_tanhF \
|
2016-09-12 22:32:07 +00:00
|
|
|
s_fpclassifyF s_truncF \
|
2017-05-16 16:34:34 +00:00
|
|
|
s_remquoF e_log2F s_roundF s_nearbyintF s_sincosF \
|
2016-12-14 00:42:51 +00:00
|
|
|
s_fmaF s_lrintF s_llrintF s_lroundF s_llroundF e_exp10F \
|
2016-06-28 13:49:23 +00:00
|
|
|
s_issignalingF $(calls:s_%=m_%) x2y2m1F \
|
2016-06-03 20:44:12 +00:00
|
|
|
gamma_productF lgamma_negF lgamma_productF \
|
2016-10-19 01:49:09 +00:00
|
|
|
s_nextupF s_totalorderF s_totalordermagF s_getpayloadF \
|
Add fromfp functions.
TS 18661-1 defines fromfp functions (fromfp, fromfpx, ufromfp,
ufromfpx, and float and long double variants) to convert from
floating-point to an integer type with any signedness and any given
width up to that of intmax_t, in any of the five IEEE rounding modes
(the usual four for binary floating point, plus rounding to nearest
with ties rounding away from zero), with control of whether in-range
non-integer values should result in the "inexact" exception being
raised. This patch implements these functions for glibc.
These implementations are (apart from raising exceptions) pure integer
implementations; it's entirely possible optimized versions could be
devised for some architectures. A common math/fromfp.h header
provides various common helper code that can readily be shared between
the implementations for different types. For each type, the bulk of
the implementation is also shared between the four functions, with
wrappers that define UNSIGNED and INEXACT macros appropriately before
including the main implementation.
As the functions return intmax_t and uintmax_t without math.h being
allowed to expose those typedef names, they are declared using
__intmax_t and __uintmax_t as obtained from <bits/types.h>.
The FP_INT_* rounding direction macros are defined as ascending
integers in the order the names are listed in the TS; I see no
significant value in allowing architectures to vary the values of
them.
The libm-test machinery is duly adapted to handle unsigned int
arguments, and intmax_t and uintmax_t results. Because each test
input is generally tested for four functions, five rounding modes and
several different widths, the libm-test.inc additions are very large.
Thus, the diffs in the body of this message exclude the libm-test.inc
changes, with the full patch being attached gzipped. The bulk of the
new tests were generated (expanded from a test input plus rounding
results and information about where it lies in the relevant interval
between integers, to libm-test tests for all relevant combinations of
function, rounding direction and width) by a script that's included in
the patch as math/gen-fromfp-tests.py (input data
math/gen-fromfp-tests-inputs); as an ad hoc script that's not really
expected to be rerun, it's not very polished, but it's at least
plausibly useful for adding any further tests for these functions in
future. I may split the libm-test tests up by function in future (so
both libm-test.inc and auto-libm-test-out are split into separate
files, and the tests for each function are also built and run
separately), but not for 2.25.
For no obvious reason, adding tgmath tests for the new functions
resulted in -Wuninitialized errors from test-tgmath.c about the
variable i being used uninitialized. Those errors were correct - the
variable is read by the frexp version in test-tgmath.c (where real
frexp would write through that pointer instead of reading it) - but I
don't know why this patch would result in the pre-existing issue being
newly detected. The patch initializes the variable to avoid those
errors.
With these changes, glibc 2.25 should have all the library features
from TS 18661-1 other than the functions that round result to narrower
type (and constant rounding directions, but I'm considering those
mainly a compiler feature not a library one).
Tested for x86_64, x86, mips64 and powerpc.
* math/bits/mathcalls.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(fromfp): New declaration.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfpx): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfp): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfpx): Likewise.
* math/tgmath.h (__TGMATH_TERNARY_FIRST_REAL_RET_ONLY): New macro.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfp): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfp): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fromfpx): Likewise.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (ufromfpx): Likewise.
* math/math.h: Include <bits/types.h>.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FP_INT_UPWARD): New enum
constant and macro.
(FP_INT_DOWNWARD): Likewise.
(FP_INT_TOWARDZERO): Likewise.
(FP_INT_TONEARESTFROMZERO): Likewise.
(FP_INT_TONEAREST): Likewise.
* math/Versions (fromfp): New libm symbol at version GLIBC_2.25.
(fromfpf): Likewise.
(fromfpl): Likewise.
(ufromfp): Likewise.
(ufromfpf): Likewise.
(ufromfpl): Likewise.
(fromfpx): Likewise.
(fromfpxf): Likewise.
(fromfpxl): Likewise.
(ufromfpx): Likewise.
(ufromfpxf): Likewise.
(ufromfpxl): Likewise.
* math/Makefile (libm-calls): Add s_fromfpF, s_ufromfpF,
s_fromfpxF and s_ufromfpxF.
* math/gen-fromfp-tests.py: New file.
* math/gen-fromfp-tests-inputs: Likewise.
* math/libm-test.inc: Include <stdint.h>
(check_intmax_t): New function.
(check_uintmax_t): Likewise.
(struct test_fiu_M_data): New type.
(struct test_fiu_U_data): Likewise.
(RUN_TEST_fiu_M): New macro.
(RUN_TEST_LOOP_fiu_M): Likewise.
(RUN_TEST_fiu_U): Likewise.
(RUN_TEST_LOOP_fiu_U): Likewise.
(fromfp_test_data): New array.
(fromfp_test): New function.
(fromfpx_test_data): New array.
(fromfpx_test): New function.
(ufromfp_test_data): New array.
(ufromfp_test): New function.
(ufromfpx_test_data): New array.
(ufromfpx_test): New function.
(main): Call fromfp_test, fromfpx_test, ufromfp_test and
ufromfpx_test.
* math/gen-libm-test.pl (parse_args): Handle u, M and U descriptor
characters.
* math/test-tgmath-ret.c: Include <stdint.h>.
(rm): New variable.
(width): Likewise.
(CHECK_RET_CONST_TYPE): Take extra arguments and pass them to
called function.
(CHECK_RET_CONST_FLOAT): Take extra arguments and pass them to
CHECK_RET_CONST_TYPE.
(CHECK_RET_CONST_DOUBLE): Likewise.
(CHECK_RET_CONST_LDOUBLE): Likewise.
(CHECK_RET_CONST): Take extra arguments and pass them to calls
macros.
(fromfp): New CHECK_RET_CONST call.
(ufromfp): Likewise.
(fromfpx): Likewise.
(ufromfpx): Likewise.
(do_test): Call check_return_fromfp, check_return_ufromfp,
check_return_fromfpx and check_return_ufromfpx.
* math/test-tgmath.c: Include <stdint.h>
(NCALLS): Increase to 138.
(F(compile_test)): Initialize i. Call fromfp functions.
(F(fromfp)): New function.
(F(fromfpx)): Likewise.
(F(ufromfp)): Likewise.
(F(ufromfpx)): Likewise.
* manual/arith.texi (Rounding Functions): Document FP_INT_UPWARD,
FP_INT_DOWNWARD, FP_INT_TOWARDZERO, FP_INT_TONEARESTFROMZERO,
FP_INT_TONEAREST, fromfp, fromfpf, fromfpl, ufromfp, ufromfpf,
ufromfpl, fromfpx, fromfpxf, fromfpxl, ufromfpx, ufromfpxf and
ufromfpxl.
* manual/libm-err-tab.pl (@all_functions): Add fromfp, fromfpx,
ufromfp and ufromfpx.
* math/fromfp.h: New file.
* sysdeps/ieee754/dbl-64/s_fromfp.c: Likewise.
* sysdeps/ieee754/dbl-64/s_fromfp_main.c: Likewise.
* sysdeps/ieee754/dbl-64/s_fromfpx.c: Likewise.
* sysdeps/ieee754/dbl-64/s_ufromfp.c: Likewise.
* sysdeps/ieee754/dbl-64/s_ufromfpx.c: Likewise.
* sysdeps/ieee754/flt-32/s_fromfpf.c: Likewise.
* sysdeps/ieee754/flt-32/s_fromfpf_main.c: Likewise.
* sysdeps/ieee754/flt-32/s_fromfpxf.c: Likewise.
* sysdeps/ieee754/flt-32/s_ufromfpf.c: Likewise.
* sysdeps/ieee754/flt-32/s_ufromfpxf.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_fromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_fromfpl_main.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_fromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_ufromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-128/s_ufromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_fromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_fromfpl_main.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_fromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_ufromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/s_ufromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_fromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_fromfpl_main.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_fromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_ufromfpl.c: Likewise.
* sysdeps/ieee754/ldbl-96/s_ufromfpxl.c: Likewise.
* sysdeps/ieee754/ldbl-opt/Makefile (libnldbl-calls): Add fromfp,
ufromfp, fromfpx and ufromfpx.
(CFLAGS-nldbl-fromfp.c): New variable.
(CFLAGS-nldbl-fromfpx.c): Likewise.
(CFLAGS-nldbl-ufromfp.c): Likewise.
(CFLAGS-nldbl-ufromfpx.c): Likewise.
* sysdeps/ieee754/ldbl-opt/nldbl-compat.h: Include <stdint.h>.
* sysdeps/ieee754/ldbl-opt/nldbl-fromfp.c: New file.
* sysdeps/ieee754/ldbl-opt/nldbl-fromfpx.c: Likewise.
* sysdeps/ieee754/ldbl-opt/nldbl-ufromfp.c: Likewise.
* sysdeps/ieee754/ldbl-opt/nldbl-ufromfpx.c: Likewise.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-12-31 00:40:59 +00:00
|
|
|
s_setpayloadF s_setpayloadsigF s_roundevenF s_fromfpF s_ufromfpF \
|
|
|
|
s_fromfpxF s_ufromfpxF $(gen-libm-calls)
|
2016-06-03 20:44:12 +00:00
|
|
|
|
2017-02-08 22:44:34 +00:00
|
|
|
libm-compat-calls = \
|
2016-12-14 00:42:51 +00:00
|
|
|
w_acosF_compat w_acoshF_compat w_asinF_compat w_atan2F_compat \
|
|
|
|
w_atanhF_compat w_coshF_compat w_exp2F_compat w_exp10F_compat \
|
|
|
|
w_fmodF_compat w_hypotF_compat w_j0F_compat w_j1F_compat \
|
|
|
|
w_jnF_compat w_log2F_compat w_log10F_compat w_logF_compat \
|
|
|
|
w_powF_compat w_remainderF_compat w_scalbF_compat \
|
2016-12-21 12:20:08 +00:00
|
|
|
w_sinhF_compat w_sqrtF_compat w_tgammaF_compat \
|
2017-02-08 22:44:34 +00:00
|
|
|
w_lgammaF_r_compat w_lgammaF_compat2 w_expF_compat \
|
|
|
|
w_lgamma_compatF k_standardF
|
2016-06-03 20:44:12 +00:00
|
|
|
|
|
|
|
# Type specific routine support.
|
|
|
|
#
|
|
|
|
# The following three variables control what is included for each type:
|
|
|
|
#
|
|
|
|
# type-floatN-suffix = The suffix of the type
|
|
|
|
# type-floatN-routines = Type specific support objects
|
|
|
|
# type-floatN-yes = If the type is supported, evaluates to floatN
|
|
|
|
#
|
|
|
|
# Finally, note that types is an intentionally recursive variable.
|
|
|
|
# We only know the full set of supported types for the target machine
|
|
|
|
# after the Rules makefile has been parsed.
|
2016-07-15 19:05:51 +00:00
|
|
|
types-basic = $(type-ldouble-$(long-double-fcts)) double float
|
2016-06-03 20:44:12 +00:00
|
|
|
|
|
|
|
# long double support
|
|
|
|
type-ldouble-suffix := l
|
Add iscanonical.
TS 18661-1 adds an iscanonical classification macro to <math.h>.
The motivation for this is decimal floating-point, where some values
have both canonical and noncanonical encodings. For IEEE binary
interchange formats, all encodings are canonical. For x86/m68k
ldbl-96, and for ldbl-128ibm, there are encodings that do not
represent any valid value of the type; although formally iscanonical
does not need to handle trap representations (and so could just always
return 1), it seems useful, and in line with the description in the TS
of "representations that are extraneous to the floating-point model"
as being non-canonical (as well as "redundant representations of some
or all of its values"), for it to detect those representations and
return 0 for them.
This patch adds iscanonical to glibc. It goes in a header
<bits/iscanonical.h>, included under appropriate conditions in
<math.h>. The default header version just evaluates the argument
(converted to its semantic type, though current GCC will probably
discard that conversion and any exceptions resulting from it) and
returns 1. ldbl-96 and ldbl-128ibm then have versions of the header
that call a function __iscanonicall for long double (the sizeof-based
tests will of course need updating for float128 support, like other
such type-generic macro implementations). The ldbl-96 version of
__iscanonicall has appropriate conditionals to reflect the differences
in the m68k version of that format (where the high mantissa bit may be
either 0 or 1 when the exponent is 0 or 0x7fff). Corresponding tests
for those formats are added as well. Other architectures do not have
any new functions added because just returning 1 is correct for all
their floating-point formats.
Tested for x86_64, x86, mips64 (to test the default macro version) and
powerpc.
* math/math.h [__GLIBC_USE (IEC_60559_BFP_EXT)]: Include
<bits/iscanonical.h>.
* bits/iscanonical.h: New file.
* math/s_iscanonicall.c: Likewise.
* math/Versions (__iscanonicall): New libm symbol at version
GLIBC_2.25.
* math/libm-test.inc (iscanonical_test_data): New array.
(iscanonical_test): New function.
(main): Call iscanonical_test.
* math/Makefile (headers): Add bits/iscanonical.h.
(type-ldouble-routines): Add s_iscanonicall.
* manual/arith.texi (Floating Point Classes): Document
iscanonical.
* manual/libm-err-tab.pl: Update comment on interfaces without
ulps tabulated.
* sysdeps/ieee754/ldbl-128ibm/bits/iscanonical.h: New file.
* sysdeps/ieee754/ldbl-128ibm/s_iscanonicall.c: Likewise.
* sysdeps/ieee754/ldbl-128ibm/test-iscanonical-ldbl-128ibm.c:
Likewise.
* sysdeps/ieee754/ldbl-128ibm/Makefile (tests): Add
test-iscanonical-ldbl-128ibm.
* sysdeps/ieee754/ldbl-96/bits/iscanonical.h: New file.
* sysdeps/ieee754/ldbl-96/s_iscanonicall.c: Likewise.
* sysdeps/ieee754/ldbl-96/test-iscanonical-ldbl-96.c: Likewise.
* sysdeps/ieee754/ldbl-96/Makefile: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Update.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-09-30 00:24:19 +00:00
|
|
|
type-ldouble-routines := t_sincosl k_sincosl s_iscanonicall
|
2016-06-03 20:44:12 +00:00
|
|
|
type-ldouble-yes := ldouble
|
|
|
|
|
|
|
|
# double support
|
|
|
|
type-double-suffix :=
|
|
|
|
type-double-routines := branred doasin dosincos halfulp mpa mpatan2 \
|
|
|
|
mpatan mpexp mplog mpsqrt mptan sincos32 slowexp \
|
2016-08-25 22:25:40 +00:00
|
|
|
slowpow sincostab k_rem_pio2
|
2016-06-03 20:44:12 +00:00
|
|
|
|
|
|
|
# float support
|
|
|
|
type-float-suffix := f
|
2016-08-25 22:25:40 +00:00
|
|
|
type-float-routines := k_rem_pio2f
|
2016-06-03 20:44:12 +00:00
|
|
|
|
2016-07-15 19:05:51 +00:00
|
|
|
# _Float128 support
|
|
|
|
type-float128-suffix := f128
|
|
|
|
type-float128-routines := t_sincosf128 k_sincosf128
|
|
|
|
type-float128-yes := float128
|
|
|
|
types = $(types-basic) $(type-float128-$(float128-fcts))
|
|
|
|
|
|
|
|
# For each of the basic types (float, double, long double), replace the
|
|
|
|
# occurrences of 'F' in arg 1 with the appropriate suffix for the type.
|
|
|
|
type-basic-foreach = $(foreach t, $(types-basic), \
|
|
|
|
$(subst F,$(type-$(t)-suffix),$(1)))
|
2016-06-03 20:44:12 +00:00
|
|
|
|
|
|
|
# Apply suffix to each type in arg 1
|
|
|
|
type-foreach = $(foreach t,$(types),$(subst F,$(type-$(t)-suffix),$(1)))
|
|
|
|
|
2017-02-08 22:44:34 +00:00
|
|
|
libm-routines = $(strip $(libm-support) \
|
2016-07-15 19:05:51 +00:00
|
|
|
$(call type-basic-foreach, \
|
|
|
|
$(libm-compat-calls)) \
|
2016-06-03 20:44:12 +00:00
|
|
|
$(call type-foreach, $(libm-calls)) \
|
|
|
|
$(foreach t, $(types), $(type-$(t)-routines))) \
|
1996-06-05 03:29:45 +00:00
|
|
|
|
1996-03-05 21:41:30 +00:00
|
|
|
# These functions are in libc instead of libm because __printf_fp
|
|
|
|
# calls them, so any program using printf will need them linked in,
|
|
|
|
# and we don't want to have to link every program with -lm.
|
2002-11-15 22:51:30 +00:00
|
|
|
# In libm-calls (above), list m_foo in place of s_foo for any
|
|
|
|
# routine that should be compiled separately for its libc and libm versions.
|
2016-06-03 20:44:12 +00:00
|
|
|
calls = s_isinfF s_isnanF s_finiteF s_copysignF s_modfF s_scalbnF s_frexpF \
|
2016-09-08 13:48:08 +00:00
|
|
|
s_signbitF $(gen-calls)
|
|
|
|
gen-calls = s_ldexpF
|
2016-06-03 20:44:12 +00:00
|
|
|
generated += $(foreach s,.c .S,$(call type-foreach, $(calls:s_%=m_%$(s))))
|
|
|
|
routines = $(call type-foreach, $(calls))
|
1999-10-19 06:29:27 +00:00
|
|
|
|
2015-05-14 14:28:06 +00:00
|
|
|
ifeq ($(build-mathvec),yes)
|
2016-12-08 14:25:59 +00:00
|
|
|
# We need to install libm.so and libm.a as linker scripts
|
|
|
|
# for transparent use of vector math library.
|
|
|
|
install-lib-ldscripts := libm.so libm.a
|
|
|
|
install-others = $(inst_libdir)/libm.so $(inst_libdir)/libm.a
|
2015-05-14 14:28:06 +00:00
|
|
|
$(inst_libdir)/libm.so: $(common-objpfx)format.lds \
|
|
|
|
$(libm) \
|
|
|
|
$(libmvec) \
|
|
|
|
$(+force)
|
|
|
|
(echo '/* GNU ld script'; echo '*/';\
|
|
|
|
cat $<; \
|
|
|
|
echo 'GROUP ( $(slibdir)/libm.so$(libm.so-version) ' \
|
2015-12-03 17:24:37 +00:00
|
|
|
'AS_NEEDED ( $(libdir)/libmvec_nonshared.a $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
|
2016-03-15 17:20:01 +00:00
|
|
|
) > $@.new
|
|
|
|
mv -f $@.new $@
|
2016-12-08 14:25:59 +00:00
|
|
|
|
2016-12-13 14:40:08 +00:00
|
|
|
$(inst_libdir)/libm-$(version).a: $(objpfx)libm.a \
|
|
|
|
$(+force)
|
|
|
|
$(do-install)
|
|
|
|
|
2016-12-08 14:25:59 +00:00
|
|
|
$(inst_libdir)/libm.a: $(common-objpfx)format.lds \
|
2016-12-13 14:40:08 +00:00
|
|
|
$(inst_libdir)/libm-$(version).a \
|
|
|
|
$(objpfx)../mathvec/libmvec.a \
|
2016-12-08 14:25:59 +00:00
|
|
|
$(+force)
|
|
|
|
(echo '/* GNU ld script'; echo '*/';\
|
|
|
|
cat $<; \
|
2016-12-13 14:40:08 +00:00
|
|
|
echo 'GROUP ( $(libdir)/libm-$(version).a $(libdir)/libmvec.a )' \
|
2016-12-08 14:25:59 +00:00
|
|
|
) > $@.new
|
|
|
|
mv -f $@.new $@
|
2015-05-14 14:28:06 +00:00
|
|
|
endif
|
|
|
|
|
1997-03-20 02:20:57 +00:00
|
|
|
# Rules for the test suite.
|
2000-01-20 08:27:38 +00:00
|
|
|
tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
|
2013-09-09 21:36:57 +00:00
|
|
|
test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \
|
|
|
|
test-tgmath-ret bug-nextafter bug-nexttoward bug-tgmath1 \
|
|
|
|
test-tgmath-int test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan \
|
2015-01-28 11:10:41 +00:00
|
|
|
test-fenv-tls test-fenv-preserve test-fenv-return test-fenvinline \
|
2015-11-05 21:23:07 +00:00
|
|
|
test-nearbyint-except test-fenv-clear test-signgam-finite \
|
2015-11-11 00:06:09 +00:00
|
|
|
test-signgam-finite-c99 test-signgam-finite-c11 \
|
Fix lgamma setting signgam for ISO C (bug 15421).
The lgamma (and likewise lgammaf, lgammal) function wrongly sets the
signgam variable even when building for strict ISO C conformance
(-std=c99 / -std=c11), although the user may define such a variable
and it's only in the implementation namespace for POSIX with XSI
extensions enabled.
Following discussions starting at
<https://sourceware.org/ml/libc-alpha/2013-04/msg00767.html> and
<https://sourceware.org/ml/libc-alpha/2015-10/msg00844.html>, it seems
that the safest approach for fixing this particular issue is for
signgam to become a weak alias for a newly exported symbol __signgam,
with the library functions only setting __signgam, at which point
static linker magic will preserve the alias for newly linked binaries
that refer to the library's signgam rather than defining their own,
while breaking the alias for programs that define their own signgam,
with new symbol versions for lgamma functions and with compat symbols
for existing binaries that set both signgam and __signgam.
This patch implements that approach for the fix. signgam is made into
a weak alias. The four symbols __signgam, lgamma, lgammaf, lgammal
get new symbol versions at version GLIBC_2.23, with the existing
versions of lgamma, lgammaf and lgammal becoming compat symbols.
When the compat versions are built, gamma, gammaf and gammal are
aliases for the compat versions (i.e. always set signgam); this is OK
as they are not ISO C functions, and avoids adding new symbol versions
for them unnecessarily. When the compat versions are not built
(i.e. for static linking and for future glibc ports), gamma, gammaf
and gammal are aliases for the new versions that set __signgam. The
ldbl-opt versions are updated accordingly.
The lgamma wrappers are adjusted so that the same source files,
included from different files with different definitions of
USE_AS_COMPAT, can build either the new versions or the compat
versions. Similar changes are made to the ia64 versions (untested).
Tests are added that the lgamma functions do not interfere with a user
variable called signgam for ISO C, with various choices for the size
of that variable, whether it is initialized, and for static and
dynamic linking. The conformtest whitelist entry is removed as well.
Tested for x86_64, x86, mips64 and powerpc, including looking at
objdump --dynamic-syms output to make sure the expected sets of
symbols were aliases. Also spot-tested that a binary built with old
glibc works properly (i.e. gets signgam set) when run with new glibc.
[BZ #15421]
* sysdeps/ieee754/s_signgam.c (signgam): Rename to __signgam,
initialize with 0 and define as weak alias of __signgam.
* include/math.h [!_ISOMAC] (__signgam): Declare.
* math/Makefile (libm-calls): Add w_lgamma_compat.
(tests): Add test-signgam-uchar, test-signgam-uchar-init,
test-signgam-uint, test-signgam-uint-init, test-signgam-ullong and
test-signgam-ullong-init.
(tests-static): Add test-signgam-uchar-static,
test-signgam-uchar-init-static, test-signgam-uint-static,
test-signgam-uint-init-static, test-signgam-ullong-static and
test-signgam-ullong-init-static.
(CFLAGS-test-signgam-uchar.c): New variable.
(CFLAGS-test-signgam-uchar-init.c): Likewise.
(CFLAGS-test-signgam-uchar-static.c): Likewise.
(CFLAGS-test-signgam-uchar-init-static.c): Likewise.
(CFLAGS-test-signgam-uint.c): Likewise.
(CFLAGS-test-signgam-uint-init.c): Likewise.
(CFLAGS-test-signgam-uint-static.c): Likewise.
(CFLAGS-test-signgam-uint-init-static.c): Likewise.
(CFLAGS-test-signgam-ullong.c): Likewise.
(CFLAGS-test-signgam-ullong-init.c): Likewise.
(CFLAGS-test-signgam-ullong-static.c): Likewise.
(CFLAGS-test-signgam-ullong-init-static.c): Likewise.
* math/Versions (libm): Add GLIBC_2.23.
* math/lgamma-compat.h: New file.
* math/test-signgam-main.c: Likewise.
* math/test-signgam-uchar-init-static.c: Likewise.
* math/test-signgam-uchar-init.c: Likewise.
* math/test-signgam-uchar-static.c: Likewise.
* math/test-signgam-uchar.c: Likewise.
* math/test-signgam-uint-init-static.c: Likewise.
* math/test-signgam-uint-init.c: Likewise.
* math/test-signgam-uint-static.c: Likewise.
* math/test-signgam-uint.c: Likewise.
* math/test-signgam-ullong-init-static.c: Likewise.
* math/test-signgam-ullong-init.c: Likewise.
* math/test-signgam-ullong-static.c: Likewise.
* math/test-signgam-ullong.c: Likewise.
* math/w_lgamma.c: Rename to w_lgamma_main.c and replace by
wrapper of w_lgamma_main.c.
* math/w_lgamma_compat.c: New file.
* math/w_lgamma_compatf.c: Likewise.
* math/w_lgamma_compatl.c: Likewise.
* math/w_lgamma_main.c: New file. Based on w_lgamma.c. Include
<lgamma-compat.h>. Condition contents on [BUILD_LGAMMA]. Support
defining compatibility symbols.
(__lgamma): Change to LGFUNC (__lgamma). Use CALL_LGAMMA.
* math/w_lgammaf.c: Rename to w_lgammaf_main.c and replace by
wrapper of w_lgammaf_main.c.
* math/w_lgammaf_main.c: New file. Based on w_lgammaf.c. Include
<lgamma-compat.h>. Condition contents on [BUILD_LGAMMA]. Support
defining compatibility symbols.
(__lgammaf): Change to LGFUNC (__lgammaf). Use CALL_LGAMMA.
* math/w_lgammal.c: Rename to w_lgammal_main.c and replace by
wrapper of w_lgammal_main.c.
* math/w_lgammal_main.c: New file. Based on w_lgammal.c. Include
<lgamma-compat.h>. Condition contents on [BUILD_LGAMMA]. Support
defining compatibility symbols.
(__lgammal): Change to LGFUNC (__lgammal). Use CALL_LGAMMA.
* sysdeps/ia64/fpu/lgamma-compat.h: New file.
* sysdeps/ia64/fpu/w_lgamma.c: Move to ....
* sysdeps/ia64/fpu/w_lgamma_main.c: ...here. Include
<lgamma-compat.h>.
(__ieee754_lgamma): Change to LGFUNC (lgamma). Use CALL_LGAMMA.
(__ieee754_gamma): Define as alias.
* sysdeps/ia64/fpu/w_lgammaf.c: Move to ....
* sysdeps/ia64/fpu/w_lgammaf_main.c: ...here. Include
<lgamma-compat.h>.
(__ieee754_lgammaf): Change to LGFUNC (lgammaf). Use CALL_LGAMMA.
(__ieee754_gammaf): Define as alias.
* sysdeps/ia64/fpu/w_lgammal.c: Move to ....
* sysdeps/ia64/fpu/w_lgammal_main.c: ...here. Include
<lgamma-compat.h>.
(__ieee754_lgammal): Change to LGFUNC (lgammal). Use CALL_LGAMMA.
(__ieee754_gammal): Define as alias.
* sysdeps/ieee754/ldbl-opt/w_lgamma.c: Move to ....
* sysdeps/ieee754/ldbl-opt/w_lgamma_compat.c: ...here. Include
<math/w_lgamma_compat.c>.
[LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)] (__lgammal_dbl_compat):
Define as alias of __lgamma_compat and use in defining lgammal.
* sysdeps/ieee754/ldbl-opt/w_lgammal.c: Move to ....
* sysdeps/ieee754/ldbl-opt/w_lgamma_compatl.c: ...here. Include
<math/lgamma-compat.h> and <math/w_lgamma_compatl.c>.
(USE_AS_COMPAT): New macro.
(LGAMMA_OLD_VER): Undefine and redefine.
(lgammal): Do not define here.
(gammal): Only define here if [GAMMA_ALIAS].
* conform/linknamespace.pl (@whitelist): Remove signgam.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2015-11-20 22:49:59 +00:00
|
|
|
test-nearbyint-except-2 test-signgam-uchar test-signgam-uchar-init \
|
|
|
|
test-signgam-uint test-signgam-uint-init test-signgam-ullong \
|
Fix nan functions handling of payload strings (bug 16961, bug 16962).
The nan, nanf and nanl functions handle payload strings by doing e.g.:
if (tagp[0] != '\0')
{
char buf[6 + strlen (tagp)];
sprintf (buf, "NAN(%s)", tagp);
return strtod (buf, NULL);
}
This is an unbounded stack allocation based on the length of the
argument. Furthermore, if the argument starts with an n-char-sequence
followed by ')', that n-char-sequence is wrongly treated as
significant for determining the payload of the resulting NaN, when ISO
C says the call should be equivalent to strtod ("NAN", NULL), without
being affected by that initial n-char-sequence. This patch fixes both
those problems by using the __strtod_nan etc. functions recently
factored out of strtod etc. for that purpose, with those functions
being exported from libc at version GLIBC_PRIVATE.
Tested for x86_64, x86, mips64 and powerpc.
[BZ #16961]
[BZ #16962]
* math/s_nan.c (__nan): Use __strtod_nan instead of constructing a
string on the stack for strtod.
* math/s_nanf.c (__nanf): Use __strtof_nan instead of constructing
a string on the stack for strtof.
* math/s_nanl.c (__nanl): Use __strtold_nan instead of
constructing a string on the stack for strtold.
* stdlib/Versions (libc): Add __strtof_nan, __strtod_nan and
__strtold_nan to GLIBC_PRIVATE.
* math/test-nan-overflow.c: New file.
* math/test-nan-payload.c: Likewise.
* math/Makefile (tests): Add test-nan-overflow and
test-nan-payload.
2015-12-04 20:36:28 +00:00
|
|
|
test-signgam-ullong-init test-nan-overflow test-nan-payload \
|
Add fesetexcept.
TS 18661-1 defines an fesetexcept function for setting floating-point
exception flags without the side-effect of causing enabled traps to be
taken.
This patch series implements this function for glibc. The present
patch adds the fallback stub implementation, x86 and x86_64
implementations, documentation, tests and ABI baseline updates. The
remaining patches, some of them untested, add implementations for
other architectures. The implementations generally follow those of
the fesetexceptflag function.
As for fesetexceptflag, the approach taken for architectures where
setting flags causes enabled traps to be taken is to set the flags
(and potentially cause traps) rather than refusing to set the flags
and returning an error. Since ISO C and TS 18661 provide no way to
enable traps, this is formally in accordance with the standards.
The NEWS entry should be considered a placeholder, since this patch
series is intended to be followed by further such series adding other
TS 18661-1 features, so that the NEWS entry would end up looking more
like
* New <fenv.h> features from TS 18661-1:2014 are added to libm: the
fesetexcept, fetestexceptflag, fegetmode and fesetmode functions,
the femode_t type and the FE_DFL_MODE macro.
with hopefully more such entries for other features, rather than
having an entry for a single function in the end.
I believe we have consensus for adding TS 18661-1 interfaces as per
<https://sourceware.org/ml/libc-alpha/2016-06/msg00421.html>.
Tested for x86_64, x86, mips64 (hard float, and soft float to test the
fallback version), arm (hard float) and powerpc (hard float, soft
float and e500).
* math/fesetexcept.c: New file.
* sysdeps/i386/fpu/fesetexcept.c: Likewise.
* sysdeps/x86_64/fpu/fesetexcept.c: Likewise.
* math/fenv.h: Define
__GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION and include
<bits/libc-header-start.h> instead of including <features.h>.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fesetexcept): New function
declaration.
* manual/arith.texi (fesetexcept): Document function.
* math/Versions (fesetexcept): New libm symbol at version
GLIBC_2.25.
* math/Makefile (libm-support): Add fesetexcept.
(tests): Add test-fesetexcept and test-fesetexcept-traps.
* math/test-fesetexcept.c: New file.
* math/test-fesetexcept-traps.c: Likewise.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-08-16 16:16:10 +00:00
|
|
|
test-fexcept test-fexcept-traps test-fesetexcept \
|
Add femode_t functions.
TS 18661-1 defines a type femode_t to represent the set of dynamic
floating-point control modes (such as the rounding mode and trap
enablement modes), and functions fegetmode and fesetmode to manipulate
those modes (without affecting other state such as the raised
exception flags) and a corresponding macro FE_DFL_MODE.
This patch series implements those interfaces for glibc. This first
patch adds the architecture-independent pieces, the x86 and x86_64
implementations, and the <bits/fenv.h> and ABI baseline updates for
all architectures so glibc keeps building and passing the ABI tests on
all architectures. Subsequent patches add the fegetmode and fesetmode
implementations for other architectures.
femode_t is generally an integer type - the same type as fenv_t, or as
the single element of fenv_t where fenv_t is a structure containing a
single integer (or the single relevant element, where it has elements
for both status and control registers) - except where architecture
properties or consistency with the fenv_t implementation indicate
otherwise. FE_DFL_MODE follows FE_DFL_ENV in whether it's a magic
pointer value (-1 cast to const femode_t *), a value that can be
distinguished from valid pointers by its high bits but otherwise
contains a representation of the desired register contents, or a
pointer to a constant variable (the powerpc case; __fe_dfl_mode is
added as an exported constant object, an alias to __fe_dfl_env).
Note that where architectures (that share a register between control
and status bits) gain definitions of new floating-point control or
status bits in future, the implementations of fesetmode for those
architectures may need updating (depending on whether the new bits are
control or status bits and what the implementation does with
previously unknown bits), just like existing implementations of
<fenv.h> functions that take care not to touch reserved bits may need
updating when the set of reserved bits changes. (As any new bits are
outside the scope of ISO C, that's just a quality-of-implementation
issue for supporting them, not a conformance issue.)
As with fenv_t, femode_t should properly include any software DFP
rounding mode (and for both fenv_t and femode_t I'd consider that
fragment of DFP support appropriate for inclusion in glibc even in the
absence of the rest of libdfp; hardware DFP rounding modes should
already be included if the definitions of which bits are status /
control bits are correct).
Tested for x86_64, x86, mips64 (hard float, and soft float to test the
fallback version), arm (hard float) and powerpc (hard float, soft
float and e500). Other architecture versions are untested.
* math/fegetmode.c: New file.
* math/fesetmode.c: Likewise.
* sysdeps/i386/fpu/fegetmode.c: Likewise.
* sysdeps/i386/fpu/fesetmode.c: Likewise.
* sysdeps/x86_64/fpu/fegetmode.c: Likewise.
* sysdeps/x86_64/fpu/fesetmode.c: Likewise.
* math/fenv.h: Update comment on inclusion of <bits/fenv.h>.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fegetmode): New function
declaration.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (fesetmode): Likewise.
* bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)] (femode_t): New
typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/aarch64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/alpha/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/arm/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/hppa/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/ia64/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/m68k/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/microblaze/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/mips/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/nios2/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/powerpc/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (__fe_dfl_mode): New variable
declaration.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/s390/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/sh/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/sparc/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/tile/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* sysdeps/x86/fpu/bits/fenv.h [__GLIBC_USE (IEC_60559_BFP_EXT)]
(femode_t): New typedef.
[__GLIBC_USE (IEC_60559_BFP_EXT)] (FE_DFL_MODE): New macro.
* manual/arith.texi (FE_DFL_MODE): Document macro.
(fegetmode): Document function.
(fesetmode): Likewise.
* math/Versions (fegetmode): New libm symbol at version
GLIBC_2.25.
(fesetmode): Likewise.
* math/Makefile (libm-support): Add fegetmode and fesetmode.
(tests): Add test-femode and test-femode-traps.
* math/test-femode-traps.c: New file.
* math/test-femode.c: Likewise.
* sysdeps/powerpc/fpu/fenv_const.c (__fe_dfl_mode): Declare as
alias for __fe_dfl_env.
* sysdeps/powerpc/nofpu/fenv_const.c (__fe_dfl_mode): Likewise.
* sysdeps/powerpc/powerpc32/e500/nofpu/fenv_const.c
(__fe_dfl_mode): Likewise.
* sysdeps/powerpc/Versions (__fe_dfl_mode): New libm symbol at
version GLIBC_2.25.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2016-09-07 16:40:09 +00:00
|
|
|
test-fesetexcept-traps test-fetestexceptflag test-femode \
|
2016-10-07 23:28:33 +00:00
|
|
|
test-femode-traps test-iszero-excess-precision \
|
2016-11-23 21:23:12 +00:00
|
|
|
test-iseqsig-excess-precision test-flt-eval-method \
|
2016-12-16 18:03:25 +00:00
|
|
|
test-fp-ilogb-constants test-fp-llogb-constants \
|
|
|
|
test-fe-snans-always-signal $(tests-static)
|
Fix lgamma setting signgam for ISO C (bug 15421).
The lgamma (and likewise lgammaf, lgammal) function wrongly sets the
signgam variable even when building for strict ISO C conformance
(-std=c99 / -std=c11), although the user may define such a variable
and it's only in the implementation namespace for POSIX with XSI
extensions enabled.
Following discussions starting at
<https://sourceware.org/ml/libc-alpha/2013-04/msg00767.html> and
<https://sourceware.org/ml/libc-alpha/2015-10/msg00844.html>, it seems
that the safest approach for fixing this particular issue is for
signgam to become a weak alias for a newly exported symbol __signgam,
with the library functions only setting __signgam, at which point
static linker magic will preserve the alias for newly linked binaries
that refer to the library's signgam rather than defining their own,
while breaking the alias for programs that define their own signgam,
with new symbol versions for lgamma functions and with compat symbols
for existing binaries that set both signgam and __signgam.
This patch implements that approach for the fix. signgam is made into
a weak alias. The four symbols __signgam, lgamma, lgammaf, lgammal
get new symbol versions at version GLIBC_2.23, with the existing
versions of lgamma, lgammaf and lgammal becoming compat symbols.
When the compat versions are built, gamma, gammaf and gammal are
aliases for the compat versions (i.e. always set signgam); this is OK
as they are not ISO C functions, and avoids adding new symbol versions
for them unnecessarily. When the compat versions are not built
(i.e. for static linking and for future glibc ports), gamma, gammaf
and gammal are aliases for the new versions that set __signgam. The
ldbl-opt versions are updated accordingly.
The lgamma wrappers are adjusted so that the same source files,
included from different files with different definitions of
USE_AS_COMPAT, can build either the new versions or the compat
versions. Similar changes are made to the ia64 versions (untested).
Tests are added that the lgamma functions do not interfere with a user
variable called signgam for ISO C, with various choices for the size
of that variable, whether it is initialized, and for static and
dynamic linking. The conformtest whitelist entry is removed as well.
Tested for x86_64, x86, mips64 and powerpc, including looking at
objdump --dynamic-syms output to make sure the expected sets of
symbols were aliases. Also spot-tested that a binary built with old
glibc works properly (i.e. gets signgam set) when run with new glibc.
[BZ #15421]
* sysdeps/ieee754/s_signgam.c (signgam): Rename to __signgam,
initialize with 0 and define as weak alias of __signgam.
* include/math.h [!_ISOMAC] (__signgam): Declare.
* math/Makefile (libm-calls): Add w_lgamma_compat.
(tests): Add test-signgam-uchar, test-signgam-uchar-init,
test-signgam-uint, test-signgam-uint-init, test-signgam-ullong and
test-signgam-ullong-init.
(tests-static): Add test-signgam-uchar-static,
test-signgam-uchar-init-static, test-signgam-uint-static,
test-signgam-uint-init-static, test-signgam-ullong-static and
test-signgam-ullong-init-static.
(CFLAGS-test-signgam-uchar.c): New variable.
(CFLAGS-test-signgam-uchar-init.c): Likewise.
(CFLAGS-test-signgam-uchar-static.c): Likewise.
(CFLAGS-test-signgam-uchar-init-static.c): Likewise.
(CFLAGS-test-signgam-uint.c): Likewise.
(CFLAGS-test-signgam-uint-init.c): Likewise.
(CFLAGS-test-signgam-uint-static.c): Likewise.
(CFLAGS-test-signgam-uint-init-static.c): Likewise.
(CFLAGS-test-signgam-ullong.c): Likewise.
(CFLAGS-test-signgam-ullong-init.c): Likewise.
(CFLAGS-test-signgam-ullong-static.c): Likewise.
(CFLAGS-test-signgam-ullong-init-static.c): Likewise.
* math/Versions (libm): Add GLIBC_2.23.
* math/lgamma-compat.h: New file.
* math/test-signgam-main.c: Likewise.
* math/test-signgam-uchar-init-static.c: Likewise.
* math/test-signgam-uchar-init.c: Likewise.
* math/test-signgam-uchar-static.c: Likewise.
* math/test-signgam-uchar.c: Likewise.
* math/test-signgam-uint-init-static.c: Likewise.
* math/test-signgam-uint-init.c: Likewise.
* math/test-signgam-uint-static.c: Likewise.
* math/test-signgam-uint.c: Likewise.
* math/test-signgam-ullong-init-static.c: Likewise.
* math/test-signgam-ullong-init.c: Likewise.
* math/test-signgam-ullong-static.c: Likewise.
* math/test-signgam-ullong.c: Likewise.
* math/w_lgamma.c: Rename to w_lgamma_main.c and replace by
wrapper of w_lgamma_main.c.
* math/w_lgamma_compat.c: New file.
* math/w_lgamma_compatf.c: Likewise.
* math/w_lgamma_compatl.c: Likewise.
* math/w_lgamma_main.c: New file. Based on w_lgamma.c. Include
<lgamma-compat.h>. Condition contents on [BUILD_LGAMMA]. Support
defining compatibility symbols.
(__lgamma): Change to LGFUNC (__lgamma). Use CALL_LGAMMA.
* math/w_lgammaf.c: Rename to w_lgammaf_main.c and replace by
wrapper of w_lgammaf_main.c.
* math/w_lgammaf_main.c: New file. Based on w_lgammaf.c. Include
<lgamma-compat.h>. Condition contents on [BUILD_LGAMMA]. Support
defining compatibility symbols.
(__lgammaf): Change to LGFUNC (__lgammaf). Use CALL_LGAMMA.
* math/w_lgammal.c: Rename to w_lgammal_main.c and replace by
wrapper of w_lgammal_main.c.
* math/w_lgammal_main.c: New file. Based on w_lgammal.c. Include
<lgamma-compat.h>. Condition contents on [BUILD_LGAMMA]. Support
defining compatibility symbols.
(__lgammal): Change to LGFUNC (__lgammal). Use CALL_LGAMMA.
* sysdeps/ia64/fpu/lgamma-compat.h: New file.
* sysdeps/ia64/fpu/w_lgamma.c: Move to ....
* sysdeps/ia64/fpu/w_lgamma_main.c: ...here. Include
<lgamma-compat.h>.
(__ieee754_lgamma): Change to LGFUNC (lgamma). Use CALL_LGAMMA.
(__ieee754_gamma): Define as alias.
* sysdeps/ia64/fpu/w_lgammaf.c: Move to ....
* sysdeps/ia64/fpu/w_lgammaf_main.c: ...here. Include
<lgamma-compat.h>.
(__ieee754_lgammaf): Change to LGFUNC (lgammaf). Use CALL_LGAMMA.
(__ieee754_gammaf): Define as alias.
* sysdeps/ia64/fpu/w_lgammal.c: Move to ....
* sysdeps/ia64/fpu/w_lgammal_main.c: ...here. Include
<lgamma-compat.h>.
(__ieee754_lgammal): Change to LGFUNC (lgammal). Use CALL_LGAMMA.
(__ieee754_gammal): Define as alias.
* sysdeps/ieee754/ldbl-opt/w_lgamma.c: Move to ....
* sysdeps/ieee754/ldbl-opt/w_lgamma_compat.c: ...here. Include
<math/w_lgamma_compat.c>.
[LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)] (__lgammal_dbl_compat):
Define as alias of __lgamma_compat and use in defining lgammal.
* sysdeps/ieee754/ldbl-opt/w_lgammal.c: Move to ....
* sysdeps/ieee754/ldbl-opt/w_lgamma_compatl.c: ...here. Include
<math/lgamma-compat.h> and <math/w_lgamma_compatl.c>.
(USE_AS_COMPAT): New macro.
(LGAMMA_OLD_VER): Undefine and redefine.
(lgammal): Do not define here.
(gammal): Only define here if [GAMMA_ALIAS].
* conform/linknamespace.pl (@whitelist): Remove signgam.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2015-11-20 22:49:59 +00:00
|
|
|
tests-static = test-fpucw-static test-fpucw-ieee-static \
|
|
|
|
test-signgam-uchar-static test-signgam-uchar-init-static \
|
|
|
|
test-signgam-uint-static test-signgam-uint-init-static \
|
|
|
|
test-signgam-ullong-static test-signgam-ullong-init-static
|
1997-03-20 02:20:57 +00:00
|
|
|
|
2016-03-04 21:27:25 +00:00
|
|
|
ifneq (,$(CXX))
|
2016-10-21 16:26:53 +00:00
|
|
|
tests += test-math-isinff test-math-iszero
|
2016-03-04 21:27:25 +00:00
|
|
|
endif
|
|
|
|
|
1999-10-19 06:29:27 +00:00
|
|
|
ifneq (no,$(PERL))
|
2015-06-09 11:51:52 +00:00
|
|
|
libm-vec-tests = $(addprefix test-,$(libmvec-tests))
|
Build most libm-test support code once per type.
libm-test-driver.c contains various functions used in the course of
libm testing, which are built as part of each test using this
machinery.
Currently, these functions get built for three tests for each type
(e.g. test-float, test-ifloat, test-float-finite), plus the vector
function tests. All these tests are huge and thus slow to build; the
output of gen-libm-test.pl totals around 40 MB across all functions.
To make the individual tests built from the Makefile smaller, it makes
sense to split these tests up so the tests for each function are built
separately (thus, three tests for each (function, type) pair, plus
vector tests built only for functions that actually have vector
versions). This improves parallelism and means that if tests fail,
the summary of failed tests makes it more obvious where the problem
might be without needing to look in the .out files to see which
functions' tests failed (though architecture maintainers still need to
keep libm-test-ulps up to date to avoid spurious failures of little
interest).
Simply including libm-test-driver.c as-is in such individual-function
tests does not work because of unused static check_* functions (those
functions only being used for the types of the outputs of the function
under test). It also means the common code gets built over 1000 times
instead of nine (plus vector tests). To avoid that issue, this patch
splits out the bulk of the libm-test-driver.c code into a separate
file libm-test-support.c (with a few functions made non-static). That
separate file is built only once for each floating-point type (so at
present three times, or twice on architectures with long double =
double). Definitions needed in both libm-test-support.c and
libm-test-driver.c go in libm-test-support.h (it's possible some of
those are in fact only needed in one of the two files).
libm-test-driver.c keeps definitions of a limited number of variables
used to configure how libm-test-support.c behaves, various macros and
structures needed by individual-function tests, and the main function.
This move is also consistent in spirit with the move away from
test-skeleton.c having all the test support code, to a small
support/test-driver.c included in individual tests with most of the
code built separately.
Tested for x86_64 and x86.
* math/libm-test-support.c: New file. Content from
math/libm-test-driver.c.
* math/libm-test-support.h: Likewise.
* math/libm-test-support-double.c: New file.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/libm-test-driver.c: Remove main comment and header
includes. Include libm-test-support.h.
[!_GNU_SOURCE] (_GNU_SOURCE): Do not define.
(flag_test_errno): Remove static.
(flag_test_exceptions): Likewise.
(flag_test_finite): Likewise.
(flag_test_inline): Likewise.
(flag_test_mathvec): Likewise.
(test_msg): Likewise.
(NO_EXCEPTION): Remove.
(INVALID_EXCEPTION): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION): Likewise.
(OVERFLOW_EXCEPTION): Likewise.
(UNDERFLOW_EXCEPTION): Likewise.
(INEXACT_EXCEPTION): Likewise.
(INVALID_EXCEPTION_OK): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION_OK): Likewise.
(OVERFLOW_EXCEPTION_OK): Likewise.
(UNDERFLOW_EXCEPTION_OK): Likewise.
(NO_INEXACT_EXCEPTION): Likewise.
(EXCEPTIONS_OK): Likewise.
(IGNORE_ZERO_INF_SIGN): Likewise.
(TEST_NAN_SIGN): Likewise.
(TEST_NAN_PAYLOAD): Likewise.
(NO_TEST_INLINE): Likewise.
(XFAIL_TEST): Likewise.
(ERRNO_UNCHANGED): Likewise.
(ERRNO_EDOM): Likewise.
(ERRNO_ERANGE): Likewise.
(IGNORE_RESULT): Likewise.
(NON_FINITE): Likewise.
(TEST_SNAN): Likewise.
(NO_TEST_MATHVEC): Likewise.
(__CONCATX): Likewise.
(TYPE_MIN): Likewise.
(TYPE_TRUE_MIN): Likewise.
(TYPE_MAX): Likewise.
(MIN_EXP): Likewise.
(MAX_EXP): Likewise.
(MANT_DIG): Likewise.
(FSTR_MAX): Likewise.
(ulp_idx): Likewise.
(qtype_str): Remove static.
(TEST_COND_binary32): Remove.
(TEST_COND_binary64): Likewise.
(TEST_COND_binary128): Likewise.
(TEST_COND_ibm128): Likewise.
(TEST_COND_intel96): Likewise.
(TEST_COND_m68k96): Likewise.
(TEST_COND_ibm128_libgcc): Likewise.
(XFAIL_IBM128_LIBGCC): Likewise.
(PAYLOAD_DIG): Likewise.
(UNDERFLOW_EXCEPTION_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_OK_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_OK_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_LDOUBLE_IBM): Likewise.
(UNDERFLOW_EXCEPTION_BEFORE_ROUNDING): Likewise.
(TEST_COND_long32): Likewise.
(TEST_COND_long64): Likewise.
(TEST_COND_before_rounding): Likewise.
(TEST_COND_after_rounding): Likewise.
(ulps_file_name): Likewise.
(ulps_file): Likewise.
(output_ulps): Likewise.
(output_dir): Likewise.
(noErrors): Likewise.
(noTests): Likewise.
(noExcTests): Likewise.
(noErrnoTests): Likewise.
(verbose): Likewise.
(output_max_error): Likewise.
(output_points): Likewise.
(ignore_max_ulp): Likewise.
(max_error): Likewise.
(real_max_error): Likewise.
(imag_max_error): Likewise.
(prev_max_error): Likewise.
(prev_real_max_error): Likewise.
(prev_imag_max_error): Likewise.
(max_valid_error): Likewise.
(TYPE_DECIMAL_DIG): Likewise.
(TYPE_HEX_DIG): Likewise.
(fmt_ftostr): Likewise.
(compare_ulp_data): Likewise.
(find_ulps): Likewise.
(init_max_error): Likewise.
(set_max_error): Likewise.
(print_float): Likewise.
(print_screen): Likewise.
(print_screen_max_error): Likewise.
(update_stats): Likewise.
(print_function_ulps): Likewise.
(print_complex_function_ulps): Likewise.
(fpstack_test): Likewise.
(print_max_error): Likewise.
(print_complex_max_error): Likewise.
(test_single_exception): Likewise.
(test_exceptions): Likewise.
(test_single_errno): Likewise.
(test_errno): Likewise.
(ULPDIFF): Likewise.
(ulp): Likewise.
(check_float_internal): Likewise.
(check_float): Likewise.
(check_complex): Likewise.
(check_int): Likewise.
(check_long): Likewise.
(check_bool): Likewise.
(check_longlong): Likewise.
(check_intmax_t): Likewise.
(check_uintmax_t): Likewise.
(enable_test): Likewise.
(matherr): Likewise.
(initialize): Likewise.
(options): Likewise.
(doc): Remove static.
(argp): Likewise.
(parse_opt): Remove.
(check_ulp): Likewise.
(libm_test_init): Likewise.
(libm_test_finish): Likewise.
* math/Makefile (libm-test-support): New variable.
(test-extras): Add libm-test-support files.
(extra-test-objs): Likewise.
(CFLAGS-libm-test-support-float.c): New variable.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
($(addprefix $(objpfx),$(libm-tests)): Depend on appropriate
libm-test-support objects.
2017-02-08 21:11:49 +00:00
|
|
|
libm-test-support = $(foreach t,$(types),libm-test-support-$(t))
|
|
|
|
test-extras += $(libm-test-support)
|
|
|
|
extra-test-objs += $(addsuffix .o, $(libm-test-support))
|
2016-04-13 15:04:37 +00:00
|
|
|
libm-vec-test-wrappers = $(addsuffix -wrappers, $(libm-vec-tests))
|
|
|
|
test-extras += $(libm-vec-test-wrappers)
|
|
|
|
extra-test-objs += $(addsuffix .o, $(libm-vec-test-wrappers))
|
1999-10-19 06:29:27 +00:00
|
|
|
|
* Makefile (subdir-target-args): New variable.
($(all-subdirs-targets)): Use it in place of -C option.
* Rules: Use $(..) instead of ../ if it's already defined.
* Makeconfig (subdir-srcdirs): New variable.
* csu/Makefile (all-Banner-files): Use it.
* configure.in (--enable-add-ons): Set to "yes" by default.
Handle absolute add-on directory names when looking for configure
fragments. Also look for sysdeps/*/preconfigure fragments in add-ons.
Require add-on configure to set $libc_add_on_canonical, use
that in $add_ons_sfx. Substitute add_on_subdirs with computed list
of subdir names each add-on configure set in libc_add_on_subdirs.
* configure: Regenerated.
* Makefile (%/preconfigure: %/preconfigure.in): New pattern rule.
* config.make.in (add-on-subdirs): New substituted variable.
* Makeconfig (all-subdirs): Include $(add-on-subdirs).
Remove $(add-ons), $(sysdep-subdirs).
Don't filter out $(sysdep-inhibit-subdirs).
($(common-objpfx)sysd-dirs): Target removed. Don't include it.
($(common-objpfx)sysd-sorted): Rewritten to feed Depend and Subdirs
files together to gen-sorted.awk, and $(subdirs) via -v.
(subdirs): Remove magic reordering for mach and hurd.
* scripts/gen-sorted.awk: Use subdirs from command line.
Process Subdirs and Depend files directly.
Let Subdirs files use "first dir" and "inhibit dir".
Always move elf to the end of the list.
* hurd/Depend: New file.
* sysdeps/mach/Subdirs: Use "first mach".
* Makefile (dist-separate): Remove linuxthreads.
(dist-separate-linuxthreads): Variable removed.
(glibc-%.tar rule): Use $(sysdeps-add-ons).
* Makerules ($(common-objpfx)Versions.v.i): Use $(subdirs),
not $(all-subdirs).
(sysdep-makefiles): Use $(sysdirs).
(sysdirs): Remove export.
($(+sysdir_pfx)sysd-rules): Handle absolute directory names in
$(config-sysdirs).
(+sysdir_pfx): Variable removed.
(sysd-rules): Use $(common-objpfx) in place of it.
(sysdirs): Variable moved to ...
* Makeconfig (sysdirs): ... here.
Handle absolute directory names in $(config-sysdirs).
(full_config_sysdirs): Variable removed.
* csu/Makefile: Use $(sysdirs) in vpath directive.
* math/Makefile (ulps-file): Use $(sysdirs).
* sysdeps/gnu/Makefile (errlist-c): Likewise.
($(objpfx)errlist-compat.c): Likewise.
* Makeconfig (all-Subdirs-files): Likewise.
($(common-objpfx)config.status): Likewise.
* configure.in (sysnames): Handle absolute add-on directory names.
(sysdeps_add_ons): New variable, AC_SUBST it.
Compute which add-ons contributed sysdeps directories.
* configure: Regenerated.
* config.make.in (sysdeps-add-ons): New substituted variable.
* Makerules (+sysdep_dirs, +sysdep-includes): Variables moved ...
* Makeconfig: ... to here.
(+sysdep_dirs): Append $(sysdeps-add-ons) here.
(+includes): Remove $(objpfx) include, already in $(+sysdep_dirs).
Remove $(includes).
(sysdep-makeconfigs): Use $(+sysdep_dirs).
($(common-objpfx)shlib-versions.v.i): Likewise.
* Makeconfig: Remove hair to set Makeconfig-add-on.
* sysdeps/unix/Makefile (sysdirs): Remove export.
(asm_CPP): Variable removed.
($(common-objpfx)sysd-syscalls): Pass them directly for the script.
* sysdeps/posix/Makefile: New file.
* Makerules (L_tmpnam, TMP_MAX, L_ctermid, L_cuserid): Set non-posix
values here with ?=.
* stdlib/gen-mpn-copy: File removed.
* stdlib/Makefile (distribute): Remove it.
* configure.in: Don't grok --with-gmp.
* configure: Regenerated.
* configure.in (libc_cv_idn): Don't check it; libidn/configure does it.
* configure: Regenerated.
* bare: Directory removed, saved in ports repository.
2006-02-28 07:11:04 +00:00
|
|
|
ulps-file = $(firstword $(wildcard $(sysdirs:%=%/libm-test-ulps)))
|
1999-11-01 02:28:55 +00:00
|
|
|
|
2017-02-06 18:28:33 +00:00
|
|
|
$(objpfx)libm-test-ulps.h: $(ulps-file) gen-libm-test.pl
|
|
|
|
$(make-target-directory)
|
|
|
|
$(PERL) gen-libm-test.pl -u $< -H $@
|
|
|
|
|
2017-02-17 17:44:23 +00:00
|
|
|
libm-test-funcs-auto = acos acosh asin asinh atan atan2 atanh cabs cacos \
|
2017-02-17 18:42:37 +00:00
|
|
|
cacosh carg casin casinh catan catanh cbrt ccos ccosh \
|
|
|
|
cexp clog clog10 cos cosh cpow csin csinh csqrt ctan \
|
|
|
|
ctanh erf erfc exp exp10 exp2 expm1 fma hypot j0 j1 jn \
|
|
|
|
lgamma log log10 log1p log2 pow sin sincos sinh sqrt \
|
|
|
|
tan tanh tgamma y0 y1 yn
|
|
|
|
libm-test-funcs-noauto = canonicalize ceil cimag conj copysign cproj creal \
|
|
|
|
fabs fdim floor fmax fmaxmag fmin fminmag fmod \
|
|
|
|
fpclassify frexp fromfp fromfpx getpayload ilogb \
|
|
|
|
iscanonical iseqsig isfinite isgreater \
|
|
|
|
isgreaterequal isinf isless islessequal \
|
|
|
|
islessgreater isnan isnormal issignaling issubnormal \
|
|
|
|
isunordered iszero llogb llrint llround logb lrint \
|
|
|
|
lround modf nearbyint nextafter nextdown nexttoward \
|
|
|
|
nextup remainder remquo rint round roundeven scalb \
|
|
|
|
scalbln scalbn setpayload setpayloadsig signbit \
|
|
|
|
significand totalorder totalordermag trunc ufromfp \
|
|
|
|
ufromfpx
|
Split libm-test.inc by function.
Continuing the process of splitting up libm tests into more reasonably
sized units, this patch splits libm-test.inc into 121 separate
libm-test-<function>.inc files, one per array of test data. (There
are 126 libm *_test functions, but five of those are for functions
that are aliases for test purposes and so share arrays of test data.)
In the present patch, the 121 files get processed separately by
gen-libm-test.pl, each using only the auto-libm-test-out-<function>
file that is relevant (/dev/null for functions not using
auto-libm-test-* at all). This effectively eliminates the
serialization on running gen-libm-test.pl. However, the resulting .c
files still all get #included together, so compiling the limited
number of libm tests using libm-test.inc may still act as a
serialization point (the compilations still all have 40 MB of code to
process). libm-test.inc doesn't actually have anything in it any more
that needs gen-libm-test.pl processing, but is left as a .inc file
that gets processed to produce a .c file, rather than being renamed,
since the intent of this patch is as an intermediate step before
libm-test.inc gets removed and tests get compiled separately for each
function being tested.
Tested for x86_64.
* math/libm-test.inc: Move all tests of individual functions to
libm-test-*.inc and #include libm-test-*.c files.
(acos_test_data): Remove.
(acos_test): Likewise.
(acosh_test_data): Likewise.
(acosh_test): Likewise.
(asin_test_data): Likewise.
(asin_test): Likewise.
(asinh_test_data): Likewise.
(asinh_test): Likewise.
(atan_test_data): Likewise.
(atan_test): Likewise.
(atanh_test_data): Likewise.
(atanh_test): Likewise.
(atan2_test_data): Likewise.
(atan2_test): Likewise.
(cabs_test_data): Likewise.
(cabs_test): Likewise.
(cacos_test_data): Likewise.
(cacos_test): Likewise.
(cacosh_test_data): Likewise.
(cacosh_test): Likewise.
(canonicalize_test_data): Likewise.
(canonicalize_test): Likewise.
(carg_test_data): Likewise.
(carg_test): Likewise.
(casin_test_data): Likewise.
(casin_test): Likewise.
(casinh_test_data): Likewise.
(casinh_test): Likewise.
(catan_test_data): Likewise.
(catan_test): Likewise.
(catanh_test_data): Likewise.
(catanh_test): Likewise.
(cbrt_test_data): Likewise.
(cbrt_test): Likewise.
(ccos_test_data): Likewise.
(ccos_test): Likewise.
(ccosh_test_data): Likewise.
(ccosh_test): Likewise.
(ceil_test_data): Likewise.
(ceil_test): Likewise.
(cexp_test_data): Likewise.
(cexp_test): Likewise.
(cimag_test_data): Likewise.
(cimag_test): Likewise.
(clog_test_data): Likewise.
(clog_test): Likewise.
(clog10_test_data): Likewise.
(clog10_test): Likewise.
(conj_test_data): Likewise.
(conj_test): Likewise.
(copysign_test_data): Likewise.
(copysign_test): Likewise.
(cos_test_data): Likewise.
(cos_test): Likewise.
(cosh_test_data): Likewise.
(cosh_test): Likewise.
(cpow_test_data): Likewise.
(cpow_test): Likewise.
(cproj_test_data): Likewise.
(cproj_test): Likewise.
(creal_test_data): Likewise.
(creal_test): Likewise.
(csin_test_data): Likewise.
(csin_test): Likewise.
(csinh_test_data): Likewise.
(csinh_test): Likewise.
(csqrt_test_data): Likewise.
(csqrt_test): Likewise.
(ctan_test_data): Likewise.
(ctan_test): Likewise.
(ctanh_test_data): Likewise.
(ctanh_test): Likewise.
(erf_test_data): Likewise.
(erf_test): Likewise.
(erfc_test_data): Likewise.
(erfc_test): Likewise.
(exp_test_data): Likewise.
(exp_test): Likewise.
(exp10_test_data): Likewise.
(exp10_test): Likewise.
(pow10_test): Likewise.
(exp2_test_data): Likewise.
(exp2_test): Likewise.
(expm1_test_data): Likewise.
(expm1_test): Likewise.
(fabs_test_data): Likewise.
(fabs_test): Likewise.
(fdim_test_data): Likewise.
(fdim_test): Likewise.
(floor_test_data): Likewise.
(floor_test): Likewise.
(fma_test_data): Likewise.
(fma_test): Likewise.
(fmax_test_data): Likewise.
(fmax_test): Likewise.
(fmaxmag_test_data): Likewise.
(fmaxmag_test): Likewise.
(fmin_test_data): Likewise.
(fmin_test): Likewise.
(fminmag_test_data): Likewise.
(fminmag_test): Likewise.
(fmod_test_data): Likewise.
(fmod_test): Likewise.
(fpclassify_test_data): Likewise.
(fpclassify_test): Likewise.
(frexp_test_data): Likewise.
(frexp_test): Likewise.
(fromfp_test_data): Likewise.
(fromfp_test): Likewise.
(fromfpx_test_data): Likewise.
(fromfpx_test): Likewise.
(getpayload_test_data): Likewise.
(getpayload_test): Likewise.
(hypot_test_data): Likewise.
(hypot_test): Likewise.
(ilogb_test_data): Likewise.
(ilogb_test): Likewise.
(iscanonical_test_data): Likewise.
(iscanonical_test): Likewise.
(iseqsig_test_data): Likewise.
(iseqsig_test): Likewise.
(isfinite_test_data): Likewise.
(isfinite_test): Likewise.
(finite_test): Likewise.
(isgreater_test_data): Likewise.
(isgreater_test): Likewise.
(isgreaterequal_test_data): Likewise.
(isgreaterequal_test): Likewise.
(isinf_test_data): Likewise.
(isinf_test): Likewise.
(isless_test_data): Likewise.
(isless_test): Likewise.
(islessequal_test_data): Likewise.
(islessequal_test): Likewise.
(islessgreater_test_data): Likewise.
(islessgreater_test): Likewise.
(isnan_test_data): Likewise.
(isnan_test): Likewise.
(isnormal_test_data): Likewise.
(isnormal_test): Likewise.
(issignaling_test_data): Likewise.
(issignaling_test): Likewise.
(issubnormal_test_data): Likewise.
(issubnormal_test): Likewise.
(isunordered_test_data): Likewise.
(isunordered_test): Likewise.
(iszero_test_data): Likewise.
(iszero_test): Likewise.
(j0_test_data): Likewise.
(j0_test): Likewise.
(j1_test_data): Likewise.
(j1_test): Likewise.
(jn_test_data): Likewise.
(jn_test): Likewise.
(lgamma_test_data): Likewise.
(lgamma_test): Likewise.
(gamma_test): Likewise.
(llogb_test_data): Likewise.
(llogb_test): Likewise.
(lrint_test_data): Likewise.
(lrint_test): Likewise.
(llrint_test_data): Likewise.
(llrint_test): Likewise.
(log_test_data): Likewise.
(log_test): Likewise.
(log10_test_data): Likewise.
(log10_test): Likewise.
(log1p_test_data): Likewise.
(log1p_test): Likewise.
(log2_test_data): Likewise.
(log2_test): Likewise.
(logb_test_data): Likewise.
(logb_test): Likewise.
(lround_test_data): Likewise.
(lround_test): Likewise.
(llround_test_data): Likewise.
(llround_test): Likewise.
(modf_test_data): Likewise.
(modf_test): Likewise.
(nearbyint_test_data): Likewise.
(nearbyint_test): Likewise.
(nextafter_test_data): Likewise.
(nextafter_test): Likewise.
(nextup_test_data): Likewise.
(nextup_test): Likewise.
(nextdown_test_data): Likewise.
(nextdown_test): Likewise.
(nexttoward_test_data): Likewise.
(nexttoward_test): Likewise.
(pow_test_data): Likewise.
(pow_test): Likewise.
(remainder_test_data): Likewise.
(remainder_test): Likewise.
(drem_test): Likewise.
(remquo_test_data): Likewise.
(remquo_test): Likewise.
(rint_test_data): Likewise.
(rint_test): Likewise.
(round_test_data): Likewise.
(round_test): Likewise.
(roundeven_test_data): Likewise.
(roundeven_test): Likewise.
(scalb_test_data): Likewise.
(scalb_test): Likewise.
(scalbn_test_data): Likewise.
(scalbn_test): Likewise.
(ldexp_test): Likewise.
(scalbln_test_data): Likewise.
(scalbln_test): Likewise.
(setpayload_test_data): Likewise.
(setpayload_test): Likewise.
(setpayloadsig_test_data): Likewise.
(setpayloadsig_test): Likewise.
(signbit_test_data): Likewise.
(signbit_test): Likewise.
(sin_test_data): Likewise.
(sin_test): Likewise.
(sincos_test_data): Likewise.
(sincos_test): Likewise.
(sinh_test_data): Likewise.
(sinh_test): Likewise.
(sqrt_test_data): Likewise.
(sqrt_test): Likewise.
(tan_test_data): Likewise.
(tan_test): Likewise.
(tanh_test_data): Likewise.
(tanh_test): Likewise.
(tgamma_test_data): Likewise.
(tgamma_test): Likewise.
(totalorder_test_data): Likewise.
(totalorder_test): Likewise.
(totalordermag_test_data): Likewise.
(totalordermag_test): Likewise.
(trunc_test_data): Likewise.
(trunc_test): Likewise.
(ufromfp_test_data): Likewise.
(ufromfp_test): Likewise.
(ufromfpx_test_data): Likewise.
(ufromfpx_test): Likewise.
(y0_test_data): Likewise.
(y0_test): Likewise.
(y1_test_data): Likewise.
(y1_test): Likewise.
(yn_test_data): Likewise.
(yn_test): Likewise.
(significand_test_data): Likewise.
(significand_test): Likewise.
* math/Makefile (auto-libm-test-out-files): Remove variable.
(libm-test-funcs-noauto): New variable.
(libm-test-funcs-all): Likewise.
(libm-test-c-auto): Likewise.
(libm-test-c-noauto): Likewise.
(libm-tests-generated): Add $(libm-test-c-auto) and
$(libm-test-c-noauto).
(generated): Do not add auto-libm-test-out.
(libm-test-c-auto-obj): New variable.
(libm-test-c-noauto-obj): Likewise.
($(objpfx)libm-test.c): Do not generate or use auto-libm-test-out.
($(libm-test-c-noauto-obj)): New static pattern rule.
($(libm-test-c-auto-obj)): Likewise.
(libm-test-incs): New variable.
($(objpfx)libm-have-vector-test.h): Depend on $(libm-test-incs)
and pass it to gen-libm-have-vector-test.sh.
* math/gen-libm-have-vector-test.sh: Expect list of .inc files to
be passed on command line.
* math/libm-test-acos.inc: New file. Content from
math/libm-test.inc.
* math/libm-test-acosh.inc: Likewise.
* math/libm-test-asin.inc: Likewise.
* math/libm-test-asinh.inc: Likewise.
* math/libm-test-atan.inc: Likewise.
* math/libm-test-atan2.inc: Likewise.
* math/libm-test-atanh.inc: Likewise.
* math/libm-test-cabs.inc: Likewise.
* math/libm-test-cacos.inc: Likewise.
* math/libm-test-cacosh.inc: Likewise.
* math/libm-test-canonicalize.inc: Likewise.
* math/libm-test-carg.inc: Likewise.
* math/libm-test-casin.inc: Likewise.
* math/libm-test-casinh.inc: Likewise.
* math/libm-test-catan.inc: Likewise.
* math/libm-test-catanh.inc: Likewise.
* math/libm-test-cbrt.inc: Likewise.
* math/libm-test-ccos.inc: Likewise.
* math/libm-test-ccosh.inc: Likewise.
* math/libm-test-ceil.inc: Likewise.
* math/libm-test-cexp.inc: Likewise.
* math/libm-test-cimag.inc: Likewise.
* math/libm-test-clog.inc: Likewise.
* math/libm-test-clog10.inc: Likewise.
* math/libm-test-conj.inc: Likewise.
* math/libm-test-copysign.inc: Likewise.
* math/libm-test-cos.inc: Likewise.
* math/libm-test-cosh.inc: Likewise.
* math/libm-test-cpow.inc: Likewise.
* math/libm-test-cproj.inc: Likewise.
* math/libm-test-creal.inc: Likewise.
* math/libm-test-csin.inc: Likewise.
* math/libm-test-csinh.inc: Likewise.
* math/libm-test-csqrt.inc: Likewise.
* math/libm-test-ctan.inc: Likewise.
* math/libm-test-ctanh.inc: Likewise.
* math/libm-test-erf.inc: Likewise.
* math/libm-test-erfc.inc: Likewise.
* math/libm-test-exp.inc: Likewise.
* math/libm-test-exp10.inc: Likewise.
* math/libm-test-exp2.inc: Likewise.
* math/libm-test-expm1.inc: Likewise.
* math/libm-test-fabs.inc: Likewise.
* math/libm-test-fdim.inc: Likewise.
* math/libm-test-floor.inc: Likewise.
* math/libm-test-fma.inc: Likewise.
* math/libm-test-fmax.inc: Likewise.
* math/libm-test-fmaxmag.inc: Likewise.
* math/libm-test-fmin.inc: Likewise.
* math/libm-test-fminmag.inc: Likewise.
* math/libm-test-fmod.inc: Likewise.
* math/libm-test-fpclassify.inc: Likewise.
* math/libm-test-frexp.inc: Likewise.
* math/libm-test-fromfp.inc: Likewise.
* math/libm-test-fromfpx.inc: Likewise.
* math/libm-test-getpayload.inc: Likewise.
* math/libm-test-hypot.inc: Likewise.
* math/libm-test-ilogb.inc: Likewise.
* math/libm-test-iscanonical.inc: Likewise.
* math/libm-test-iseqsig.inc: Likewise.
* math/libm-test-isfinite.inc: Likewise.
* math/libm-test-isgreater.inc: Likewise.
* math/libm-test-isgreaterequal.inc: Likewise.
* math/libm-test-isinf.inc: Likewise.
* math/libm-test-isless.inc: Likewise.
* math/libm-test-islessequal.inc: Likewise.
* math/libm-test-islessgreater.inc: Likewise.
* math/libm-test-isnan.inc: Likewise.
* math/libm-test-isnormal.inc: Likewise.
* math/libm-test-issignaling.inc: Likewise.
* math/libm-test-issubnormal.inc: Likewise.
* math/libm-test-isunordered.inc: Likewise.
* math/libm-test-iszero.inc: Likewise.
* math/libm-test-j0.inc: Likewise.
* math/libm-test-j1.inc: Likewise.
* math/libm-test-jn.inc: Likewise.
* math/libm-test-lgamma.inc: Likewise.
* math/libm-test-llogb.inc: Likewise.
* math/libm-test-llrint.inc: Likewise.
* math/libm-test-llround.inc: Likewise.
* math/libm-test-log.inc: Likewise.
* math/libm-test-log10.inc: Likewise.
* math/libm-test-log1p.inc: Likewise.
* math/libm-test-log2.inc: Likewise.
* math/libm-test-logb.inc: Likewise.
* math/libm-test-lrint.inc: Likewise.
* math/libm-test-lround.inc: Likewise.
* math/libm-test-modf.inc: Likewise.
* math/libm-test-nearbyint.inc: Likewise.
* math/libm-test-nextafter.inc: Likewise.
* math/libm-test-nextdown.inc: Likewise.
* math/libm-test-nexttoward.inc: Likewise.
* math/libm-test-nextup.inc: Likewise.
* math/libm-test-pow.inc: Likewise.
* math/libm-test-remainder.inc: Likewise.
* math/libm-test-remquo.inc: Likewise.
* math/libm-test-rint.inc: Likewise.
* math/libm-test-round.inc: Likewise.
* math/libm-test-roundeven.inc: Likewise.
* math/libm-test-scalb.inc: Likewise.
* math/libm-test-scalbln.inc: Likewise.
* math/libm-test-scalbn.inc: Likewise.
* math/libm-test-setpayload.inc: Likewise.
* math/libm-test-setpayloadsig.inc: Likewise.
* math/libm-test-signbit.inc: Likewise.
* math/libm-test-significand.inc: Likewise.
* math/libm-test-sin.inc: Likewise.
* math/libm-test-sincos.inc: Likewise.
* math/libm-test-sinh.inc: Likewise.
* math/libm-test-sqrt.inc: Likewise.
* math/libm-test-tan.inc: Likewise.
* math/libm-test-tanh.inc: Likewise.
* math/libm-test-tgamma.inc: Likewise.
* math/libm-test-totalorder.inc: Likewise.
* math/libm-test-totalordermag.inc: Likewise.
* math/libm-test-trunc.inc: Likewise.
* math/libm-test-ufromfp.inc: Likewise.
* math/libm-test-ufromfpx.inc: Likewise.
* math/libm-test-y0.inc: Likewise.
* math/libm-test-y1.inc: Likewise.
* math/libm-test-yn.inc: Likewise.
* math/README.libm-test: Update.
2017-02-06 18:57:25 +00:00
|
|
|
libm-test-funcs-all = $(libm-test-funcs-auto) $(libm-test-funcs-noauto)
|
|
|
|
libm-test-c-auto = $(foreach f,$(libm-test-funcs-auto),libm-test-$(f).c)
|
|
|
|
libm-test-c-noauto = $(foreach f,$(libm-test-funcs-noauto),libm-test-$(f).c)
|
Run libm tests separately for each function.
At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
over 50 MB of libm-test-*.c sources.
This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 50
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).
All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.
This should reduce the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.
Tested for x86_64 and x86.
* math/Makefile (libm-tests-generated): Remove variable.
(libm-tests-base-normal): New variable.
(libm-tests-base-finite): Likewise.
(libm-tests-base-inline): Likewise.
(libm-tests-base): Likewise.
(libm-tests-normal): Likewise.
(libm-tests-finite): Likewise.
(libm-tests-inline): Likewise.
(libm-tests-vector): Likewise.
(libm-tests): Define in terms of these new variables.
(libm-tests-for-type): New variable.
(libm-tests.o): Move definition.
(tests): Move addition of $(libm-tests).
(generated): Update for new and removed libm test files.
($(objpfx)libm-test.c): Remove target.
($(objpfx)libm-have-vector-test.h): Likewise.
(CFLAGS-test-double-vlen2.c): Remove variable.
(CFLAGS-test-double-vlen4.c): Likewise.
(CFLAGS-test-double-vlen8.c): Likewise.
(CFLAGS-test-float-vlen4.c): Likewise.
(CFLAGS-test-float-vlen8.c): Likewise.
(CFLAGS-test-float-vlen16.c): Likewise.
(CFLAGS-test-float.c): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-libm-test-support-float.c): Likewise.
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
(libm-test-inline-cflags): New variable.
(CFLAGS-test-ifloat.c): Remove variable.
(CFLAGS-test-idouble.c): Likewise.
(CFLAGS-test-ildouble.c): Likewise.
($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
dependencies.
($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
Likewise.
(dependencies on libm-test-support-*.o): Remove.
($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
rules using iterators.
($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
Likewise.
($(objpfx)libm-test-support-$(o).o): Likewise.
($(addprefix $(objpfx),$(filter-out $(tests-static)
$(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
instead.
($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
define rule instead.
* math/README.libm-test: Update.
* math/libm-test-acos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-acosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-canonicalize.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-carg.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cbrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ceil.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cimag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-conj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-copysign.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cpow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cproj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-creal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erfc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-expm1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fdim.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-floor.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmax.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fminmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmod.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fpclassify.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-frexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-getpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-hypot.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ilogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iscanonical.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iseqsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isfinite.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isinf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isless.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issignaling.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issubnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isunordered.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iszero.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-jn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log1p.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-logb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-modf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nearbyint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextafter.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextdown.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nexttoward.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextup.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-pow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remainder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remquo.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-rint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-round.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-roundeven.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbln.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-signbit.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-significand.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sincos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalorder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalordermag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-trunc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-yn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-driver.c: Do not include libm-have-vector-test.h.
(HAVE_VECTOR): Remove macro.
(START): Do not call HAVE_VECTOR.
* math/test-double-vlen2.h (FUNC_TEST): Remove macro.
* math/test-double-vlen4.h (FUNC_TEST): Remove macro.
* math/test-double-vlen8.h (FUNC_TEST): Remove macro.
* math/test-float-vlen16.h (FUNC_TEST): Remove macro.
* math/test-float-vlen4.h (FUNC_TEST): Remove macro.
* math/test-float-vlen8.h (FUNC_TEST): Remove macro.
* math/test-math-vector.h (FUNC_TEST): New macro.
(WRAPPER_DECL): Rename to WRAPPER_DECL_f.
* sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
(double-vlen4-funcs): Likewise.
(double-vlen4-avx2-funcs): Likewise.
(double-vlen8-funcs): Likewise.
(float-vlen4-funcs): Likewise.
(float-vlen8-funcs): Likewise.
(float-vlen8-avx2-funcs): Likewise.
(float-vlen16-funcs): Likewise.
(CFLAGS-test-double-vlen4-avx2.c): Remove variable.
(CFLAGS-test-float-vlen8-avx2.c): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
macro.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
Likewise.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* math/gen-libm-have-vector-test.sh: Remove file.
* math/libm-test.inc: Likewise.
* math/libm-test-support-double.c: Likewise.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/test-double-finite.c: Likewise.: Likewise.
* math/test-double.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildouble.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2017-02-24 00:51:45 +00:00
|
|
|
generated += libm-test-ulps.h $(libm-test-c-auto) $(libm-test-c-noauto)
|
|
|
|
|
|
|
|
libm-tests-base-normal = $(foreach t,$(types),test-$(t))
|
|
|
|
libm-tests-base-finite = $(foreach t,$(types),test-$(t)-finite)
|
|
|
|
libm-tests-base-inline = $(foreach t,$(types),test-i$(t))
|
|
|
|
libm-tests-base = $(libm-tests-base-normal) $(libm-tests-base-finite) \
|
|
|
|
$(libm-tests-base-inline) $(libm-vec-tests)
|
|
|
|
libm-tests-normal = $(foreach t,$(libm-tests-base-normal),\
|
|
|
|
$(foreach f,$(libm-test-funcs-all),\
|
|
|
|
$(t)-$(f)))
|
|
|
|
libm-tests-finite = $(foreach t,$(libm-tests-base-finite),\
|
|
|
|
$(foreach f,$(libm-test-funcs-all),\
|
|
|
|
$(t)-$(f)))
|
|
|
|
libm-tests-inline = $(foreach t,$(libm-tests-base-inline),\
|
|
|
|
$(foreach f,$(libm-test-funcs-all),\
|
|
|
|
$(t)-$(f)))
|
|
|
|
libm-tests-vector = $(foreach t,$(libmvec-tests),\
|
|
|
|
$(foreach f,$($(t)-funcs),test-$(t)-$(f)))
|
|
|
|
libm-tests = $(libm-tests-normal) $(libm-tests-finite) $(libm-tests-inline) \
|
|
|
|
$(libm-tests-vector)
|
|
|
|
libm-tests-for-type = $(foreach f,$(libm-test-funcs-all),\
|
|
|
|
test-$(1)-$(f) test-$(1)-finite-$(f) \
|
|
|
|
test-i$(1)-$(f)) \
|
|
|
|
$(filter test-$(1)-%,$(libm-tests-vector))
|
|
|
|
|
|
|
|
libm-tests.o = $(addsuffix .o,$(libm-tests))
|
|
|
|
|
|
|
|
tests += $(libm-tests)
|
|
|
|
generated += $(addsuffix .c,$(libm-tests)) \
|
|
|
|
$(foreach t,$(types),libm-test-support-$(t).c)
|
Split libm-test.inc by function.
Continuing the process of splitting up libm tests into more reasonably
sized units, this patch splits libm-test.inc into 121 separate
libm-test-<function>.inc files, one per array of test data. (There
are 126 libm *_test functions, but five of those are for functions
that are aliases for test purposes and so share arrays of test data.)
In the present patch, the 121 files get processed separately by
gen-libm-test.pl, each using only the auto-libm-test-out-<function>
file that is relevant (/dev/null for functions not using
auto-libm-test-* at all). This effectively eliminates the
serialization on running gen-libm-test.pl. However, the resulting .c
files still all get #included together, so compiling the limited
number of libm tests using libm-test.inc may still act as a
serialization point (the compilations still all have 40 MB of code to
process). libm-test.inc doesn't actually have anything in it any more
that needs gen-libm-test.pl processing, but is left as a .inc file
that gets processed to produce a .c file, rather than being renamed,
since the intent of this patch is as an intermediate step before
libm-test.inc gets removed and tests get compiled separately for each
function being tested.
Tested for x86_64.
* math/libm-test.inc: Move all tests of individual functions to
libm-test-*.inc and #include libm-test-*.c files.
(acos_test_data): Remove.
(acos_test): Likewise.
(acosh_test_data): Likewise.
(acosh_test): Likewise.
(asin_test_data): Likewise.
(asin_test): Likewise.
(asinh_test_data): Likewise.
(asinh_test): Likewise.
(atan_test_data): Likewise.
(atan_test): Likewise.
(atanh_test_data): Likewise.
(atanh_test): Likewise.
(atan2_test_data): Likewise.
(atan2_test): Likewise.
(cabs_test_data): Likewise.
(cabs_test): Likewise.
(cacos_test_data): Likewise.
(cacos_test): Likewise.
(cacosh_test_data): Likewise.
(cacosh_test): Likewise.
(canonicalize_test_data): Likewise.
(canonicalize_test): Likewise.
(carg_test_data): Likewise.
(carg_test): Likewise.
(casin_test_data): Likewise.
(casin_test): Likewise.
(casinh_test_data): Likewise.
(casinh_test): Likewise.
(catan_test_data): Likewise.
(catan_test): Likewise.
(catanh_test_data): Likewise.
(catanh_test): Likewise.
(cbrt_test_data): Likewise.
(cbrt_test): Likewise.
(ccos_test_data): Likewise.
(ccos_test): Likewise.
(ccosh_test_data): Likewise.
(ccosh_test): Likewise.
(ceil_test_data): Likewise.
(ceil_test): Likewise.
(cexp_test_data): Likewise.
(cexp_test): Likewise.
(cimag_test_data): Likewise.
(cimag_test): Likewise.
(clog_test_data): Likewise.
(clog_test): Likewise.
(clog10_test_data): Likewise.
(clog10_test): Likewise.
(conj_test_data): Likewise.
(conj_test): Likewise.
(copysign_test_data): Likewise.
(copysign_test): Likewise.
(cos_test_data): Likewise.
(cos_test): Likewise.
(cosh_test_data): Likewise.
(cosh_test): Likewise.
(cpow_test_data): Likewise.
(cpow_test): Likewise.
(cproj_test_data): Likewise.
(cproj_test): Likewise.
(creal_test_data): Likewise.
(creal_test): Likewise.
(csin_test_data): Likewise.
(csin_test): Likewise.
(csinh_test_data): Likewise.
(csinh_test): Likewise.
(csqrt_test_data): Likewise.
(csqrt_test): Likewise.
(ctan_test_data): Likewise.
(ctan_test): Likewise.
(ctanh_test_data): Likewise.
(ctanh_test): Likewise.
(erf_test_data): Likewise.
(erf_test): Likewise.
(erfc_test_data): Likewise.
(erfc_test): Likewise.
(exp_test_data): Likewise.
(exp_test): Likewise.
(exp10_test_data): Likewise.
(exp10_test): Likewise.
(pow10_test): Likewise.
(exp2_test_data): Likewise.
(exp2_test): Likewise.
(expm1_test_data): Likewise.
(expm1_test): Likewise.
(fabs_test_data): Likewise.
(fabs_test): Likewise.
(fdim_test_data): Likewise.
(fdim_test): Likewise.
(floor_test_data): Likewise.
(floor_test): Likewise.
(fma_test_data): Likewise.
(fma_test): Likewise.
(fmax_test_data): Likewise.
(fmax_test): Likewise.
(fmaxmag_test_data): Likewise.
(fmaxmag_test): Likewise.
(fmin_test_data): Likewise.
(fmin_test): Likewise.
(fminmag_test_data): Likewise.
(fminmag_test): Likewise.
(fmod_test_data): Likewise.
(fmod_test): Likewise.
(fpclassify_test_data): Likewise.
(fpclassify_test): Likewise.
(frexp_test_data): Likewise.
(frexp_test): Likewise.
(fromfp_test_data): Likewise.
(fromfp_test): Likewise.
(fromfpx_test_data): Likewise.
(fromfpx_test): Likewise.
(getpayload_test_data): Likewise.
(getpayload_test): Likewise.
(hypot_test_data): Likewise.
(hypot_test): Likewise.
(ilogb_test_data): Likewise.
(ilogb_test): Likewise.
(iscanonical_test_data): Likewise.
(iscanonical_test): Likewise.
(iseqsig_test_data): Likewise.
(iseqsig_test): Likewise.
(isfinite_test_data): Likewise.
(isfinite_test): Likewise.
(finite_test): Likewise.
(isgreater_test_data): Likewise.
(isgreater_test): Likewise.
(isgreaterequal_test_data): Likewise.
(isgreaterequal_test): Likewise.
(isinf_test_data): Likewise.
(isinf_test): Likewise.
(isless_test_data): Likewise.
(isless_test): Likewise.
(islessequal_test_data): Likewise.
(islessequal_test): Likewise.
(islessgreater_test_data): Likewise.
(islessgreater_test): Likewise.
(isnan_test_data): Likewise.
(isnan_test): Likewise.
(isnormal_test_data): Likewise.
(isnormal_test): Likewise.
(issignaling_test_data): Likewise.
(issignaling_test): Likewise.
(issubnormal_test_data): Likewise.
(issubnormal_test): Likewise.
(isunordered_test_data): Likewise.
(isunordered_test): Likewise.
(iszero_test_data): Likewise.
(iszero_test): Likewise.
(j0_test_data): Likewise.
(j0_test): Likewise.
(j1_test_data): Likewise.
(j1_test): Likewise.
(jn_test_data): Likewise.
(jn_test): Likewise.
(lgamma_test_data): Likewise.
(lgamma_test): Likewise.
(gamma_test): Likewise.
(llogb_test_data): Likewise.
(llogb_test): Likewise.
(lrint_test_data): Likewise.
(lrint_test): Likewise.
(llrint_test_data): Likewise.
(llrint_test): Likewise.
(log_test_data): Likewise.
(log_test): Likewise.
(log10_test_data): Likewise.
(log10_test): Likewise.
(log1p_test_data): Likewise.
(log1p_test): Likewise.
(log2_test_data): Likewise.
(log2_test): Likewise.
(logb_test_data): Likewise.
(logb_test): Likewise.
(lround_test_data): Likewise.
(lround_test): Likewise.
(llround_test_data): Likewise.
(llround_test): Likewise.
(modf_test_data): Likewise.
(modf_test): Likewise.
(nearbyint_test_data): Likewise.
(nearbyint_test): Likewise.
(nextafter_test_data): Likewise.
(nextafter_test): Likewise.
(nextup_test_data): Likewise.
(nextup_test): Likewise.
(nextdown_test_data): Likewise.
(nextdown_test): Likewise.
(nexttoward_test_data): Likewise.
(nexttoward_test): Likewise.
(pow_test_data): Likewise.
(pow_test): Likewise.
(remainder_test_data): Likewise.
(remainder_test): Likewise.
(drem_test): Likewise.
(remquo_test_data): Likewise.
(remquo_test): Likewise.
(rint_test_data): Likewise.
(rint_test): Likewise.
(round_test_data): Likewise.
(round_test): Likewise.
(roundeven_test_data): Likewise.
(roundeven_test): Likewise.
(scalb_test_data): Likewise.
(scalb_test): Likewise.
(scalbn_test_data): Likewise.
(scalbn_test): Likewise.
(ldexp_test): Likewise.
(scalbln_test_data): Likewise.
(scalbln_test): Likewise.
(setpayload_test_data): Likewise.
(setpayload_test): Likewise.
(setpayloadsig_test_data): Likewise.
(setpayloadsig_test): Likewise.
(signbit_test_data): Likewise.
(signbit_test): Likewise.
(sin_test_data): Likewise.
(sin_test): Likewise.
(sincos_test_data): Likewise.
(sincos_test): Likewise.
(sinh_test_data): Likewise.
(sinh_test): Likewise.
(sqrt_test_data): Likewise.
(sqrt_test): Likewise.
(tan_test_data): Likewise.
(tan_test): Likewise.
(tanh_test_data): Likewise.
(tanh_test): Likewise.
(tgamma_test_data): Likewise.
(tgamma_test): Likewise.
(totalorder_test_data): Likewise.
(totalorder_test): Likewise.
(totalordermag_test_data): Likewise.
(totalordermag_test): Likewise.
(trunc_test_data): Likewise.
(trunc_test): Likewise.
(ufromfp_test_data): Likewise.
(ufromfp_test): Likewise.
(ufromfpx_test_data): Likewise.
(ufromfpx_test): Likewise.
(y0_test_data): Likewise.
(y0_test): Likewise.
(y1_test_data): Likewise.
(y1_test): Likewise.
(yn_test_data): Likewise.
(yn_test): Likewise.
(significand_test_data): Likewise.
(significand_test): Likewise.
* math/Makefile (auto-libm-test-out-files): Remove variable.
(libm-test-funcs-noauto): New variable.
(libm-test-funcs-all): Likewise.
(libm-test-c-auto): Likewise.
(libm-test-c-noauto): Likewise.
(libm-tests-generated): Add $(libm-test-c-auto) and
$(libm-test-c-noauto).
(generated): Do not add auto-libm-test-out.
(libm-test-c-auto-obj): New variable.
(libm-test-c-noauto-obj): Likewise.
($(objpfx)libm-test.c): Do not generate or use auto-libm-test-out.
($(libm-test-c-noauto-obj)): New static pattern rule.
($(libm-test-c-auto-obj)): Likewise.
(libm-test-incs): New variable.
($(objpfx)libm-have-vector-test.h): Depend on $(libm-test-incs)
and pass it to gen-libm-have-vector-test.sh.
* math/gen-libm-have-vector-test.sh: Expect list of .inc files to
be passed on command line.
* math/libm-test-acos.inc: New file. Content from
math/libm-test.inc.
* math/libm-test-acosh.inc: Likewise.
* math/libm-test-asin.inc: Likewise.
* math/libm-test-asinh.inc: Likewise.
* math/libm-test-atan.inc: Likewise.
* math/libm-test-atan2.inc: Likewise.
* math/libm-test-atanh.inc: Likewise.
* math/libm-test-cabs.inc: Likewise.
* math/libm-test-cacos.inc: Likewise.
* math/libm-test-cacosh.inc: Likewise.
* math/libm-test-canonicalize.inc: Likewise.
* math/libm-test-carg.inc: Likewise.
* math/libm-test-casin.inc: Likewise.
* math/libm-test-casinh.inc: Likewise.
* math/libm-test-catan.inc: Likewise.
* math/libm-test-catanh.inc: Likewise.
* math/libm-test-cbrt.inc: Likewise.
* math/libm-test-ccos.inc: Likewise.
* math/libm-test-ccosh.inc: Likewise.
* math/libm-test-ceil.inc: Likewise.
* math/libm-test-cexp.inc: Likewise.
* math/libm-test-cimag.inc: Likewise.
* math/libm-test-clog.inc: Likewise.
* math/libm-test-clog10.inc: Likewise.
* math/libm-test-conj.inc: Likewise.
* math/libm-test-copysign.inc: Likewise.
* math/libm-test-cos.inc: Likewise.
* math/libm-test-cosh.inc: Likewise.
* math/libm-test-cpow.inc: Likewise.
* math/libm-test-cproj.inc: Likewise.
* math/libm-test-creal.inc: Likewise.
* math/libm-test-csin.inc: Likewise.
* math/libm-test-csinh.inc: Likewise.
* math/libm-test-csqrt.inc: Likewise.
* math/libm-test-ctan.inc: Likewise.
* math/libm-test-ctanh.inc: Likewise.
* math/libm-test-erf.inc: Likewise.
* math/libm-test-erfc.inc: Likewise.
* math/libm-test-exp.inc: Likewise.
* math/libm-test-exp10.inc: Likewise.
* math/libm-test-exp2.inc: Likewise.
* math/libm-test-expm1.inc: Likewise.
* math/libm-test-fabs.inc: Likewise.
* math/libm-test-fdim.inc: Likewise.
* math/libm-test-floor.inc: Likewise.
* math/libm-test-fma.inc: Likewise.
* math/libm-test-fmax.inc: Likewise.
* math/libm-test-fmaxmag.inc: Likewise.
* math/libm-test-fmin.inc: Likewise.
* math/libm-test-fminmag.inc: Likewise.
* math/libm-test-fmod.inc: Likewise.
* math/libm-test-fpclassify.inc: Likewise.
* math/libm-test-frexp.inc: Likewise.
* math/libm-test-fromfp.inc: Likewise.
* math/libm-test-fromfpx.inc: Likewise.
* math/libm-test-getpayload.inc: Likewise.
* math/libm-test-hypot.inc: Likewise.
* math/libm-test-ilogb.inc: Likewise.
* math/libm-test-iscanonical.inc: Likewise.
* math/libm-test-iseqsig.inc: Likewise.
* math/libm-test-isfinite.inc: Likewise.
* math/libm-test-isgreater.inc: Likewise.
* math/libm-test-isgreaterequal.inc: Likewise.
* math/libm-test-isinf.inc: Likewise.
* math/libm-test-isless.inc: Likewise.
* math/libm-test-islessequal.inc: Likewise.
* math/libm-test-islessgreater.inc: Likewise.
* math/libm-test-isnan.inc: Likewise.
* math/libm-test-isnormal.inc: Likewise.
* math/libm-test-issignaling.inc: Likewise.
* math/libm-test-issubnormal.inc: Likewise.
* math/libm-test-isunordered.inc: Likewise.
* math/libm-test-iszero.inc: Likewise.
* math/libm-test-j0.inc: Likewise.
* math/libm-test-j1.inc: Likewise.
* math/libm-test-jn.inc: Likewise.
* math/libm-test-lgamma.inc: Likewise.
* math/libm-test-llogb.inc: Likewise.
* math/libm-test-llrint.inc: Likewise.
* math/libm-test-llround.inc: Likewise.
* math/libm-test-log.inc: Likewise.
* math/libm-test-log10.inc: Likewise.
* math/libm-test-log1p.inc: Likewise.
* math/libm-test-log2.inc: Likewise.
* math/libm-test-logb.inc: Likewise.
* math/libm-test-lrint.inc: Likewise.
* math/libm-test-lround.inc: Likewise.
* math/libm-test-modf.inc: Likewise.
* math/libm-test-nearbyint.inc: Likewise.
* math/libm-test-nextafter.inc: Likewise.
* math/libm-test-nextdown.inc: Likewise.
* math/libm-test-nexttoward.inc: Likewise.
* math/libm-test-nextup.inc: Likewise.
* math/libm-test-pow.inc: Likewise.
* math/libm-test-remainder.inc: Likewise.
* math/libm-test-remquo.inc: Likewise.
* math/libm-test-rint.inc: Likewise.
* math/libm-test-round.inc: Likewise.
* math/libm-test-roundeven.inc: Likewise.
* math/libm-test-scalb.inc: Likewise.
* math/libm-test-scalbln.inc: Likewise.
* math/libm-test-scalbn.inc: Likewise.
* math/libm-test-setpayload.inc: Likewise.
* math/libm-test-setpayloadsig.inc: Likewise.
* math/libm-test-signbit.inc: Likewise.
* math/libm-test-significand.inc: Likewise.
* math/libm-test-sin.inc: Likewise.
* math/libm-test-sincos.inc: Likewise.
* math/libm-test-sinh.inc: Likewise.
* math/libm-test-sqrt.inc: Likewise.
* math/libm-test-tan.inc: Likewise.
* math/libm-test-tanh.inc: Likewise.
* math/libm-test-tgamma.inc: Likewise.
* math/libm-test-totalorder.inc: Likewise.
* math/libm-test-totalordermag.inc: Likewise.
* math/libm-test-trunc.inc: Likewise.
* math/libm-test-ufromfp.inc: Likewise.
* math/libm-test-ufromfpx.inc: Likewise.
* math/libm-test-y0.inc: Likewise.
* math/libm-test-y1.inc: Likewise.
* math/libm-test-yn.inc: Likewise.
* math/README.libm-test: Update.
2017-02-06 18:57:25 +00:00
|
|
|
|
|
|
|
libm-test-c-auto-obj = $(addprefix $(objpfx),$(libm-test-c-auto))
|
|
|
|
libm-test-c-noauto-obj = $(addprefix $(objpfx),$(libm-test-c-noauto))
|
|
|
|
|
Run libm tests separately for each function.
At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
over 50 MB of libm-test-*.c sources.
This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 50
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).
All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.
This should reduce the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.
Tested for x86_64 and x86.
* math/Makefile (libm-tests-generated): Remove variable.
(libm-tests-base-normal): New variable.
(libm-tests-base-finite): Likewise.
(libm-tests-base-inline): Likewise.
(libm-tests-base): Likewise.
(libm-tests-normal): Likewise.
(libm-tests-finite): Likewise.
(libm-tests-inline): Likewise.
(libm-tests-vector): Likewise.
(libm-tests): Define in terms of these new variables.
(libm-tests-for-type): New variable.
(libm-tests.o): Move definition.
(tests): Move addition of $(libm-tests).
(generated): Update for new and removed libm test files.
($(objpfx)libm-test.c): Remove target.
($(objpfx)libm-have-vector-test.h): Likewise.
(CFLAGS-test-double-vlen2.c): Remove variable.
(CFLAGS-test-double-vlen4.c): Likewise.
(CFLAGS-test-double-vlen8.c): Likewise.
(CFLAGS-test-float-vlen4.c): Likewise.
(CFLAGS-test-float-vlen8.c): Likewise.
(CFLAGS-test-float-vlen16.c): Likewise.
(CFLAGS-test-float.c): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-libm-test-support-float.c): Likewise.
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
(libm-test-inline-cflags): New variable.
(CFLAGS-test-ifloat.c): Remove variable.
(CFLAGS-test-idouble.c): Likewise.
(CFLAGS-test-ildouble.c): Likewise.
($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
dependencies.
($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
Likewise.
(dependencies on libm-test-support-*.o): Remove.
($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
rules using iterators.
($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
Likewise.
($(objpfx)libm-test-support-$(o).o): Likewise.
($(addprefix $(objpfx),$(filter-out $(tests-static)
$(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
instead.
($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
define rule instead.
* math/README.libm-test: Update.
* math/libm-test-acos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-acosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-canonicalize.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-carg.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cbrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ceil.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cimag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-conj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-copysign.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cpow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cproj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-creal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erfc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-expm1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fdim.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-floor.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmax.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fminmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmod.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fpclassify.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-frexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-getpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-hypot.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ilogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iscanonical.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iseqsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isfinite.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isinf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isless.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issignaling.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issubnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isunordered.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iszero.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-jn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log1p.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-logb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-modf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nearbyint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextafter.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextdown.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nexttoward.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextup.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-pow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remainder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remquo.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-rint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-round.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-roundeven.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbln.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-signbit.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-significand.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sincos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalorder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalordermag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-trunc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-yn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-driver.c: Do not include libm-have-vector-test.h.
(HAVE_VECTOR): Remove macro.
(START): Do not call HAVE_VECTOR.
* math/test-double-vlen2.h (FUNC_TEST): Remove macro.
* math/test-double-vlen4.h (FUNC_TEST): Remove macro.
* math/test-double-vlen8.h (FUNC_TEST): Remove macro.
* math/test-float-vlen16.h (FUNC_TEST): Remove macro.
* math/test-float-vlen4.h (FUNC_TEST): Remove macro.
* math/test-float-vlen8.h (FUNC_TEST): Remove macro.
* math/test-math-vector.h (FUNC_TEST): New macro.
(WRAPPER_DECL): Rename to WRAPPER_DECL_f.
* sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
(double-vlen4-funcs): Likewise.
(double-vlen4-avx2-funcs): Likewise.
(double-vlen8-funcs): Likewise.
(float-vlen4-funcs): Likewise.
(float-vlen8-funcs): Likewise.
(float-vlen8-avx2-funcs): Likewise.
(float-vlen16-funcs): Likewise.
(CFLAGS-test-double-vlen4-avx2.c): Remove variable.
(CFLAGS-test-float-vlen8-avx2.c): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
macro.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
Likewise.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* math/gen-libm-have-vector-test.sh: Remove file.
* math/libm-test.inc: Likewise.
* math/libm-test-support-double.c: Likewise.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/test-double-finite.c: Likewise.: Likewise.
* math/test-double.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildouble.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2017-02-24 00:51:45 +00:00
|
|
|
$(libm-test-c-noauto-obj): $(objpfx)libm-test%.c: libm-test%.inc \
|
|
|
|
gen-libm-test.pl
|
Split libm-test.inc by function.
Continuing the process of splitting up libm tests into more reasonably
sized units, this patch splits libm-test.inc into 121 separate
libm-test-<function>.inc files, one per array of test data. (There
are 126 libm *_test functions, but five of those are for functions
that are aliases for test purposes and so share arrays of test data.)
In the present patch, the 121 files get processed separately by
gen-libm-test.pl, each using only the auto-libm-test-out-<function>
file that is relevant (/dev/null for functions not using
auto-libm-test-* at all). This effectively eliminates the
serialization on running gen-libm-test.pl. However, the resulting .c
files still all get #included together, so compiling the limited
number of libm tests using libm-test.inc may still act as a
serialization point (the compilations still all have 40 MB of code to
process). libm-test.inc doesn't actually have anything in it any more
that needs gen-libm-test.pl processing, but is left as a .inc file
that gets processed to produce a .c file, rather than being renamed,
since the intent of this patch is as an intermediate step before
libm-test.inc gets removed and tests get compiled separately for each
function being tested.
Tested for x86_64.
* math/libm-test.inc: Move all tests of individual functions to
libm-test-*.inc and #include libm-test-*.c files.
(acos_test_data): Remove.
(acos_test): Likewise.
(acosh_test_data): Likewise.
(acosh_test): Likewise.
(asin_test_data): Likewise.
(asin_test): Likewise.
(asinh_test_data): Likewise.
(asinh_test): Likewise.
(atan_test_data): Likewise.
(atan_test): Likewise.
(atanh_test_data): Likewise.
(atanh_test): Likewise.
(atan2_test_data): Likewise.
(atan2_test): Likewise.
(cabs_test_data): Likewise.
(cabs_test): Likewise.
(cacos_test_data): Likewise.
(cacos_test): Likewise.
(cacosh_test_data): Likewise.
(cacosh_test): Likewise.
(canonicalize_test_data): Likewise.
(canonicalize_test): Likewise.
(carg_test_data): Likewise.
(carg_test): Likewise.
(casin_test_data): Likewise.
(casin_test): Likewise.
(casinh_test_data): Likewise.
(casinh_test): Likewise.
(catan_test_data): Likewise.
(catan_test): Likewise.
(catanh_test_data): Likewise.
(catanh_test): Likewise.
(cbrt_test_data): Likewise.
(cbrt_test): Likewise.
(ccos_test_data): Likewise.
(ccos_test): Likewise.
(ccosh_test_data): Likewise.
(ccosh_test): Likewise.
(ceil_test_data): Likewise.
(ceil_test): Likewise.
(cexp_test_data): Likewise.
(cexp_test): Likewise.
(cimag_test_data): Likewise.
(cimag_test): Likewise.
(clog_test_data): Likewise.
(clog_test): Likewise.
(clog10_test_data): Likewise.
(clog10_test): Likewise.
(conj_test_data): Likewise.
(conj_test): Likewise.
(copysign_test_data): Likewise.
(copysign_test): Likewise.
(cos_test_data): Likewise.
(cos_test): Likewise.
(cosh_test_data): Likewise.
(cosh_test): Likewise.
(cpow_test_data): Likewise.
(cpow_test): Likewise.
(cproj_test_data): Likewise.
(cproj_test): Likewise.
(creal_test_data): Likewise.
(creal_test): Likewise.
(csin_test_data): Likewise.
(csin_test): Likewise.
(csinh_test_data): Likewise.
(csinh_test): Likewise.
(csqrt_test_data): Likewise.
(csqrt_test): Likewise.
(ctan_test_data): Likewise.
(ctan_test): Likewise.
(ctanh_test_data): Likewise.
(ctanh_test): Likewise.
(erf_test_data): Likewise.
(erf_test): Likewise.
(erfc_test_data): Likewise.
(erfc_test): Likewise.
(exp_test_data): Likewise.
(exp_test): Likewise.
(exp10_test_data): Likewise.
(exp10_test): Likewise.
(pow10_test): Likewise.
(exp2_test_data): Likewise.
(exp2_test): Likewise.
(expm1_test_data): Likewise.
(expm1_test): Likewise.
(fabs_test_data): Likewise.
(fabs_test): Likewise.
(fdim_test_data): Likewise.
(fdim_test): Likewise.
(floor_test_data): Likewise.
(floor_test): Likewise.
(fma_test_data): Likewise.
(fma_test): Likewise.
(fmax_test_data): Likewise.
(fmax_test): Likewise.
(fmaxmag_test_data): Likewise.
(fmaxmag_test): Likewise.
(fmin_test_data): Likewise.
(fmin_test): Likewise.
(fminmag_test_data): Likewise.
(fminmag_test): Likewise.
(fmod_test_data): Likewise.
(fmod_test): Likewise.
(fpclassify_test_data): Likewise.
(fpclassify_test): Likewise.
(frexp_test_data): Likewise.
(frexp_test): Likewise.
(fromfp_test_data): Likewise.
(fromfp_test): Likewise.
(fromfpx_test_data): Likewise.
(fromfpx_test): Likewise.
(getpayload_test_data): Likewise.
(getpayload_test): Likewise.
(hypot_test_data): Likewise.
(hypot_test): Likewise.
(ilogb_test_data): Likewise.
(ilogb_test): Likewise.
(iscanonical_test_data): Likewise.
(iscanonical_test): Likewise.
(iseqsig_test_data): Likewise.
(iseqsig_test): Likewise.
(isfinite_test_data): Likewise.
(isfinite_test): Likewise.
(finite_test): Likewise.
(isgreater_test_data): Likewise.
(isgreater_test): Likewise.
(isgreaterequal_test_data): Likewise.
(isgreaterequal_test): Likewise.
(isinf_test_data): Likewise.
(isinf_test): Likewise.
(isless_test_data): Likewise.
(isless_test): Likewise.
(islessequal_test_data): Likewise.
(islessequal_test): Likewise.
(islessgreater_test_data): Likewise.
(islessgreater_test): Likewise.
(isnan_test_data): Likewise.
(isnan_test): Likewise.
(isnormal_test_data): Likewise.
(isnormal_test): Likewise.
(issignaling_test_data): Likewise.
(issignaling_test): Likewise.
(issubnormal_test_data): Likewise.
(issubnormal_test): Likewise.
(isunordered_test_data): Likewise.
(isunordered_test): Likewise.
(iszero_test_data): Likewise.
(iszero_test): Likewise.
(j0_test_data): Likewise.
(j0_test): Likewise.
(j1_test_data): Likewise.
(j1_test): Likewise.
(jn_test_data): Likewise.
(jn_test): Likewise.
(lgamma_test_data): Likewise.
(lgamma_test): Likewise.
(gamma_test): Likewise.
(llogb_test_data): Likewise.
(llogb_test): Likewise.
(lrint_test_data): Likewise.
(lrint_test): Likewise.
(llrint_test_data): Likewise.
(llrint_test): Likewise.
(log_test_data): Likewise.
(log_test): Likewise.
(log10_test_data): Likewise.
(log10_test): Likewise.
(log1p_test_data): Likewise.
(log1p_test): Likewise.
(log2_test_data): Likewise.
(log2_test): Likewise.
(logb_test_data): Likewise.
(logb_test): Likewise.
(lround_test_data): Likewise.
(lround_test): Likewise.
(llround_test_data): Likewise.
(llround_test): Likewise.
(modf_test_data): Likewise.
(modf_test): Likewise.
(nearbyint_test_data): Likewise.
(nearbyint_test): Likewise.
(nextafter_test_data): Likewise.
(nextafter_test): Likewise.
(nextup_test_data): Likewise.
(nextup_test): Likewise.
(nextdown_test_data): Likewise.
(nextdown_test): Likewise.
(nexttoward_test_data): Likewise.
(nexttoward_test): Likewise.
(pow_test_data): Likewise.
(pow_test): Likewise.
(remainder_test_data): Likewise.
(remainder_test): Likewise.
(drem_test): Likewise.
(remquo_test_data): Likewise.
(remquo_test): Likewise.
(rint_test_data): Likewise.
(rint_test): Likewise.
(round_test_data): Likewise.
(round_test): Likewise.
(roundeven_test_data): Likewise.
(roundeven_test): Likewise.
(scalb_test_data): Likewise.
(scalb_test): Likewise.
(scalbn_test_data): Likewise.
(scalbn_test): Likewise.
(ldexp_test): Likewise.
(scalbln_test_data): Likewise.
(scalbln_test): Likewise.
(setpayload_test_data): Likewise.
(setpayload_test): Likewise.
(setpayloadsig_test_data): Likewise.
(setpayloadsig_test): Likewise.
(signbit_test_data): Likewise.
(signbit_test): Likewise.
(sin_test_data): Likewise.
(sin_test): Likewise.
(sincos_test_data): Likewise.
(sincos_test): Likewise.
(sinh_test_data): Likewise.
(sinh_test): Likewise.
(sqrt_test_data): Likewise.
(sqrt_test): Likewise.
(tan_test_data): Likewise.
(tan_test): Likewise.
(tanh_test_data): Likewise.
(tanh_test): Likewise.
(tgamma_test_data): Likewise.
(tgamma_test): Likewise.
(totalorder_test_data): Likewise.
(totalorder_test): Likewise.
(totalordermag_test_data): Likewise.
(totalordermag_test): Likewise.
(trunc_test_data): Likewise.
(trunc_test): Likewise.
(ufromfp_test_data): Likewise.
(ufromfp_test): Likewise.
(ufromfpx_test_data): Likewise.
(ufromfpx_test): Likewise.
(y0_test_data): Likewise.
(y0_test): Likewise.
(y1_test_data): Likewise.
(y1_test): Likewise.
(yn_test_data): Likewise.
(yn_test): Likewise.
(significand_test_data): Likewise.
(significand_test): Likewise.
* math/Makefile (auto-libm-test-out-files): Remove variable.
(libm-test-funcs-noauto): New variable.
(libm-test-funcs-all): Likewise.
(libm-test-c-auto): Likewise.
(libm-test-c-noauto): Likewise.
(libm-tests-generated): Add $(libm-test-c-auto) and
$(libm-test-c-noauto).
(generated): Do not add auto-libm-test-out.
(libm-test-c-auto-obj): New variable.
(libm-test-c-noauto-obj): Likewise.
($(objpfx)libm-test.c): Do not generate or use auto-libm-test-out.
($(libm-test-c-noauto-obj)): New static pattern rule.
($(libm-test-c-auto-obj)): Likewise.
(libm-test-incs): New variable.
($(objpfx)libm-have-vector-test.h): Depend on $(libm-test-incs)
and pass it to gen-libm-have-vector-test.sh.
* math/gen-libm-have-vector-test.sh: Expect list of .inc files to
be passed on command line.
* math/libm-test-acos.inc: New file. Content from
math/libm-test.inc.
* math/libm-test-acosh.inc: Likewise.
* math/libm-test-asin.inc: Likewise.
* math/libm-test-asinh.inc: Likewise.
* math/libm-test-atan.inc: Likewise.
* math/libm-test-atan2.inc: Likewise.
* math/libm-test-atanh.inc: Likewise.
* math/libm-test-cabs.inc: Likewise.
* math/libm-test-cacos.inc: Likewise.
* math/libm-test-cacosh.inc: Likewise.
* math/libm-test-canonicalize.inc: Likewise.
* math/libm-test-carg.inc: Likewise.
* math/libm-test-casin.inc: Likewise.
* math/libm-test-casinh.inc: Likewise.
* math/libm-test-catan.inc: Likewise.
* math/libm-test-catanh.inc: Likewise.
* math/libm-test-cbrt.inc: Likewise.
* math/libm-test-ccos.inc: Likewise.
* math/libm-test-ccosh.inc: Likewise.
* math/libm-test-ceil.inc: Likewise.
* math/libm-test-cexp.inc: Likewise.
* math/libm-test-cimag.inc: Likewise.
* math/libm-test-clog.inc: Likewise.
* math/libm-test-clog10.inc: Likewise.
* math/libm-test-conj.inc: Likewise.
* math/libm-test-copysign.inc: Likewise.
* math/libm-test-cos.inc: Likewise.
* math/libm-test-cosh.inc: Likewise.
* math/libm-test-cpow.inc: Likewise.
* math/libm-test-cproj.inc: Likewise.
* math/libm-test-creal.inc: Likewise.
* math/libm-test-csin.inc: Likewise.
* math/libm-test-csinh.inc: Likewise.
* math/libm-test-csqrt.inc: Likewise.
* math/libm-test-ctan.inc: Likewise.
* math/libm-test-ctanh.inc: Likewise.
* math/libm-test-erf.inc: Likewise.
* math/libm-test-erfc.inc: Likewise.
* math/libm-test-exp.inc: Likewise.
* math/libm-test-exp10.inc: Likewise.
* math/libm-test-exp2.inc: Likewise.
* math/libm-test-expm1.inc: Likewise.
* math/libm-test-fabs.inc: Likewise.
* math/libm-test-fdim.inc: Likewise.
* math/libm-test-floor.inc: Likewise.
* math/libm-test-fma.inc: Likewise.
* math/libm-test-fmax.inc: Likewise.
* math/libm-test-fmaxmag.inc: Likewise.
* math/libm-test-fmin.inc: Likewise.
* math/libm-test-fminmag.inc: Likewise.
* math/libm-test-fmod.inc: Likewise.
* math/libm-test-fpclassify.inc: Likewise.
* math/libm-test-frexp.inc: Likewise.
* math/libm-test-fromfp.inc: Likewise.
* math/libm-test-fromfpx.inc: Likewise.
* math/libm-test-getpayload.inc: Likewise.
* math/libm-test-hypot.inc: Likewise.
* math/libm-test-ilogb.inc: Likewise.
* math/libm-test-iscanonical.inc: Likewise.
* math/libm-test-iseqsig.inc: Likewise.
* math/libm-test-isfinite.inc: Likewise.
* math/libm-test-isgreater.inc: Likewise.
* math/libm-test-isgreaterequal.inc: Likewise.
* math/libm-test-isinf.inc: Likewise.
* math/libm-test-isless.inc: Likewise.
* math/libm-test-islessequal.inc: Likewise.
* math/libm-test-islessgreater.inc: Likewise.
* math/libm-test-isnan.inc: Likewise.
* math/libm-test-isnormal.inc: Likewise.
* math/libm-test-issignaling.inc: Likewise.
* math/libm-test-issubnormal.inc: Likewise.
* math/libm-test-isunordered.inc: Likewise.
* math/libm-test-iszero.inc: Likewise.
* math/libm-test-j0.inc: Likewise.
* math/libm-test-j1.inc: Likewise.
* math/libm-test-jn.inc: Likewise.
* math/libm-test-lgamma.inc: Likewise.
* math/libm-test-llogb.inc: Likewise.
* math/libm-test-llrint.inc: Likewise.
* math/libm-test-llround.inc: Likewise.
* math/libm-test-log.inc: Likewise.
* math/libm-test-log10.inc: Likewise.
* math/libm-test-log1p.inc: Likewise.
* math/libm-test-log2.inc: Likewise.
* math/libm-test-logb.inc: Likewise.
* math/libm-test-lrint.inc: Likewise.
* math/libm-test-lround.inc: Likewise.
* math/libm-test-modf.inc: Likewise.
* math/libm-test-nearbyint.inc: Likewise.
* math/libm-test-nextafter.inc: Likewise.
* math/libm-test-nextdown.inc: Likewise.
* math/libm-test-nexttoward.inc: Likewise.
* math/libm-test-nextup.inc: Likewise.
* math/libm-test-pow.inc: Likewise.
* math/libm-test-remainder.inc: Likewise.
* math/libm-test-remquo.inc: Likewise.
* math/libm-test-rint.inc: Likewise.
* math/libm-test-round.inc: Likewise.
* math/libm-test-roundeven.inc: Likewise.
* math/libm-test-scalb.inc: Likewise.
* math/libm-test-scalbln.inc: Likewise.
* math/libm-test-scalbn.inc: Likewise.
* math/libm-test-setpayload.inc: Likewise.
* math/libm-test-setpayloadsig.inc: Likewise.
* math/libm-test-signbit.inc: Likewise.
* math/libm-test-significand.inc: Likewise.
* math/libm-test-sin.inc: Likewise.
* math/libm-test-sincos.inc: Likewise.
* math/libm-test-sinh.inc: Likewise.
* math/libm-test-sqrt.inc: Likewise.
* math/libm-test-tan.inc: Likewise.
* math/libm-test-tanh.inc: Likewise.
* math/libm-test-tgamma.inc: Likewise.
* math/libm-test-totalorder.inc: Likewise.
* math/libm-test-totalordermag.inc: Likewise.
* math/libm-test-trunc.inc: Likewise.
* math/libm-test-ufromfp.inc: Likewise.
* math/libm-test-ufromfpx.inc: Likewise.
* math/libm-test-y0.inc: Likewise.
* math/libm-test-y1.inc: Likewise.
* math/libm-test-yn.inc: Likewise.
* math/README.libm-test: Update.
2017-02-06 18:57:25 +00:00
|
|
|
$(make-target-directory)
|
|
|
|
$(PERL) gen-libm-test.pl -c $< -a /dev/null -C $@
|
Split auto-libm-test-out by function.
math/auto-libm-test-out is, at over 30 MB, by far the largest file in
the glibc source tree. This patch splits it by function, so reducing
it to auto-libm-test-out-<func> files that are all under 5 MB in size.
This is preliminary to splitting up libm-test.inc as well so that each
function's tests can also be processed separately by
gen-libm-test.pl. As a preliminary patch it doesn't actually
implement that step; rather, all the separate files get concatenated
by the Makefile to produce the monolithic auto-libm-test-out file
again as an input to gen-libm-test.pl. (The concatentation is
identical to the file in the source tree before this patch.)
Even this preliminary step, however, is of use independent of
splitting up libm-test.inc: some tests for csin and csinh have not
been moved to auto-libm-test-in because they result in
auto-libm-test-out generation taking several minutes rather than a few
seconds (all released MPC versions are very slow for certain sin /
sinh inputs; there are some old improvements in MPC mainline which
should eventually become MPC 1.1, but the complex inverse trig and
hyperbolic functions are slow even in MPC mainline and have yet to be
moved to auto-libm-test-in at all), and it seems much more reasonable
to add such inputs to auto-libm-test-in when it will only slow down
regeneration for particular functions than when it will slow down
regeneration globally.
gen-auto-libm-tests still parses the whole input file, but only
generates output for the requested function. This ensures bad syntax
in the file is always detected, and parsing the whole file is quick;
it's output generation that is comparatively slow for some functions.
Tested for x86_64.
* math/gen-auto-libm-tests.c: Update comment about use of program.
(generate_output): Add argument FUNCTION.
(main): Require extra argument. Pass function name to
generate_output.
* math/Makefile (generated): Add auto-libm-test-out.
(libm-test-funcs-auto): New variable.
(auto-libm-test-out-files): New variable.
($(objpfx)libm-test.c): Depend on $(auto-libm-test-out-files).
Concatenate those files to form $(objpfx)auto-libm-test-out and
use it as input to gen-libm-test.pl.
* math/README.libm-test: Update.
* math/auto-libm-test-out: Remove.
* math/auto-libm-test-out-acos: New generated file.
* math/auto-libm-test-out-acosh: Likewise.
* math/auto-libm-test-out-asin: Likewise.
* math/auto-libm-test-out-asinh: Likewise.
* math/auto-libm-test-out-atan: Likewise.
* math/auto-libm-test-out-atan2: Likewise.
* math/auto-libm-test-out-atanh: Likewise.
* math/auto-libm-test-out-cabs: Likewise.
* math/auto-libm-test-out-carg: Likewise.
* math/auto-libm-test-out-cbrt: Likewise.
* math/auto-libm-test-out-ccos: Likewise.
* math/auto-libm-test-out-ccosh: Likewise.
* math/auto-libm-test-out-cexp: Likewise.
* math/auto-libm-test-out-clog: Likewise.
* math/auto-libm-test-out-clog10: Likewise.
* math/auto-libm-test-out-cos: Likewise.
* math/auto-libm-test-out-cosh: Likewise.
* math/auto-libm-test-out-cpow: Likewise.
* math/auto-libm-test-out-csin: Likewise.
* math/auto-libm-test-out-csinh: Likewise.
* math/auto-libm-test-out-csqrt: Likewise.
* math/auto-libm-test-out-ctan: Likewise.
* math/auto-libm-test-out-ctanh: Likewise.
* math/auto-libm-test-out-erf: Likewise.
* math/auto-libm-test-out-erfc: Likewise.
* math/auto-libm-test-out-exp: Likewise.
* math/auto-libm-test-out-exp10: Likewise.
* math/auto-libm-test-out-exp2: Likewise.
* math/auto-libm-test-out-expm1: Likewise.
* math/auto-libm-test-out-fma: Likewise.
* math/auto-libm-test-out-hypot: Likewise.
* math/auto-libm-test-out-j0: Likewise.
* math/auto-libm-test-out-j1: Likewise.
* math/auto-libm-test-out-jn: Likewise.
* math/auto-libm-test-out-lgamma: Likewise.
* math/auto-libm-test-out-log: Likewise.
* math/auto-libm-test-out-log10: Likewise.
* math/auto-libm-test-out-log1p: Likewise.
* math/auto-libm-test-out-log2: Likewise.
* math/auto-libm-test-out-pow: Likewise.
* math/auto-libm-test-out-sin: Likewise.
* math/auto-libm-test-out-sincos: Likewise.
* math/auto-libm-test-out-sinh: Likewise.
* math/auto-libm-test-out-sqrt: Likewise.
* math/auto-libm-test-out-tan: Likewise.
* math/auto-libm-test-out-tanh: Likewise.
* math/auto-libm-test-out-tgamma: Likewise.
* math/auto-libm-test-out-y0: Likewise.
* math/auto-libm-test-out-y1: Likewise.
* math/auto-libm-test-out-yn: Likewise.
2017-02-06 18:41:20 +00:00
|
|
|
|
Split libm-test.inc by function.
Continuing the process of splitting up libm tests into more reasonably
sized units, this patch splits libm-test.inc into 121 separate
libm-test-<function>.inc files, one per array of test data. (There
are 126 libm *_test functions, but five of those are for functions
that are aliases for test purposes and so share arrays of test data.)
In the present patch, the 121 files get processed separately by
gen-libm-test.pl, each using only the auto-libm-test-out-<function>
file that is relevant (/dev/null for functions not using
auto-libm-test-* at all). This effectively eliminates the
serialization on running gen-libm-test.pl. However, the resulting .c
files still all get #included together, so compiling the limited
number of libm tests using libm-test.inc may still act as a
serialization point (the compilations still all have 40 MB of code to
process). libm-test.inc doesn't actually have anything in it any more
that needs gen-libm-test.pl processing, but is left as a .inc file
that gets processed to produce a .c file, rather than being renamed,
since the intent of this patch is as an intermediate step before
libm-test.inc gets removed and tests get compiled separately for each
function being tested.
Tested for x86_64.
* math/libm-test.inc: Move all tests of individual functions to
libm-test-*.inc and #include libm-test-*.c files.
(acos_test_data): Remove.
(acos_test): Likewise.
(acosh_test_data): Likewise.
(acosh_test): Likewise.
(asin_test_data): Likewise.
(asin_test): Likewise.
(asinh_test_data): Likewise.
(asinh_test): Likewise.
(atan_test_data): Likewise.
(atan_test): Likewise.
(atanh_test_data): Likewise.
(atanh_test): Likewise.
(atan2_test_data): Likewise.
(atan2_test): Likewise.
(cabs_test_data): Likewise.
(cabs_test): Likewise.
(cacos_test_data): Likewise.
(cacos_test): Likewise.
(cacosh_test_data): Likewise.
(cacosh_test): Likewise.
(canonicalize_test_data): Likewise.
(canonicalize_test): Likewise.
(carg_test_data): Likewise.
(carg_test): Likewise.
(casin_test_data): Likewise.
(casin_test): Likewise.
(casinh_test_data): Likewise.
(casinh_test): Likewise.
(catan_test_data): Likewise.
(catan_test): Likewise.
(catanh_test_data): Likewise.
(catanh_test): Likewise.
(cbrt_test_data): Likewise.
(cbrt_test): Likewise.
(ccos_test_data): Likewise.
(ccos_test): Likewise.
(ccosh_test_data): Likewise.
(ccosh_test): Likewise.
(ceil_test_data): Likewise.
(ceil_test): Likewise.
(cexp_test_data): Likewise.
(cexp_test): Likewise.
(cimag_test_data): Likewise.
(cimag_test): Likewise.
(clog_test_data): Likewise.
(clog_test): Likewise.
(clog10_test_data): Likewise.
(clog10_test): Likewise.
(conj_test_data): Likewise.
(conj_test): Likewise.
(copysign_test_data): Likewise.
(copysign_test): Likewise.
(cos_test_data): Likewise.
(cos_test): Likewise.
(cosh_test_data): Likewise.
(cosh_test): Likewise.
(cpow_test_data): Likewise.
(cpow_test): Likewise.
(cproj_test_data): Likewise.
(cproj_test): Likewise.
(creal_test_data): Likewise.
(creal_test): Likewise.
(csin_test_data): Likewise.
(csin_test): Likewise.
(csinh_test_data): Likewise.
(csinh_test): Likewise.
(csqrt_test_data): Likewise.
(csqrt_test): Likewise.
(ctan_test_data): Likewise.
(ctan_test): Likewise.
(ctanh_test_data): Likewise.
(ctanh_test): Likewise.
(erf_test_data): Likewise.
(erf_test): Likewise.
(erfc_test_data): Likewise.
(erfc_test): Likewise.
(exp_test_data): Likewise.
(exp_test): Likewise.
(exp10_test_data): Likewise.
(exp10_test): Likewise.
(pow10_test): Likewise.
(exp2_test_data): Likewise.
(exp2_test): Likewise.
(expm1_test_data): Likewise.
(expm1_test): Likewise.
(fabs_test_data): Likewise.
(fabs_test): Likewise.
(fdim_test_data): Likewise.
(fdim_test): Likewise.
(floor_test_data): Likewise.
(floor_test): Likewise.
(fma_test_data): Likewise.
(fma_test): Likewise.
(fmax_test_data): Likewise.
(fmax_test): Likewise.
(fmaxmag_test_data): Likewise.
(fmaxmag_test): Likewise.
(fmin_test_data): Likewise.
(fmin_test): Likewise.
(fminmag_test_data): Likewise.
(fminmag_test): Likewise.
(fmod_test_data): Likewise.
(fmod_test): Likewise.
(fpclassify_test_data): Likewise.
(fpclassify_test): Likewise.
(frexp_test_data): Likewise.
(frexp_test): Likewise.
(fromfp_test_data): Likewise.
(fromfp_test): Likewise.
(fromfpx_test_data): Likewise.
(fromfpx_test): Likewise.
(getpayload_test_data): Likewise.
(getpayload_test): Likewise.
(hypot_test_data): Likewise.
(hypot_test): Likewise.
(ilogb_test_data): Likewise.
(ilogb_test): Likewise.
(iscanonical_test_data): Likewise.
(iscanonical_test): Likewise.
(iseqsig_test_data): Likewise.
(iseqsig_test): Likewise.
(isfinite_test_data): Likewise.
(isfinite_test): Likewise.
(finite_test): Likewise.
(isgreater_test_data): Likewise.
(isgreater_test): Likewise.
(isgreaterequal_test_data): Likewise.
(isgreaterequal_test): Likewise.
(isinf_test_data): Likewise.
(isinf_test): Likewise.
(isless_test_data): Likewise.
(isless_test): Likewise.
(islessequal_test_data): Likewise.
(islessequal_test): Likewise.
(islessgreater_test_data): Likewise.
(islessgreater_test): Likewise.
(isnan_test_data): Likewise.
(isnan_test): Likewise.
(isnormal_test_data): Likewise.
(isnormal_test): Likewise.
(issignaling_test_data): Likewise.
(issignaling_test): Likewise.
(issubnormal_test_data): Likewise.
(issubnormal_test): Likewise.
(isunordered_test_data): Likewise.
(isunordered_test): Likewise.
(iszero_test_data): Likewise.
(iszero_test): Likewise.
(j0_test_data): Likewise.
(j0_test): Likewise.
(j1_test_data): Likewise.
(j1_test): Likewise.
(jn_test_data): Likewise.
(jn_test): Likewise.
(lgamma_test_data): Likewise.
(lgamma_test): Likewise.
(gamma_test): Likewise.
(llogb_test_data): Likewise.
(llogb_test): Likewise.
(lrint_test_data): Likewise.
(lrint_test): Likewise.
(llrint_test_data): Likewise.
(llrint_test): Likewise.
(log_test_data): Likewise.
(log_test): Likewise.
(log10_test_data): Likewise.
(log10_test): Likewise.
(log1p_test_data): Likewise.
(log1p_test): Likewise.
(log2_test_data): Likewise.
(log2_test): Likewise.
(logb_test_data): Likewise.
(logb_test): Likewise.
(lround_test_data): Likewise.
(lround_test): Likewise.
(llround_test_data): Likewise.
(llround_test): Likewise.
(modf_test_data): Likewise.
(modf_test): Likewise.
(nearbyint_test_data): Likewise.
(nearbyint_test): Likewise.
(nextafter_test_data): Likewise.
(nextafter_test): Likewise.
(nextup_test_data): Likewise.
(nextup_test): Likewise.
(nextdown_test_data): Likewise.
(nextdown_test): Likewise.
(nexttoward_test_data): Likewise.
(nexttoward_test): Likewise.
(pow_test_data): Likewise.
(pow_test): Likewise.
(remainder_test_data): Likewise.
(remainder_test): Likewise.
(drem_test): Likewise.
(remquo_test_data): Likewise.
(remquo_test): Likewise.
(rint_test_data): Likewise.
(rint_test): Likewise.
(round_test_data): Likewise.
(round_test): Likewise.
(roundeven_test_data): Likewise.
(roundeven_test): Likewise.
(scalb_test_data): Likewise.
(scalb_test): Likewise.
(scalbn_test_data): Likewise.
(scalbn_test): Likewise.
(ldexp_test): Likewise.
(scalbln_test_data): Likewise.
(scalbln_test): Likewise.
(setpayload_test_data): Likewise.
(setpayload_test): Likewise.
(setpayloadsig_test_data): Likewise.
(setpayloadsig_test): Likewise.
(signbit_test_data): Likewise.
(signbit_test): Likewise.
(sin_test_data): Likewise.
(sin_test): Likewise.
(sincos_test_data): Likewise.
(sincos_test): Likewise.
(sinh_test_data): Likewise.
(sinh_test): Likewise.
(sqrt_test_data): Likewise.
(sqrt_test): Likewise.
(tan_test_data): Likewise.
(tan_test): Likewise.
(tanh_test_data): Likewise.
(tanh_test): Likewise.
(tgamma_test_data): Likewise.
(tgamma_test): Likewise.
(totalorder_test_data): Likewise.
(totalorder_test): Likewise.
(totalordermag_test_data): Likewise.
(totalordermag_test): Likewise.
(trunc_test_data): Likewise.
(trunc_test): Likewise.
(ufromfp_test_data): Likewise.
(ufromfp_test): Likewise.
(ufromfpx_test_data): Likewise.
(ufromfpx_test): Likewise.
(y0_test_data): Likewise.
(y0_test): Likewise.
(y1_test_data): Likewise.
(y1_test): Likewise.
(yn_test_data): Likewise.
(yn_test): Likewise.
(significand_test_data): Likewise.
(significand_test): Likewise.
* math/Makefile (auto-libm-test-out-files): Remove variable.
(libm-test-funcs-noauto): New variable.
(libm-test-funcs-all): Likewise.
(libm-test-c-auto): Likewise.
(libm-test-c-noauto): Likewise.
(libm-tests-generated): Add $(libm-test-c-auto) and
$(libm-test-c-noauto).
(generated): Do not add auto-libm-test-out.
(libm-test-c-auto-obj): New variable.
(libm-test-c-noauto-obj): Likewise.
($(objpfx)libm-test.c): Do not generate or use auto-libm-test-out.
($(libm-test-c-noauto-obj)): New static pattern rule.
($(libm-test-c-auto-obj)): Likewise.
(libm-test-incs): New variable.
($(objpfx)libm-have-vector-test.h): Depend on $(libm-test-incs)
and pass it to gen-libm-have-vector-test.sh.
* math/gen-libm-have-vector-test.sh: Expect list of .inc files to
be passed on command line.
* math/libm-test-acos.inc: New file. Content from
math/libm-test.inc.
* math/libm-test-acosh.inc: Likewise.
* math/libm-test-asin.inc: Likewise.
* math/libm-test-asinh.inc: Likewise.
* math/libm-test-atan.inc: Likewise.
* math/libm-test-atan2.inc: Likewise.
* math/libm-test-atanh.inc: Likewise.
* math/libm-test-cabs.inc: Likewise.
* math/libm-test-cacos.inc: Likewise.
* math/libm-test-cacosh.inc: Likewise.
* math/libm-test-canonicalize.inc: Likewise.
* math/libm-test-carg.inc: Likewise.
* math/libm-test-casin.inc: Likewise.
* math/libm-test-casinh.inc: Likewise.
* math/libm-test-catan.inc: Likewise.
* math/libm-test-catanh.inc: Likewise.
* math/libm-test-cbrt.inc: Likewise.
* math/libm-test-ccos.inc: Likewise.
* math/libm-test-ccosh.inc: Likewise.
* math/libm-test-ceil.inc: Likewise.
* math/libm-test-cexp.inc: Likewise.
* math/libm-test-cimag.inc: Likewise.
* math/libm-test-clog.inc: Likewise.
* math/libm-test-clog10.inc: Likewise.
* math/libm-test-conj.inc: Likewise.
* math/libm-test-copysign.inc: Likewise.
* math/libm-test-cos.inc: Likewise.
* math/libm-test-cosh.inc: Likewise.
* math/libm-test-cpow.inc: Likewise.
* math/libm-test-cproj.inc: Likewise.
* math/libm-test-creal.inc: Likewise.
* math/libm-test-csin.inc: Likewise.
* math/libm-test-csinh.inc: Likewise.
* math/libm-test-csqrt.inc: Likewise.
* math/libm-test-ctan.inc: Likewise.
* math/libm-test-ctanh.inc: Likewise.
* math/libm-test-erf.inc: Likewise.
* math/libm-test-erfc.inc: Likewise.
* math/libm-test-exp.inc: Likewise.
* math/libm-test-exp10.inc: Likewise.
* math/libm-test-exp2.inc: Likewise.
* math/libm-test-expm1.inc: Likewise.
* math/libm-test-fabs.inc: Likewise.
* math/libm-test-fdim.inc: Likewise.
* math/libm-test-floor.inc: Likewise.
* math/libm-test-fma.inc: Likewise.
* math/libm-test-fmax.inc: Likewise.
* math/libm-test-fmaxmag.inc: Likewise.
* math/libm-test-fmin.inc: Likewise.
* math/libm-test-fminmag.inc: Likewise.
* math/libm-test-fmod.inc: Likewise.
* math/libm-test-fpclassify.inc: Likewise.
* math/libm-test-frexp.inc: Likewise.
* math/libm-test-fromfp.inc: Likewise.
* math/libm-test-fromfpx.inc: Likewise.
* math/libm-test-getpayload.inc: Likewise.
* math/libm-test-hypot.inc: Likewise.
* math/libm-test-ilogb.inc: Likewise.
* math/libm-test-iscanonical.inc: Likewise.
* math/libm-test-iseqsig.inc: Likewise.
* math/libm-test-isfinite.inc: Likewise.
* math/libm-test-isgreater.inc: Likewise.
* math/libm-test-isgreaterequal.inc: Likewise.
* math/libm-test-isinf.inc: Likewise.
* math/libm-test-isless.inc: Likewise.
* math/libm-test-islessequal.inc: Likewise.
* math/libm-test-islessgreater.inc: Likewise.
* math/libm-test-isnan.inc: Likewise.
* math/libm-test-isnormal.inc: Likewise.
* math/libm-test-issignaling.inc: Likewise.
* math/libm-test-issubnormal.inc: Likewise.
* math/libm-test-isunordered.inc: Likewise.
* math/libm-test-iszero.inc: Likewise.
* math/libm-test-j0.inc: Likewise.
* math/libm-test-j1.inc: Likewise.
* math/libm-test-jn.inc: Likewise.
* math/libm-test-lgamma.inc: Likewise.
* math/libm-test-llogb.inc: Likewise.
* math/libm-test-llrint.inc: Likewise.
* math/libm-test-llround.inc: Likewise.
* math/libm-test-log.inc: Likewise.
* math/libm-test-log10.inc: Likewise.
* math/libm-test-log1p.inc: Likewise.
* math/libm-test-log2.inc: Likewise.
* math/libm-test-logb.inc: Likewise.
* math/libm-test-lrint.inc: Likewise.
* math/libm-test-lround.inc: Likewise.
* math/libm-test-modf.inc: Likewise.
* math/libm-test-nearbyint.inc: Likewise.
* math/libm-test-nextafter.inc: Likewise.
* math/libm-test-nextdown.inc: Likewise.
* math/libm-test-nexttoward.inc: Likewise.
* math/libm-test-nextup.inc: Likewise.
* math/libm-test-pow.inc: Likewise.
* math/libm-test-remainder.inc: Likewise.
* math/libm-test-remquo.inc: Likewise.
* math/libm-test-rint.inc: Likewise.
* math/libm-test-round.inc: Likewise.
* math/libm-test-roundeven.inc: Likewise.
* math/libm-test-scalb.inc: Likewise.
* math/libm-test-scalbln.inc: Likewise.
* math/libm-test-scalbn.inc: Likewise.
* math/libm-test-setpayload.inc: Likewise.
* math/libm-test-setpayloadsig.inc: Likewise.
* math/libm-test-signbit.inc: Likewise.
* math/libm-test-significand.inc: Likewise.
* math/libm-test-sin.inc: Likewise.
* math/libm-test-sincos.inc: Likewise.
* math/libm-test-sinh.inc: Likewise.
* math/libm-test-sqrt.inc: Likewise.
* math/libm-test-tan.inc: Likewise.
* math/libm-test-tanh.inc: Likewise.
* math/libm-test-tgamma.inc: Likewise.
* math/libm-test-totalorder.inc: Likewise.
* math/libm-test-totalordermag.inc: Likewise.
* math/libm-test-trunc.inc: Likewise.
* math/libm-test-ufromfp.inc: Likewise.
* math/libm-test-ufromfpx.inc: Likewise.
* math/libm-test-y0.inc: Likewise.
* math/libm-test-y1.inc: Likewise.
* math/libm-test-yn.inc: Likewise.
* math/README.libm-test: Update.
2017-02-06 18:57:25 +00:00
|
|
|
$(libm-test-c-auto-obj): $(objpfx)libm-test%.c: libm-test%.inc \
|
|
|
|
gen-libm-test.pl \
|
|
|
|
auto-libm-test-out%
|
2017-02-06 18:28:33 +00:00
|
|
|
$(make-target-directory)
|
Split libm-test.inc by function.
Continuing the process of splitting up libm tests into more reasonably
sized units, this patch splits libm-test.inc into 121 separate
libm-test-<function>.inc files, one per array of test data. (There
are 126 libm *_test functions, but five of those are for functions
that are aliases for test purposes and so share arrays of test data.)
In the present patch, the 121 files get processed separately by
gen-libm-test.pl, each using only the auto-libm-test-out-<function>
file that is relevant (/dev/null for functions not using
auto-libm-test-* at all). This effectively eliminates the
serialization on running gen-libm-test.pl. However, the resulting .c
files still all get #included together, so compiling the limited
number of libm tests using libm-test.inc may still act as a
serialization point (the compilations still all have 40 MB of code to
process). libm-test.inc doesn't actually have anything in it any more
that needs gen-libm-test.pl processing, but is left as a .inc file
that gets processed to produce a .c file, rather than being renamed,
since the intent of this patch is as an intermediate step before
libm-test.inc gets removed and tests get compiled separately for each
function being tested.
Tested for x86_64.
* math/libm-test.inc: Move all tests of individual functions to
libm-test-*.inc and #include libm-test-*.c files.
(acos_test_data): Remove.
(acos_test): Likewise.
(acosh_test_data): Likewise.
(acosh_test): Likewise.
(asin_test_data): Likewise.
(asin_test): Likewise.
(asinh_test_data): Likewise.
(asinh_test): Likewise.
(atan_test_data): Likewise.
(atan_test): Likewise.
(atanh_test_data): Likewise.
(atanh_test): Likewise.
(atan2_test_data): Likewise.
(atan2_test): Likewise.
(cabs_test_data): Likewise.
(cabs_test): Likewise.
(cacos_test_data): Likewise.
(cacos_test): Likewise.
(cacosh_test_data): Likewise.
(cacosh_test): Likewise.
(canonicalize_test_data): Likewise.
(canonicalize_test): Likewise.
(carg_test_data): Likewise.
(carg_test): Likewise.
(casin_test_data): Likewise.
(casin_test): Likewise.
(casinh_test_data): Likewise.
(casinh_test): Likewise.
(catan_test_data): Likewise.
(catan_test): Likewise.
(catanh_test_data): Likewise.
(catanh_test): Likewise.
(cbrt_test_data): Likewise.
(cbrt_test): Likewise.
(ccos_test_data): Likewise.
(ccos_test): Likewise.
(ccosh_test_data): Likewise.
(ccosh_test): Likewise.
(ceil_test_data): Likewise.
(ceil_test): Likewise.
(cexp_test_data): Likewise.
(cexp_test): Likewise.
(cimag_test_data): Likewise.
(cimag_test): Likewise.
(clog_test_data): Likewise.
(clog_test): Likewise.
(clog10_test_data): Likewise.
(clog10_test): Likewise.
(conj_test_data): Likewise.
(conj_test): Likewise.
(copysign_test_data): Likewise.
(copysign_test): Likewise.
(cos_test_data): Likewise.
(cos_test): Likewise.
(cosh_test_data): Likewise.
(cosh_test): Likewise.
(cpow_test_data): Likewise.
(cpow_test): Likewise.
(cproj_test_data): Likewise.
(cproj_test): Likewise.
(creal_test_data): Likewise.
(creal_test): Likewise.
(csin_test_data): Likewise.
(csin_test): Likewise.
(csinh_test_data): Likewise.
(csinh_test): Likewise.
(csqrt_test_data): Likewise.
(csqrt_test): Likewise.
(ctan_test_data): Likewise.
(ctan_test): Likewise.
(ctanh_test_data): Likewise.
(ctanh_test): Likewise.
(erf_test_data): Likewise.
(erf_test): Likewise.
(erfc_test_data): Likewise.
(erfc_test): Likewise.
(exp_test_data): Likewise.
(exp_test): Likewise.
(exp10_test_data): Likewise.
(exp10_test): Likewise.
(pow10_test): Likewise.
(exp2_test_data): Likewise.
(exp2_test): Likewise.
(expm1_test_data): Likewise.
(expm1_test): Likewise.
(fabs_test_data): Likewise.
(fabs_test): Likewise.
(fdim_test_data): Likewise.
(fdim_test): Likewise.
(floor_test_data): Likewise.
(floor_test): Likewise.
(fma_test_data): Likewise.
(fma_test): Likewise.
(fmax_test_data): Likewise.
(fmax_test): Likewise.
(fmaxmag_test_data): Likewise.
(fmaxmag_test): Likewise.
(fmin_test_data): Likewise.
(fmin_test): Likewise.
(fminmag_test_data): Likewise.
(fminmag_test): Likewise.
(fmod_test_data): Likewise.
(fmod_test): Likewise.
(fpclassify_test_data): Likewise.
(fpclassify_test): Likewise.
(frexp_test_data): Likewise.
(frexp_test): Likewise.
(fromfp_test_data): Likewise.
(fromfp_test): Likewise.
(fromfpx_test_data): Likewise.
(fromfpx_test): Likewise.
(getpayload_test_data): Likewise.
(getpayload_test): Likewise.
(hypot_test_data): Likewise.
(hypot_test): Likewise.
(ilogb_test_data): Likewise.
(ilogb_test): Likewise.
(iscanonical_test_data): Likewise.
(iscanonical_test): Likewise.
(iseqsig_test_data): Likewise.
(iseqsig_test): Likewise.
(isfinite_test_data): Likewise.
(isfinite_test): Likewise.
(finite_test): Likewise.
(isgreater_test_data): Likewise.
(isgreater_test): Likewise.
(isgreaterequal_test_data): Likewise.
(isgreaterequal_test): Likewise.
(isinf_test_data): Likewise.
(isinf_test): Likewise.
(isless_test_data): Likewise.
(isless_test): Likewise.
(islessequal_test_data): Likewise.
(islessequal_test): Likewise.
(islessgreater_test_data): Likewise.
(islessgreater_test): Likewise.
(isnan_test_data): Likewise.
(isnan_test): Likewise.
(isnormal_test_data): Likewise.
(isnormal_test): Likewise.
(issignaling_test_data): Likewise.
(issignaling_test): Likewise.
(issubnormal_test_data): Likewise.
(issubnormal_test): Likewise.
(isunordered_test_data): Likewise.
(isunordered_test): Likewise.
(iszero_test_data): Likewise.
(iszero_test): Likewise.
(j0_test_data): Likewise.
(j0_test): Likewise.
(j1_test_data): Likewise.
(j1_test): Likewise.
(jn_test_data): Likewise.
(jn_test): Likewise.
(lgamma_test_data): Likewise.
(lgamma_test): Likewise.
(gamma_test): Likewise.
(llogb_test_data): Likewise.
(llogb_test): Likewise.
(lrint_test_data): Likewise.
(lrint_test): Likewise.
(llrint_test_data): Likewise.
(llrint_test): Likewise.
(log_test_data): Likewise.
(log_test): Likewise.
(log10_test_data): Likewise.
(log10_test): Likewise.
(log1p_test_data): Likewise.
(log1p_test): Likewise.
(log2_test_data): Likewise.
(log2_test): Likewise.
(logb_test_data): Likewise.
(logb_test): Likewise.
(lround_test_data): Likewise.
(lround_test): Likewise.
(llround_test_data): Likewise.
(llround_test): Likewise.
(modf_test_data): Likewise.
(modf_test): Likewise.
(nearbyint_test_data): Likewise.
(nearbyint_test): Likewise.
(nextafter_test_data): Likewise.
(nextafter_test): Likewise.
(nextup_test_data): Likewise.
(nextup_test): Likewise.
(nextdown_test_data): Likewise.
(nextdown_test): Likewise.
(nexttoward_test_data): Likewise.
(nexttoward_test): Likewise.
(pow_test_data): Likewise.
(pow_test): Likewise.
(remainder_test_data): Likewise.
(remainder_test): Likewise.
(drem_test): Likewise.
(remquo_test_data): Likewise.
(remquo_test): Likewise.
(rint_test_data): Likewise.
(rint_test): Likewise.
(round_test_data): Likewise.
(round_test): Likewise.
(roundeven_test_data): Likewise.
(roundeven_test): Likewise.
(scalb_test_data): Likewise.
(scalb_test): Likewise.
(scalbn_test_data): Likewise.
(scalbn_test): Likewise.
(ldexp_test): Likewise.
(scalbln_test_data): Likewise.
(scalbln_test): Likewise.
(setpayload_test_data): Likewise.
(setpayload_test): Likewise.
(setpayloadsig_test_data): Likewise.
(setpayloadsig_test): Likewise.
(signbit_test_data): Likewise.
(signbit_test): Likewise.
(sin_test_data): Likewise.
(sin_test): Likewise.
(sincos_test_data): Likewise.
(sincos_test): Likewise.
(sinh_test_data): Likewise.
(sinh_test): Likewise.
(sqrt_test_data): Likewise.
(sqrt_test): Likewise.
(tan_test_data): Likewise.
(tan_test): Likewise.
(tanh_test_data): Likewise.
(tanh_test): Likewise.
(tgamma_test_data): Likewise.
(tgamma_test): Likewise.
(totalorder_test_data): Likewise.
(totalorder_test): Likewise.
(totalordermag_test_data): Likewise.
(totalordermag_test): Likewise.
(trunc_test_data): Likewise.
(trunc_test): Likewise.
(ufromfp_test_data): Likewise.
(ufromfp_test): Likewise.
(ufromfpx_test_data): Likewise.
(ufromfpx_test): Likewise.
(y0_test_data): Likewise.
(y0_test): Likewise.
(y1_test_data): Likewise.
(y1_test): Likewise.
(yn_test_data): Likewise.
(yn_test): Likewise.
(significand_test_data): Likewise.
(significand_test): Likewise.
* math/Makefile (auto-libm-test-out-files): Remove variable.
(libm-test-funcs-noauto): New variable.
(libm-test-funcs-all): Likewise.
(libm-test-c-auto): Likewise.
(libm-test-c-noauto): Likewise.
(libm-tests-generated): Add $(libm-test-c-auto) and
$(libm-test-c-noauto).
(generated): Do not add auto-libm-test-out.
(libm-test-c-auto-obj): New variable.
(libm-test-c-noauto-obj): Likewise.
($(objpfx)libm-test.c): Do not generate or use auto-libm-test-out.
($(libm-test-c-noauto-obj)): New static pattern rule.
($(libm-test-c-auto-obj)): Likewise.
(libm-test-incs): New variable.
($(objpfx)libm-have-vector-test.h): Depend on $(libm-test-incs)
and pass it to gen-libm-have-vector-test.sh.
* math/gen-libm-have-vector-test.sh: Expect list of .inc files to
be passed on command line.
* math/libm-test-acos.inc: New file. Content from
math/libm-test.inc.
* math/libm-test-acosh.inc: Likewise.
* math/libm-test-asin.inc: Likewise.
* math/libm-test-asinh.inc: Likewise.
* math/libm-test-atan.inc: Likewise.
* math/libm-test-atan2.inc: Likewise.
* math/libm-test-atanh.inc: Likewise.
* math/libm-test-cabs.inc: Likewise.
* math/libm-test-cacos.inc: Likewise.
* math/libm-test-cacosh.inc: Likewise.
* math/libm-test-canonicalize.inc: Likewise.
* math/libm-test-carg.inc: Likewise.
* math/libm-test-casin.inc: Likewise.
* math/libm-test-casinh.inc: Likewise.
* math/libm-test-catan.inc: Likewise.
* math/libm-test-catanh.inc: Likewise.
* math/libm-test-cbrt.inc: Likewise.
* math/libm-test-ccos.inc: Likewise.
* math/libm-test-ccosh.inc: Likewise.
* math/libm-test-ceil.inc: Likewise.
* math/libm-test-cexp.inc: Likewise.
* math/libm-test-cimag.inc: Likewise.
* math/libm-test-clog.inc: Likewise.
* math/libm-test-clog10.inc: Likewise.
* math/libm-test-conj.inc: Likewise.
* math/libm-test-copysign.inc: Likewise.
* math/libm-test-cos.inc: Likewise.
* math/libm-test-cosh.inc: Likewise.
* math/libm-test-cpow.inc: Likewise.
* math/libm-test-cproj.inc: Likewise.
* math/libm-test-creal.inc: Likewise.
* math/libm-test-csin.inc: Likewise.
* math/libm-test-csinh.inc: Likewise.
* math/libm-test-csqrt.inc: Likewise.
* math/libm-test-ctan.inc: Likewise.
* math/libm-test-ctanh.inc: Likewise.
* math/libm-test-erf.inc: Likewise.
* math/libm-test-erfc.inc: Likewise.
* math/libm-test-exp.inc: Likewise.
* math/libm-test-exp10.inc: Likewise.
* math/libm-test-exp2.inc: Likewise.
* math/libm-test-expm1.inc: Likewise.
* math/libm-test-fabs.inc: Likewise.
* math/libm-test-fdim.inc: Likewise.
* math/libm-test-floor.inc: Likewise.
* math/libm-test-fma.inc: Likewise.
* math/libm-test-fmax.inc: Likewise.
* math/libm-test-fmaxmag.inc: Likewise.
* math/libm-test-fmin.inc: Likewise.
* math/libm-test-fminmag.inc: Likewise.
* math/libm-test-fmod.inc: Likewise.
* math/libm-test-fpclassify.inc: Likewise.
* math/libm-test-frexp.inc: Likewise.
* math/libm-test-fromfp.inc: Likewise.
* math/libm-test-fromfpx.inc: Likewise.
* math/libm-test-getpayload.inc: Likewise.
* math/libm-test-hypot.inc: Likewise.
* math/libm-test-ilogb.inc: Likewise.
* math/libm-test-iscanonical.inc: Likewise.
* math/libm-test-iseqsig.inc: Likewise.
* math/libm-test-isfinite.inc: Likewise.
* math/libm-test-isgreater.inc: Likewise.
* math/libm-test-isgreaterequal.inc: Likewise.
* math/libm-test-isinf.inc: Likewise.
* math/libm-test-isless.inc: Likewise.
* math/libm-test-islessequal.inc: Likewise.
* math/libm-test-islessgreater.inc: Likewise.
* math/libm-test-isnan.inc: Likewise.
* math/libm-test-isnormal.inc: Likewise.
* math/libm-test-issignaling.inc: Likewise.
* math/libm-test-issubnormal.inc: Likewise.
* math/libm-test-isunordered.inc: Likewise.
* math/libm-test-iszero.inc: Likewise.
* math/libm-test-j0.inc: Likewise.
* math/libm-test-j1.inc: Likewise.
* math/libm-test-jn.inc: Likewise.
* math/libm-test-lgamma.inc: Likewise.
* math/libm-test-llogb.inc: Likewise.
* math/libm-test-llrint.inc: Likewise.
* math/libm-test-llround.inc: Likewise.
* math/libm-test-log.inc: Likewise.
* math/libm-test-log10.inc: Likewise.
* math/libm-test-log1p.inc: Likewise.
* math/libm-test-log2.inc: Likewise.
* math/libm-test-logb.inc: Likewise.
* math/libm-test-lrint.inc: Likewise.
* math/libm-test-lround.inc: Likewise.
* math/libm-test-modf.inc: Likewise.
* math/libm-test-nearbyint.inc: Likewise.
* math/libm-test-nextafter.inc: Likewise.
* math/libm-test-nextdown.inc: Likewise.
* math/libm-test-nexttoward.inc: Likewise.
* math/libm-test-nextup.inc: Likewise.
* math/libm-test-pow.inc: Likewise.
* math/libm-test-remainder.inc: Likewise.
* math/libm-test-remquo.inc: Likewise.
* math/libm-test-rint.inc: Likewise.
* math/libm-test-round.inc: Likewise.
* math/libm-test-roundeven.inc: Likewise.
* math/libm-test-scalb.inc: Likewise.
* math/libm-test-scalbln.inc: Likewise.
* math/libm-test-scalbn.inc: Likewise.
* math/libm-test-setpayload.inc: Likewise.
* math/libm-test-setpayloadsig.inc: Likewise.
* math/libm-test-signbit.inc: Likewise.
* math/libm-test-significand.inc: Likewise.
* math/libm-test-sin.inc: Likewise.
* math/libm-test-sincos.inc: Likewise.
* math/libm-test-sinh.inc: Likewise.
* math/libm-test-sqrt.inc: Likewise.
* math/libm-test-tan.inc: Likewise.
* math/libm-test-tanh.inc: Likewise.
* math/libm-test-tgamma.inc: Likewise.
* math/libm-test-totalorder.inc: Likewise.
* math/libm-test-totalordermag.inc: Likewise.
* math/libm-test-trunc.inc: Likewise.
* math/libm-test-ufromfp.inc: Likewise.
* math/libm-test-ufromfpx.inc: Likewise.
* math/libm-test-y0.inc: Likewise.
* math/libm-test-y1.inc: Likewise.
* math/libm-test-yn.inc: Likewise.
* math/README.libm-test: Update.
2017-02-06 18:57:25 +00:00
|
|
|
$(PERL) gen-libm-test.pl -c $< -a auto-libm-test-out$* -C $@
|
|
|
|
|
|
|
|
libm-test-incs = $(foreach f,$(libm-test-funcs-all),libm-test-$(f).inc)
|
1999-10-19 06:29:27 +00:00
|
|
|
endif
|
|
|
|
|
2017-06-28 14:20:21 +00:00
|
|
|
ifdef PYTHON
|
|
|
|
tests += test-tgmath3
|
|
|
|
generated += test-tgmath3.c
|
|
|
|
CFLAGS-test-tgmath3.c = -fno-builtin
|
|
|
|
|
|
|
|
$(objpfx)test-tgmath3.c: gen-tgmath-tests.py
|
|
|
|
$(PYTHON) $< > $@
|
|
|
|
endif
|
|
|
|
|
2015-06-09 11:51:52 +00:00
|
|
|
libm-test-fast-math-cflags = -fno-builtin -D__FAST_MATH__ -DTEST_FAST_MATH
|
|
|
|
libm-test-vec-cflags = $(libm-test-fast-math-cflags) -fno-inline \
|
|
|
|
-ffloat-store -D_OPENMP=201307 -Wno-unknown-pragmas
|
|
|
|
|
|
|
|
CFLAGS-test-double-vlen4-wrappers.c = $(double-vlen4-arch-ext-cflags)
|
|
|
|
|
|
|
|
CFLAGS-test-double-vlen8-wrappers.c = $(double-vlen8-arch-ext-cflags)
|
|
|
|
|
2015-06-09 15:32:42 +00:00
|
|
|
CFLAGS-test-float-vlen8-wrappers.c = $(float-vlen8-arch-ext-cflags)
|
|
|
|
|
|
|
|
CFLAGS-test-float-vlen16-wrappers.c = $(float-vlen16-arch-ext-cflags)
|
|
|
|
|
2016-05-26 16:38:04 +00:00
|
|
|
# The no-inline tests use -fsignaling-nans, and thereby use the
|
|
|
|
# versions of classification macros that support sNaNs. The inline
|
|
|
|
# function tests use the versions of classification macros that may
|
|
|
|
# raise spurious exceptions for sNaNs, but also do not test for
|
|
|
|
# exceptions. Thus both versions of the classification macros are
|
|
|
|
# validated.
|
|
|
|
libm-test-no-inline-cflags = -fno-inline -ffloat-store -fno-builtin \
|
|
|
|
-fsignaling-nans
|
Run libm-test tests for finite-math-only functions.
This patch arranges for the libm-test tests to be run for the
finite-math-only function variants, in addition to the existing runs
for out-of-line and bits/mathinline.h inline variants.
gen-libm-test.pl is made to add a flag to all tests with non-finite
inputs or outputs so that they can be skipped at runtime when the
finite-math-only variants are being tested (skipping is for all
rounding modes; that is, -ffinite-math-only is being treated as
excluding overflow cases even when the rounding mode is such that the
overflowed result is finite). errno setting is not tested for these
variants (in general they don't set it, and it's
implementation-defined in ISO C whether it's set on underflow, with
the glibc definition being that it may not be for -ffinite-math-only;
other cases where errno would normally be expected to be set are
mostly excluded as having non-finite or overflowing arguments or
results).
As with the inline function tests, these ones are built with
-D__FINITE_MATH_ONLY=1 to select the function variants, rather than
-ffinite-math-only. Use of -ffinite-math-only would not be suitable
for these tests because it would also affect libm-test.inc code that
e.g. tests whether results are infinities or NaNs - if these function
variants have bugs that incorrectly produce such results, we want them
to show up in the tests, which means the compiler should not be
optimizing the tests on the basis of results being finite.
The finite-math-only functions share the same ulps settings as the
main out-of-line functions.
These interfaces were one significant group of untested ABIs listed at
<https://sourceware.org/ml/libc-alpha/2013-07/msg00386.html>. I
haven't rerun the script to list untested interfaces, but I expect
that the vast bulk of interfaces there are still untested and could do
with testcases being added (or, if applicable, being made compat
symbols; in general, most symbols not starting '_' are safe bets to
add tests for, while _* need more investigation of what the actual
public API is, if any). I'd like to encourage people to help reduce
the accumulation of untested interfaces by adding more tests.
Tested for x86_64 and x86. Given my recent lgamma/gamma and log*
fixes, the new tests pass (before those fixes, the new tests showed up
those bugs, so illustrating the practical utility of having tests for
these function variants).
* math/libm-test.inc (NON_FINITE): New macro.
(enable_test): Do not run tests flagged NON_FINITE if TEST_FINITE.
* math/gen-libm-test.pl (show_exceptions): Add argument
$non_finite.
(parse_args): Update call to show_exceptions.
* math/test-math-finite.h: New file.
* math/test-math-no-finite.h: Likewise.
* math/test-double-finite.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-double.c: Include "test-math-no-finite.h".
* math/test-float.c: Include "test-math-no-finite.h".
* math/test-ldouble.c: Include "test-math-no-finite.h".
* math/test-math-inline.h (TEST_FINITE): New macro.
* math/test-math-vector.h (TEST_FINITE): Likewise.
* math/Makefile (test-longdouble-yes): Add test-ldouble-finite.
(libm-tests): Add test-float-finite and test-double-finite.
($(objpfx)test-float-finite.o): New dependency on
$(objpfx)libm-test.stmp.
($(objpfx)test-double-finite.o): Likewise.
($(objpfx)test-ldouble-finite.o): Likewise.
(libm-test-no-inline-cflags): New variable.
(libm-test-finite-cflags): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-test-float.c): Use $(libm-test-no-inline-cflags).
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
2015-11-05 23:28:16 +00:00
|
|
|
libm-test-finite-cflags = $(libm-test-no-inline-cflags) \
|
|
|
|
-U__FINITE_MATH_ONLY__ -D__FINITE_MATH_ONLY__=1
|
Run libm tests separately for each function.
At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
over 50 MB of libm-test-*.c sources.
This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 50
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).
All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.
This should reduce the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.
Tested for x86_64 and x86.
* math/Makefile (libm-tests-generated): Remove variable.
(libm-tests-base-normal): New variable.
(libm-tests-base-finite): Likewise.
(libm-tests-base-inline): Likewise.
(libm-tests-base): Likewise.
(libm-tests-normal): Likewise.
(libm-tests-finite): Likewise.
(libm-tests-inline): Likewise.
(libm-tests-vector): Likewise.
(libm-tests): Define in terms of these new variables.
(libm-tests-for-type): New variable.
(libm-tests.o): Move definition.
(tests): Move addition of $(libm-tests).
(generated): Update for new and removed libm test files.
($(objpfx)libm-test.c): Remove target.
($(objpfx)libm-have-vector-test.h): Likewise.
(CFLAGS-test-double-vlen2.c): Remove variable.
(CFLAGS-test-double-vlen4.c): Likewise.
(CFLAGS-test-double-vlen8.c): Likewise.
(CFLAGS-test-float-vlen4.c): Likewise.
(CFLAGS-test-float-vlen8.c): Likewise.
(CFLAGS-test-float-vlen16.c): Likewise.
(CFLAGS-test-float.c): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-libm-test-support-float.c): Likewise.
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
(libm-test-inline-cflags): New variable.
(CFLAGS-test-ifloat.c): Remove variable.
(CFLAGS-test-idouble.c): Likewise.
(CFLAGS-test-ildouble.c): Likewise.
($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
dependencies.
($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
Likewise.
(dependencies on libm-test-support-*.o): Remove.
($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
rules using iterators.
($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
Likewise.
($(objpfx)libm-test-support-$(o).o): Likewise.
($(addprefix $(objpfx),$(filter-out $(tests-static)
$(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
instead.
($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
define rule instead.
* math/README.libm-test: Update.
* math/libm-test-acos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-acosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-canonicalize.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-carg.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cbrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ceil.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cimag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-conj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-copysign.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cpow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cproj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-creal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erfc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-expm1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fdim.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-floor.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmax.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fminmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmod.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fpclassify.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-frexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-getpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-hypot.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ilogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iscanonical.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iseqsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isfinite.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isinf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isless.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issignaling.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issubnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isunordered.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iszero.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-jn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log1p.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-logb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-modf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nearbyint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextafter.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextdown.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nexttoward.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextup.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-pow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remainder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remquo.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-rint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-round.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-roundeven.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbln.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-signbit.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-significand.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sincos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalorder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalordermag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-trunc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-yn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-driver.c: Do not include libm-have-vector-test.h.
(HAVE_VECTOR): Remove macro.
(START): Do not call HAVE_VECTOR.
* math/test-double-vlen2.h (FUNC_TEST): Remove macro.
* math/test-double-vlen4.h (FUNC_TEST): Remove macro.
* math/test-double-vlen8.h (FUNC_TEST): Remove macro.
* math/test-float-vlen16.h (FUNC_TEST): Remove macro.
* math/test-float-vlen4.h (FUNC_TEST): Remove macro.
* math/test-float-vlen8.h (FUNC_TEST): Remove macro.
* math/test-math-vector.h (FUNC_TEST): New macro.
(WRAPPER_DECL): Rename to WRAPPER_DECL_f.
* sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
(double-vlen4-funcs): Likewise.
(double-vlen4-avx2-funcs): Likewise.
(double-vlen8-funcs): Likewise.
(float-vlen4-funcs): Likewise.
(float-vlen8-funcs): Likewise.
(float-vlen8-avx2-funcs): Likewise.
(float-vlen16-funcs): Likewise.
(CFLAGS-test-double-vlen4-avx2.c): Remove variable.
(CFLAGS-test-float-vlen8-avx2.c): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
macro.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
Likewise.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* math/gen-libm-have-vector-test.sh: Remove file.
* math/libm-test.inc: Likewise.
* math/libm-test-support-double.c: Likewise.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/test-double-finite.c: Likewise.: Likewise.
* math/test-double.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildouble.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2017-02-24 00:51:45 +00:00
|
|
|
libm-test-inline-cflags = $(libm-test-fast-math-cflags)
|
2001-01-25 22:38:42 +00:00
|
|
|
CFLAGS-test-tgmath.c = -fno-builtin
|
2012-10-18 20:03:49 +00:00
|
|
|
# The following testcase uses very long lines (>3 million), so it may take a
|
|
|
|
# while to compile it. See: http://llvm.org/bugs/show_bug.cgi?id=14106 and
|
|
|
|
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54402
|
2013-01-10 09:42:57 +00:00
|
|
|
CFLAGS-test-tgmath2.c = -fno-builtin
|
2003-06-16 08:03:44 +00:00
|
|
|
CFLAGS-test-tgmath-ret.c = -fno-builtin
|
2011-05-18 23:50:48 +00:00
|
|
|
CFLAGS-test-powl.c = -fno-builtin
|
2015-09-18 15:30:43 +00:00
|
|
|
|
|
|
|
CFLAGS-test-snan.c = -fsignaling-nans
|
1997-03-20 02:20:57 +00:00
|
|
|
|
2015-11-05 21:23:07 +00:00
|
|
|
CFLAGS-test-signgam-finite.c = -ffinite-math-only
|
|
|
|
CFLAGS-test-signgam-finite-c99.c = -ffinite-math-only -std=c99
|
|
|
|
CFLAGS-test-signgam-finite-c11.c = -ffinite-math-only -std=c11
|
Fix lgamma setting signgam for ISO C (bug 15421).
The lgamma (and likewise lgammaf, lgammal) function wrongly sets the
signgam variable even when building for strict ISO C conformance
(-std=c99 / -std=c11), although the user may define such a variable
and it's only in the implementation namespace for POSIX with XSI
extensions enabled.
Following discussions starting at
<https://sourceware.org/ml/libc-alpha/2013-04/msg00767.html> and
<https://sourceware.org/ml/libc-alpha/2015-10/msg00844.html>, it seems
that the safest approach for fixing this particular issue is for
signgam to become a weak alias for a newly exported symbol __signgam,
with the library functions only setting __signgam, at which point
static linker magic will preserve the alias for newly linked binaries
that refer to the library's signgam rather than defining their own,
while breaking the alias for programs that define their own signgam,
with new symbol versions for lgamma functions and with compat symbols
for existing binaries that set both signgam and __signgam.
This patch implements that approach for the fix. signgam is made into
a weak alias. The four symbols __signgam, lgamma, lgammaf, lgammal
get new symbol versions at version GLIBC_2.23, with the existing
versions of lgamma, lgammaf and lgammal becoming compat symbols.
When the compat versions are built, gamma, gammaf and gammal are
aliases for the compat versions (i.e. always set signgam); this is OK
as they are not ISO C functions, and avoids adding new symbol versions
for them unnecessarily. When the compat versions are not built
(i.e. for static linking and for future glibc ports), gamma, gammaf
and gammal are aliases for the new versions that set __signgam. The
ldbl-opt versions are updated accordingly.
The lgamma wrappers are adjusted so that the same source files,
included from different files with different definitions of
USE_AS_COMPAT, can build either the new versions or the compat
versions. Similar changes are made to the ia64 versions (untested).
Tests are added that the lgamma functions do not interfere with a user
variable called signgam for ISO C, with various choices for the size
of that variable, whether it is initialized, and for static and
dynamic linking. The conformtest whitelist entry is removed as well.
Tested for x86_64, x86, mips64 and powerpc, including looking at
objdump --dynamic-syms output to make sure the expected sets of
symbols were aliases. Also spot-tested that a binary built with old
glibc works properly (i.e. gets signgam set) when run with new glibc.
[BZ #15421]
* sysdeps/ieee754/s_signgam.c (signgam): Rename to __signgam,
initialize with 0 and define as weak alias of __signgam.
* include/math.h [!_ISOMAC] (__signgam): Declare.
* math/Makefile (libm-calls): Add w_lgamma_compat.
(tests): Add test-signgam-uchar, test-signgam-uchar-init,
test-signgam-uint, test-signgam-uint-init, test-signgam-ullong and
test-signgam-ullong-init.
(tests-static): Add test-signgam-uchar-static,
test-signgam-uchar-init-static, test-signgam-uint-static,
test-signgam-uint-init-static, test-signgam-ullong-static and
test-signgam-ullong-init-static.
(CFLAGS-test-signgam-uchar.c): New variable.
(CFLAGS-test-signgam-uchar-init.c): Likewise.
(CFLAGS-test-signgam-uchar-static.c): Likewise.
(CFLAGS-test-signgam-uchar-init-static.c): Likewise.
(CFLAGS-test-signgam-uint.c): Likewise.
(CFLAGS-test-signgam-uint-init.c): Likewise.
(CFLAGS-test-signgam-uint-static.c): Likewise.
(CFLAGS-test-signgam-uint-init-static.c): Likewise.
(CFLAGS-test-signgam-ullong.c): Likewise.
(CFLAGS-test-signgam-ullong-init.c): Likewise.
(CFLAGS-test-signgam-ullong-static.c): Likewise.
(CFLAGS-test-signgam-ullong-init-static.c): Likewise.
* math/Versions (libm): Add GLIBC_2.23.
* math/lgamma-compat.h: New file.
* math/test-signgam-main.c: Likewise.
* math/test-signgam-uchar-init-static.c: Likewise.
* math/test-signgam-uchar-init.c: Likewise.
* math/test-signgam-uchar-static.c: Likewise.
* math/test-signgam-uchar.c: Likewise.
* math/test-signgam-uint-init-static.c: Likewise.
* math/test-signgam-uint-init.c: Likewise.
* math/test-signgam-uint-static.c: Likewise.
* math/test-signgam-uint.c: Likewise.
* math/test-signgam-ullong-init-static.c: Likewise.
* math/test-signgam-ullong-init.c: Likewise.
* math/test-signgam-ullong-static.c: Likewise.
* math/test-signgam-ullong.c: Likewise.
* math/w_lgamma.c: Rename to w_lgamma_main.c and replace by
wrapper of w_lgamma_main.c.
* math/w_lgamma_compat.c: New file.
* math/w_lgamma_compatf.c: Likewise.
* math/w_lgamma_compatl.c: Likewise.
* math/w_lgamma_main.c: New file. Based on w_lgamma.c. Include
<lgamma-compat.h>. Condition contents on [BUILD_LGAMMA]. Support
defining compatibility symbols.
(__lgamma): Change to LGFUNC (__lgamma). Use CALL_LGAMMA.
* math/w_lgammaf.c: Rename to w_lgammaf_main.c and replace by
wrapper of w_lgammaf_main.c.
* math/w_lgammaf_main.c: New file. Based on w_lgammaf.c. Include
<lgamma-compat.h>. Condition contents on [BUILD_LGAMMA]. Support
defining compatibility symbols.
(__lgammaf): Change to LGFUNC (__lgammaf). Use CALL_LGAMMA.
* math/w_lgammal.c: Rename to w_lgammal_main.c and replace by
wrapper of w_lgammal_main.c.
* math/w_lgammal_main.c: New file. Based on w_lgammal.c. Include
<lgamma-compat.h>. Condition contents on [BUILD_LGAMMA]. Support
defining compatibility symbols.
(__lgammal): Change to LGFUNC (__lgammal). Use CALL_LGAMMA.
* sysdeps/ia64/fpu/lgamma-compat.h: New file.
* sysdeps/ia64/fpu/w_lgamma.c: Move to ....
* sysdeps/ia64/fpu/w_lgamma_main.c: ...here. Include
<lgamma-compat.h>.
(__ieee754_lgamma): Change to LGFUNC (lgamma). Use CALL_LGAMMA.
(__ieee754_gamma): Define as alias.
* sysdeps/ia64/fpu/w_lgammaf.c: Move to ....
* sysdeps/ia64/fpu/w_lgammaf_main.c: ...here. Include
<lgamma-compat.h>.
(__ieee754_lgammaf): Change to LGFUNC (lgammaf). Use CALL_LGAMMA.
(__ieee754_gammaf): Define as alias.
* sysdeps/ia64/fpu/w_lgammal.c: Move to ....
* sysdeps/ia64/fpu/w_lgammal_main.c: ...here. Include
<lgamma-compat.h>.
(__ieee754_lgammal): Change to LGFUNC (lgammal). Use CALL_LGAMMA.
(__ieee754_gammal): Define as alias.
* sysdeps/ieee754/ldbl-opt/w_lgamma.c: Move to ....
* sysdeps/ieee754/ldbl-opt/w_lgamma_compat.c: ...here. Include
<math/w_lgamma_compat.c>.
[LONG_DOUBLE_COMPAT(libm, GLIBC_2_0)] (__lgammal_dbl_compat):
Define as alias of __lgamma_compat and use in defining lgammal.
* sysdeps/ieee754/ldbl-opt/w_lgammal.c: Move to ....
* sysdeps/ieee754/ldbl-opt/w_lgamma_compatl.c: ...here. Include
<math/lgamma-compat.h> and <math/w_lgamma_compatl.c>.
(USE_AS_COMPAT): New macro.
(LGAMMA_OLD_VER): Undefine and redefine.
(lgammal): Do not define here.
(gammal): Only define here if [GAMMA_ALIAS].
* conform/linknamespace.pl (@whitelist): Remove signgam.
* sysdeps/nacl/libm.abilist: Update.
* sysdeps/unix/sysv/linux/aarch64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/alpha/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/arm/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/hppa/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/i386/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/ia64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/coldfire/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/m68k/m680x0/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/microblaze/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/nios2/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm-le.abilist:
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/s390/s390-32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/s390/s390-64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sh/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc32/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx32/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilegx/tilegx64/libm.abilist:
Likewise.
* sysdeps/unix/sysv/linux/tile/tilepro/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/64/libm.abilist: Likewise.
* sysdeps/unix/sysv/linux/x86_64/x32/libm.abilist: Likewise.
2015-11-20 22:49:59 +00:00
|
|
|
CFLAGS-test-signgam-uchar.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-uchar-init.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-uchar-static.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-uchar-init-static.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-uint.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-uint-init.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-uint-static.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-uint-init-static.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-ullong.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-ullong-init.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-ullong-static.c = -std=c99
|
|
|
|
CFLAGS-test-signgam-ullong-init-static.c = -std=c99
|
2015-11-05 21:23:07 +00:00
|
|
|
|
2016-02-15 00:27:06 +00:00
|
|
|
CFLAGS-test-math-isinff.cc = -std=gnu++11
|
2016-10-21 16:26:53 +00:00
|
|
|
CFLAGS-test-math-iszero.cc = -std=gnu++11
|
2016-02-15 00:27:06 +00:00
|
|
|
|
2016-09-28 21:11:58 +00:00
|
|
|
CFLAGS-test-iszero-excess-precision.c = -fexcess-precision=standard
|
2016-10-07 23:28:33 +00:00
|
|
|
CFLAGS-test-iseqsig-excess-precision.c = -fexcess-precision=standard
|
Fix default float_t definition (bug 20855).
The default (top-level) version of bits/mathdef.h defines float_t to
double. It is used on ColdFire, MicroBlaze, Nios II and SH3, all of
which define FLT_EVAL_METHOD to 0, so float_t should be float (and C11
requires a certain correspondence between these typedefs and
FLT_EVAL_METHOD values).
I proposed fixing this default in
<https://sourceware.org/ml/libc-alpha/2015-01/msg00499.html>, with no
objections from architecture maintainers, and this patch makes that
fix. As noted in the NEWS entry added, this might affect the ABIs of
non-glibc libraries (ImageMagick has been mentioned in gcc-patches
discussion of the S/390 case - which is unaffected by this patch), but
as noted in my previous message, affected libraries would have
problems with -mfpmath=sse anyway on 32-bit x86.
A (compilation) testcase is added to verify the required
correspondence of typedefs to FLT_EVAL_METHOD values. This test is
built with -fexcess-precision=standard to avoid any issues with GCC 7
on S/390 providing a more accurate FLT_EVAL_METHOD definition in the
default (no excess precision) mode. (This will also be usable to test
a fix for the recently reported bug about these typedefs on x86_64
-mfpmath=387, as architecture-specific tests can be added that
It is entirely possible that the fixed default makes some
architecture-specific versions of bits/mathdef.h semantically
equivalent to the default version and so no longer required. I don't
intend to investigate that separately from the refactoring I proposed
in <https://sourceware.org/ml/libc-alpha/2016-11/msg00745.html>, which
will create as few header variants as possible for each group of
definitions.
Tested (compilation only) with build-many-glibcs.py.
[BZ #20855]
* bits/mathdef.h (float_t): Define to float.
* math/test-flt-eval-method.c: New file.
* math/Makefile (tests): Add test-flt-eval-method.
(CFLAGS-test-flt-eval-method.c): New variable.
2016-11-23 00:28:30 +00:00
|
|
|
CFLAGS-test-flt-eval-method.c = -fexcess-precision=standard
|
2016-09-28 21:11:58 +00:00
|
|
|
|
2016-12-16 18:03:25 +00:00
|
|
|
CFLAGS-test-fe-snans-always-signal.c = -fsignaling-nans
|
|
|
|
|
1996-06-16 09:31:23 +00:00
|
|
|
# The -lieee module sets the _LIB_VERSION_ switch to IEEE mode
|
|
|
|
# for error handling in the -lm functions.
|
|
|
|
install-lib += libieee.a
|
|
|
|
non-lib.a += libieee.a
|
|
|
|
extra-objs += libieee.a ieee-math.o
|
|
|
|
|
1995-02-18 01:27:10 +00:00
|
|
|
include ../Rules
|
|
|
|
|
2016-09-08 13:48:08 +00:00
|
|
|
gen-all-calls = $(gen-libm-calls) $(gen-calls)
|
|
|
|
|
|
|
|
generated += $(addsuffix .c,$(call type-foreach,$(gen-all-calls))) \
|
2016-06-14 16:44:14 +00:00
|
|
|
gen-libm-templates.stmp
|
|
|
|
|
|
|
|
# Create wrappers in the math build directory.
|
2016-09-08 13:48:08 +00:00
|
|
|
$(objpfx)gen-libm-templates.stmp: Makefile
|
|
|
|
$(make-target-directory)
|
|
|
|
for gcall in $(gen-all-calls); do \
|
2016-06-14 16:44:14 +00:00
|
|
|
func=$${gcall%F*}$${gcall#*F}; \
|
|
|
|
for type in $(foreach t,$(types),$(t)__$(type-$(t)-suffix)); do \
|
|
|
|
suff=$${type#*__}; \
|
|
|
|
type=$${type%__*}; \
|
|
|
|
file=$(objpfx)$${gcall%F*}$${suff}$${gcall#*F}.c; \
|
|
|
|
( \
|
|
|
|
echo "#include <math-type-macros-$${type}.h>"; \
|
|
|
|
echo "#include <$${func}_template.c>"; \
|
|
|
|
) > $${file}; \
|
|
|
|
done; \
|
|
|
|
done; \
|
|
|
|
echo > $(@)
|
|
|
|
|
|
|
|
# Add dependency to ensure the generator runs prior.
|
2016-09-08 13:48:08 +00:00
|
|
|
$(foreach t, $(call type-foreach, $(gen-all-calls)), \
|
2016-06-14 16:44:14 +00:00
|
|
|
$(objpfx)$(t).c): $(objpfx)gen-libm-templates.stmp
|
|
|
|
|
New Makefile target `regen-ulps'.
The wiki "Regeneration" page has this to say about update ULPs.
"The libm-test-ulps files are semiautomatically updated. To
update an ulps baseline, run each of the failing tests (test-float,
test-double, etc.) with -u; this will generate a file called ULPs;
concatenate each of those files with the existing libm-test-ulps
file, after removing any entries for particularly huge numbers of
ulps that you do not want to mark as expected. Then run
gen-libm-test.pl -n -u FILE where FILE is the concatenated file
produced in the previous step. This generates a file called
NewUlps which is the new sorted version of libm-test-ulps."
The same information is listed in math/README.libm-test, and is a
lot of manual work that you often want to run over-and-over again
while working on a particular test.
The `regen-ulps' convenience target does this automatically for
developers.
We strictly assume the source tree is readonly and add a
new --output-dir option to libm-test.inc to allow for writing
out ULPs to $(objpfx).
When run the new target does the following:
* Starts with the baseline ULPs file.
* Runs each of the libm math tests with -u.
* Adds new changes seen with -u to the baseline.
* Sorts and prepares the test output with gen-libm-test.pl.
* Leaves math/NewUlps in your build tree to copy to your source
tree, cleanup, and checkin.
The math test documentation in math/README.libm-test is updated
document the new Makefile target.
---
2013-04-06 Carlos O'Donell <carlos@redhat.com>
* Makefile.in (regen-ulps): New target.
* math/Makefile [ifneq (no,$(PERL)]: Declare regen-ulps with .PHONY.
[ifneq (no,$(PERL)] (run-regen-ulps): New variable.
[ifneq (no,$(PERL)] (regen-ulps): New target.
[ifeq (no,$(PERL)] (regen-ulps): New target.
* math/libm-test.inc (ulps_file_name): Define.
(output_dir): New variable.
(options): Add "output-dir" option.
(parse_opt): Handle 'o' case.
(main): If output_dir is non-NULL use it as a prefix
otherwise use "".
* math/README.libm-test: Update `How can I generate "libm-test-ulps"?'
2013-04-06 20:22:47 +00:00
|
|
|
ifneq (no,$(PERL))
|
2015-06-23 16:27:25 +00:00
|
|
|
# This must come after the inclusion of sysdeps Makefiles via Rules.
|
|
|
|
|
Run libm tests separately for each function.
At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
over 50 MB of libm-test-*.c sources.
This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 50
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).
All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.
This should reduce the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.
Tested for x86_64 and x86.
* math/Makefile (libm-tests-generated): Remove variable.
(libm-tests-base-normal): New variable.
(libm-tests-base-finite): Likewise.
(libm-tests-base-inline): Likewise.
(libm-tests-base): Likewise.
(libm-tests-normal): Likewise.
(libm-tests-finite): Likewise.
(libm-tests-inline): Likewise.
(libm-tests-vector): Likewise.
(libm-tests): Define in terms of these new variables.
(libm-tests-for-type): New variable.
(libm-tests.o): Move definition.
(tests): Move addition of $(libm-tests).
(generated): Update for new and removed libm test files.
($(objpfx)libm-test.c): Remove target.
($(objpfx)libm-have-vector-test.h): Likewise.
(CFLAGS-test-double-vlen2.c): Remove variable.
(CFLAGS-test-double-vlen4.c): Likewise.
(CFLAGS-test-double-vlen8.c): Likewise.
(CFLAGS-test-float-vlen4.c): Likewise.
(CFLAGS-test-float-vlen8.c): Likewise.
(CFLAGS-test-float-vlen16.c): Likewise.
(CFLAGS-test-float.c): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-libm-test-support-float.c): Likewise.
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
(libm-test-inline-cflags): New variable.
(CFLAGS-test-ifloat.c): Remove variable.
(CFLAGS-test-idouble.c): Likewise.
(CFLAGS-test-ildouble.c): Likewise.
($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
dependencies.
($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
Likewise.
(dependencies on libm-test-support-*.o): Remove.
($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
rules using iterators.
($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
Likewise.
($(objpfx)libm-test-support-$(o).o): Likewise.
($(addprefix $(objpfx),$(filter-out $(tests-static)
$(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
instead.
($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
define rule instead.
* math/README.libm-test: Update.
* math/libm-test-acos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-acosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-canonicalize.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-carg.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cbrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ceil.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cimag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-conj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-copysign.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cpow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cproj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-creal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erfc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-expm1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fdim.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-floor.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmax.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fminmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmod.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fpclassify.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-frexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-getpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-hypot.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ilogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iscanonical.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iseqsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isfinite.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isinf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isless.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issignaling.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issubnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isunordered.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iszero.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-jn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log1p.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-logb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-modf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nearbyint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextafter.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextdown.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nexttoward.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextup.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-pow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remainder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remquo.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-rint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-round.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-roundeven.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbln.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-signbit.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-significand.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sincos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalorder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalordermag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-trunc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-yn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-driver.c: Do not include libm-have-vector-test.h.
(HAVE_VECTOR): Remove macro.
(START): Do not call HAVE_VECTOR.
* math/test-double-vlen2.h (FUNC_TEST): Remove macro.
* math/test-double-vlen4.h (FUNC_TEST): Remove macro.
* math/test-double-vlen8.h (FUNC_TEST): Remove macro.
* math/test-float-vlen16.h (FUNC_TEST): Remove macro.
* math/test-float-vlen4.h (FUNC_TEST): Remove macro.
* math/test-float-vlen8.h (FUNC_TEST): Remove macro.
* math/test-math-vector.h (FUNC_TEST): New macro.
(WRAPPER_DECL): Rename to WRAPPER_DECL_f.
* sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
(double-vlen4-funcs): Likewise.
(double-vlen4-avx2-funcs): Likewise.
(double-vlen8-funcs): Likewise.
(float-vlen4-funcs): Likewise.
(float-vlen8-funcs): Likewise.
(float-vlen8-avx2-funcs): Likewise.
(float-vlen16-funcs): Likewise.
(CFLAGS-test-double-vlen4-avx2.c): Remove variable.
(CFLAGS-test-float-vlen8-avx2.c): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
macro.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
Likewise.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* math/gen-libm-have-vector-test.sh: Remove file.
* math/libm-test.inc: Likewise.
* math/libm-test-support-double.c: Likewise.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/test-double-finite.c: Likewise.: Likewise.
* math/test-double.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildouble.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2017-02-24 00:51:45 +00:00
|
|
|
$(foreach t,$(libm-tests-normal),$(objpfx)$(t).c): $(objpfx)test-%.c:
|
|
|
|
type_func=$*; \
|
|
|
|
type=$${type_func%%-*}; \
|
|
|
|
func=$${type_func#*-}; \
|
|
|
|
( \
|
|
|
|
echo "#include <test-$$type.h>"; \
|
|
|
|
echo "#include <test-math-no-finite.h>"; \
|
|
|
|
echo "#include <test-math-no-inline.h>"; \
|
|
|
|
echo "#include <test-math-errno.h>"; \
|
|
|
|
echo "#include <test-math-scalar.h>"; \
|
|
|
|
echo "#include <libm-test-$$func.c>"; \
|
|
|
|
) > $@
|
|
|
|
|
|
|
|
$(foreach t,$(libm-tests-finite),$(objpfx)$(t).c): $(objpfx)test-%.c:
|
|
|
|
type_func=$*; \
|
|
|
|
type=$${type_func%%-*}; \
|
|
|
|
func=$${type_func#*-finite-}; \
|
|
|
|
( \
|
|
|
|
echo "#include <test-$$type.h>"; \
|
|
|
|
echo "#include <test-math-finite.h>"; \
|
|
|
|
echo "#include <test-math-no-inline.h>"; \
|
|
|
|
echo "#include <test-math-scalar.h>"; \
|
|
|
|
echo "#include <libm-test-$$func.c>"; \
|
|
|
|
) > $@
|
|
|
|
|
|
|
|
$(foreach t,$(libm-tests-inline),$(objpfx)$(t).c): $(objpfx)test-i%.c:
|
|
|
|
type_func=$*; \
|
|
|
|
type=$${type_func%%-*}; \
|
|
|
|
func=$${type_func#*-}; \
|
|
|
|
( \
|
|
|
|
echo "#include <test-$$type.h>"; \
|
|
|
|
echo "#include <test-math-inline.h>"; \
|
|
|
|
echo "#include <test-math-scalar.h>"; \
|
|
|
|
echo "#include <libm-test-$$func.c>"; \
|
|
|
|
) > $@
|
|
|
|
|
|
|
|
$(foreach t,$(libm-tests-vector),$(objpfx)$(t).c): $(objpfx)test-%.c:
|
|
|
|
type_func=$*; \
|
|
|
|
type=$${type_func%-*}; \
|
|
|
|
func=$${type_func##*-}; \
|
|
|
|
func_args=$$(grep ALL_RM_TEST libm-test-$$func.inc \
|
|
|
|
| sed 's/.*RUN_TEST_LOOP_//;s/_.*//'); \
|
|
|
|
( \
|
|
|
|
echo "#include <test-$$type.h>"; \
|
|
|
|
echo "WRAPPER_DECL_$$func_args (WRAPPER_NAME (FUNC ($$func)))"; \
|
|
|
|
echo "#include <libm-test-$$func.c>"; \
|
|
|
|
) > $@
|
|
|
|
|
|
|
|
$(foreach t,$(types),\
|
|
|
|
$(objpfx)libm-test-support-$(t).c): $(objpfx)libm-test-support-%.c:
|
|
|
|
( \
|
|
|
|
echo "#include <test-$*.h>"; \
|
|
|
|
echo "#include <libm-test-support.c>"; \
|
|
|
|
) > $@
|
|
|
|
|
|
|
|
$(addprefix $(objpfx), $(libm-tests.o)): $(objpfx)libm-test-ulps.h
|
Build most libm-test support code once per type.
libm-test-driver.c contains various functions used in the course of
libm testing, which are built as part of each test using this
machinery.
Currently, these functions get built for three tests for each type
(e.g. test-float, test-ifloat, test-float-finite), plus the vector
function tests. All these tests are huge and thus slow to build; the
output of gen-libm-test.pl totals around 40 MB across all functions.
To make the individual tests built from the Makefile smaller, it makes
sense to split these tests up so the tests for each function are built
separately (thus, three tests for each (function, type) pair, plus
vector tests built only for functions that actually have vector
versions). This improves parallelism and means that if tests fail,
the summary of failed tests makes it more obvious where the problem
might be without needing to look in the .out files to see which
functions' tests failed (though architecture maintainers still need to
keep libm-test-ulps up to date to avoid spurious failures of little
interest).
Simply including libm-test-driver.c as-is in such individual-function
tests does not work because of unused static check_* functions (those
functions only being used for the types of the outputs of the function
under test). It also means the common code gets built over 1000 times
instead of nine (plus vector tests). To avoid that issue, this patch
splits out the bulk of the libm-test-driver.c code into a separate
file libm-test-support.c (with a few functions made non-static). That
separate file is built only once for each floating-point type (so at
present three times, or twice on architectures with long double =
double). Definitions needed in both libm-test-support.c and
libm-test-driver.c go in libm-test-support.h (it's possible some of
those are in fact only needed in one of the two files).
libm-test-driver.c keeps definitions of a limited number of variables
used to configure how libm-test-support.c behaves, various macros and
structures needed by individual-function tests, and the main function.
This move is also consistent in spirit with the move away from
test-skeleton.c having all the test support code, to a small
support/test-driver.c included in individual tests with most of the
code built separately.
Tested for x86_64 and x86.
* math/libm-test-support.c: New file. Content from
math/libm-test-driver.c.
* math/libm-test-support.h: Likewise.
* math/libm-test-support-double.c: New file.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/libm-test-driver.c: Remove main comment and header
includes. Include libm-test-support.h.
[!_GNU_SOURCE] (_GNU_SOURCE): Do not define.
(flag_test_errno): Remove static.
(flag_test_exceptions): Likewise.
(flag_test_finite): Likewise.
(flag_test_inline): Likewise.
(flag_test_mathvec): Likewise.
(test_msg): Likewise.
(NO_EXCEPTION): Remove.
(INVALID_EXCEPTION): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION): Likewise.
(OVERFLOW_EXCEPTION): Likewise.
(UNDERFLOW_EXCEPTION): Likewise.
(INEXACT_EXCEPTION): Likewise.
(INVALID_EXCEPTION_OK): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION_OK): Likewise.
(OVERFLOW_EXCEPTION_OK): Likewise.
(UNDERFLOW_EXCEPTION_OK): Likewise.
(NO_INEXACT_EXCEPTION): Likewise.
(EXCEPTIONS_OK): Likewise.
(IGNORE_ZERO_INF_SIGN): Likewise.
(TEST_NAN_SIGN): Likewise.
(TEST_NAN_PAYLOAD): Likewise.
(NO_TEST_INLINE): Likewise.
(XFAIL_TEST): Likewise.
(ERRNO_UNCHANGED): Likewise.
(ERRNO_EDOM): Likewise.
(ERRNO_ERANGE): Likewise.
(IGNORE_RESULT): Likewise.
(NON_FINITE): Likewise.
(TEST_SNAN): Likewise.
(NO_TEST_MATHVEC): Likewise.
(__CONCATX): Likewise.
(TYPE_MIN): Likewise.
(TYPE_TRUE_MIN): Likewise.
(TYPE_MAX): Likewise.
(MIN_EXP): Likewise.
(MAX_EXP): Likewise.
(MANT_DIG): Likewise.
(FSTR_MAX): Likewise.
(ulp_idx): Likewise.
(qtype_str): Remove static.
(TEST_COND_binary32): Remove.
(TEST_COND_binary64): Likewise.
(TEST_COND_binary128): Likewise.
(TEST_COND_ibm128): Likewise.
(TEST_COND_intel96): Likewise.
(TEST_COND_m68k96): Likewise.
(TEST_COND_ibm128_libgcc): Likewise.
(XFAIL_IBM128_LIBGCC): Likewise.
(PAYLOAD_DIG): Likewise.
(UNDERFLOW_EXCEPTION_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_OK_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_OK_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_LDOUBLE_IBM): Likewise.
(UNDERFLOW_EXCEPTION_BEFORE_ROUNDING): Likewise.
(TEST_COND_long32): Likewise.
(TEST_COND_long64): Likewise.
(TEST_COND_before_rounding): Likewise.
(TEST_COND_after_rounding): Likewise.
(ulps_file_name): Likewise.
(ulps_file): Likewise.
(output_ulps): Likewise.
(output_dir): Likewise.
(noErrors): Likewise.
(noTests): Likewise.
(noExcTests): Likewise.
(noErrnoTests): Likewise.
(verbose): Likewise.
(output_max_error): Likewise.
(output_points): Likewise.
(ignore_max_ulp): Likewise.
(max_error): Likewise.
(real_max_error): Likewise.
(imag_max_error): Likewise.
(prev_max_error): Likewise.
(prev_real_max_error): Likewise.
(prev_imag_max_error): Likewise.
(max_valid_error): Likewise.
(TYPE_DECIMAL_DIG): Likewise.
(TYPE_HEX_DIG): Likewise.
(fmt_ftostr): Likewise.
(compare_ulp_data): Likewise.
(find_ulps): Likewise.
(init_max_error): Likewise.
(set_max_error): Likewise.
(print_float): Likewise.
(print_screen): Likewise.
(print_screen_max_error): Likewise.
(update_stats): Likewise.
(print_function_ulps): Likewise.
(print_complex_function_ulps): Likewise.
(fpstack_test): Likewise.
(print_max_error): Likewise.
(print_complex_max_error): Likewise.
(test_single_exception): Likewise.
(test_exceptions): Likewise.
(test_single_errno): Likewise.
(test_errno): Likewise.
(ULPDIFF): Likewise.
(ulp): Likewise.
(check_float_internal): Likewise.
(check_float): Likewise.
(check_complex): Likewise.
(check_int): Likewise.
(check_long): Likewise.
(check_bool): Likewise.
(check_longlong): Likewise.
(check_intmax_t): Likewise.
(check_uintmax_t): Likewise.
(enable_test): Likewise.
(matherr): Likewise.
(initialize): Likewise.
(options): Likewise.
(doc): Remove static.
(argp): Likewise.
(parse_opt): Remove.
(check_ulp): Likewise.
(libm_test_init): Likewise.
(libm_test_finish): Likewise.
* math/Makefile (libm-test-support): New variable.
(test-extras): Add libm-test-support files.
(extra-test-objs): Likewise.
(CFLAGS-libm-test-support-float.c): New variable.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
($(addprefix $(objpfx),$(libm-tests)): Depend on appropriate
libm-test-support objects.
2017-02-08 21:11:49 +00:00
|
|
|
|
Run libm tests separately for each function.
At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
over 50 MB of libm-test-*.c sources.
This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 50
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).
All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.
This should reduce the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.
Tested for x86_64 and x86.
* math/Makefile (libm-tests-generated): Remove variable.
(libm-tests-base-normal): New variable.
(libm-tests-base-finite): Likewise.
(libm-tests-base-inline): Likewise.
(libm-tests-base): Likewise.
(libm-tests-normal): Likewise.
(libm-tests-finite): Likewise.
(libm-tests-inline): Likewise.
(libm-tests-vector): Likewise.
(libm-tests): Define in terms of these new variables.
(libm-tests-for-type): New variable.
(libm-tests.o): Move definition.
(tests): Move addition of $(libm-tests).
(generated): Update for new and removed libm test files.
($(objpfx)libm-test.c): Remove target.
($(objpfx)libm-have-vector-test.h): Likewise.
(CFLAGS-test-double-vlen2.c): Remove variable.
(CFLAGS-test-double-vlen4.c): Likewise.
(CFLAGS-test-double-vlen8.c): Likewise.
(CFLAGS-test-float-vlen4.c): Likewise.
(CFLAGS-test-float-vlen8.c): Likewise.
(CFLAGS-test-float-vlen16.c): Likewise.
(CFLAGS-test-float.c): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-libm-test-support-float.c): Likewise.
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
(libm-test-inline-cflags): New variable.
(CFLAGS-test-ifloat.c): Remove variable.
(CFLAGS-test-idouble.c): Likewise.
(CFLAGS-test-ildouble.c): Likewise.
($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
dependencies.
($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
Likewise.
(dependencies on libm-test-support-*.o): Remove.
($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
rules using iterators.
($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
Likewise.
($(objpfx)libm-test-support-$(o).o): Likewise.
($(addprefix $(objpfx),$(filter-out $(tests-static)
$(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
instead.
($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
define rule instead.
* math/README.libm-test: Update.
* math/libm-test-acos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-acosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-canonicalize.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-carg.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cbrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ceil.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cimag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-conj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-copysign.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cpow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cproj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-creal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erfc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-expm1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fdim.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-floor.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmax.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fminmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmod.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fpclassify.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-frexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-getpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-hypot.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ilogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iscanonical.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iseqsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isfinite.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isinf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isless.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issignaling.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issubnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isunordered.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iszero.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-jn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log1p.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-logb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-modf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nearbyint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextafter.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextdown.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nexttoward.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextup.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-pow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remainder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remquo.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-rint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-round.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-roundeven.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbln.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-signbit.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-significand.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sincos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalorder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalordermag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-trunc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-yn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-driver.c: Do not include libm-have-vector-test.h.
(HAVE_VECTOR): Remove macro.
(START): Do not call HAVE_VECTOR.
* math/test-double-vlen2.h (FUNC_TEST): Remove macro.
* math/test-double-vlen4.h (FUNC_TEST): Remove macro.
* math/test-double-vlen8.h (FUNC_TEST): Remove macro.
* math/test-float-vlen16.h (FUNC_TEST): Remove macro.
* math/test-float-vlen4.h (FUNC_TEST): Remove macro.
* math/test-float-vlen8.h (FUNC_TEST): Remove macro.
* math/test-math-vector.h (FUNC_TEST): New macro.
(WRAPPER_DECL): Rename to WRAPPER_DECL_f.
* sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
(double-vlen4-funcs): Likewise.
(double-vlen4-avx2-funcs): Likewise.
(double-vlen8-funcs): Likewise.
(float-vlen4-funcs): Likewise.
(float-vlen8-funcs): Likewise.
(float-vlen8-avx2-funcs): Likewise.
(float-vlen16-funcs): Likewise.
(CFLAGS-test-double-vlen4-avx2.c): Remove variable.
(CFLAGS-test-float-vlen8-avx2.c): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
macro.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
Likewise.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* math/gen-libm-have-vector-test.sh: Remove file.
* math/libm-test.inc: Likewise.
* math/libm-test-support-double.c: Likewise.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/test-double-finite.c: Likewise.: Likewise.
* math/test-double.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildouble.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2017-02-24 00:51:45 +00:00
|
|
|
define o-iterator-doit
|
|
|
|
$(foreach f,$(libm-test-funcs-all),\
|
|
|
|
$(objpfx)$(o)-$(f).o): $(objpfx)$(o)%.o: $(objpfx)libm-test%.c
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(libm-tests-base)
|
|
|
|
include $(o-iterator)
|
|
|
|
|
|
|
|
define o-iterator-doit
|
|
|
|
$(foreach f,$(libm-test-funcs-all),\
|
|
|
|
$(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-no-inline-cflags)
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(libm-tests-base-normal)
|
|
|
|
include $(o-iterator)
|
Build most libm-test support code once per type.
libm-test-driver.c contains various functions used in the course of
libm testing, which are built as part of each test using this
machinery.
Currently, these functions get built for three tests for each type
(e.g. test-float, test-ifloat, test-float-finite), plus the vector
function tests. All these tests are huge and thus slow to build; the
output of gen-libm-test.pl totals around 40 MB across all functions.
To make the individual tests built from the Makefile smaller, it makes
sense to split these tests up so the tests for each function are built
separately (thus, three tests for each (function, type) pair, plus
vector tests built only for functions that actually have vector
versions). This improves parallelism and means that if tests fail,
the summary of failed tests makes it more obvious where the problem
might be without needing to look in the .out files to see which
functions' tests failed (though architecture maintainers still need to
keep libm-test-ulps up to date to avoid spurious failures of little
interest).
Simply including libm-test-driver.c as-is in such individual-function
tests does not work because of unused static check_* functions (those
functions only being used for the types of the outputs of the function
under test). It also means the common code gets built over 1000 times
instead of nine (plus vector tests). To avoid that issue, this patch
splits out the bulk of the libm-test-driver.c code into a separate
file libm-test-support.c (with a few functions made non-static). That
separate file is built only once for each floating-point type (so at
present three times, or twice on architectures with long double =
double). Definitions needed in both libm-test-support.c and
libm-test-driver.c go in libm-test-support.h (it's possible some of
those are in fact only needed in one of the two files).
libm-test-driver.c keeps definitions of a limited number of variables
used to configure how libm-test-support.c behaves, various macros and
structures needed by individual-function tests, and the main function.
This move is also consistent in spirit with the move away from
test-skeleton.c having all the test support code, to a small
support/test-driver.c included in individual tests with most of the
code built separately.
Tested for x86_64 and x86.
* math/libm-test-support.c: New file. Content from
math/libm-test-driver.c.
* math/libm-test-support.h: Likewise.
* math/libm-test-support-double.c: New file.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/libm-test-driver.c: Remove main comment and header
includes. Include libm-test-support.h.
[!_GNU_SOURCE] (_GNU_SOURCE): Do not define.
(flag_test_errno): Remove static.
(flag_test_exceptions): Likewise.
(flag_test_finite): Likewise.
(flag_test_inline): Likewise.
(flag_test_mathvec): Likewise.
(test_msg): Likewise.
(NO_EXCEPTION): Remove.
(INVALID_EXCEPTION): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION): Likewise.
(OVERFLOW_EXCEPTION): Likewise.
(UNDERFLOW_EXCEPTION): Likewise.
(INEXACT_EXCEPTION): Likewise.
(INVALID_EXCEPTION_OK): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION_OK): Likewise.
(OVERFLOW_EXCEPTION_OK): Likewise.
(UNDERFLOW_EXCEPTION_OK): Likewise.
(NO_INEXACT_EXCEPTION): Likewise.
(EXCEPTIONS_OK): Likewise.
(IGNORE_ZERO_INF_SIGN): Likewise.
(TEST_NAN_SIGN): Likewise.
(TEST_NAN_PAYLOAD): Likewise.
(NO_TEST_INLINE): Likewise.
(XFAIL_TEST): Likewise.
(ERRNO_UNCHANGED): Likewise.
(ERRNO_EDOM): Likewise.
(ERRNO_ERANGE): Likewise.
(IGNORE_RESULT): Likewise.
(NON_FINITE): Likewise.
(TEST_SNAN): Likewise.
(NO_TEST_MATHVEC): Likewise.
(__CONCATX): Likewise.
(TYPE_MIN): Likewise.
(TYPE_TRUE_MIN): Likewise.
(TYPE_MAX): Likewise.
(MIN_EXP): Likewise.
(MAX_EXP): Likewise.
(MANT_DIG): Likewise.
(FSTR_MAX): Likewise.
(ulp_idx): Likewise.
(qtype_str): Remove static.
(TEST_COND_binary32): Remove.
(TEST_COND_binary64): Likewise.
(TEST_COND_binary128): Likewise.
(TEST_COND_ibm128): Likewise.
(TEST_COND_intel96): Likewise.
(TEST_COND_m68k96): Likewise.
(TEST_COND_ibm128_libgcc): Likewise.
(XFAIL_IBM128_LIBGCC): Likewise.
(PAYLOAD_DIG): Likewise.
(UNDERFLOW_EXCEPTION_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_OK_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_OK_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_LDOUBLE_IBM): Likewise.
(UNDERFLOW_EXCEPTION_BEFORE_ROUNDING): Likewise.
(TEST_COND_long32): Likewise.
(TEST_COND_long64): Likewise.
(TEST_COND_before_rounding): Likewise.
(TEST_COND_after_rounding): Likewise.
(ulps_file_name): Likewise.
(ulps_file): Likewise.
(output_ulps): Likewise.
(output_dir): Likewise.
(noErrors): Likewise.
(noTests): Likewise.
(noExcTests): Likewise.
(noErrnoTests): Likewise.
(verbose): Likewise.
(output_max_error): Likewise.
(output_points): Likewise.
(ignore_max_ulp): Likewise.
(max_error): Likewise.
(real_max_error): Likewise.
(imag_max_error): Likewise.
(prev_max_error): Likewise.
(prev_real_max_error): Likewise.
(prev_imag_max_error): Likewise.
(max_valid_error): Likewise.
(TYPE_DECIMAL_DIG): Likewise.
(TYPE_HEX_DIG): Likewise.
(fmt_ftostr): Likewise.
(compare_ulp_data): Likewise.
(find_ulps): Likewise.
(init_max_error): Likewise.
(set_max_error): Likewise.
(print_float): Likewise.
(print_screen): Likewise.
(print_screen_max_error): Likewise.
(update_stats): Likewise.
(print_function_ulps): Likewise.
(print_complex_function_ulps): Likewise.
(fpstack_test): Likewise.
(print_max_error): Likewise.
(print_complex_max_error): Likewise.
(test_single_exception): Likewise.
(test_exceptions): Likewise.
(test_single_errno): Likewise.
(test_errno): Likewise.
(ULPDIFF): Likewise.
(ulp): Likewise.
(check_float_internal): Likewise.
(check_float): Likewise.
(check_complex): Likewise.
(check_int): Likewise.
(check_long): Likewise.
(check_bool): Likewise.
(check_longlong): Likewise.
(check_intmax_t): Likewise.
(check_uintmax_t): Likewise.
(enable_test): Likewise.
(matherr): Likewise.
(initialize): Likewise.
(options): Likewise.
(doc): Remove static.
(argp): Likewise.
(parse_opt): Remove.
(check_ulp): Likewise.
(libm_test_init): Likewise.
(libm_test_finish): Likewise.
* math/Makefile (libm-test-support): New variable.
(test-extras): Add libm-test-support files.
(extra-test-objs): Likewise.
(CFLAGS-libm-test-support-float.c): New variable.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
($(addprefix $(objpfx),$(libm-tests)): Depend on appropriate
libm-test-support objects.
2017-02-08 21:11:49 +00:00
|
|
|
|
Run libm tests separately for each function.
At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
over 50 MB of libm-test-*.c sources.
This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 50
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).
All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.
This should reduce the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.
Tested for x86_64 and x86.
* math/Makefile (libm-tests-generated): Remove variable.
(libm-tests-base-normal): New variable.
(libm-tests-base-finite): Likewise.
(libm-tests-base-inline): Likewise.
(libm-tests-base): Likewise.
(libm-tests-normal): Likewise.
(libm-tests-finite): Likewise.
(libm-tests-inline): Likewise.
(libm-tests-vector): Likewise.
(libm-tests): Define in terms of these new variables.
(libm-tests-for-type): New variable.
(libm-tests.o): Move definition.
(tests): Move addition of $(libm-tests).
(generated): Update for new and removed libm test files.
($(objpfx)libm-test.c): Remove target.
($(objpfx)libm-have-vector-test.h): Likewise.
(CFLAGS-test-double-vlen2.c): Remove variable.
(CFLAGS-test-double-vlen4.c): Likewise.
(CFLAGS-test-double-vlen8.c): Likewise.
(CFLAGS-test-float-vlen4.c): Likewise.
(CFLAGS-test-float-vlen8.c): Likewise.
(CFLAGS-test-float-vlen16.c): Likewise.
(CFLAGS-test-float.c): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-libm-test-support-float.c): Likewise.
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
(libm-test-inline-cflags): New variable.
(CFLAGS-test-ifloat.c): Remove variable.
(CFLAGS-test-idouble.c): Likewise.
(CFLAGS-test-ildouble.c): Likewise.
($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
dependencies.
($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
Likewise.
(dependencies on libm-test-support-*.o): Remove.
($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
rules using iterators.
($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
Likewise.
($(objpfx)libm-test-support-$(o).o): Likewise.
($(addprefix $(objpfx),$(filter-out $(tests-static)
$(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
instead.
($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
define rule instead.
* math/README.libm-test: Update.
* math/libm-test-acos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-acosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-canonicalize.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-carg.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cbrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ceil.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cimag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-conj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-copysign.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cpow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cproj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-creal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erfc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-expm1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fdim.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-floor.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmax.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fminmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmod.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fpclassify.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-frexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-getpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-hypot.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ilogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iscanonical.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iseqsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isfinite.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isinf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isless.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issignaling.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issubnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isunordered.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iszero.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-jn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log1p.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-logb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-modf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nearbyint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextafter.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextdown.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nexttoward.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextup.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-pow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remainder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remquo.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-rint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-round.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-roundeven.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbln.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-signbit.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-significand.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sincos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalorder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalordermag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-trunc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-yn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-driver.c: Do not include libm-have-vector-test.h.
(HAVE_VECTOR): Remove macro.
(START): Do not call HAVE_VECTOR.
* math/test-double-vlen2.h (FUNC_TEST): Remove macro.
* math/test-double-vlen4.h (FUNC_TEST): Remove macro.
* math/test-double-vlen8.h (FUNC_TEST): Remove macro.
* math/test-float-vlen16.h (FUNC_TEST): Remove macro.
* math/test-float-vlen4.h (FUNC_TEST): Remove macro.
* math/test-float-vlen8.h (FUNC_TEST): Remove macro.
* math/test-math-vector.h (FUNC_TEST): New macro.
(WRAPPER_DECL): Rename to WRAPPER_DECL_f.
* sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
(double-vlen4-funcs): Likewise.
(double-vlen4-avx2-funcs): Likewise.
(double-vlen8-funcs): Likewise.
(float-vlen4-funcs): Likewise.
(float-vlen8-funcs): Likewise.
(float-vlen8-avx2-funcs): Likewise.
(float-vlen16-funcs): Likewise.
(CFLAGS-test-double-vlen4-avx2.c): Remove variable.
(CFLAGS-test-float-vlen8-avx2.c): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
macro.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
Likewise.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* math/gen-libm-have-vector-test.sh: Remove file.
* math/libm-test.inc: Likewise.
* math/libm-test-support-double.c: Likewise.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/test-double-finite.c: Likewise.: Likewise.
* math/test-double.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildouble.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2017-02-24 00:51:45 +00:00
|
|
|
define o-iterator-doit
|
|
|
|
$(foreach f,$(libm-test-funcs-all),\
|
|
|
|
$(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-finite-cflags)
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(libm-tests-base-finite)
|
|
|
|
include $(o-iterator)
|
|
|
|
|
|
|
|
define o-iterator-doit
|
|
|
|
$(foreach f,$(libm-test-funcs-all),\
|
|
|
|
$(objpfx)$(o)-$(f).o): CFLAGS += $(libm-test-inline-cflags)
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(libm-tests-base-inline)
|
|
|
|
include $(o-iterator)
|
|
|
|
|
|
|
|
define o-iterator-doit
|
|
|
|
$(foreach f,$($(o)-funcs),\
|
|
|
|
$(objpfx)test-$(o)-$(f).o): CFLAGS += $(libm-test-vec-cflags)
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(libmvec-tests)
|
|
|
|
include $(o-iterator)
|
|
|
|
|
|
|
|
define o-iterator-doit
|
Build most libm-test support code once per type.
libm-test-driver.c contains various functions used in the course of
libm testing, which are built as part of each test using this
machinery.
Currently, these functions get built for three tests for each type
(e.g. test-float, test-ifloat, test-float-finite), plus the vector
function tests. All these tests are huge and thus slow to build; the
output of gen-libm-test.pl totals around 40 MB across all functions.
To make the individual tests built from the Makefile smaller, it makes
sense to split these tests up so the tests for each function are built
separately (thus, three tests for each (function, type) pair, plus
vector tests built only for functions that actually have vector
versions). This improves parallelism and means that if tests fail,
the summary of failed tests makes it more obvious where the problem
might be without needing to look in the .out files to see which
functions' tests failed (though architecture maintainers still need to
keep libm-test-ulps up to date to avoid spurious failures of little
interest).
Simply including libm-test-driver.c as-is in such individual-function
tests does not work because of unused static check_* functions (those
functions only being used for the types of the outputs of the function
under test). It also means the common code gets built over 1000 times
instead of nine (plus vector tests). To avoid that issue, this patch
splits out the bulk of the libm-test-driver.c code into a separate
file libm-test-support.c (with a few functions made non-static). That
separate file is built only once for each floating-point type (so at
present three times, or twice on architectures with long double =
double). Definitions needed in both libm-test-support.c and
libm-test-driver.c go in libm-test-support.h (it's possible some of
those are in fact only needed in one of the two files).
libm-test-driver.c keeps definitions of a limited number of variables
used to configure how libm-test-support.c behaves, various macros and
structures needed by individual-function tests, and the main function.
This move is also consistent in spirit with the move away from
test-skeleton.c having all the test support code, to a small
support/test-driver.c included in individual tests with most of the
code built separately.
Tested for x86_64 and x86.
* math/libm-test-support.c: New file. Content from
math/libm-test-driver.c.
* math/libm-test-support.h: Likewise.
* math/libm-test-support-double.c: New file.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/libm-test-driver.c: Remove main comment and header
includes. Include libm-test-support.h.
[!_GNU_SOURCE] (_GNU_SOURCE): Do not define.
(flag_test_errno): Remove static.
(flag_test_exceptions): Likewise.
(flag_test_finite): Likewise.
(flag_test_inline): Likewise.
(flag_test_mathvec): Likewise.
(test_msg): Likewise.
(NO_EXCEPTION): Remove.
(INVALID_EXCEPTION): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION): Likewise.
(OVERFLOW_EXCEPTION): Likewise.
(UNDERFLOW_EXCEPTION): Likewise.
(INEXACT_EXCEPTION): Likewise.
(INVALID_EXCEPTION_OK): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION_OK): Likewise.
(OVERFLOW_EXCEPTION_OK): Likewise.
(UNDERFLOW_EXCEPTION_OK): Likewise.
(NO_INEXACT_EXCEPTION): Likewise.
(EXCEPTIONS_OK): Likewise.
(IGNORE_ZERO_INF_SIGN): Likewise.
(TEST_NAN_SIGN): Likewise.
(TEST_NAN_PAYLOAD): Likewise.
(NO_TEST_INLINE): Likewise.
(XFAIL_TEST): Likewise.
(ERRNO_UNCHANGED): Likewise.
(ERRNO_EDOM): Likewise.
(ERRNO_ERANGE): Likewise.
(IGNORE_RESULT): Likewise.
(NON_FINITE): Likewise.
(TEST_SNAN): Likewise.
(NO_TEST_MATHVEC): Likewise.
(__CONCATX): Likewise.
(TYPE_MIN): Likewise.
(TYPE_TRUE_MIN): Likewise.
(TYPE_MAX): Likewise.
(MIN_EXP): Likewise.
(MAX_EXP): Likewise.
(MANT_DIG): Likewise.
(FSTR_MAX): Likewise.
(ulp_idx): Likewise.
(qtype_str): Remove static.
(TEST_COND_binary32): Remove.
(TEST_COND_binary64): Likewise.
(TEST_COND_binary128): Likewise.
(TEST_COND_ibm128): Likewise.
(TEST_COND_intel96): Likewise.
(TEST_COND_m68k96): Likewise.
(TEST_COND_ibm128_libgcc): Likewise.
(XFAIL_IBM128_LIBGCC): Likewise.
(PAYLOAD_DIG): Likewise.
(UNDERFLOW_EXCEPTION_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_OK_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_OK_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_LDOUBLE_IBM): Likewise.
(UNDERFLOW_EXCEPTION_BEFORE_ROUNDING): Likewise.
(TEST_COND_long32): Likewise.
(TEST_COND_long64): Likewise.
(TEST_COND_before_rounding): Likewise.
(TEST_COND_after_rounding): Likewise.
(ulps_file_name): Likewise.
(ulps_file): Likewise.
(output_ulps): Likewise.
(output_dir): Likewise.
(noErrors): Likewise.
(noTests): Likewise.
(noExcTests): Likewise.
(noErrnoTests): Likewise.
(verbose): Likewise.
(output_max_error): Likewise.
(output_points): Likewise.
(ignore_max_ulp): Likewise.
(max_error): Likewise.
(real_max_error): Likewise.
(imag_max_error): Likewise.
(prev_max_error): Likewise.
(prev_real_max_error): Likewise.
(prev_imag_max_error): Likewise.
(max_valid_error): Likewise.
(TYPE_DECIMAL_DIG): Likewise.
(TYPE_HEX_DIG): Likewise.
(fmt_ftostr): Likewise.
(compare_ulp_data): Likewise.
(find_ulps): Likewise.
(init_max_error): Likewise.
(set_max_error): Likewise.
(print_float): Likewise.
(print_screen): Likewise.
(print_screen_max_error): Likewise.
(update_stats): Likewise.
(print_function_ulps): Likewise.
(print_complex_function_ulps): Likewise.
(fpstack_test): Likewise.
(print_max_error): Likewise.
(print_complex_max_error): Likewise.
(test_single_exception): Likewise.
(test_exceptions): Likewise.
(test_single_errno): Likewise.
(test_errno): Likewise.
(ULPDIFF): Likewise.
(ulp): Likewise.
(check_float_internal): Likewise.
(check_float): Likewise.
(check_complex): Likewise.
(check_int): Likewise.
(check_long): Likewise.
(check_bool): Likewise.
(check_longlong): Likewise.
(check_intmax_t): Likewise.
(check_uintmax_t): Likewise.
(enable_test): Likewise.
(matherr): Likewise.
(initialize): Likewise.
(options): Likewise.
(doc): Remove static.
(argp): Likewise.
(parse_opt): Remove.
(check_ulp): Likewise.
(libm_test_init): Likewise.
(libm_test_finish): Likewise.
* math/Makefile (libm-test-support): New variable.
(test-extras): Add libm-test-support files.
(extra-test-objs): Likewise.
(CFLAGS-libm-test-support-float.c): New variable.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
($(addprefix $(objpfx),$(libm-tests)): Depend on appropriate
libm-test-support objects.
2017-02-08 21:11:49 +00:00
|
|
|
$(addprefix $(objpfx),\
|
Run libm tests separately for each function.
At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
over 50 MB of libm-test-*.c sources.
This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 50
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).
All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.
This should reduce the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.
Tested for x86_64 and x86.
* math/Makefile (libm-tests-generated): Remove variable.
(libm-tests-base-normal): New variable.
(libm-tests-base-finite): Likewise.
(libm-tests-base-inline): Likewise.
(libm-tests-base): Likewise.
(libm-tests-normal): Likewise.
(libm-tests-finite): Likewise.
(libm-tests-inline): Likewise.
(libm-tests-vector): Likewise.
(libm-tests): Define in terms of these new variables.
(libm-tests-for-type): New variable.
(libm-tests.o): Move definition.
(tests): Move addition of $(libm-tests).
(generated): Update for new and removed libm test files.
($(objpfx)libm-test.c): Remove target.
($(objpfx)libm-have-vector-test.h): Likewise.
(CFLAGS-test-double-vlen2.c): Remove variable.
(CFLAGS-test-double-vlen4.c): Likewise.
(CFLAGS-test-double-vlen8.c): Likewise.
(CFLAGS-test-float-vlen4.c): Likewise.
(CFLAGS-test-float-vlen8.c): Likewise.
(CFLAGS-test-float-vlen16.c): Likewise.
(CFLAGS-test-float.c): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-libm-test-support-float.c): Likewise.
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
(libm-test-inline-cflags): New variable.
(CFLAGS-test-ifloat.c): Remove variable.
(CFLAGS-test-idouble.c): Likewise.
(CFLAGS-test-ildouble.c): Likewise.
($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
dependencies.
($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
Likewise.
(dependencies on libm-test-support-*.o): Remove.
($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
rules using iterators.
($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
Likewise.
($(objpfx)libm-test-support-$(o).o): Likewise.
($(addprefix $(objpfx),$(filter-out $(tests-static)
$(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
instead.
($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
define rule instead.
* math/README.libm-test: Update.
* math/libm-test-acos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-acosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-canonicalize.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-carg.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cbrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ceil.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cimag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-conj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-copysign.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cpow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cproj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-creal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erfc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-expm1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fdim.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-floor.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmax.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fminmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmod.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fpclassify.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-frexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-getpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-hypot.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ilogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iscanonical.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iseqsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isfinite.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isinf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isless.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issignaling.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issubnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isunordered.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iszero.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-jn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log1p.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-logb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-modf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nearbyint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextafter.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextdown.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nexttoward.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextup.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-pow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remainder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remquo.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-rint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-round.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-roundeven.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbln.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-signbit.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-significand.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sincos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalorder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalordermag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-trunc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-yn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-driver.c: Do not include libm-have-vector-test.h.
(HAVE_VECTOR): Remove macro.
(START): Do not call HAVE_VECTOR.
* math/test-double-vlen2.h (FUNC_TEST): Remove macro.
* math/test-double-vlen4.h (FUNC_TEST): Remove macro.
* math/test-double-vlen8.h (FUNC_TEST): Remove macro.
* math/test-float-vlen16.h (FUNC_TEST): Remove macro.
* math/test-float-vlen4.h (FUNC_TEST): Remove macro.
* math/test-float-vlen8.h (FUNC_TEST): Remove macro.
* math/test-math-vector.h (FUNC_TEST): New macro.
(WRAPPER_DECL): Rename to WRAPPER_DECL_f.
* sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
(double-vlen4-funcs): Likewise.
(double-vlen4-avx2-funcs): Likewise.
(double-vlen8-funcs): Likewise.
(float-vlen4-funcs): Likewise.
(float-vlen8-funcs): Likewise.
(float-vlen8-avx2-funcs): Likewise.
(float-vlen16-funcs): Likewise.
(CFLAGS-test-double-vlen4-avx2.c): Remove variable.
(CFLAGS-test-float-vlen8-avx2.c): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
macro.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
Likewise.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* math/gen-libm-have-vector-test.sh: Remove file.
* math/libm-test.inc: Likewise.
* math/libm-test-support-double.c: Likewise.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/test-double-finite.c: Likewise.: Likewise.
* math/test-double.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildouble.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2017-02-24 00:51:45 +00:00
|
|
|
$(call libm-tests-for-type,$(o))): $(objpfx)libm-test-support-$(o).o
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(types)
|
|
|
|
include $(o-iterator)
|
|
|
|
|
|
|
|
define o-iterator-doit
|
|
|
|
$(objpfx)libm-test-support-$(o).o: CFLAGS += $(libm-test-no-inline-cflags)
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(types)
|
|
|
|
include $(o-iterator)
|
Build most libm-test support code once per type.
libm-test-driver.c contains various functions used in the course of
libm testing, which are built as part of each test using this
machinery.
Currently, these functions get built for three tests for each type
(e.g. test-float, test-ifloat, test-float-finite), plus the vector
function tests. All these tests are huge and thus slow to build; the
output of gen-libm-test.pl totals around 40 MB across all functions.
To make the individual tests built from the Makefile smaller, it makes
sense to split these tests up so the tests for each function are built
separately (thus, three tests for each (function, type) pair, plus
vector tests built only for functions that actually have vector
versions). This improves parallelism and means that if tests fail,
the summary of failed tests makes it more obvious where the problem
might be without needing to look in the .out files to see which
functions' tests failed (though architecture maintainers still need to
keep libm-test-ulps up to date to avoid spurious failures of little
interest).
Simply including libm-test-driver.c as-is in such individual-function
tests does not work because of unused static check_* functions (those
functions only being used for the types of the outputs of the function
under test). It also means the common code gets built over 1000 times
instead of nine (plus vector tests). To avoid that issue, this patch
splits out the bulk of the libm-test-driver.c code into a separate
file libm-test-support.c (with a few functions made non-static). That
separate file is built only once for each floating-point type (so at
present three times, or twice on architectures with long double =
double). Definitions needed in both libm-test-support.c and
libm-test-driver.c go in libm-test-support.h (it's possible some of
those are in fact only needed in one of the two files).
libm-test-driver.c keeps definitions of a limited number of variables
used to configure how libm-test-support.c behaves, various macros and
structures needed by individual-function tests, and the main function.
This move is also consistent in spirit with the move away from
test-skeleton.c having all the test support code, to a small
support/test-driver.c included in individual tests with most of the
code built separately.
Tested for x86_64 and x86.
* math/libm-test-support.c: New file. Content from
math/libm-test-driver.c.
* math/libm-test-support.h: Likewise.
* math/libm-test-support-double.c: New file.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/libm-test-driver.c: Remove main comment and header
includes. Include libm-test-support.h.
[!_GNU_SOURCE] (_GNU_SOURCE): Do not define.
(flag_test_errno): Remove static.
(flag_test_exceptions): Likewise.
(flag_test_finite): Likewise.
(flag_test_inline): Likewise.
(flag_test_mathvec): Likewise.
(test_msg): Likewise.
(NO_EXCEPTION): Remove.
(INVALID_EXCEPTION): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION): Likewise.
(OVERFLOW_EXCEPTION): Likewise.
(UNDERFLOW_EXCEPTION): Likewise.
(INEXACT_EXCEPTION): Likewise.
(INVALID_EXCEPTION_OK): Likewise.
(DIVIDE_BY_ZERO_EXCEPTION_OK): Likewise.
(OVERFLOW_EXCEPTION_OK): Likewise.
(UNDERFLOW_EXCEPTION_OK): Likewise.
(NO_INEXACT_EXCEPTION): Likewise.
(EXCEPTIONS_OK): Likewise.
(IGNORE_ZERO_INF_SIGN): Likewise.
(TEST_NAN_SIGN): Likewise.
(TEST_NAN_PAYLOAD): Likewise.
(NO_TEST_INLINE): Likewise.
(XFAIL_TEST): Likewise.
(ERRNO_UNCHANGED): Likewise.
(ERRNO_EDOM): Likewise.
(ERRNO_ERANGE): Likewise.
(IGNORE_RESULT): Likewise.
(NON_FINITE): Likewise.
(TEST_SNAN): Likewise.
(NO_TEST_MATHVEC): Likewise.
(__CONCATX): Likewise.
(TYPE_MIN): Likewise.
(TYPE_TRUE_MIN): Likewise.
(TYPE_MAX): Likewise.
(MIN_EXP): Likewise.
(MAX_EXP): Likewise.
(MANT_DIG): Likewise.
(FSTR_MAX): Likewise.
(ulp_idx): Likewise.
(qtype_str): Remove static.
(TEST_COND_binary32): Remove.
(TEST_COND_binary64): Likewise.
(TEST_COND_binary128): Likewise.
(TEST_COND_ibm128): Likewise.
(TEST_COND_intel96): Likewise.
(TEST_COND_m68k96): Likewise.
(TEST_COND_ibm128_libgcc): Likewise.
(XFAIL_IBM128_LIBGCC): Likewise.
(PAYLOAD_DIG): Likewise.
(UNDERFLOW_EXCEPTION_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_OK_FLOAT): Likewise.
(UNDERFLOW_EXCEPTION_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_OK_DOUBLE): Likewise.
(UNDERFLOW_EXCEPTION_LDOUBLE_IBM): Likewise.
(UNDERFLOW_EXCEPTION_BEFORE_ROUNDING): Likewise.
(TEST_COND_long32): Likewise.
(TEST_COND_long64): Likewise.
(TEST_COND_before_rounding): Likewise.
(TEST_COND_after_rounding): Likewise.
(ulps_file_name): Likewise.
(ulps_file): Likewise.
(output_ulps): Likewise.
(output_dir): Likewise.
(noErrors): Likewise.
(noTests): Likewise.
(noExcTests): Likewise.
(noErrnoTests): Likewise.
(verbose): Likewise.
(output_max_error): Likewise.
(output_points): Likewise.
(ignore_max_ulp): Likewise.
(max_error): Likewise.
(real_max_error): Likewise.
(imag_max_error): Likewise.
(prev_max_error): Likewise.
(prev_real_max_error): Likewise.
(prev_imag_max_error): Likewise.
(max_valid_error): Likewise.
(TYPE_DECIMAL_DIG): Likewise.
(TYPE_HEX_DIG): Likewise.
(fmt_ftostr): Likewise.
(compare_ulp_data): Likewise.
(find_ulps): Likewise.
(init_max_error): Likewise.
(set_max_error): Likewise.
(print_float): Likewise.
(print_screen): Likewise.
(print_screen_max_error): Likewise.
(update_stats): Likewise.
(print_function_ulps): Likewise.
(print_complex_function_ulps): Likewise.
(fpstack_test): Likewise.
(print_max_error): Likewise.
(print_complex_max_error): Likewise.
(test_single_exception): Likewise.
(test_exceptions): Likewise.
(test_single_errno): Likewise.
(test_errno): Likewise.
(ULPDIFF): Likewise.
(ulp): Likewise.
(check_float_internal): Likewise.
(check_float): Likewise.
(check_complex): Likewise.
(check_int): Likewise.
(check_long): Likewise.
(check_bool): Likewise.
(check_longlong): Likewise.
(check_intmax_t): Likewise.
(check_uintmax_t): Likewise.
(enable_test): Likewise.
(matherr): Likewise.
(initialize): Likewise.
(options): Likewise.
(doc): Remove static.
(argp): Likewise.
(parse_opt): Remove.
(check_ulp): Likewise.
(libm_test_init): Likewise.
(libm_test_finish): Likewise.
* math/Makefile (libm-test-support): New variable.
(test-extras): Add libm-test-support files.
(extra-test-objs): Likewise.
(CFLAGS-libm-test-support-float.c): New variable.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
($(addprefix $(objpfx),$(libm-tests)): Depend on appropriate
libm-test-support objects.
2017-02-08 21:11:49 +00:00
|
|
|
|
New Makefile target `regen-ulps'.
The wiki "Regeneration" page has this to say about update ULPs.
"The libm-test-ulps files are semiautomatically updated. To
update an ulps baseline, run each of the failing tests (test-float,
test-double, etc.) with -u; this will generate a file called ULPs;
concatenate each of those files with the existing libm-test-ulps
file, after removing any entries for particularly huge numbers of
ulps that you do not want to mark as expected. Then run
gen-libm-test.pl -n -u FILE where FILE is the concatenated file
produced in the previous step. This generates a file called
NewUlps which is the new sorted version of libm-test-ulps."
The same information is listed in math/README.libm-test, and is a
lot of manual work that you often want to run over-and-over again
while working on a particular test.
The `regen-ulps' convenience target does this automatically for
developers.
We strictly assume the source tree is readonly and add a
new --output-dir option to libm-test.inc to allow for writing
out ULPs to $(objpfx).
When run the new target does the following:
* Starts with the baseline ULPs file.
* Runs each of the libm math tests with -u.
* Adds new changes seen with -u to the baseline.
* Sorts and prepares the test output with gen-libm-test.pl.
* Leaves math/NewUlps in your build tree to copy to your source
tree, cleanup, and checkin.
The math test documentation in math/README.libm-test is updated
document the new Makefile target.
---
2013-04-06 Carlos O'Donell <carlos@redhat.com>
* Makefile.in (regen-ulps): New target.
* math/Makefile [ifneq (no,$(PERL)]: Declare regen-ulps with .PHONY.
[ifneq (no,$(PERL)] (run-regen-ulps): New variable.
[ifneq (no,$(PERL)] (regen-ulps): New target.
[ifeq (no,$(PERL)] (regen-ulps): New target.
* math/libm-test.inc (ulps_file_name): Define.
(output_dir): New variable.
(options): Add "output-dir" option.
(parse_opt): Handle 'o' case.
(main): If output_dir is non-NULL use it as a prefix
otherwise use "".
* math/README.libm-test: Update `How can I generate "libm-test-ulps"?'
2013-04-06 20:22:47 +00:00
|
|
|
# Run the math programs to automatically generate ULPs files.
|
|
|
|
.PHONY: regen-ulps
|
|
|
|
|
|
|
|
run-regen-ulps = $(test-wrapper-env) \
|
Don't require test wrappers to preserve environment variables, use more consistent environment.
One wart in the original support for test wrappers for cross testing,
as noted in
<https://sourceware.org/ml/libc-alpha/2012-10/msg00722.html>, is the
requirement for test wrappers to pass a poorly-defined set of
environment variables from the build system to the system running the
glibc under test. Although some variables are passed explicitly via
$(test-wrapper-env), including LD_* variables that simply can't be
passed implicitly because of the side effects they'd have on the build
system's dynamic linker, others are passed implicitly, including
variables such as GCONV_PATH and LOCPATH that could potentially affect
the build system's libc (so effectively relying on any such effects
not breaking the wrappers). In addition, the code in
cross-test-ssh.sh for preserving environment variables is fragile (it
depends on how bash formats a list of exported variables, and could
well break for multi-line variable definitions where the contents
contain things looking like other variable definitions).
This patch moves to explicitly passing environment variables via
$(test-wrapper-env). Makefile variables that previously used
$(test-wrapper) are split up into -before-env and -after-env parts
that can be passed separately to the various .sh files used in
testing, so those files can then insert environment settings between
the two parts.
The common default environment settings in make-test-out are made into
a separate makefile variable that can also be passed to scripts,
rather than many scripts duplicating those settings (for testing an
installed glibc, it is desirable to have the GCONV_PATH setting on
just one place, so just that one place needs to support it pointing to
an installed sysroot instead of the build tree). The default settings
are included in the variables such as $(test-program-prefix), so that
if tests do not need any non-default settings they can continue to use
single variables rather than the split-up variables.
Although this patch cleans up LC_ALL=C settings (that being part of
the common defaults), various LANG=C and LANGUAGE=C settings remain.
Those are generally unnecessary and I propose a subsequent cleanup to
remove them. LC_ALL takes precedence over LANG, and while LANGUAGE
takes precedence over LC_ALL, it only does so for settings other than
LC_ALL=C. So LC_ALL=C on its own is sufficient to ensure the C
locale, and anything that gets LC_ALL=C does not need the other
settings.
While preparing this patch I noticed some tests with .sh files that
appeared to do nothing beyond what the generic makefile support for
tests can do (localedata/tst-wctype.sh - the makefiles support -ENV
variables and .input files - and localedata/tst-mbswcs.sh - just runs
five tests that could be run individually from the makefile). So I
propose another subsequent cleanup to move those to using the generic
support instead of special .sh files.
Tested x86_64 (native) and powerpc32 (cross).
* Makeconfig (run-program-env): New variable.
(run-program-prefix-before-env): Likewise.
(run-program-prefix-after-env): Likewise.
(run-program-prefix): Define in terms of new variables.
(built-program-cmd-before-env): New variable.
(built-program-cmd-after-env): Likewise.
(built-program-cmd): Define in terms of new variables.
(test-program-prefix-before-env): New variable.
(test-program-prefix-after-env): Likewise.
(test-program-prefix): Define in terms of new variables.
(test-program-cmd-before-env): New variable.
(test-program-cmd-after-env): Likewise.
(test-program-cmd): Define in terms of new variables.
* Rules (make-test-out): Use $(run-program-env).
* scripts/cross-test-ssh.sh (env_blacklist): Remove variable.
(help): Do not mention environment variables. Mention
--timeoutfactor option.
(timeoutfactor): New variable.
(blacklist_exports): Remove function.
(exports): Remove variable.
(command): Do not include ${exports}.
* manual/install.texi (Configuring and compiling): Do not mention
test wrappers preserving environment variables. Mention that last
assignment to a variable must take precedence.
* INSTALL: Regenerated.
* benchtests/Makefile (run-bench): Use $(run-program-env).
* catgets/Makefile ($(objpfx)test1.cat): Use
$(built-program-cmd-before-env), $(run-program-env) and
$(built-program-cmd-after-env).
($(objpfx)test2.cat): Do not specify environment variables
explicitly.
($(objpfx)de/libc.cat): Use $(built-program-cmd-before-env),
$(run-program-env) and $(built-program-cmd-after-env).
($(objpfx)test-gencat.out): Use $(test-program-cmd-before-env),
$(run-program-env) and $(test-program-cmd-after-env).
($(objpfx)sample.SJIS.cat): Do not specify environment variables
explicitly.
* catgets/test-gencat.sh: Use test_program_cmd_before_env,
run_program_env and test_program_cmd_after_env arguments.
* elf/Makefile ($(objpfx)tst-pathopt.out): Use $(run-program-env).
* elf/tst-pathopt.sh: Use run_program_env argument.
* iconvdata/Makefile ($(objpfx)iconv-test.out): Use
$(test-wrapper-env) and $(run-program-env).
* iconvdata/run-iconv-test.sh: Use test_wrapper_env and
run_program_env arguments.
* iconvdata/tst-table.sh: Do not set GCONV_PATH explicitly.
* intl/Makefile ($(objpfx)tst-gettext.out): Use
$(test-program-prefix-before-env), $(run-program-env) and
$(test-program-prefix-after-env).
($(objpfx)tst-gettext2.out): Likewise.
* intl/tst-gettext.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
* intl/tst-gettext2.sh: Likewise.
* intl/tst-gettext4.sh: Do not set environment variables
explicitly.
* intl/tst-gettext6.sh: Likewise.
* intl/tst-translit.sh: Likewise.
* malloc/Makefile ($(objpfx)tst-mtrace.out): Use
$(test-program-prefix-before-env), $(run-program-env) and
$(test-program-prefix-after-env).
* malloc/tst-mtrace.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
* math/Makefile (run-regen-ulps): Use $(run-program-env).
* nptl/Makefile ($(objpfx)tst-tls6.out): Use $(run-program-env).
* nptl/tst-tls6.sh: Use run_program_env argument. Set LANG=C
explicitly with each use of ${test_wrapper_env}.
* posix/Makefile ($(objpfx)wordexp-tst.out): Use
$(test-program-prefix-before-env), $(run-program-env) and
$(test-program-prefix-after-env).
* posix/tst-getconf.sh: Do not set environment variables
explicitly.
* posix/wordexp-tst.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
* stdio-common/tst-printf.sh: Do not set environment variables
explicitly.
* stdlib/Makefile ($(objpfx)tst-fmtmsg.out): Use
$(test-program-prefix-before-env), $(run-program-env) and
$(test-program-prefix-after-env).
* stdlib/tst-fmtmsg.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
Split $test calls into $test_pre and $test.
* timezone/Makefile (build-testdata): Use
$(built-program-cmd-before-env), $(run-program-env) and
$(built-program-cmd-after-env).
localedata/ChangeLog:
* Makefile ($(addprefix $(objpfx),$(CTYPE_FILES))): Use
$(built-program-cmd-before-env), $(run-program-env) and
$(built-program-cmd-after-env).
($(objpfx)sort-test.out): Use $(test-program-prefix-before-env),
$(run-program-env) and $(test-program-prefix-after-env).
($(objpfx)tst-fmon.out): Use $(run-program-prefix-before-env),
$(run-program-env) and $(run-program-prefix-after-env).
($(objpfx)tst-locale.out): Use $(built-program-cmd-before-env),
$(run-program-env) and $(built-program-cmd-after-env).
($(objpfx)tst-trans.out): Use $(run-program-prefix-before-env),
$(run-program-env), $(run-program-prefix-after-env),
$(test-program-prefix-before-env) and
$(test-program-prefix-after-env).
($(objpfx)tst-ctype.out): Use $(test-program-cmd-before-env),
$(run-program-env) and $(test-program-cmd-after-env).
($(objpfx)tst-wctype.out): Likewise.
($(objpfx)tst-langinfo.out): Likewise.
($(objpfx)tst-langinfo-static.out): Likewise.
* gen-locale.sh: Use localedef_before_env, run_program_env and
localedef_after_env arguments.
* sort-test.sh: Use test_program_prefix_before_env,
run_program_env and test_program_prefix_after_env arguments.
* tst-ctype.sh: Use tst_ctype_before_env, run_program_env and
tst_ctype_after_env arguments.
* tst-fmon.sh: Use run_program_prefix_before_env, run_program_env
and run_program_prefix_after_env arguments.
* tst-langinfo.sh: Use tst_langinfo_before_env, run_program_env
and tst_langinfo_after_env arguments.
* tst-locale.sh: Use localedef_before_env, run_program_env and
localedef_after_env arguments.
* tst-mbswcs.sh: Do not set environment variables explicitly.
* tst-numeric.sh: Likewise.
* tst-rpmatch.sh: Likewise.
* tst-trans.sh: Use run_program_prefix_before_env,
run_program_env, run_program_prefix_after_env,
test_program_prefix_before_env and test_program_prefix_after_env
arguments.
* tst-wctype.sh: Use tst_wctype_before_env, run_program_env and
tst_wctype_after_env arguments.
2014-06-06 22:19:27 +00:00
|
|
|
$(run-program-env) \
|
2013-04-11 04:07:50 +00:00
|
|
|
$($*-ENV) $(rtld-prefix) $${run}
|
New Makefile target `regen-ulps'.
The wiki "Regeneration" page has this to say about update ULPs.
"The libm-test-ulps files are semiautomatically updated. To
update an ulps baseline, run each of the failing tests (test-float,
test-double, etc.) with -u; this will generate a file called ULPs;
concatenate each of those files with the existing libm-test-ulps
file, after removing any entries for particularly huge numbers of
ulps that you do not want to mark as expected. Then run
gen-libm-test.pl -n -u FILE where FILE is the concatenated file
produced in the previous step. This generates a file called
NewUlps which is the new sorted version of libm-test-ulps."
The same information is listed in math/README.libm-test, and is a
lot of manual work that you often want to run over-and-over again
while working on a particular test.
The `regen-ulps' convenience target does this automatically for
developers.
We strictly assume the source tree is readonly and add a
new --output-dir option to libm-test.inc to allow for writing
out ULPs to $(objpfx).
When run the new target does the following:
* Starts with the baseline ULPs file.
* Runs each of the libm math tests with -u.
* Adds new changes seen with -u to the baseline.
* Sorts and prepares the test output with gen-libm-test.pl.
* Leaves math/NewUlps in your build tree to copy to your source
tree, cleanup, and checkin.
The math test documentation in math/README.libm-test is updated
document the new Makefile target.
---
2013-04-06 Carlos O'Donell <carlos@redhat.com>
* Makefile.in (regen-ulps): New target.
* math/Makefile [ifneq (no,$(PERL)]: Declare regen-ulps with .PHONY.
[ifneq (no,$(PERL)] (run-regen-ulps): New variable.
[ifneq (no,$(PERL)] (regen-ulps): New target.
[ifeq (no,$(PERL)] (regen-ulps): New target.
* math/libm-test.inc (ulps_file_name): Define.
(output_dir): New variable.
(options): Add "output-dir" option.
(parse_opt): Handle 'o' case.
(main): If output_dir is non-NULL use it as a prefix
otherwise use "".
* math/README.libm-test: Update `How can I generate "libm-test-ulps"?'
2013-04-06 20:22:47 +00:00
|
|
|
|
|
|
|
regen-ulps: $(addprefix $(objpfx),$(libm-tests))
|
|
|
|
rm -f $(objpfx)ULPs; rm -f $(objpfx)NewUlps; \
|
|
|
|
cp $(ulps-file) $(objpfx)libm-test-ulps; \
|
|
|
|
for run in $^; do \
|
|
|
|
echo "Regenerating ULPs for $${run}"; \
|
|
|
|
$(run-regen-ulps) -u -o $(objpfx); \
|
|
|
|
cat $(objpfx)ULPs >> $(objpfx)libm-test-ulps; \
|
|
|
|
rm $(objpfx)ULPs; \
|
|
|
|
done; \
|
2017-02-06 18:20:15 +00:00
|
|
|
$(PERL) gen-libm-test.pl -n $(objpfx)NewUlps \
|
|
|
|
-u $(objpfx)libm-test-ulps; \
|
New Makefile target `regen-ulps'.
The wiki "Regeneration" page has this to say about update ULPs.
"The libm-test-ulps files are semiautomatically updated. To
update an ulps baseline, run each of the failing tests (test-float,
test-double, etc.) with -u; this will generate a file called ULPs;
concatenate each of those files with the existing libm-test-ulps
file, after removing any entries for particularly huge numbers of
ulps that you do not want to mark as expected. Then run
gen-libm-test.pl -n -u FILE where FILE is the concatenated file
produced in the previous step. This generates a file called
NewUlps which is the new sorted version of libm-test-ulps."
The same information is listed in math/README.libm-test, and is a
lot of manual work that you often want to run over-and-over again
while working on a particular test.
The `regen-ulps' convenience target does this automatically for
developers.
We strictly assume the source tree is readonly and add a
new --output-dir option to libm-test.inc to allow for writing
out ULPs to $(objpfx).
When run the new target does the following:
* Starts with the baseline ULPs file.
* Runs each of the libm math tests with -u.
* Adds new changes seen with -u to the baseline.
* Sorts and prepares the test output with gen-libm-test.pl.
* Leaves math/NewUlps in your build tree to copy to your source
tree, cleanup, and checkin.
The math test documentation in math/README.libm-test is updated
document the new Makefile target.
---
2013-04-06 Carlos O'Donell <carlos@redhat.com>
* Makefile.in (regen-ulps): New target.
* math/Makefile [ifneq (no,$(PERL)]: Declare regen-ulps with .PHONY.
[ifneq (no,$(PERL)] (run-regen-ulps): New variable.
[ifneq (no,$(PERL)] (regen-ulps): New target.
[ifeq (no,$(PERL)] (regen-ulps): New target.
* math/libm-test.inc (ulps_file_name): Define.
(output_dir): New variable.
(options): Add "output-dir" option.
(parse_opt): Handle 'o' case.
(main): If output_dir is non-NULL use it as a prefix
otherwise use "".
* math/README.libm-test: Update `How can I generate "libm-test-ulps"?'
2013-04-06 20:22:47 +00:00
|
|
|
echo "Automatic regeneration of ULPs complete."; \
|
|
|
|
echo "Difference between the current baseline and the new baseline is:";\
|
|
|
|
diff -urN $(ulps-file) $(objpfx)NewUlps; \
|
|
|
|
echo "Copy $(objpfx)NewUlps to $(ulps-file) (relative to source)."
|
|
|
|
else
|
|
|
|
regen-ulps:
|
|
|
|
@echo "Automatic regeneration of ULPs requires perl."; \
|
|
|
|
exit 1;
|
|
|
|
endif
|
1996-03-05 21:41:30 +00:00
|
|
|
|
2006-01-19 07:29:40 +00:00
|
|
|
# The generated sysd-rules file defines rules like this for sources
|
|
|
|
# coming from sysdeps/ directories. These rules find the generic sources.
|
|
|
|
define o-iterator-doit
|
|
|
|
$(objpfx)m_%$o: s_%.c $(before-compile); $$(compile-command.c)
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(all-object-suffixes)
|
|
|
|
include $(o-iterator)
|
|
|
|
|
2016-09-08 13:48:08 +00:00
|
|
|
# Likewise, for those generated files shared with libc.
|
|
|
|
define o-iterator-doit
|
|
|
|
$(objpfx)m_%$o: $(objpfx)s_%.c $(before-compile); $$(compile-command.c)
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(all-object-suffixes)
|
|
|
|
include $(o-iterator)
|
2006-01-19 07:29:40 +00:00
|
|
|
|
1996-03-05 21:41:30 +00:00
|
|
|
# This file defines the default _LIB_VERSION variable that controls
|
|
|
|
# the error return conventions for the math functions.
|
|
|
|
CPPFLAGS-s_lib_version.c := -D_POSIX_MODE
|
|
|
|
|
Fri Apr 19 00:49:44 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdlib/rpmatch.c (rpmatch: try): Take new arg NOMATCH, return value
for nonmatching nonerror (instead of !MATCH).
(rpmatch): Use it, so we return -1 when NOEXPR doesn't match either.
* resolv/getnetnamadr.c (getnetbyaddr): Use u_int32_t instead of
unsigned long for variable NET2.
* time/etcetera, time/europe, time/solar89: Updated from ADO's 96e.
Tue Apr 9 14:37:31 1996 Ulrich Drepper <drepper@cygnus.com>
* catgets/Makefile, catgets/catgets.c, catgets/catgetsinfo.h,
catgets/config.h, catgets/gencat.c, catgets/nl_types.h,
catgets/open_catalog.c: New files. Implementation of XPG4
compliant catgets() function and needed tools.
* Makefile (subdirs): Add catgets.
Thu Apr 18 23:36:11 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* math/Makefile (CPPFLAGS): Append -D__NO_MATH_INLINES.
Wed Apr 10 20:48:43 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/vfprintf.c: Correct some typos.
* sysdeps/libm-ieee754/w_gammaf.c, sysdeps/libm-ieee754/w_lgamma.c,
sysdeps/libm-ieee754/w_lgammaf.c: Reference signgam instead of
__signgam.
Thu Apr 18 21:07:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Makerules (no-whole-archive): New variable.
(build-shlib): Use it.
* elf/Makefile (libdl.so): Use it.
* configure.in (libc_cv_ld_no_whole_archive): New check for
--no-whole-archive.
* config.make.in (have-no-whole-archive): New variable.
* stdio-common/printf_fp.c: Increase fudge factor for BIGNUM_SIZE calc
from 3 to 4.
* Make-dist: Include version.mk.
(version, release): Variables removed.
* Makeconfig (version.mk): New target.
Fri Apr 19 01:42:18 1996 Ulrich Drepper <drepper@cygnus.com>
* locale/Makefile (headers): Add langinfo.h.
(CPPFLAGS): Remove -Iliblib.
1996-04-20 00:05:25 +00:00
|
|
|
# We don't want the fdlibm code to use the inline math functions,
|
|
|
|
# only the fdlibm code.
|
2001-07-23 18:14:55 +00:00
|
|
|
math-CPPFLAGS += -D__NO_MATH_INLINES -D__LIBC_INTERNAL_MATH_INLINES
|
Fri Apr 19 00:49:44 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* stdlib/rpmatch.c (rpmatch: try): Take new arg NOMATCH, return value
for nonmatching nonerror (instead of !MATCH).
(rpmatch): Use it, so we return -1 when NOEXPR doesn't match either.
* resolv/getnetnamadr.c (getnetbyaddr): Use u_int32_t instead of
unsigned long for variable NET2.
* time/etcetera, time/europe, time/solar89: Updated from ADO's 96e.
Tue Apr 9 14:37:31 1996 Ulrich Drepper <drepper@cygnus.com>
* catgets/Makefile, catgets/catgets.c, catgets/catgetsinfo.h,
catgets/config.h, catgets/gencat.c, catgets/nl_types.h,
catgets/open_catalog.c: New files. Implementation of XPG4
compliant catgets() function and needed tools.
* Makefile (subdirs): Add catgets.
Thu Apr 18 23:36:11 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* math/Makefile (CPPFLAGS): Append -D__NO_MATH_INLINES.
Wed Apr 10 20:48:43 1996 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/vfprintf.c: Correct some typos.
* sysdeps/libm-ieee754/w_gammaf.c, sysdeps/libm-ieee754/w_lgamma.c,
sysdeps/libm-ieee754/w_lgammaf.c: Reference signgam instead of
__signgam.
Thu Apr 18 21:07:27 1996 Roland McGrath <roland@delasyd.gnu.ai.mit.edu>
* Makerules (no-whole-archive): New variable.
(build-shlib): Use it.
* elf/Makefile (libdl.so): Use it.
* configure.in (libc_cv_ld_no_whole_archive): New check for
--no-whole-archive.
* config.make.in (have-no-whole-archive): New variable.
* stdio-common/printf_fp.c: Increase fudge factor for BIGNUM_SIZE calc
from 3 to 4.
* Make-dist: Include version.mk.
(version, release): Variables removed.
* Makeconfig (version.mk): New target.
Fri Apr 19 01:42:18 1996 Ulrich Drepper <drepper@cygnus.com>
* locale/Makefile (headers): Add langinfo.h.
(CPPFLAGS): Remove -Iliblib.
1996-04-20 00:05:25 +00:00
|
|
|
|
1996-06-05 03:29:45 +00:00
|
|
|
ifneq ($(long-double-fcts),yes)
|
|
|
|
# The `double' and `long double' types are the same on this machine.
|
|
|
|
# We won't compile the `long double' code at all. Tell the `double' code
|
1996-07-08 17:35:27 +00:00
|
|
|
# to define aliases for the `FUNCl' names. To avoid type conflicts in
|
|
|
|
# defining those aliases, tell <math.h> to declare the `FUNCl' names with
|
|
|
|
# `double' instead of `long double'.
|
2001-07-23 18:14:55 +00:00
|
|
|
math-CPPFLAGS += -DNO_LONG_DOUBLE -D_Mlong_double_=double
|
1996-06-05 03:29:45 +00:00
|
|
|
endif
|
|
|
|
|
2016-06-10 23:16:27 +00:00
|
|
|
# These files quiet sNaNs in a way that is optimized away without
|
|
|
|
# -fsignaling-nans.
|
|
|
|
CFLAGS-s_modf.c += -fsignaling-nans
|
|
|
|
CFLAGS-s_modff.c += -fsignaling-nans
|
|
|
|
CFLAGS-s_modfl.c += -fsignaling-nans
|
2016-07-15 19:05:51 +00:00
|
|
|
CFLAGS-s_modff128.c += -fsignaling-nans
|
2016-06-10 23:16:27 +00:00
|
|
|
|
1996-06-16 09:31:23 +00:00
|
|
|
# The -lieee library is actually an object file.
|
|
|
|
# The module just defines the _LIB_VERSION_ variable.
|
|
|
|
# It's not a library to make sure it is linked in instead of s_lib_version.o.
|
|
|
|
$(objpfx)libieee.a: $(objpfx)ieee-math.o
|
|
|
|
rm -f $@
|
1998-09-21 14:34:13 +00:00
|
|
|
$(patsubst %/,cd % &&,$(objpfx)) \
|
|
|
|
$(LN_S) $(<F) $(@F)
|
Update.
1997-03-25 02:15 Ulrich Drepper <drepper@cygnus.com>
* gmon/gmon.c: Optimize a bit by using more sets of records to
write in a single writev call.
* math/math.h: Add definitions of macros __MATHCALLX and __MATHDECLX.
* math/mathcalls.h: Use __MATHCALLX for fabs, infnan, copysign,
nan, isnan, nextafter, trunc, __fpclassify and signbit to mark as
`const'.
Use __MATHDECLX for isinf and finite.
* sysdeps/generic/setenv.c [_LIBC]: Define __clearenv and make
clearenv a weak alias.
Implement complex exponential function.
* sysdeps/libm-ieee754/s_cexp.c: New file.
* sysdeps/libm-ieee754/s_cexpf.c: New file.
* sysdeps/libm-ieee754/s_cexpl.c: New file.
* sysdeps/libm-ieee754/s_nan.c: Define function as __nan and make
nan a weak alias.
* sysdeps/libm-ieee754/s_nanf.c: Likewise for nanf.
* sysdeps/libm-ieee754/s_nanl.c: Likewise for nanl.
* sysdeps/unix/sysv/linux/iovec.h: Don't use kernel header because
of type clashes. Add all definitions here.
* sysdeps/unix/sysv/linux/shmat.c: Likewise. Correct types according
to XPG4.2.
* sysdeps/unix/sysv/linux/shmdt.c: Likewise.
* sysdeps/unix/sysv/linux/msgrcv.c: Likewise.
* sysvipc/sys/shm.h (shmat, shmdt): Correct types.
* sysdeps/unix/sysv/linux/sys/kd.h: Define _LINUX_TYPES_H to avoid
use of kernel types.
1997-03-25 00:00 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/unix/sysv/linux/netinet/ip.h (struct ip_timestamp):
Correct typos. Reported by a sun <asun@zoology.washington.edu>.
1997-03-20 21:58 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/libm-ieee754/s_asinhl.c: Fix sign of result.
1997-03-20 16:20 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/libm-ieee754/e_atan2l.c: Fix typo.
1997-03-20 14:23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/fpu/__math.h (__logb, logb): Don't define.
* sysdeps/m68k/fpu/s_logb.c: Removed.
* sysdeps/m68k/fpu/s_logbf.c: Removed.
* sysdeps/m68k/fpu/s_logbl.c: Removed.
* sysdeps/m68k/fpu/__math.h (__ieee754_atan2, __ieee754_pow):
Don't define here.
* sysdeps/m68k/fpu/e_atan2.c: Rewritten.
* sysdeps/m68k/fpu/e_pow.c: Likewise.
* sysdeps/m68k/fpu/e_atan2f.c: Based on e_atan2.c.
* sysdeps/m68k/fpu/e_atan2l.c: Likewise.
* sysdeps/m68k/fpu/e_powf.c: Based on e_pow.c.
* sysdeps/m68k/fpu/e_powl.c: Likewise.
* sysdeps/m68k/fpu/s_log2.c: New file.
* sysdeps/m68k/fpu/s_log2f.c: New file.
* sysdeps/m68k/fpu/s_log2l.c: New file.
* sysdeps/m68k/fpu/s_exp2.c: New file.
* sysdeps/m68k/fpu/s_exp2f.c: New file.
* sysdeps/m68k/fpu/s_exp2l.c: New file.
1997-03-20 14:46 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makeconfig (all): Make sure this is always the default goal.
1997-03-20 11:09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* math/libm-test.c: Increase epsilon in many places. Fix many
typos. Allow optinal argument also for short option.
1997-03-20 11:09 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* math/Makefile ($(objpfx)$(tests)): Link against libm.
1997-03-24 23:14 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/libm-ieee754/s_fpclassifyl.c: Correct recognition of
denormalized numbers.
* sysdeps/i386/huge_val.h: Remove references to byte order macros.
Don't include <endian.h>.
1997-03-19 15:18 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* sysdeps/m68k/huge_val.h: Remove references to byte order macros.
Don't include <endian.h>.
1997-03-24 23:09 Ulrich Drepper <drepper@cygnus.com>
* inet/rcmd.c (iruserok): Use access instead of euidaccess.
1997-03-15 18:08 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* math/cmathcalls.h: Remove whitespace before function name in use
of __MATHDECL macro, to make it compilable with a traditional
preprocessor.
1997-03-24 15:31 Ulrich Drepper <drepper@cygnus.com>
* configure.in: Use AC_PROG_CC instead of AC_PROG_TOOL to find
compiler.
1997-03-24 02:34 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/libm-ieee754/s_finitel.c (__finitel): Shift return value
by 31 positions to get 0/1 result.
Patch by Joe Keane <jgk@jgk.org>.
1997-03-23 12:15 H.J. Lu <hjl@gnu.ai.mit.edu>
* posix/getopt.c (__getopt_nonoption_flags): Make it extern
to prevent from ld linking in getopt.o even if there is another
incompatible one.
* posix/getopt_init.c (__getopt_nonoption_flags): Remove extern.
1997-03-23 23:30 Thorsten Kukuk <kukuk@vt.uni-paderborn.de>
* nis/nis_call.c (__do_niscall): Print message if cold start file
does not exist.
* nis/nis_file.c: Don't print error messages.
* nis/nis_local_name.c (nis_local_host): Fix pointer errors.
* nis/rpcsvc/ypclnt.h: Fix copyright and prototypes.
* nis/rpcsvc/nis.h: Likewise.
* nis/ypclnt.c: Fix prototypes.
1997-03-24 01:36 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/libm-i387/e_scalb.S: Pop additional result before
returning.
* sysdeps/libm-i387/e_scalbf.S: Likewise.
* sysdeps/libm-i387/e_scalbl.S: Likewise.
Reported by Andreas Jaeger <aj@arthur.pfalz.de>.
* elf/rtld.c (dl_main): Set main_map->l_opencount to 1 also if
dynamic linker was called implicitly by the kernel.
Reported by Eric Youngdale <eric@andante.jic.com>.
* math/Makefile (CFLAGS-test-float.c, CFLAGS-test-double.c,
CFLAGS-test-longdouble.c): New variables. Set to -fno-inline to
prevent clever optimizations which corrupt the tests.
1997-03-23 21:33 Andreas Jaeger <aj@arthur.pfalz.de>
* math/libm-test.c (scalb_test): New function.
(sqrt_test): New function.
(scalbn_test): New function.
(ilogb_test): New function.
(main): Added calls for new test functions.
(ldexp_test): Add another test for ldexp(x,0).
1997-03-23 12:35 Andreas Jaeger <aj@arthur.pfalz.de>
* math/libm-test.c (remquo_test): Correct messages so that they
match the tests.
(copysign_test): Likewise.
1997-03-23 16:28 Ulrich Drepper <drepper@cygnus.com>
* stdio-common/Makefile (routines): Add printf_size.
* stdio-common/printf.h: Add declarations for printf_size and
printf_size_info.
* stdio-common/printf-parse.h (__printf_arginfo_table): Correct
declaration.
(parse_one_spec): Test whether __printf_function_table is not NULL
before using registered handlers and don't test
__printf_arginfo_table. Update nargs also when handler is
registered.
* stdio-common/vfprintf.c (vfprintf): Count number of specifiers
processed in fast loop.
* stdio-common/printf_size: New file.
1997-03-22 04:53 Ulgmon_out_readrich Drepper <drepper@cygnus.com>
1997-03-25 01:45:04 +00:00
|
|
|
|
2016-04-13 15:04:37 +00:00
|
|
|
$(addprefix $(objpfx),\
|
Run libm tests separately for each function.
At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
over 50 MB of libm-test-*.c sources.
This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 50
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).
All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.
This should reduce the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.
Tested for x86_64 and x86.
* math/Makefile (libm-tests-generated): Remove variable.
(libm-tests-base-normal): New variable.
(libm-tests-base-finite): Likewise.
(libm-tests-base-inline): Likewise.
(libm-tests-base): Likewise.
(libm-tests-normal): Likewise.
(libm-tests-finite): Likewise.
(libm-tests-inline): Likewise.
(libm-tests-vector): Likewise.
(libm-tests): Define in terms of these new variables.
(libm-tests-for-type): New variable.
(libm-tests.o): Move definition.
(tests): Move addition of $(libm-tests).
(generated): Update for new and removed libm test files.
($(objpfx)libm-test.c): Remove target.
($(objpfx)libm-have-vector-test.h): Likewise.
(CFLAGS-test-double-vlen2.c): Remove variable.
(CFLAGS-test-double-vlen4.c): Likewise.
(CFLAGS-test-double-vlen8.c): Likewise.
(CFLAGS-test-float-vlen4.c): Likewise.
(CFLAGS-test-float-vlen8.c): Likewise.
(CFLAGS-test-float-vlen16.c): Likewise.
(CFLAGS-test-float.c): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-libm-test-support-float.c): Likewise.
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
(libm-test-inline-cflags): New variable.
(CFLAGS-test-ifloat.c): Remove variable.
(CFLAGS-test-idouble.c): Likewise.
(CFLAGS-test-ildouble.c): Likewise.
($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
dependencies.
($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
Likewise.
(dependencies on libm-test-support-*.o): Remove.
($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
rules using iterators.
($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
Likewise.
($(objpfx)libm-test-support-$(o).o): Likewise.
($(addprefix $(objpfx),$(filter-out $(tests-static)
$(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
instead.
($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
define rule instead.
* math/README.libm-test: Update.
* math/libm-test-acos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-acosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-canonicalize.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-carg.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cbrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ceil.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cimag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-conj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-copysign.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cpow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cproj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-creal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erfc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-expm1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fdim.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-floor.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmax.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fminmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmod.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fpclassify.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-frexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-getpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-hypot.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ilogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iscanonical.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iseqsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isfinite.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isinf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isless.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issignaling.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issubnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isunordered.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iszero.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-jn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log1p.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-logb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-modf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nearbyint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextafter.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextdown.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nexttoward.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextup.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-pow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remainder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remquo.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-rint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-round.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-roundeven.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbln.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-signbit.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-significand.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sincos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalorder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalordermag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-trunc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-yn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-driver.c: Do not include libm-have-vector-test.h.
(HAVE_VECTOR): Remove macro.
(START): Do not call HAVE_VECTOR.
* math/test-double-vlen2.h (FUNC_TEST): Remove macro.
* math/test-double-vlen4.h (FUNC_TEST): Remove macro.
* math/test-double-vlen8.h (FUNC_TEST): Remove macro.
* math/test-float-vlen16.h (FUNC_TEST): Remove macro.
* math/test-float-vlen4.h (FUNC_TEST): Remove macro.
* math/test-float-vlen8.h (FUNC_TEST): Remove macro.
* math/test-math-vector.h (FUNC_TEST): New macro.
(WRAPPER_DECL): Rename to WRAPPER_DECL_f.
* sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
(double-vlen4-funcs): Likewise.
(double-vlen4-avx2-funcs): Likewise.
(double-vlen8-funcs): Likewise.
(float-vlen4-funcs): Likewise.
(float-vlen8-funcs): Likewise.
(float-vlen8-avx2-funcs): Likewise.
(float-vlen16-funcs): Likewise.
(CFLAGS-test-double-vlen4-avx2.c): Remove variable.
(CFLAGS-test-float-vlen8-avx2.c): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
macro.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
Likewise.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* math/gen-libm-have-vector-test.sh: Remove file.
* math/libm-test.inc: Likewise.
* math/libm-test-support-double.c: Likewise.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/test-double-finite.c: Likewise.: Likewise.
* math/test-double.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildouble.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2017-02-24 00:51:45 +00:00
|
|
|
$(filter-out $(tests-static) $(libm-tests-vector),\
|
|
|
|
$(tests))): $(libm)
|
2013-09-09 21:36:57 +00:00
|
|
|
$(addprefix $(objpfx),$(tests-static)): $(objpfx)libm.a
|
Run libm tests separately for each function.
At present, libm tests for each function get built into a single
executable (for each floating point type, for each of normal / inline
/ finite-math-only functions, plus vector variants) and run together,
resulting in a single PASS or FAIL (for each of those nine variants
plus vector variants). Building this executable involves reading
over 50 MB of libm-test-*.c sources.
This patch arranges for tests of each function to be run separately
from the makefiles instead. There are 121 functions being tested for
each (type, variant pair) (actually 126, but run as 121 from the
Makefile because each of the pairs (exp10, pow10), (isfinite, finite),
(lgamma, gamma), (remainder, drem), (scalbn, ldexp), shares a table of
test results and so is run together), so 1089 separate tests run from
the Makefile, plus 48 vector tests on x86_64 (six functions for eight
vector variants). Each test only involves a libm-test-<func>.c file
of no more than about 4 MB, rather than all such files taking about 50
MB. With tests run separately, test summaries will indicate which
functions actually have problems (of course, those problems may just
be out-of-date libm-test-ulps files if the file hasn't been updated
for the architecture in question recently).
All the .c files for the 1089+48 tests are generated automatically
from the Makefiles. Various checked-in boilerplate .c files are
removed as no longer needed. CFLAGS definitions for the different
kinds of tests are generated using makefile iterators to apply
target-specific variable settings. libm-have-vector-test.h is no
longer needed; the list of functions to test for each vector type is
now in the sysdeps Makefile.
This should reduce the amount of boilerplate needed for float128
testing support; test-float128.h will still be needed, but not various
.c files or Makefile CFLAGS definitions. The logic for creating
dependencies on libm-test-support-*.o files should also render
<https://sourceware.org/ml/libc-alpha/2017-02/msg00279.html>
unnecessary.
Tested for x86_64 and x86.
* math/Makefile (libm-tests-generated): Remove variable.
(libm-tests-base-normal): New variable.
(libm-tests-base-finite): Likewise.
(libm-tests-base-inline): Likewise.
(libm-tests-base): Likewise.
(libm-tests-normal): Likewise.
(libm-tests-finite): Likewise.
(libm-tests-inline): Likewise.
(libm-tests-vector): Likewise.
(libm-tests): Define in terms of these new variables.
(libm-tests-for-type): New variable.
(libm-tests.o): Move definition.
(tests): Move addition of $(libm-tests).
(generated): Update for new and removed libm test files.
($(objpfx)libm-test.c): Remove target.
($(objpfx)libm-have-vector-test.h): Likewise.
(CFLAGS-test-double-vlen2.c): Remove variable.
(CFLAGS-test-double-vlen4.c): Likewise.
(CFLAGS-test-double-vlen8.c): Likewise.
(CFLAGS-test-float-vlen4.c): Likewise.
(CFLAGS-test-float-vlen8.c): Likewise.
(CFLAGS-test-float-vlen16.c): Likewise.
(CFLAGS-test-float.c): Likewise.
(CFLAGS-test-float-finite.c): Likewise.
(CFLAGS-libm-test-support-float.c): Likewise.
(CFLAGS-test-double.c): Likewise.
(CFLAGS-test-double-finite.c): Likewise.
(CFLAGS-libm-test-support-double.c): Likewise.
(CFLAGS-test-ldouble.c): Likewise.
(CFLAGS-test-ldouble-finite.c): Likewise.
(CFLAGS-libm-test-support-ldouble.c): Likewise.
(libm-test-inline-cflags): New variable.
(CFLAGS-test-ifloat.c): Remove variable.
(CFLAGS-test-idouble.c): Likewise.
(CFLAGS-test-ildouble.c): Likewise.
($(addprefix $(objpfx), $(libm-tests.o))): Move target and update
dependencies.
($(foreach t,$(libm-tests-normal),$(objpfx)$(t).c)): New rule.
($(foreach t,$(libm-tests-finite),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-inline),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(libm-tests-vector),$(objpfx)$(t).c)): Likewise.
($(foreach t,$(types),$(objpfx)libm-test-support-$(t).c)):
Likewise.
(dependencies on libm-test-support-*.o): Remove.
($(foreach f,$(libm-test-funcs-all),$(objpfx)$(o)-$(f).o)): New
rules using iterators.
($(addprefix $(objpfx),$(call libm-tests-for-type,$(o)))):
Likewise.
($(objpfx)libm-test-support-$(o).o): Likewise.
($(addprefix $(objpfx),$(filter-out $(tests-static)
$(libm-vec-tests),$(tests)))): Filter out $(libm-tests-vector)
instead.
($(addprefix $(objpfx), $(libm-vec-tests))): Use iterator to
define rule instead.
* math/README.libm-test: Update.
* math/libm-test-acos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-acosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-asinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atan2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-atanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cacosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-canonicalize.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-carg.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-casinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-catanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cbrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ccosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ceil.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cimag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-clog10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-conj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-copysign.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cosh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cpow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-cproj.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-creal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-csqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ctanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-erfc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-exp2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-expm1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fabs.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fdim.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-floor.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmax.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmaxmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fminmag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fmod.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fpclassify.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-frexp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-fromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-getpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-hypot.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ilogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iscanonical.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iseqsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isfinite.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isgreaterequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isinf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isless.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessequal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-islessgreater.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issignaling.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-issubnormal.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-isunordered.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-iszero.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-j1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-jn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llogb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-llround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log10.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log1p.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-log2.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-logb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lrint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-lround.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-modf.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nearbyint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextafter.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextdown.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nexttoward.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-nextup.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-pow.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remainder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-remquo.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-rint.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-round.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-roundeven.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalb.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbln.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-scalbn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayload.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-setpayloadsig.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-signbit.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-significand.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sin.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sincos.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sinh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-sqrt.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tan.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tanh.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-tgamma.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalorder.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-totalordermag.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-trunc.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfp.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-ufromfpx.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y0.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-y1.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-yn.inc: Include libm-test-driver.c.
(do_test): New function.
* math/libm-test-driver.c: Do not include libm-have-vector-test.h.
(HAVE_VECTOR): Remove macro.
(START): Do not call HAVE_VECTOR.
* math/test-double-vlen2.h (FUNC_TEST): Remove macro.
* math/test-double-vlen4.h (FUNC_TEST): Remove macro.
* math/test-double-vlen8.h (FUNC_TEST): Remove macro.
* math/test-float-vlen16.h (FUNC_TEST): Remove macro.
* math/test-float-vlen4.h (FUNC_TEST): Remove macro.
* math/test-float-vlen8.h (FUNC_TEST): Remove macro.
* math/test-math-vector.h (FUNC_TEST): New macro.
(WRAPPER_DECL): Rename to WRAPPER_DECL_f.
* sysdeps/x86_64/fpu/Makefile (double-vlen2-funcs): New variable.
(double-vlen4-funcs): Likewise.
(double-vlen4-avx2-funcs): Likewise.
(double-vlen8-funcs): Likewise.
(float-vlen4-funcs): Likewise.
(float-vlen8-funcs): Likewise.
(float-vlen8-avx2-funcs): Likewise.
(float-vlen16-funcs): Likewise.
(CFLAGS-test-double-vlen4-avx2.c): Remove variable.
(CFLAGS-test-float-vlen8-avx2.c): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.h (TEST_VECTOR_cos): Remove
macro.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.h (TEST_VECTOR_cos):
Likewise.
(TEST_VECTOR_sin): Likewise.
(TEST_VECTOR_sincos): Likewise.
(TEST_VECTOR_log): Likewise.
(TEST_VECTOR_exp): Likewise.
(TEST_VECTOR_pow): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.h (TEST_VECTOR_cosf):
Likewise.
(TEST_VECTOR_sinf): Likewise.
(TEST_VECTOR_sincosf): Likewise.
(TEST_VECTOR_logf): Likewise.
(TEST_VECTOR_expf): Likewise.
(TEST_VECTOR_powf): Likewise.
* math/gen-libm-have-vector-test.sh: Remove file.
* math/libm-test.inc: Likewise.
* math/libm-test-support-double.c: Likewise.
* math/libm-test-support-float.c: Likewise.
* math/libm-test-support-ldouble.c: Likewise.
* math/test-double-finite.c: Likewise.: Likewise.
* math/test-double.c: Likewise.
* math/test-float-finite.c: Likewise.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildouble.c: Likewise.
* math/test-ldouble-finite.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen2.h: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-double-vlen8.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen16.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen4.h: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8-avx2.c: Likewise.
* sysdeps/x86_64/fpu/test-float-vlen8.c: Likewise.
2017-02-24 00:51:45 +00:00
|
|
|
define o-iterator-doit
|
|
|
|
$(foreach f,$($(o)-funcs),\
|
|
|
|
$(objpfx)test-$(o)-$(f)): $(objpfx)test-$(o)-wrappers.o \
|
|
|
|
$(libm) $(libmvec)
|
|
|
|
endef
|
|
|
|
object-suffixes-left := $(libmvec-tests)
|
|
|
|
include $(o-iterator)
|
1997-05-21 16:03:22 +00:00
|
|
|
|
2012-01-08 14:52:29 +00:00
|
|
|
gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%.o,\
|
1998-08-26 18:03:49 +00:00
|
|
|
add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \
|
2013-01-12 07:31:06 +00:00
|
|
|
lshift rshift mp_clz_tab udiv_qrnnd inlines \
|
|
|
|
$(gmp-sysdep_routines))
|
1998-08-26 18:03:49 +00:00
|
|
|
$(objpfx)atest-exp: $(gmp-objs)
|
|
|
|
$(objpfx)atest-sincos: $(gmp-objs)
|
|
|
|
$(objpfx)atest-exp2: $(gmp-objs)
|
Use existing makefile variables for dependencies on glibc libraries.
glibc's Makeconfig defines some variables such as $(libm) and $(libdl)
for linking with libraries built by glibc, and nptl/Makeconfig
(included by the toplevel Makeconfig) defines others such as
$(shared-thread-library).
In some places glibc's Makefiles use those variables when linking
against the relevant libraries, but in other places they hardcode the
location of the libraries in the build tree. This patch cleans up
various places to use the variables that already exist (in the case of
libm, replacing several duplicate definitions of a $(link-libm)
variable in subdirectory Makefiles). (It's not necessarily exactly
equivalent to what the existing code does - in particular,
$(shared-thread-library) includes libpthread_nonshared, but is
replacing places that just referred to libpthread.so. But I think
that change is desirable on the general principle of linking things as
close as possible to the way in which they would be linked with an
installed library, unless there is a clear reason not to do so.)
To support running tests with an installed copy of glibc without
needing the full build tree from when that copy was built, I think it
will be useful to use such variables more generally and systematically
- every time the rules for building a test refer to some file from the
build tree that's also installed by glibc, use a makefile variable so
that the installed-testing case can point those variables to installed
copies of the files. This patch just deals with straightforward cases
where such variables already exist.
It's quite possible some uses of $(shared-thread-library) should
actually be a new $(thread-library) variable that's set appropriately
in the --disable-shared case, if those uses would in fact work without
shared libraries. I didn't change the status quo that those cases
hardcode use of a shared library whether or not it's actually needed
(but other uses such as $(libm) and $(libdl) would now get the static
library if the shared library isn't built, when some previously
hardcoded use of the shared library - if they actually need shared
libraries, the test itself needs an enable-shared conditional anyway).
Tested x86_64.
* benchtests/Makefile
($(addprefix $(objpfx)bench-,$(bench-math))): Depend on $(libm),
not $(common-objpfx)math/libm.so.
($(addprefix $(objpfx)bench-,$(bench-pthread))): Depend on
$(shared-thread-library), not $(common-objpfx)nptl/libpthread.so.
* elf/Makefile ($(objpfx)noload): Depend on $(libdl), not
$(common-objpfx)dlfcn/libdl.so.
($(objpfx)tst-audit8): Depend on $(libm), not
$(common-objpfx)math/libm.so.
* malloc/Makefile ($(objpfx)libmemusage.so): Depend on $(libdl),
not $(common-objpfx)dlfcn/libdl.so.
* math/Makefile
($(addprefix $(objpfx),$(filter-out $(tests-static),$(tests)))):
Depend on $(libm), not $(objpfx)libm.so. Do not condition on
[$(build-shared) = yes].
($(objpfx)test-fenv-tls): Depend on $(shared-thread-library), not
$(common-objpfx)nptl/libpthread.so.
* misc/Makefile ($(objpfx)tst-tsearch): Depend on $(libm), not
$(common-objpfx)math/libm.so$(libm.so-version) or
$(common-objpfx)math/libm.a depending on [$(build-shared) = yes].
* nptl/Makefile ($(objpfx)tst-unload): Depend on $(libdl), not
$(common-objpfx)dlfcn/libdl.so.
* setjmp/Makefile (link-libm): Remove variable.
($(objpfx)tst-setjmp-fp): Depend on $(libm), not $(link-libm).
* stdio-common/Makefile (link-libm): Remove variable.
($(objpfx)tst-printf-round): Depend on $(libm), not $(link-libm).
* stdlib/Makefile (link-libm): Remove variable.
($(objpfx)bug-getcontext): Depend on $(libm), not $(link-libm).
($(objpfx)tst-strtod-round): Likewise.
($(objpfx)tst-tininess): Likewise.
($(objpfx)tst-strtod-underflow): Likewise.
($(objpfx)tst-strtod6): Likewise.
($(objpfx)tst-tls-atexit): Depend on $(shared-thread-library) and
$(libdl), not $(common-objpfx)nptl/libpthread.so and
$(common-objpfx)dlfcn/libdl.so.
2014-05-16 21:38:08 +00:00
|
|
|
$(objpfx)test-fenv-tls: $(shared-thread-library)
|