about summary refs log tree commit diff
path: root/math/Makefile
diff options
context:
space:
mode:
authorAndrew Senkevich <andrew.senkevich@intel.com>2015-06-09 14:51:52 +0300
committerAndrew Senkevich <andrew.senkevich@intel.com>2015-06-09 14:51:52 +0300
commit24a2718f595bc11dc6abb31303ceb8fdcb664f2f (patch)
tree28e738d8aa4f8716b6a37dd342db8a13714ab23c /math/Makefile
parent2193311288b97cf11dfabf1be22eac89b4ff7366 (diff)
downloadglibc-24a2718f595bc11dc6abb31303ceb8fdcb664f2f.tar.gz
glibc-24a2718f595bc11dc6abb31303ceb8fdcb664f2f.tar.xz
glibc-24a2718f595bc11dc6abb31303ceb8fdcb664f2f.zip
Addition of testing infrastructure for vector math functions.
We test vector math functions using scalar tests infrastructure with
help of special wrappers from scalar versions to vector ones. Wrapper
implemented using platform specific vector types and placed in separate
file for compilation with architecture specific options, main part of
test has no such options. With help of system of definitions unfolding
of which is drived from test code we have wrapper called in individual
testing function instead of scalar function. Also system of definitions
includes generated during make check header math/libm-have-vector-test.h
with series of conditional definitions which help to avoid build fails
for functions having no vector versions; runtime architecture check
to prevent runtime fails of test run on inappropriate hardware.

    * math/Makefile: Added rules for vector tests.
    * math/gen-libm-have-vector-test.sh: Added generation of wrapper
    declaration under condition.
    * math/test-double-vlen2.h: New file.
    * math/test-double-vlen4.h: New file.
    * math/test-double-vlen8.h: New file.
    * math/test-vec-loop.h: Added initialization macro.
    * sysdeps/x86_64/fpu/Makefile: Added variables for vector tests.
    * sysdeps/x86_64/fpu/libm-test-ulps: Regenarated.
    * sysdeps/x86_64/fpu/math-tests-arch.h: New file.
    * sysdeps/x86_64/fpu/test-double-vlen2-wrappers.c: New file.
    * sysdeps/x86_64/fpu/test-double-vlen2.c: New file.
    * sysdeps/x86_64/fpu/test-double-vlen4-avx2-wrappers.c: New file.
    * sysdeps/x86_64/fpu/test-double-vlen4-avx2.c: New file.
    * sysdeps/x86_64/fpu/test-double-vlen4-wrappers.c: New file.
    * sysdeps/x86_64/fpu/test-double-vlen4.c: New file.
    * sysdeps/x86_64/fpu/test-double-vlen8-wrappers.c: New file.
    * sysdeps/x86_64/fpu/test-double-vlen8.c: New file.
Diffstat (limited to 'math/Makefile')
-rw-r--r--math/Makefile33
1 files changed, 25 insertions, 8 deletions
diff --git a/math/Makefile b/math/Makefile
index 9a3cf3228b..8f14f255df 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -115,8 +115,9 @@ tests-static = test-fpucw-static test-fpucw-ieee-static
 test-longdouble-yes = test-ldouble test-ildoubl
 
 ifneq (no,$(PERL))
+libm-vec-tests = $(addprefix test-,$(libmvec-tests))
 libm-tests = test-float test-double $(test-longdouble-$(long-double-fcts)) \
-	test-ifloat test-idouble
+	test-ifloat test-idouble $(libm-vec-tests)
 libm-tests.o = $(addsuffix .o,$(libm-tests))
 
 tests += $(libm-tests)
@@ -143,8 +144,22 @@ $(objpfx)test-double.o: $(objpfx)libm-test.stmp
 $(objpfx)test-idouble.o: $(objpfx)libm-test.stmp
 $(objpfx)test-ldouble.o: $(objpfx)libm-test.stmp
 $(objpfx)test-ildoubl.o: $(objpfx)libm-test.stmp
+$(addprefix $(objpfx), $(addsuffix .o, $(libm-vec-tests))): $(objpfx)libm-test.stmp
 endif
 
+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-vlen2.c = $(libm-test-vec-cflags)
+CFLAGS-test-double-vlen2-wrappers.c = $(double-vlen2-arch-ext-cflags)
+
+CFLAGS-test-double-vlen4.c = $(libm-test-vec-cflags)
+CFLAGS-test-double-vlen4-wrappers.c = $(double-vlen4-arch-ext-cflags)
+
+CFLAGS-test-double-vlen8.c = $(libm-test-vec-cflags)
+CFLAGS-test-double-vlen8-wrappers.c = $(double-vlen8-arch-ext-cflags)
+
 CFLAGS-test-float.c = -fno-inline -ffloat-store -fno-builtin
 CFLAGS-test-double.c = -fno-inline -ffloat-store -fno-builtin
 CFLAGS-test-ldouble.c = -fno-inline -ffloat-store -fno-builtin
@@ -155,12 +170,12 @@ CFLAGS-test-tgmath.c = -fno-builtin
 CFLAGS-test-tgmath2.c = -fno-builtin
 CFLAGS-test-tgmath-ret.c = -fno-builtin
 CFLAGS-test-powl.c = -fno-builtin
-CPPFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
-			 -DTEST_FAST_MATH -fno-builtin
-CPPFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
-			  -DTEST_FAST_MATH -fno-builtin
-CPPFLAGS-test-ildoubl.c = -U__LIBC_INTERNAL_MATH_INLINES -D__FAST_MATH__ \
-			  -DTEST_FAST_MATH -fno-builtin
+CPPFLAGS-test-ifloat.c = -U__LIBC_INTERNAL_MATH_INLINES \
+			 $(libm-test-fast-math-cflags)
+CPPFLAGS-test-idouble.c = -U__LIBC_INTERNAL_MATH_INLINES \
+			  $(libm-test-fast-math-cflags)
+CPPFLAGS-test-ildoubl.c = -U__LIBC_INTERNAL_MATH_INLINES \
+			  $(libm-test-fast-math-cflags)
 
 
 # The -lieee module sets the _LIB_VERSION_ switch to IEEE mode
@@ -236,8 +251,10 @@ $(objpfx)libieee.a: $(objpfx)ieee-math.o
 	$(patsubst %/,cd % &&,$(objpfx)) \
 	$(LN_S) $(<F) $(@F)
 
-$(addprefix $(objpfx),$(filter-out $(tests-static),$(tests))): $(libm)
+$(addprefix $(objpfx),$(filter-out $(tests-static) $(libm-vec-tests),$(tests))): $(libm)
 $(addprefix $(objpfx),$(tests-static)): $(objpfx)libm.a
+$(addprefix $(objpfx), $(libm-vec-tests)): $(objpfx)%: $(libm) $(libmvec) \
+					   $(objpfx)init-arch.o $(objpfx)%-wrappers.o
 
 gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%.o,\
 		      add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \