1 /* Enumerate available IFUNC implementations of a function. PowerPC64 version.
2 Copyright (C) 2013-2017 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
, hwcap2
& PPC_FEATURE2_ARCH_2_07
,
106 IFUNC_IMPL_ADD (array
, i
, strlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
108 IFUNC_IMPL_ADD (array
, i
, strlen
, 1,
111 /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */
112 IFUNC_IMPL (i
, name
, strncmp
,
113 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap2
& PPC_FEATURE2_ARCH_3_00
,
115 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap2
& PPC_FEATURE2_ARCH_2_07
,
117 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
119 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap
& PPC_FEATURE_POWER4
,
121 IFUNC_IMPL_ADD (array
, i
, strncmp
, 1,
124 /* Support sysdeps/powerpc/powerpc64/multiarch/strchr.c. */
125 IFUNC_IMPL (i
, name
, strchr
,
126 IFUNC_IMPL_ADD (array
, i
, strchr
,
127 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
129 IFUNC_IMPL_ADD (array
, i
, strchr
,
130 hwcap
& PPC_FEATURE_HAS_VSX
,
132 IFUNC_IMPL_ADD (array
, i
, strchr
, 1,
135 /* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c. */
136 IFUNC_IMPL (i
, name
, strchrnul
,
137 IFUNC_IMPL_ADD (array
, i
, strchrnul
,
138 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
140 IFUNC_IMPL_ADD (array
, i
, strchrnul
,
141 hwcap
& PPC_FEATURE_HAS_VSX
,
143 IFUNC_IMPL_ADD (array
, i
, strchrnul
, 1,
147 /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */
148 IFUNC_IMPL (i
, name
, memcmp
,
149 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
151 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_POWER4
,
153 IFUNC_IMPL_ADD (array
, i
, memcmp
, 1, __memcmp_ppc
))
155 /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */
156 IFUNC_IMPL (i
, name
, bzero
,
157 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap2
& PPC_FEATURE2_ARCH_2_07
,
159 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_HAS_VSX
,
161 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_ARCH_2_05
,
163 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_POWER4
,
165 IFUNC_IMPL_ADD (array
, i
, bzero
, 1, __bzero_ppc
))
167 /* Support sysdeps/powerpc/powerpc64/multiarch/bcopy.c. */
168 IFUNC_IMPL (i
, name
, bcopy
,
169 IFUNC_IMPL_ADD (array
, i
, bcopy
, hwcap
& PPC_FEATURE_HAS_VSX
,
171 IFUNC_IMPL_ADD (array
, i
, bcopy
, 1, __bcopy_ppc
))
173 /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */
174 IFUNC_IMPL (i
, name
, mempcpy
,
175 IFUNC_IMPL_ADD (array
, i
, mempcpy
,
176 hwcap
& PPC_FEATURE_HAS_VSX
,
178 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1,
181 /* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */
182 IFUNC_IMPL (i
, name
, memchr
,
183 IFUNC_IMPL_ADD (array
, i
, memchr
,
184 hwcap
& PPC_FEATURE_HAS_VSX
,
186 IFUNC_IMPL_ADD (array
, i
, memchr
, 1,
189 /* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c. */
190 IFUNC_IMPL (i
, name
, memrchr
,
191 IFUNC_IMPL_ADD (array
, i
, memrchr
,
192 hwcap
& PPC_FEATURE_HAS_VSX
,
194 IFUNC_IMPL_ADD (array
, i
, memrchr
, 1,
197 /* Support sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c. */
198 IFUNC_IMPL (i
, name
, rawmemchr
,
199 IFUNC_IMPL_ADD (array
, i
, rawmemchr
,
200 hwcap
& PPC_FEATURE_HAS_VSX
,
202 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, 1,
205 /* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c. */
206 IFUNC_IMPL (i
, name
, strnlen
,
207 IFUNC_IMPL_ADD (array
, i
, strnlen
,
208 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
210 IFUNC_IMPL_ADD (array
, i
, strnlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
212 IFUNC_IMPL_ADD (array
, i
, strnlen
, 1,
215 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c. */
216 IFUNC_IMPL (i
, name
, strcasecmp
,
217 IFUNC_IMPL_ADD (array
, i
, strcasecmp
,
218 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
220 IFUNC_IMPL_ADD (array
, i
, strcasecmp
,
221 hwcap
& PPC_FEATURE_HAS_VSX
,
223 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, 1, __strcasecmp_ppc
))
225 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c. */
226 IFUNC_IMPL (i
, name
, strcasecmp_l
,
227 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
,
228 hwcap
& PPC_FEATURE_HAS_VSX
,
229 __strcasecmp_l_power7
)
230 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, 1,
233 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c. */
234 IFUNC_IMPL (i
, name
, strncasecmp
,
235 IFUNC_IMPL_ADD (array
, i
, strncasecmp
,
236 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
237 __strncasecmp_power8
)
238 IFUNC_IMPL_ADD (array
, i
, strncasecmp
,
239 hwcap
& PPC_FEATURE_HAS_VSX
,
240 __strncasecmp_power7
)
241 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1, __strncasecmp_ppc
))
243 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase_l.c. */
244 IFUNC_IMPL (i
, name
, strncasecmp_l
,
245 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
,
246 hwcap
& PPC_FEATURE_HAS_VSX
,
247 __strncasecmp_l_power7
)
248 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
249 __strncasecmp_l_ppc
))
251 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
252 IFUNC_IMPL (i
, name
, wcschr
,
253 IFUNC_IMPL_ADD (array
, i
, wcschr
,
254 hwcap
& PPC_FEATURE_HAS_VSX
,
256 IFUNC_IMPL_ADD (array
, i
, wcschr
,
257 hwcap
& PPC_FEATURE_ARCH_2_05
,
259 IFUNC_IMPL_ADD (array
, i
, wcschr
, 1,
262 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
263 IFUNC_IMPL (i
, name
, wcsrchr
,
264 IFUNC_IMPL_ADD (array
, i
, wcsrchr
,
265 hwcap
& PPC_FEATURE_HAS_VSX
,
267 IFUNC_IMPL_ADD (array
, i
, wcsrchr
,
268 hwcap
& PPC_FEATURE_ARCH_2_05
,
270 IFUNC_IMPL_ADD (array
, i
, wcsrchr
, 1,
273 /* Support sysdeps/powerpc/powerpc64/multiarch/wcscpy.c. */
274 IFUNC_IMPL (i
, name
, wcscpy
,
275 IFUNC_IMPL_ADD (array
, i
, wcscpy
,
276 hwcap
& PPC_FEATURE_HAS_VSX
,
278 IFUNC_IMPL_ADD (array
, i
, wcscpy
,
279 hwcap
& PPC_FEATURE_ARCH_2_05
,
281 IFUNC_IMPL_ADD (array
, i
, wcscpy
, 1,
284 /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */
285 IFUNC_IMPL (i
, name
, strrchr
,
286 IFUNC_IMPL_ADD (array
, i
, strrchr
,
287 hwcap
& PPC_FEATURE_HAS_VSX
,
289 IFUNC_IMPL_ADD (array
, i
, strrchr
, 1,
292 /* Support sysdeps/powerpc/powerpc64/multiarch/strncat.c. */
293 IFUNC_IMPL (i
, name
, strncat
,
294 IFUNC_IMPL_ADD (array
, i
, strncat
,
295 hwcap
& PPC_FEATURE_HAS_VSX
,
297 IFUNC_IMPL_ADD (array
, i
, strncat
, 1,
300 /* Support sysdeps/powerpc/powerpc64/multiarch/strncpy.c. */
301 IFUNC_IMPL (i
, name
, strncpy
,
302 IFUNC_IMPL_ADD (array
, i
, strncpy
,
303 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
305 IFUNC_IMPL_ADD (array
, i
, strncpy
,
306 hwcap
& PPC_FEATURE_HAS_VSX
,
308 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1,
311 /* Support sysdeps/powerpc/powerpc64/multiarch/stpncpy.c. */
312 IFUNC_IMPL (i
, name
, stpncpy
,
313 IFUNC_IMPL_ADD (array
, i
, stpncpy
,
314 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
316 IFUNC_IMPL_ADD (array
, i
, stpncpy
,
317 hwcap
& PPC_FEATURE_HAS_VSX
,
319 IFUNC_IMPL_ADD (array
, i
, stpncpy
, 1,
322 /* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c. */
323 IFUNC_IMPL (i
, name
, strcmp
,
324 IFUNC_IMPL_ADD (array
, i
, strcmp
,
325 hwcap2
& PPC_FEATURE2_ARCH_3_00
,
327 IFUNC_IMPL_ADD (array
, i
, strcmp
,
328 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
330 IFUNC_IMPL_ADD (array
, i
, strcmp
,
331 hwcap
& PPC_FEATURE_HAS_VSX
,
333 IFUNC_IMPL_ADD (array
, i
, strcmp
, 1,
336 /* Support sysdeps/powerpc/powerpc64/multiarch/strcat.c. */
337 IFUNC_IMPL (i
, name
, strcat
,
338 IFUNC_IMPL_ADD (array
, i
, strcat
,
339 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
341 IFUNC_IMPL_ADD (array
, i
, strcat
,
342 hwcap
& PPC_FEATURE_HAS_VSX
,
344 IFUNC_IMPL_ADD (array
, i
, strcat
, 1,
347 /* Support sysdeps/powerpc/powerpc64/multiarch/strspn.c. */
348 IFUNC_IMPL (i
, name
, strspn
,
349 IFUNC_IMPL_ADD (array
, i
, strspn
,
350 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
352 IFUNC_IMPL_ADD (array
, i
, strspn
, 1,
355 /* Support sysdeps/powerpc/powerpc64/multiarch/strcspn.c. */
356 IFUNC_IMPL (i
, name
, strcspn
,
357 IFUNC_IMPL_ADD (array
, i
, strcspn
,
358 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
360 IFUNC_IMPL_ADD (array
, i
, strcspn
, 1,
363 /* Support sysdeps/powerpc/powerpc64/multiarch/strstr.c. */
364 IFUNC_IMPL (i
, name
, strstr
,
365 IFUNC_IMPL_ADD (array
, i
, strstr
,
366 hwcap
& PPC_FEATURE_HAS_VSX
,
368 IFUNC_IMPL_ADD (array
, i
, strstr
, 1,
372 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasestr.c. */
373 IFUNC_IMPL (i
, name
, strcasestr
,
374 IFUNC_IMPL_ADD (array
, i
, strcasestr
,
375 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
377 IFUNC_IMPL_ADD (array
, i
, strcasestr
, 1,