about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu/Makeconfig
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2021-10-11 18:07:09 -0700
committerH.J. Lu <hjl.tools@gmail.com>2021-10-20 11:53:45 -0700
commitd962cce139583c71fcbe9a05dc4c5fa68f72f655 (patch)
tree512381b317b5021de12ba1b0c35f2cb131760d9b /sysdeps/x86_64/fpu/Makeconfig
parente037274c8ec86ca9d491331984b34f30701b23cf (diff)
downloadglibc-d962cce139583c71fcbe9a05dc4c5fa68f72f655.tar.gz
glibc-d962cce139583c71fcbe9a05dc4c5fa68f72f655.tar.xz
glibc-d962cce139583c71fcbe9a05dc4c5fa68f72f655.zip
x86-64: Add sysdeps/x86_64/fpu/Makeconfig
1. Add sysdeps/x86_64/fpu/Makeconfig to auto-generate libmvec.mk, which
contains libmvec ABI test dependencies and CFLAGS, in the build directory.
2. Include libmvec.mk for libmvec ABI test dependencies and CFLAGS.

Tested on SSE4, AVX, AVX2 and AVX512 machines.

Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
Diffstat (limited to 'sysdeps/x86_64/fpu/Makeconfig')
-rw-r--r--sysdeps/x86_64/fpu/Makeconfig92
1 files changed, 92 insertions, 0 deletions
diff --git a/sysdeps/x86_64/fpu/Makeconfig b/sysdeps/x86_64/fpu/Makeconfig
new file mode 100644
index 0000000000..0a9341cdd9
--- /dev/null
+++ b/sysdeps/x86_64/fpu/Makeconfig
@@ -0,0 +1,92 @@
+# Generate libmvec.mk for libmvec ABI tests.
+
+# Copyright (C) 2021 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
+# <https://www.gnu.org/licenses/>.
+
+-include $(common-objpfx)libmvec.mk
+postclean-generated += libmvec.mk
+
+# Define for both math and mathvec directories.
+libmvec-funcs = \
+  cos \
+  exp \
+  log \
+  pow \
+  sin \
+  sincos \
+
+# FIXME: Add ABI tests for all libmvec functions and replace
+# libmvec-abi-funcs with libmvec-funcs.
+libmvec-abi-funcs = \
+  sincos
+
+# The base libmvec ABI tests.
+libmvec-abi-func-tests = \
+  $(addprefix test-double-libmvec-,$(libmvec-abi-funcs)) \
+  $(addsuffix f,$(addprefix test-float-libmvec-,$(libmvec-abi-funcs)))
+
+# The AVX libmvec ABI tests.
+libmvec-abi-func-avx-tests = \
+  $(addsuffix -avx,$(libmvec-abi-func-tests))
+#
+# The AVX2 libmvec ABI tests.
+libmvec-abi-func-avx2-tests = \
+  $(addsuffix -avx2,$(libmvec-abi-func-tests))
+#
+# The AVX512F libmvec ABI tests.
+libmvec-abi-func-avx512f-tests = \
+  $(addsuffix -avx512f,$(libmvec-abi-func-tests))
+
+$(common-objpfx)libmvec.mk: $(common-objpfx)config.make
+	(echo "ifeq (\$$(subdir)\$$(build-mathvec),mathyes)"; \
+	 echo; \
+	 for i in "" "-avx" "-avx2" "-avx512f"; do \
+	   for t in $(libmvec-abi-func-tests); do \
+	     echo "\$$(objpfx)$$t$$i: \\"; \
+	     echo "  \$$(objpfx)$$t$$i.o \\"; \
+	     echo "  \$$(objpfx)test-libmvec$$i.o \$$(libmvec)"; \
+	     echo; \
+	   done; \
+	 done; \
+	 for t in $(libmvec-abi-funcs); do \
+	   echo "CFLAGS-test-double-libmvec-$$t.c = \\"; \
+	   echo "  \$$(libmvec-abi-test-cflags)"; \
+	   echo "CFLAGS-test-double-libmvec-$$t-avx.c = \\"; \
+	   echo "  \$$(libmvec-abi-test-cflags) \\"; \
+	   echo "  \$$(double-vlen4-arch-ext-cflags)"; \
+	   echo "CFLAGS-test-double-libmvec-$$t-avx2.c = \\"; \
+	   echo "  \$$(libmvec-abi-test-cflags) \\"; \
+	   echo "  \$$(double-vlen4-arch-ext2-cflags)"; \
+	   echo "CFLAGS-test-double-libmvec-$$t-avx512f.c = \\"; \
+	   echo "  \$$(libmvec-abi-test-cflags) \\"; \
+	   echo "  \$$(double-vlen8-arch-ext-cflags)"; \
+	   echo; \
+	   echo "CFLAGS-test-float-libmvec-$${t}f.c = \\"; \
+	   echo "  \$$(libmvec-abi-test-cflags)"; \
+	   echo "CFLAGS-test-float-libmvec-$${t}f-avx.c = \\"; \
+	   echo "  \$$(libmvec-abi-test-cflags) \\"; \
+	   echo "  \$$(float-vlen8-arch-ext-cflags)"; \
+	   echo "CFLAGS-test-float-libmvec-$${t}f-avx2.c = \\"; \
+	   echo "  \$$(libmvec-abi-test-cflags) \\"; \
+	   echo "  \$$(float-vlen8-arch-ext2-cflags)"; \
+	   echo "CFLAGS-test-float-libmvec-$${t}f-avx512f.c = \\"; \
+	   echo "  \$$(libmvec-abi-test-cflags) \\"; \
+	   echo "  \$$(float-vlen16-arch-ext-cflags)"; \
+	   echo; \
+	 done; \
+	 echo "endif") > $@T
+	mv -f $@T $@