1 /* Enumerate available IFUNC implementations of a function. PowerPC64 version.
2 Copyright (C) 2013-2015 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
23 #include <ifunc-impl-list.h>
25 /* Maximum number of IFUNC implementations. */
29 __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
32 assert (max >= MAX_IFUNC);
36 unsigned long int hwcap = GLRO(dl_hwcap);
37 unsigned long int hwcap2 = GLRO(dl_hwcap2);
39 /* hwcap contains only the latest supported ISA, the code checks which is
40 and fills the previous supported ones. */
41 if (hwcap & PPC_FEATURE_ARCH_2_06)
42 hwcap |= PPC_FEATURE_ARCH_2_05 | PPC_FEATURE_POWER5_PLUS |
43 PPC_FEATURE_POWER5 | PPC_FEATURE_POWER4;
44 else if (hwcap & PPC_FEATURE_ARCH_2_05)
45 hwcap |= PPC_FEATURE_POWER5_PLUS | PPC_FEATURE_POWER5 | PPC_FEATURE_POWER4;
46 else if (hwcap & PPC_FEATURE_POWER5_PLUS)
47 hwcap |= PPC_FEATURE_POWER5 | PPC_FEATURE_POWER4;
48 else if (hwcap & PPC_FEATURE_POWER5)
49 hwcap |= PPC_FEATURE_POWER4;
52 /* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
53 IFUNC_IMPL (i, name, memcpy,
54 IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_HAS_VSX,
56 IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_06,
58 IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_ARCH_2_05,
60 IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_CELL_BE,
62 IFUNC_IMPL_ADD (array, i, memcpy, hwcap & PPC_FEATURE_POWER4,
64 IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ppc))
66 /* Support sysdeps/powerpc/powerpc64/multiarch/memmove.c. */
67 IFUNC_IMPL (i, name, memmove,
68 IFUNC_IMPL_ADD (array, i, memmove, hwcap & PPC_FEATURE_HAS_VSX,
70 IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_ppc))
72 /* Support sysdeps/powerpc/powerpc64/multiarch/memset.c. */
73 IFUNC_IMPL (i, name, memset,
74 IFUNC_IMPL_ADD (array, i, memset, hwcap2 & PPC_FEATURE2_ARCH_2_07,
76 IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_HAS_VSX,
78 IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_ARCH_2_05,
80 IFUNC_IMPL_ADD (array, i, memset, hwcap & PPC_FEATURE_POWER4,
82 IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ppc))
84 /* Support sysdeps/powerpc/powerpc64/multiarch/strcpy.c. */
85 IFUNC_IMPL (i, name, strcpy,
86 IFUNC_IMPL_ADD (array, i, strcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
88 IFUNC_IMPL_ADD (array, i, strcpy, hwcap & PPC_FEATURE_HAS_VSX,
90 IFUNC_IMPL_ADD (array, i, strcpy, 1,
93 /* Support sysdeps/powerpc/powerpc64/multiarch/stpcpy.c. */
94 IFUNC_IMPL (i, name, stpcpy,
95 IFUNC_IMPL_ADD (array, i, stpcpy, hwcap2 & PPC_FEATURE2_ARCH_2_07,
97 IFUNC_IMPL_ADD (array, i, stpcpy, hwcap & PPC_FEATURE_HAS_VSX,
99 IFUNC_IMPL_ADD (array, i, stpcpy, 1,
102 /* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c. */
103 IFUNC_IMPL (i, name, strlen,
104 IFUNC_IMPL_ADD (array, i, strlen, hwcap & PPC_FEATURE_HAS_VSX,
106 IFUNC_IMPL_ADD (array, i, strlen, 1,
109 /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */
110 IFUNC_IMPL (i, name, strncmp,
111 IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_HAS_VSX,
113 IFUNC_IMPL_ADD (array, i, strncmp, hwcap & PPC_FEATURE_POWER4,
115 IFUNC_IMPL_ADD (array, i, strncmp, 1,
118 /* Support sysdeps/powerpc/powerpc64/multiarch/strchr.c. */
119 IFUNC_IMPL (i, name, strchr,
120 IFUNC_IMPL_ADD (array, i, strchr,
121 hwcap & PPC_FEATURE_HAS_VSX,
123 IFUNC_IMPL_ADD (array, i, strchr, 1,
126 /* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c. */
127 IFUNC_IMPL (i, name, strchrnul,
128 IFUNC_IMPL_ADD (array, i, strchrnul,
129 hwcap & PPC_FEATURE_HAS_VSX,
131 IFUNC_IMPL_ADD (array, i, strchrnul, 1,
135 /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */
136 IFUNC_IMPL (i, name, memcmp,
137 IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_HAS_VSX,
139 IFUNC_IMPL_ADD (array, i, memcmp, hwcap & PPC_FEATURE_POWER4,
141 IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_ppc))
143 /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */
144 IFUNC_IMPL (i, name, bzero,
145 IFUNC_IMPL_ADD (array, i, bzero, hwcap2 & PPC_FEATURE2_ARCH_2_07,
147 IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_HAS_VSX,
149 IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_ARCH_2_05,
151 IFUNC_IMPL_ADD (array, i, bzero, hwcap & PPC_FEATURE_POWER4,
153 IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc))
155 /* Support sysdeps/powerpc/powerpc64/multiarch/bcopy.c. */
156 IFUNC_IMPL (i, name, bcopy,
157 IFUNC_IMPL_ADD (array, i, bcopy, hwcap & PPC_FEATURE_HAS_VSX,
159 IFUNC_IMPL_ADD (array, i, bcopy, 1, __bcopy_ppc))
161 /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */
162 IFUNC_IMPL (i, name, mempcpy,
163 IFUNC_IMPL_ADD (array, i, mempcpy,
164 hwcap & PPC_FEATURE_HAS_VSX,
166 IFUNC_IMPL_ADD (array, i, mempcpy, 1,
169 /* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */
170 IFUNC_IMPL (i, name, memchr,
171 IFUNC_IMPL_ADD (array, i, memchr,
172 hwcap & PPC_FEATURE_HAS_VSX,
174 IFUNC_IMPL_ADD (array, i, memchr, 1,
177 /* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c. */
178 IFUNC_IMPL (i, name, memrchr,
179 IFUNC_IMPL_ADD (array, i, memrchr,
180 hwcap & PPC_FEATURE_HAS_VSX,
182 IFUNC_IMPL_ADD (array, i, memrchr, 1,
185 /* Support sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c. */
186 IFUNC_IMPL (i, name, rawmemchr,
187 IFUNC_IMPL_ADD (array, i, rawmemchr,
188 hwcap & PPC_FEATURE_HAS_VSX,
190 IFUNC_IMPL_ADD (array, i, rawmemchr, 1,
193 /* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c. */
194 IFUNC_IMPL (i, name, strnlen,
195 IFUNC_IMPL_ADD (array, i, strnlen, hwcap & PPC_FEATURE_HAS_VSX,
197 IFUNC_IMPL_ADD (array, i, strnlen, 1,
200 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c. */
201 IFUNC_IMPL (i, name, strcasecmp,
202 IFUNC_IMPL_ADD (array, i, strcasecmp,
203 hwcap & PPC_FEATURE_HAS_VSX,
205 IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_ppc))
207 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c. */
208 IFUNC_IMPL (i, name, strcasecmp_l,
209 IFUNC_IMPL_ADD (array, i, strcasecmp_l,
210 hwcap & PPC_FEATURE_HAS_VSX,
211 __strcasecmp_l_power7)
212 IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
215 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c. */
216 IFUNC_IMPL (i, name, strncasecmp,
217 IFUNC_IMPL_ADD (array, i, strncasecmp,
218 hwcap & PPC_FEATURE_HAS_VSX,
219 __strncasecmp_power7)
220 IFUNC_IMPL_ADD (array, i, strncasecmp, 1, __strncasecmp_ppc))
222 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase_l.c. */
223 IFUNC_IMPL (i, name, strncasecmp_l,
224 IFUNC_IMPL_ADD (array, i, strncasecmp_l,
225 hwcap & PPC_FEATURE_HAS_VSX,
226 __strncasecmp_l_power7)
227 IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
228 __strncasecmp_l_ppc))
230 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
231 IFUNC_IMPL (i, name, wcschr,
232 IFUNC_IMPL_ADD (array, i, wcschr,
233 hwcap & PPC_FEATURE_HAS_VSX,
235 IFUNC_IMPL_ADD (array, i, wcschr,
236 hwcap & PPC_FEATURE_ARCH_2_05,
238 IFUNC_IMPL_ADD (array, i, wcschr, 1,
241 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
242 IFUNC_IMPL (i, name, wcsrchr,
243 IFUNC_IMPL_ADD (array, i, wcsrchr,
244 hwcap & PPC_FEATURE_HAS_VSX,
246 IFUNC_IMPL_ADD (array, i, wcsrchr,
247 hwcap & PPC_FEATURE_ARCH_2_05,
249 IFUNC_IMPL_ADD (array, i, wcsrchr, 1,
252 /* Support sysdeps/powerpc/powerpc64/multiarch/wcscpy.c. */
253 IFUNC_IMPL (i, name, wcscpy,
254 IFUNC_IMPL_ADD (array, i, wcscpy,
255 hwcap & PPC_FEATURE_HAS_VSX,
257 IFUNC_IMPL_ADD (array, i, wcscpy,
258 hwcap & PPC_FEATURE_ARCH_2_05,
260 IFUNC_IMPL_ADD (array, i, wcscpy, 1,
263 /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */
264 IFUNC_IMPL (i, name, strrchr,
265 IFUNC_IMPL_ADD (array, i, strrchr,
266 hwcap & PPC_FEATURE_HAS_VSX,
268 IFUNC_IMPL_ADD (array, i, strrchr, 1,
271 /* Support sysdeps/powerpc/powerpc64/multiarch/strncat.c. */
272 IFUNC_IMPL (i, name, strncat,
273 IFUNC_IMPL_ADD (array, i, strncat,
274 hwcap & PPC_FEATURE_HAS_VSX,
276 IFUNC_IMPL_ADD (array, i, strncat, 1,
279 /* Support sysdeps/powerpc/powerpc64/multiarch/strncpy.c. */
280 IFUNC_IMPL (i, name, strncpy,
281 IFUNC_IMPL_ADD (array, i, strncpy,
282 hwcap2 & PPC_FEATURE2_ARCH_2_07,
284 IFUNC_IMPL_ADD (array, i, strncpy,
285 hwcap & PPC_FEATURE_HAS_VSX,
287 IFUNC_IMPL_ADD (array, i, strncpy, 1,
290 /* Support sysdeps/powerpc/powerpc64/multiarch/stpncpy.c. */
291 IFUNC_IMPL (i, name, stpncpy,
292 IFUNC_IMPL_ADD (array, i, stpncpy,
293 hwcap2 & PPC_FEATURE2_ARCH_2_07,
295 IFUNC_IMPL_ADD (array, i, stpncpy,
296 hwcap & PPC_FEATURE_HAS_VSX,
298 IFUNC_IMPL_ADD (array, i, stpncpy, 1,
301 /* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c. */
302 IFUNC_IMPL (i, name, strcmp,
303 IFUNC_IMPL_ADD (array, i, strcmp,
304 hwcap2 & PPC_FEATURE2_ARCH_2_07,
306 IFUNC_IMPL_ADD (array, i, strcmp,
307 hwcap & PPC_FEATURE_HAS_VSX,
309 IFUNC_IMPL_ADD (array, i, strcmp, 1,
312 /* Support sysdeps/powerpc/powerpc64/multiarch/strcat.c. */
313 IFUNC_IMPL (i, name, strcat,
314 IFUNC_IMPL_ADD (array, i, strcat,
315 hwcap2 & PPC_FEATURE2_ARCH_2_07,
317 IFUNC_IMPL_ADD (array, i, strcat,
318 hwcap & PPC_FEATURE_HAS_VSX,
320 IFUNC_IMPL_ADD (array, i, strcat, 1,