mirror of
git://sourceware.org/git/glibc.git
synced 2026-09-09 05:59:27 +08:00
Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec3a4b85a8 | ||
|
|
a50ac6ec0a | ||
|
|
93c1dba3b4 | ||
|
|
a0f4fa7b6e | ||
|
|
0d7660a2fc |
+4
-2
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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>
|
||||
@@ -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"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
+21
-3
@@ -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
|
||||
@@ -85,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 \
|
||||
@@ -103,7 +120,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 +131,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
|
||||
|
||||
@@ -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
|
||||
+45
-28
@@ -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))
|
||||
@@ -1302,8 +1303,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 +1321,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 +1348,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 +1368,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 +1389,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 +1416,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 +1443,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 +1471,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 +1499,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 +1520,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 +1541,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 +1594,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 +1628,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 +1645,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 +1665,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, \
|
||||
@@ -1691,9 +1692,23 @@ 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)
|
||||
|
||||
/* 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, EXACT) \
|
||||
const char *this_func = #FUNC; \
|
||||
#define START(FUN, SUFF, EXACT) \
|
||||
CHECK_ARCH_EXT; \
|
||||
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)
|
||||
@@ -1706,28 +1721,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 +6040,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 +7559,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 +9521,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 +9971,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). */
|
||||
|
||||
@@ -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) \
|
||||
|
||||
@@ -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
|
||||
@@ -25,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
|
||||
|
||||
@@ -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
|
||||
@@ -25,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
|
||||
|
||||
@@ -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
|
||||
@@ -25,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
|
||||
|
||||
@@ -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
|
||||
@@ -25,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
|
||||
|
||||
@@ -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
|
||||
@@ -26,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
|
||||
|
||||
@@ -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
|
||||
@@ -25,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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
math
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/* Runtime architecture check for math tests.
|
||||
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/>. */
|
||||
|
||||
/* 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
|
||||
Reference in New Issue
Block a user