]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/x86_64/fpu/Makeconfig
x86-64: Add vector log2/log2f implementation to libmvec
[thirdparty/glibc.git] / sysdeps / x86_64 / fpu / Makeconfig
1 # Generate libmvec.mk for libmvec ABI tests.
2
3 # Copyright (C) 2021 Free Software Foundation, Inc.
4 # This file is part of the GNU C Library.
5
6 # The GNU C Library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10
11 # The GNU C Library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
15
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with the GNU C Library; if not, see
18 # <https://www.gnu.org/licenses/>.
19
20 -include $(common-objpfx)libmvec.mk
21 postclean-generated += libmvec.mk
22
23 # Define for both math and mathvec directories.
24 libmvec-funcs = \
25 acos \
26 asin \
27 atan \
28 atan2 \
29 cbrt \
30 cos \
31 cosh \
32 exp \
33 exp10 \
34 exp2 \
35 expm1 \
36 hypot \
37 log \
38 log10 \
39 log2 \
40 pow \
41 sin \
42 sincos \
43 sinh \
44
45 # Define libmvec function for benchtests directory.
46 libmvec-bench-funcs = \
47 cos \
48 exp \
49 log \
50 pow \
51 sin \
52
53 bench-libmvec-double = \
54 $(addprefix double-vlen1-, $(libmvec-bench-funcs)) \
55 $(addprefix double-vlen2-, $(libmvec-bench-funcs)) \
56 $(addprefix double-vlen4-, $(libmvec-bench-funcs)) \
57 $(addprefix double-vlen4-avx2-, $(libmvec-bench-funcs)) \
58 $(addprefix double-vlen8-, $(libmvec-bench-funcs)) \
59
60 bench-libmvec-float = \
61 $(addsuffix f, $(addprefix float-vlen1-, $(libmvec-bench-funcs))) \
62 $(addsuffix f, $(addprefix float-vlen4-, $(libmvec-bench-funcs))) \
63 $(addsuffix f, $(addprefix float-vlen8-, $(libmvec-bench-funcs))) \
64 $(addsuffix f, $(addprefix float-vlen8-avx2-, $(libmvec-bench-funcs))) \
65 $(addsuffix f, $(addprefix float-vlen16-, $(libmvec-bench-funcs))) \
66
67 # The base libmvec ABI tests.
68 libmvec-abi-func-tests = \
69 $(addprefix test-double-libmvec-,$(libmvec-funcs)) \
70 $(addsuffix f,$(addprefix test-float-libmvec-,$(libmvec-funcs)))
71
72 # The AVX libmvec ABI tests.
73 libmvec-abi-func-avx-tests = \
74 $(addsuffix -avx,$(libmvec-abi-func-tests))
75 #
76 # The AVX2 libmvec ABI tests.
77 libmvec-abi-func-avx2-tests = \
78 $(addsuffix -avx2,$(libmvec-abi-func-tests))
79 #
80 # The AVX512F libmvec ABI tests.
81 libmvec-abi-func-avx512f-tests = \
82 $(addsuffix -avx512f,$(libmvec-abi-func-tests))
83
84 $(common-objpfx)libmvec.mk: $(common-objpfx)config.make
85 (echo "ifeq (\$$(subdir)\$$(build-mathvec),mathyes)"; \
86 echo; \
87 for i in "" "-avx" "-avx2" "-avx512f"; do \
88 for t in $(libmvec-abi-func-tests); do \
89 echo "\$$(objpfx)$$t$$i: \\"; \
90 echo " \$$(objpfx)$$t$$i.o \\"; \
91 echo " \$$(objpfx)test-libmvec$$i.o \$$(libmvec)"; \
92 echo; \
93 done; \
94 done; \
95 for t in $(libmvec-funcs); do \
96 echo "CFLAGS-test-double-libmvec-$$t.c = \\"; \
97 echo " \$$(libmvec-abi-test-cflags)"; \
98 echo "CFLAGS-test-double-libmvec-$$t-avx.c = \\"; \
99 echo " \$$(libmvec-abi-test-cflags) \\"; \
100 echo " \$$(double-vlen4-arch-ext-cflags)"; \
101 echo "CFLAGS-test-double-libmvec-$$t-avx2.c = \\"; \
102 echo " \$$(libmvec-abi-test-cflags) \\"; \
103 echo " \$$(double-vlen4-arch-ext2-cflags)"; \
104 echo "CFLAGS-test-double-libmvec-$$t-avx512f.c = \\"; \
105 echo " \$$(libmvec-abi-test-cflags) \\"; \
106 echo " \$$(double-vlen8-arch-ext-cflags)"; \
107 echo; \
108 echo "CFLAGS-test-float-libmvec-$${t}f.c = \\"; \
109 echo " \$$(libmvec-abi-test-cflags)"; \
110 echo "CFLAGS-test-float-libmvec-$${t}f-avx.c = \\"; \
111 echo " \$$(libmvec-abi-test-cflags) \\"; \
112 echo " \$$(float-vlen8-arch-ext-cflags)"; \
113 echo "CFLAGS-test-float-libmvec-$${t}f-avx2.c = \\"; \
114 echo " \$$(libmvec-abi-test-cflags) \\"; \
115 echo " \$$(float-vlen8-arch-ext2-cflags)"; \
116 echo "CFLAGS-test-float-libmvec-$${t}f-avx512f.c = \\"; \
117 echo " \$$(libmvec-abi-test-cflags) \\"; \
118 echo " \$$(float-vlen16-arch-ext-cflags)"; \
119 echo; \
120 done; \
121 echo "endif"; \
122 echo "ifeq (\$$(subdir),benchtests)"; \
123 for t in $(libmvec-bench-funcs); do \
124 echo "CFLAGS-bench-double-vlen4-$$t.c = \\"; \
125 echo " \$$(double-vlen4-arch-ext-cflags)"; \
126 echo "CFLAGS-bench-double-vlen4-avx2-$$t.c = \\"; \
127 echo " \$$(double-vlen4-arch-ext2-cflags)"; \
128 echo "CFLAGS-bench-double-vlen8-$$t.c = \\"; \
129 echo " \$$(double-vlen8-arch-ext-cflags)"; \
130 echo; \
131 echo "CFLAGS-bench-float-vlen8-$${t}f.c = \\"; \
132 echo " \$$(float-vlen8-arch-ext-cflags)"; \
133 echo "CFLAGS-bench-float-vlen8-avx2-$${t}f.c = \\"; \
134 echo " \$$(float-vlen8-arch-ext2-cflags)"; \
135 echo "CFLAGS-bench-float-vlen16-$${t}f.c = \\"; \
136 echo " \$$(float-vlen16-arch-ext-cflags)"; \
137 echo; \
138 done; \
139 echo "endif") > $@T
140 mv -f $@T $@