about summary refs log tree commit diff
path: root/sysdeps/x86_64/fpu/Makeconfig
blob: 7acf1f306cc1740680e8566371d46d44d00420b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# 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 = \
  acos \
  cos \
  exp \
  log \
  pow \
  sin \
  sincos \

# Define libmvec function for benchtests directory.
libmvec-bench-funcs = \
  cos \
  exp \
  log \
  pow \
  sin \

bench-libmvec-double = \
  $(addprefix double-vlen1-, $(libmvec-bench-funcs)) \
  $(addprefix double-vlen2-, $(libmvec-bench-funcs)) \
  $(addprefix double-vlen4-, $(libmvec-bench-funcs)) \
  $(addprefix double-vlen4-avx2-, $(libmvec-bench-funcs)) \
  $(addprefix double-vlen8-, $(libmvec-bench-funcs)) \

bench-libmvec-float = \
  $(addsuffix f, $(addprefix float-vlen1-, $(libmvec-bench-funcs))) \
  $(addsuffix f, $(addprefix float-vlen4-, $(libmvec-bench-funcs))) \
  $(addsuffix f, $(addprefix float-vlen8-, $(libmvec-bench-funcs))) \
  $(addsuffix f, $(addprefix float-vlen8-avx2-, $(libmvec-bench-funcs))) \
  $(addsuffix f, $(addprefix float-vlen16-, $(libmvec-bench-funcs))) \

# The base libmvec ABI tests.
libmvec-abi-func-tests = \
  $(addprefix test-double-libmvec-,$(libmvec-funcs)) \
  $(addsuffix f,$(addprefix test-float-libmvec-,$(libmvec-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-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"; \
	 echo "ifeq (\$$(subdir),benchtests)"; \
	 for t in $(libmvec-bench-funcs); do \
	   echo "CFLAGS-bench-double-vlen4-$$t.c = \\"; \
	   echo "  \$$(double-vlen4-arch-ext-cflags)"; \
	   echo "CFLAGS-bench-double-vlen4-avx2-$$t.c = \\"; \
	   echo "  \$$(double-vlen4-arch-ext2-cflags)"; \
	   echo "CFLAGS-bench-double-vlen8-$$t.c = \\"; \
	   echo "  \$$(double-vlen8-arch-ext-cflags)"; \
	   echo; \
	   echo "CFLAGS-bench-float-vlen8-$${t}f.c = \\"; \
	   echo "  \$$(float-vlen8-arch-ext-cflags)"; \
	   echo "CFLAGS-bench-float-vlen8-avx2-$${t}f.c = \\"; \
	   echo "  \$$(float-vlen8-arch-ext2-cflags)"; \
	   echo "CFLAGS-bench-float-vlen16-$${t}f.c = \\"; \
	   echo "  \$$(float-vlen16-arch-ext-cflags)"; \
	   echo; \
	 done; \
	 echo "endif") > $@T
	mv -f $@T $@