This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch andros/libmvec created. glibc-2.21-293-gec3a4b8
- From: andros at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 28 Apr 2015 12:27:12 -0000
- Subject: GNU C Library master sources branch andros/libmvec created. glibc-2.21-293-gec3a4b8
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, andros/libmvec has been created
at ec3a4b85a8568795e30307e1c2f892cdb5ffafe6 (commit)
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ec3a4b85a8568795e30307e1c2f892cdb5ffafe6
commit ec3a4b85a8568795e30307e1c2f892cdb5ffafe6
Author: Andrew Senkevich <andrew.senkevich@intel.com>
Date: Tue Apr 28 13:48:23 2015 +0300
This is infrastructure update for configure, build and install of vector
math library. Installation of libm.so as linker script only in case of
libmvec.so build.
2015-04-28 Andrew Senkevich <andrew.n.senkevich@gmail.com>
* Makeconfig (rpath-dirs, all-subdirs): Added mathvec folder.
(libmvec): New variable.
* configure.ac: Added option for mathvec build.
* configure: Regenerated.
* mathvec/Depend: New file.
* mathvec/Makefile: New file.
* shlib-versions: Added libmvec.
* math/Makefile: Added rule for libm.so installation.
diff --git a/Makeconfig b/Makeconfig
index 77752c0..d32a0fd 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -498,7 +498,7 @@ link-libc = $(link-libc-rpath-link) $(link-libc-before-gnulib) $(gnulib)
link-libc-tests = $(link-libc-tests-rpath-link) \
$(link-libc-before-gnulib) $(gnulib-tests)
# This is how to find at build-time things that will be installed there.
-rpath-dirs = math elf dlfcn nss nis rt resolv crypt
+rpath-dirs = math elf dlfcn nss nis rt resolv crypt mathvec
rpath-link = \
$(common-objdir):$(subst $(empty) ,:,$(patsubst ../$(subdir),.,$(rpath-dirs:%=$(common-objpfx)%)))
else
@@ -1074,8 +1074,10 @@ endif
ifeq ($(build-shared),yes)
libm = $(common-objpfx)math/libm.so$(libm.so-version)
+libmvec = $(common-objpfx)mathvec/libmvec.so$(libmvec.so-version)
else
libm = $(common-objpfx)math/libm.a
+libmvec = $(common-objpfx)mathvec/libmvec.a
endif
# These are the subdirectories containing the library source. The order
@@ -1085,7 +1087,7 @@ all-subdirs = csu assert ctype locale intl catgets math setjmp signal \
stdlib stdio-common libio malloc string wcsmbs time dirent \
grp pwd posix io termios resource misc socket sysvipc gmon \
gnulib iconv iconvdata wctype manual shadow gshadow po argp \
- crypt localedata timezone rt conform debug \
+ crypt localedata timezone rt conform debug mathvec \
$(add-on-subdirs) dlfcn elf
ifndef avoid-generated
diff --git a/configure b/configure
index 97e549e..1e4138b 100755
--- a/configure
+++ b/configure
@@ -777,6 +777,7 @@ enable_systemtap
enable_build_nscd
enable_nscd
enable_pt_chown
+enable_mathvec
with_cpu
'
ac_precious_vars='build_alias
@@ -1441,6 +1442,8 @@ Optional Features:
--disable-build-nscd disable building and installing the nscd daemon
--disable-nscd library functions will not contact the nscd daemon
--enable-pt_chown Enable building and installing pt_chown
+ --enable-mathvec Enable building and installing mathvec [default
+ depends on architecture]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -3845,6 +3848,14 @@ gnu*)
;;
esac
+# Check whether --enable-mathvec was given.
+if test "${enable_mathvec+set}" = set; then :
+ enableval=$enable_mathvec; build_mathvec=$enableval
+else
+ build_mathvec=notset
+fi
+
+
# We keep the original values in `$config_*' and never modify them, so we
# can write them unchanged into config.make. Everything else uses
# $machine, $vendor, and $os, and changes them whenever convenient.
@@ -7215,6 +7226,12 @@ $as_echo "running configure fragment for $dir" >&6; }
fi
done
+if test x"$build_mathvec" = xnotset; then
+ build_mathvec=no
+fi
+config_vars="$config_vars
+build-mathvec = $build_mathvec"
+
diff --git a/configure.ac b/configure.ac
index def655a..ff66b87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -381,6 +381,12 @@ gnu*)
;;
esac
+AC_ARG_ENABLE([mathvec],
+ [AS_HELP_STRING([--enable-mathvec],
+ [Enable building and installing mathvec @<:@default depends on architecture@:>@])],
+ [build_mathvec=$enableval],
+ [build_mathvec=notset])
+
# We keep the original values in `$config_*' and never modify them, so we
# can write them unchanged into config.make. Everything else uses
# $machine, $vendor, and $os, and changes them whenever convenient.
@@ -1994,6 +2000,11 @@ for dir in $sysnames; do
fi
done
+if test x"$build_mathvec" = xnotset; then
+ build_mathvec=no
+fi
+LIBC_CONFIG_VAR([build-mathvec], [$build_mathvec])
+
AC_SUBST(libc_extra_cflags)
AC_SUBST(libc_extra_cppflags)
diff --git a/math/Makefile b/math/Makefile
index 4f66162..9a3cf32 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -86,6 +86,22 @@ generated += $(foreach s,.c .S l.c l.S f.c f.S,$(calls:s_%=m_%$s))
routines = $(calls) $(calls:=f) $(long-c-$(long-double-fcts))
long-c-yes = $(calls:=l)
+ifeq ($(build-mathvec),yes)
+# We need to install libm.so as linker script
+# for more comfortable use of vector math library.
+install-lib-ldscripts := libm.so
+install_subdir: $(inst_libdir)/libm.so
+$(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) ' \
+ 'AS_NEEDED ( $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
+ ) > $@
+endif
+
# Rules for the test suite.
tests = test-matherr test-fenv atest-exp atest-sincos atest-exp2 basic-test \
test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \
diff --git a/mathvec/Depend b/mathvec/Depend
new file mode 100644
index 0000000..ede10ab
--- /dev/null
+++ b/mathvec/Depend
@@ -0,0 +1 @@
+math
diff --git a/mathvec/Makefile b/mathvec/Makefile
new file mode 100644
index 0000000..269a086
--- /dev/null
+++ b/mathvec/Makefile
@@ -0,0 +1,35 @@
+# Copyright (C) 2015 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# 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.
+
+# 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
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <http://www.gnu.org/licenses/>.
+
+# Makefile for the vector math library.
+
+subdir := mathvec
+
+include ../Makeconfig
+
+ifeq ($(build-mathvec),yes)
+extra-libs := libmvec
+extra-libs-others = $(extra-libs)
+
+libmvec-routines = $(strip $(libmvec-support))
+
+$(objpfx)libmvec.so: $(libm)
+endif
+
+# Rules for the test suite are in math directory.
+
+include ../Rules
diff --git a/shlib-versions b/shlib-versions
index e05b248..fa3cf1d 100644
--- a/shlib-versions
+++ b/shlib-versions
@@ -71,3 +71,6 @@ libanl=1
# This defines the libgcc soname version this glibc is to load for
# asynchronous cancellation to work correctly.
libgcc_s=1
+
+# The vector math library
+libmvec=1
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a50ac6ec0a8e23e1b062e92545606951747c8b8c
commit a50ac6ec0a8e23e1b062e92545606951747c8b8c
Author: Andrew Senkevich <andrew.senkevich@intel.com>
Date: Tue Apr 28 13:48:22 2015 +0300
This patch adds infrastructure for addition of SIMD
declarations for math functions in math.h. Added new headers math-vector.h
only generic version for now and libm-simd-decl-stubs.h with empty
definitions required for proper unfolding of new macros __MATHCALL_VEC which
will be used for declaration of vector math functions.
2015-04-28 Andrew Senkevich <andrew.senkevich@intel.com>
* bits/math-vector.h: New file.
* bits/libm-simd-decl-stubs.h: New header.
* math/Makefile (headers): Added new header libm-simd-decl-stubs.h.
* math/math.h (__MATHCALL_VEC): New macro.
diff --git a/bits/libm-simd-decl-stubs.h b/bits/libm-simd-decl-stubs.h
new file mode 100644
index 0000000..7ddd6fa
--- /dev/null
+++ b/bits/libm-simd-decl-stubs.h
@@ -0,0 +1,40 @@
+/* Empty definitions required for __MATHCALL_VEC unfolding in mathcalls.h.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ 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.
+
+ 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never include <bits/libm-simd-decl-stubs.h> directly;\
+ include <math.h> instead."
+#endif
+
+/* Needed definitions could be generated with:
+ for func in $(grep __MATHCALL_VEC math/bits/mathcalls.h |\
+ sed -r "s|__MATHCALL_VEC.?\(||; s|,.*||"); do
+ echo "#define __DECL_SIMD_${func}";
+ echo "#define __DECL_SIMD_${func}f";
+ echo "#define __DECL_SIMD_${func}l";
+ done
+ */
+
+#ifndef _BITS_LIBM_SIMD_DECL_STUBS_H
+#define _BITS_LIBM_SIMD_DECL_STUBS_H 1
+
+#define __DECL_SIMD_cos
+#define __DECL_SIMD_cosf
+#define __DECL_SIMD_cosl
+
+#endif
diff --git a/bits/math-vector.h b/bits/math-vector.h
new file mode 100644
index 0000000..2d01e35
--- /dev/null
+++ b/bits/math-vector.h
@@ -0,0 +1,27 @@
+/* Platform-specific SIMD declarations of math functions.
+ Copyright (C) 2015 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _MATH_H
+# error "Never include <bits/math-vector.h> directly;\
+ include <math.h> instead."
+#endif
+
+/* Get default empty definitions required for __MATHCALL_VEC unfolding.
+ Plaform-specific analogue of this header should redefine them with specific
+ SIMD declarations. */
+#include <bits/libm-simd-decl-stubs.h>
diff --git a/math/Makefile b/math/Makefile
index fdfeb4a..4f66162 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -26,7 +26,8 @@ headers := math.h bits/mathcalls.h bits/mathinline.h bits/huge_val.h \
bits/huge_valf.h bits/huge_vall.h bits/inf.h bits/nan.h \
fpu_control.h complex.h bits/cmathcalls.h fenv.h \
bits/fenv.h bits/fenvinline.h bits/mathdef.h tgmath.h \
- bits/math-finite.h
+ bits/math-finite.h bits/math-vector.h \
+ bits/libm-simd-decl-stubs.h
# FPU support code.
aux := setfpucw fpu_control
diff --git a/math/math.h b/math/math.h
index c7ff169..7e959fc 100644
--- a/math/math.h
+++ b/math/math.h
@@ -27,6 +27,9 @@
__BEGIN_DECLS
+/* Get machine-dependent vector math functions declarations. */
+#include <bits/math-vector.h>
+
/* Get machine-dependent HUGE_VAL value (returned on overflow).
On all IEEE754 machines, this is +Infinity. */
#include <bits/huge_val.h>
@@ -49,6 +52,12 @@ __BEGIN_DECLS
so we can easily declare each function as both `name' and `__name',
and can declare the float versions `namef' and `__namef'. */
+#define __SIMD_DECL(function) __CONCAT (__DECL_SIMD_, function)
+
+#define __MATHCALL_VEC(function, suffix, args) \
+ __SIMD_DECL (__MATH_PRECNAME (function, suffix)) \
+ __MATHCALL (function, suffix, args)
+
#define __MATHCALL(function,suffix, args) \
__MATHDECL (_Mdouble_,function,suffix, args)
#define __MATHDECL(type, function,suffix, args) \
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=93c1dba3b429eae4569dc0aeb3dff30e95cb0088
commit 93c1dba3b429eae4569dc0aeb3dff30e95cb0088
Author: Andrew Senkevich <andrew.senkevich@intel.com>
Date: Tue Apr 28 13:48:22 2015 +0300
Last part of changes regarding to libm-test.inc:
addition of method for separation which exactly testing function needed to
run with help of generated during make check header with series of
conditional definitions.
2015-04-28 Andrew Senkevich <andrew.senkevich@intel.com>
* math/gen-libm-have-vector-test.sh: Script generates series of macros
for conditions in testing functions.
* math/Makefile: Added call of libm-have-vector-test.sh.
* math/libm-test.inc (HAVE_VECTOR): New macros.
diff --git a/math/Makefile b/math/Makefile
index 1537b5a..fdfeb4a 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -103,7 +103,7 @@ libm-tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \
libm-tests.o = $(addsuffix .o,$(libm-tests))
tests += $(libm-tests)
-libm-tests-generated = libm-test-ulps.h libm-test.c
+libm-tests-generated = libm-test-ulps.h libm-have-vector-test.h libm-test.c
generated += $(libm-tests-generated) libm-test.stmp
# This is needed for dependencies
@@ -114,9 +114,10 @@ ulps-file = $(firstword $(wildcard $(sysdirs:%=%/libm-test-ulps)))
$(addprefix $(objpfx), $(libm-tests-generated)): $(objpfx)libm-test.stmp
$(objpfx)libm-test.stmp: $(ulps-file) libm-test.inc gen-libm-test.pl \
- auto-libm-test-out
+ gen-libm-have-vector-test.sh auto-libm-test-out
$(make-target-directory)
$(PERL) gen-libm-test.pl -u $< -o "$(objpfx)"
+ $(SHELL) gen-libm-have-vector-test.sh > $(objpfx)libm-have-vector-test.h
@echo > $@
$(objpfx)test-float.o: $(objpfx)libm-test.stmp
diff --git a/math/gen-libm-have-vector-test.sh b/math/gen-libm-have-vector-test.sh
new file mode 100644
index 0000000..add5a85
--- /dev/null
+++ b/math/gen-libm-have-vector-test.sh
@@ -0,0 +1,47 @@
+#!/bin/sh
+# Copyright (C) 1999-2015 Free Software Foundation, Inc.
+# This file is part of the GNU C Library.
+
+# The GNU C Library is free software; you can redistribute it and/or
+# 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.
+
+# 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
+# Lesser General Public License for more details.
+
+# You should have received a copy of the GNU Lesser General Public
+# License along with the GNU C Library; if not, see
+# <http://www.gnu.org/licenses/>.
+
+# Generate series of definitions used for vector math functions tests.
+# TEST_VECTOR_* and WRAPPER_NAME are defined in vector math functions tests.
+# *_VEC_SUFF is used in individual tests, as result of FUNC_TEST unfolding
+# to avoid warnings / errors about undeclared functions.
+print_defs()
+{
+ echo "#if defined TEST_VECTOR_$1 && TEST_VECTOR_$1"
+ echo "# define HAVE_VECTOR_$1 1"
+ echo "# define ${1}_VEC_SUFF WRAPPER_NAME ($1)"
+ echo "#else"
+ echo "# define HAVE_VECTOR_$1 0"
+ echo "# define ${1}_VEC_SUFF $1"
+ echo "#endif"
+ echo
+}
+
+for func in $(grep ALL_RM_TEST libm-test.inc | grep -v define | sed -r "s/.*\(//; s/,.*//"); do
+ print_defs ${func}
+ print_defs ${func}f
+ print_defs ${func}l
+done
+
+# When all functions will use ALL_RM_TEST instead of using START directly,
+# this code can be removed.
+for func in $(grep 'START.*;$' libm-test.inc | sed -r "s/.*\(//; s/,.*//"); do
+ print_defs ${func}
+ print_defs ${func}f
+ print_defs ${func}l
+done
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 2e13be7..0aa8bb3 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -1699,11 +1699,16 @@ struct test_fFF_11_data
#define STR_CONCAT(a, b, c) __STRING (a##b##c)
#define STR_CON3(a, b, c) STR_CONCAT (a, b, c)
+/* This generated header defines series of macros started with HAVE_VECTOR_. */
+#include "libm-have-vector-test.h"
+
+#define HAVE_VECTOR(func) __CONCAT (HAVE_VECTOR_, func)
+
/* Start and end the tests for a given function. */
-#define START(FUNC, SUFF, EXACT) \
+#define START(FUN, SUFF, EXACT) \
CHECK_ARCH_EXT; \
- if (TEST_MATHVEC) return; \
- const char *this_func = STR_CON3 (FUNC, SUFF, VEC_SUFF); \
+ if (TEST_MATHVEC && !HAVE_VECTOR (FUNC (FUN))) return; \
+ const char *this_func = STR_CON3 (FUN, SUFF, VEC_SUFF); \
init_max_error (this_func, EXACT)
#define END \
print_max_error (this_func)
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a0f4fa7b6e9f574f554e223b1bd02c6083256c45
commit a0f4fa7b6e9f574f554e223b1bd02c6083256c45
Author: Andrew Senkevich <andrew.senkevich@intel.com>
Date: Tue Apr 28 13:48:22 2015 +0300
Refactoring of START for conditions in individual tests
and addition of macros used for runtime architecture check.
2015-04-28 Andrew Senkevich <andrew.senkevich@intel.com>
* math/libm-test.inc: START refactored.
* math/test-double.c (TEST_MATHVEC): Add define.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildoubl.c: Likewise.
* math/test-ldouble.c: Likewise.
* sysdeps/generic/math-tests-arch.h (INIT_ARCH_EXT, CHECK_ARCH_EXT):
New helper macros for runtime architecture check.
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 2637ed2..2e13be7 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -126,6 +126,7 @@
#include <argp.h>
#include <tininess.h>
#include <math-tests.h>
+#include <math-tests-arch.h>
/* Structure for ulp data for a function, or the real or imaginary
part of a function. */
@@ -685,7 +686,7 @@ static void
test_single_errno (const char *test_name, int errno_value,
int expected_value, const char *expected_name)
{
-#ifndef TEST_INLINE
+#if !defined TEST_INLINE && !TEST_MATHVEC
if (errno_value == expected_value)
{
if (print_screen (1))
@@ -1691,9 +1692,18 @@ struct test_fFF_11_data
(ARRAY)[i].RM_##ROUNDING_MODE.extra2_expected); \
ROUND_RESTORE_ ## ROUNDING_MODE
+#if !TEST_MATHVEC
+# define VEC_SUFF
+#endif
+
+#define STR_CONCAT(a, b, c) __STRING (a##b##c)
+#define STR_CON3(a, b, c) STR_CONCAT (a, b, c)
+
/* Start and end the tests for a given function. */
-#define START(FUNC, EXACT) \
- const char *this_func = #FUNC; \
+#define START(FUNC, SUFF, EXACT) \
+ CHECK_ARCH_EXT; \
+ if (TEST_MATHVEC) return; \
+ const char *this_func = STR_CON3 (FUNC, SUFF, VEC_SUFF); \
init_max_error (this_func, EXACT)
#define END \
print_max_error (this_func)
@@ -1706,28 +1716,28 @@ struct test_fFF_11_data
{ \
do \
{ \
- START (FUNC, EXACT); \
+ START (FUNC,, EXACT); \
LOOP_MACRO (FUNC, ARRAY, , ## __VA_ARGS__); \
END_MACRO; \
} \
while (0); \
do \
{ \
- START (FUNC ## _downward, EXACT); \
+ START (FUNC, _downward, EXACT); \
LOOP_MACRO (FUNC, ARRAY, FE_DOWNWARD, ## __VA_ARGS__); \
END_MACRO; \
} \
while (0); \
do \
{ \
- START (FUNC ## _towardzero, EXACT); \
+ START (FUNC, _towardzero, EXACT); \
LOOP_MACRO (FUNC, ARRAY, FE_TOWARDZERO, ## __VA_ARGS__); \
END_MACRO; \
} \
while (0); \
do \
{ \
- START (FUNC ## _upward, EXACT); \
+ START (FUNC, _upward, EXACT); \
LOOP_MACRO (FUNC, ARRAY, FE_UPWARD, ## __VA_ARGS__); \
END_MACRO; \
} \
@@ -6025,7 +6035,7 @@ static const struct test_c_c_data cexp_test_data[] =
static void
cexp_test (void)
{
- START (cexp, 0);
+ START (cexp,, 0);
RUN_TEST_LOOP_c_c (cexp, cexp_test_data, );
END_COMPLEX;
}
@@ -7544,7 +7554,7 @@ static const struct test_if_f_data jn_test_data[] =
static void
jn_test (void)
{
- START (jn, 0);
+ START (jn,, 0);
RUN_TEST_LOOP_if_f (jn, jn_test_data, );
END;
}
@@ -9506,7 +9516,7 @@ static const struct test_f_f_data tgamma_test_data[] =
static void
tgamma_test (void)
{
- START (tgamma, 0);
+ START (tgamma,, 0);
RUN_TEST_LOOP_f_f (tgamma, tgamma_test_data, );
END;
}
@@ -9956,6 +9966,8 @@ main (int argc, char **argv)
initialize ();
printf (TEST_MSG);
+ INIT_ARCH_EXT;
+
check_ulp ();
/* Keep the tests a wee bit ordered (according to ISO C99). */
diff --git a/math/test-double.c b/math/test-double.c
index cbb81f9..6c1c11c 100644
--- a/math/test-double.c
+++ b/math/test-double.c
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "a"
#define PRINTF_NEXPR "f"
#define TEST_DOUBLE 1
+#define TEST_MATHVEC 0
#ifndef __NO_MATH_INLINES
# define __NO_MATH_INLINES
diff --git a/math/test-float.c b/math/test-float.c
index c54dd3c..07dc8ea 100644
--- a/math/test-float.c
+++ b/math/test-float.c
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "a"
#define PRINTF_NEXPR "f"
#define TEST_FLOAT 1
+#define TEST_MATHVEC 0
#ifndef __NO_MATH_INLINES
# define __NO_MATH_INLINES
diff --git a/math/test-idouble.c b/math/test-idouble.c
index b23bd21..bb73f9c 100644
--- a/math/test-idouble.c
+++ b/math/test-idouble.c
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "a"
#define PRINTF_NEXPR "f"
#define TEST_DOUBLE 1
+#define TEST_MATHVEC 0
#define TEST_INLINE
#ifdef __NO_MATH_INLINES
diff --git a/math/test-ifloat.c b/math/test-ifloat.c
index 57a7a77..74e8e4b 100644
--- a/math/test-ifloat.c
+++ b/math/test-ifloat.c
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "a"
#define PRINTF_NEXPR "f"
#define TEST_FLOAT 1
+#define TEST_MATHVEC 0
#define TEST_INLINE 1
#ifdef __NO_MATH_INLINES
diff --git a/math/test-ildoubl.c b/math/test-ildoubl.c
index c38a109..f90a9ba 100644
--- a/math/test-ildoubl.c
+++ b/math/test-ildoubl.c
@@ -27,6 +27,7 @@
#define PRINTF_NEXPR "Lf"
#define TEST_INLINE
#define TEST_LDOUBLE 1
+#define TEST_MATHVEC 0
#ifdef __NO_MATH_INLINES
# undef __NO_MATH_INLINES
diff --git a/math/test-ldouble.c b/math/test-ldouble.c
index 20bf0a1..97effb6 100644
--- a/math/test-ldouble.c
+++ b/math/test-ldouble.c
@@ -26,6 +26,7 @@
#define PRINTF_XEXPR "La"
#define PRINTF_NEXPR "Lf"
#define TEST_LDOUBLE 1
+#define TEST_MATHVEC 0
#ifndef __NO_MATH_INLINES
# define __NO_MATH_INLINES
diff --git a/math/test-double.c b/sysdeps/generic/math-tests-arch.h
similarity index 56%
copy from math/test-double.c
copy to sysdeps/generic/math-tests-arch.h
index cbb81f9..ce82201 100644
--- a/math/test-double.c
+++ b/sysdeps/generic/math-tests-arch.h
@@ -1,6 +1,6 @@
-/* Copyright (C) 1997-2015 Free Software Foundation, Inc.
+/* Runtime architecture check for math tests.
+ Copyright (C) 2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Andreas Jaeger <aj@suse.de>, 1997.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -16,19 +16,9 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#define FUNC(function) function
-#define FUNC_TEST(function) FUNC (function)
-#define FLOAT double
-#define TEST_MSG "testing double (without inline functions)\n"
-#define MATHCONST(x) x
-#define CHOOSE(Clongdouble,Cdouble,Cfloat,Cinlinelongdouble,Cinlinedouble,Cinlinefloat) Cdouble
-#define PRINTF_EXPR "e"
-#define PRINTF_XEXPR "a"
-#define PRINTF_NEXPR "f"
-#define TEST_DOUBLE 1
-
-#ifndef __NO_MATH_INLINES
-# define __NO_MATH_INLINES
-#endif
-
-#include "libm-test.c"
+/* These macros used for architecture check in math tests runtime.
+ INIT_ARCH_EXT should set up for example some global variable which is
+ checked by CHECK_ARCH_EXT which produces return from individual test to
+ prevent run on hardware not supported by tested function implementation. */
+#define INIT_ARCH_EXT
+#define CHECK_ARCH_EXT
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0d7660a2fc79b2afca5047a709c5968c77a09e8c
commit 0d7660a2fc79b2afca5047a709c5968c77a09e8c
Author: Andrew Senkevich <andrew.senkevich@intel.com>
Date: Tue Apr 28 13:48:22 2015 +0300
This is the beginning of series of patches with addition of
vector math functions infrastructure. This patch is preparatory change
in libm-test.c - splitting of macros which form name of tested functions
for ability to use separate name for tested functions and for functions
used in test suite infrastructure.
2015-04-28 Andrew Senkevich <andrew.senkevich@intel.com>
* math/test-double.c (FUNC_TEST): New macro.
* math/test-float.c: Likewise.
* math/test-idouble.c: Likewise.
* math/test-ifloat.c: Likewise.
* math/test-ildoubl.c: Likewise.
* math/test-ldouble.c: Likewise.
* math/libm-test.inc: Use FUNC_TEST for name of tested functions.
diff --git a/math/libm-test.inc b/math/libm-test.inc
index 5d7f5a2..2637ed2 100644
--- a/math/libm-test.inc
+++ b/math/libm-test.inc
@@ -1302,8 +1302,8 @@ struct test_fFF_11_data
if (enable_test (EXCEPTIONS)) \
{ \
COMMON_TEST_SETUP (ARG_STR); \
- check_float (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
- EXCEPTIONS); \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG), \
+ EXPECTED, EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
while (0)
@@ -1320,7 +1320,7 @@ struct test_fFF_11_data
if (enable_test (EXCEPTIONS)) \
{ \
COMMON_TEST_SETUP (ARG_STR); \
- check_float (test_name, FUNC (FUNC_NAME) (ARG1, ARG2), \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG1, ARG2), \
EXPECTED, EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
@@ -1347,7 +1347,7 @@ struct test_fFF_11_data
if (enable_test (EXCEPTIONS)) \
{ \
COMMON_TEST_SETUP (ARG_STR); \
- check_float (test_name, FUNC (FUNC_NAME) (ARG1, ARG2, ARG3), \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG1, ARG2, ARG3), \
EXPECTED, EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
@@ -1367,7 +1367,7 @@ struct test_fFF_11_data
{ \
COMMON_TEST_SETUP (ARG_STR); \
check_float (test_name, \
- FUNC (FUNC_NAME) (BUILD_COMPLEX (ARG1, ARG2)), \
+ FUNC_TEST (FUNC_NAME) (BUILD_COMPLEX (ARG1, ARG2)),\
EXPECTED, EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
@@ -1388,7 +1388,7 @@ struct test_fFF_11_data
{ \
COMMON_TEST_SETUP (ARG_STR); \
(EXTRA_VAR) = (EXTRA_EXPECTED) == 0 ? 1 : 0; \
- check_float (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG), EXPECTED, \
EXCEPTIONS); \
EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
if (EXTRA_TEST) \
@@ -1415,7 +1415,7 @@ struct test_fFF_11_data
{ \
COMMON_TEST_SETUP (ARG_STR); \
(EXTRA_VAR) = (EXTRA_EXPECTED) == 0 ? 1 : 0; \
- check_float (test_name, FUNC (FUNC_NAME) (ARG, &(EXTRA_VAR)), \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG, &(EXTRA_VAR)), \
EXPECTED, EXCEPTIONS); \
EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
if (EXTRA_TEST) \
@@ -1442,7 +1442,7 @@ struct test_fFF_11_data
{ \
COMMON_TEST_SETUP (ARG_STR); \
(EXTRA_VAR) = (EXTRA_EXPECTED) == 0 ? 1 : 0; \
- check_float (test_name, FUNC (FUNC_NAME) (ARG, &(EXTRA_VAR)), \
+ check_float (test_name, FUNC_TEST (FUNC_NAME) (ARG, &(EXTRA_VAR)), \
EXPECTED, EXCEPTIONS); \
EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
if (EXTRA_TEST) \
@@ -1470,7 +1470,7 @@ struct test_fFF_11_data
COMMON_TEST_SETUP (ARG_STR); \
(EXTRA_VAR) = (EXTRA_EXPECTED) == 0 ? 1 : 0; \
check_float (test_name, \
- FUNC (FUNC_NAME) (ARG1, ARG2, &(EXTRA_VAR)), \
+ FUNC_TEST (FUNC_NAME) (ARG1, ARG2, &(EXTRA_VAR)), \
EXPECTED, EXCEPTIONS); \
EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
if (EXTRA_TEST) \
@@ -1498,7 +1498,7 @@ struct test_fFF_11_data
{ \
COMMON_TEST_SETUP (ARG_STR); \
check_complex (test_name, \
- FUNC (FUNC_NAME) (BUILD_COMPLEX (ARGR, ARGC)), \
+ FUNC_TEST (FUNC_NAME) (BUILD_COMPLEX (ARGR, ARGC)), \
BUILD_COMPLEX (EXPR, EXPC), EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
@@ -1519,8 +1519,8 @@ struct test_fFF_11_data
{ \
COMMON_TEST_SETUP (ARG_STR); \
check_complex (test_name, \
- FUNC (FUNC_NAME) (BUILD_COMPLEX (ARG1R, ARG1C), \
- BUILD_COMPLEX (ARG2R, ARG2C)), \
+ FUNC_TEST (FUNC_NAME) (BUILD_COMPLEX (ARG1R, ARG1C), \
+ BUILD_COMPLEX (ARG2R, ARG2C)), \
BUILD_COMPLEX (EXPR, EXPC), EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
@@ -1540,7 +1540,7 @@ struct test_fFF_11_data
if (enable_test (EXCEPTIONS)) \
{ \
COMMON_TEST_SETUP (ARG_STR); \
- check_int (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
+ check_int (test_name, FUNC_TEST (FUNC_NAME) (ARG), EXPECTED, \
EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
@@ -1593,7 +1593,7 @@ struct test_fFF_11_data
if (enable_test (EXCEPTIONS)) \
{ \
COMMON_TEST_SETUP (ARG_STR); \
- check_bool (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
+ check_bool (test_name, FUNC_TEST (FUNC_NAME) (ARG), EXPECTED, \
EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
@@ -1627,7 +1627,7 @@ struct test_fFF_11_data
if (enable_test (EXCEPTIONS)) \
{ \
COMMON_TEST_SETUP (ARG_STR); \
- check_long (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
+ check_long (test_name, FUNC_TEST (FUNC_NAME) (ARG), EXPECTED, \
EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
@@ -1644,8 +1644,8 @@ struct test_fFF_11_data
if (enable_test (EXCEPTIONS)) \
{ \
COMMON_TEST_SETUP (ARG_STR); \
- check_longlong (test_name, FUNC (FUNC_NAME) (ARG), EXPECTED, \
- EXCEPTIONS); \
+ check_longlong (test_name, FUNC_TEST (FUNC_NAME) (ARG), \
+ EXPECTED, EXCEPTIONS); \
COMMON_TEST_CLEANUP; \
} \
while (0)
@@ -1664,7 +1664,7 @@ struct test_fFF_11_data
if (enable_test (EXCEPTIONS)) \
{ \
COMMON_TEST_SETUP (ARG_STR); \
- FUNC (FUNC_NAME) (ARG, &(EXTRA1_VAR), &(EXTRA2_VAR)); \
+ FUNC_TEST (FUNC_NAME) (ARG, &(EXTRA1_VAR), &(EXTRA2_VAR)); \
EXTRA_OUTPUT_TEST_SETUP (ARG_STR, 1); \
if (EXTRA1_TEST) \
check_float (extra1_name, EXTRA1_VAR, EXTRA1_EXPECTED, \
diff --git a/math/test-double.c b/math/test-double.c
index c8203a3..cbb81f9 100644
--- a/math/test-double.c
+++ b/math/test-double.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#define FUNC(function) function
+#define FUNC_TEST(function) FUNC (function)
#define FLOAT double
#define TEST_MSG "testing double (without inline functions)\n"
#define MATHCONST(x) x
diff --git a/math/test-float.c b/math/test-float.c
index 3f04e15..c54dd3c 100644
--- a/math/test-float.c
+++ b/math/test-float.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#define FUNC(function) function ## f
+#define FUNC_TEST(function) FUNC (function)
#define FLOAT float
#define TEST_MSG "testing float (without inline functions)\n"
#define MATHCONST(x) x
diff --git a/math/test-idouble.c b/math/test-idouble.c
index 1c11017..b23bd21 100644
--- a/math/test-idouble.c
+++ b/math/test-idouble.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#define FUNC(function) function
+#define FUNC_TEST(function) FUNC (function)
#define FLOAT double
#define TEST_MSG "testing double (inline functions)\n"
#define MATHCONST(x) x
diff --git a/math/test-ifloat.c b/math/test-ifloat.c
index e64f9ca..57a7a77 100644
--- a/math/test-ifloat.c
+++ b/math/test-ifloat.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#define FUNC(function) function ## f
+#define FUNC_TEST(function) FUNC (function)
#define FLOAT float
#define TEST_MSG "testing float (inline functions)\n"
#define MATHCONST(x) x
diff --git a/math/test-ildoubl.c b/math/test-ildoubl.c
index 2b98544..c38a109 100644
--- a/math/test-ildoubl.c
+++ b/math/test-ildoubl.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#define FUNC(function) function##l
+#define FUNC_TEST(function) FUNC (function)
#define FLOAT long double
#define TEST_MSG "testing long double (inline functions)\n"
#define MATHCONST(x) x##L
diff --git a/math/test-ldouble.c b/math/test-ldouble.c
index 94a71a2..20bf0a1 100644
--- a/math/test-ldouble.c
+++ b/math/test-ldouble.c
@@ -17,6 +17,7 @@
<http://www.gnu.org/licenses/>. */
#define FUNC(function) function##l
+#define FUNC_TEST(function) FUNC (function)
#define FLOAT long double
#define TEST_MSG "testing long double (without inline functions)\n"
#define MATHCONST(x) x##L
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources