]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
1 /* Enumerate available IFUNC implementations of a function. PowerPC64 version.
2 Copyright (C) 2013-2016 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_2_07
,
115 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
117 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap
& PPC_FEATURE_POWER4
,
119 IFUNC_IMPL_ADD (array
, i
, strncmp
, 1,
122 /* Support sysdeps/powerpc/powerpc64/multiarch/strchr.c. */
123 IFUNC_IMPL (i
, name
, strchr
,
124 IFUNC_IMPL_ADD (array
, i
, strchr
,
125 hwcap
& PPC_FEATURE_HAS_VSX
,
127 IFUNC_IMPL_ADD (array
, i
, strchr
, 1,
130 /* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c. */
131 IFUNC_IMPL (i
, name
, strchrnul
,
132 IFUNC_IMPL_ADD (array
, i
, strchrnul
,
133 hwcap
& PPC_FEATURE_HAS_VSX
,
135 IFUNC_IMPL_ADD (array
, i
, strchrnul
, 1,
139 /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */
140 IFUNC_IMPL (i
, name
, memcmp
,
141 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
143 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_POWER4
,
145 IFUNC_IMPL_ADD (array
, i
, memcmp
, 1, __memcmp_ppc
))
147 /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */
148 IFUNC_IMPL (i
, name
, bzero
,
149 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap2
& PPC_FEATURE2_ARCH_2_07
,
151 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_HAS_VSX
,
153 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_ARCH_2_05
,
155 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_POWER4
,
157 IFUNC_IMPL_ADD (array
, i
, bzero
, 1, __bzero_ppc
))
159 /* Support sysdeps/powerpc/powerpc64/multiarch/bcopy.c. */
160 IFUNC_IMPL (i
, name
, bcopy
,
161 IFUNC_IMPL_ADD (array
, i
, bcopy
, hwcap
& PPC_FEATURE_HAS_VSX
,
163 IFUNC_IMPL_ADD (array
, i
, bcopy
, 1, __bcopy_ppc
))
165 /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */
166 IFUNC_IMPL (i
, name
, mempcpy
,
167 IFUNC_IMPL_ADD (array
, i
, mempcpy
,
168 hwcap
& PPC_FEATURE_HAS_VSX
,
170 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1,
173 /* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */
174 IFUNC_IMPL (i
, name
, memchr
,
175 IFUNC_IMPL_ADD (array
, i
, memchr
,
176 hwcap
& PPC_FEATURE_HAS_VSX
,
178 IFUNC_IMPL_ADD (array
, i
, memchr
, 1,
181 /* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c. */
182 IFUNC_IMPL (i
, name
, memrchr
,
183 IFUNC_IMPL_ADD (array
, i
, memrchr
,
184 hwcap
& PPC_FEATURE_HAS_VSX
,
186 IFUNC_IMPL_ADD (array
, i
, memrchr
, 1,
189 /* Support sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c. */
190 IFUNC_IMPL (i
, name
, rawmemchr
,
191 IFUNC_IMPL_ADD (array
, i
, rawmemchr
,
192 hwcap
& PPC_FEATURE_HAS_VSX
,
194 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, 1,
197 /* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c. */
198 IFUNC_IMPL (i
, name
, strnlen
,
199 IFUNC_IMPL_ADD (array
, i
, strnlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
201 IFUNC_IMPL_ADD (array
, i
, strnlen
, 1,
204 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c. */
205 IFUNC_IMPL (i
, name
, strcasecmp
,
206 IFUNC_IMPL_ADD (array
, i
, strcasecmp
,
207 hwcap
& PPC_FEATURE_HAS_VSX
,
209 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, 1, __strcasecmp_ppc
))
211 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c. */
212 IFUNC_IMPL (i
, name
, strcasecmp_l
,
213 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
,
214 hwcap
& PPC_FEATURE_HAS_VSX
,
215 __strcasecmp_l_power7
)
216 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, 1,
219 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c. */
220 IFUNC_IMPL (i
, name
, strncasecmp
,
221 IFUNC_IMPL_ADD (array
, i
, strncasecmp
,
222 hwcap
& PPC_FEATURE_HAS_VSX
,
223 __strncasecmp_power7
)
224 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1, __strncasecmp_ppc
))
226 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase_l.c. */
227 IFUNC_IMPL (i
, name
, strncasecmp_l
,
228 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
,
229 hwcap
& PPC_FEATURE_HAS_VSX
,
230 __strncasecmp_l_power7
)
231 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
232 __strncasecmp_l_ppc
))
234 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
235 IFUNC_IMPL (i
, name
, wcschr
,
236 IFUNC_IMPL_ADD (array
, i
, wcschr
,
237 hwcap
& PPC_FEATURE_HAS_VSX
,
239 IFUNC_IMPL_ADD (array
, i
, wcschr
,
240 hwcap
& PPC_FEATURE_ARCH_2_05
,
242 IFUNC_IMPL_ADD (array
, i
, wcschr
, 1,
245 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
246 IFUNC_IMPL (i
, name
, wcsrchr
,
247 IFUNC_IMPL_ADD (array
, i
, wcsrchr
,
248 hwcap
& PPC_FEATURE_HAS_VSX
,
250 IFUNC_IMPL_ADD (array
, i
, wcsrchr
,
251 hwcap
& PPC_FEATURE_ARCH_2_05
,
253 IFUNC_IMPL_ADD (array
, i
, wcsrchr
, 1,
256 /* Support sysdeps/powerpc/powerpc64/multiarch/wcscpy.c. */
257 IFUNC_IMPL (i
, name
, wcscpy
,
258 IFUNC_IMPL_ADD (array
, i
, wcscpy
,
259 hwcap
& PPC_FEATURE_HAS_VSX
,
261 IFUNC_IMPL_ADD (array
, i
, wcscpy
,
262 hwcap
& PPC_FEATURE_ARCH_2_05
,
264 IFUNC_IMPL_ADD (array
, i
, wcscpy
, 1,
267 /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */
268 IFUNC_IMPL (i
, name
, strrchr
,
269 IFUNC_IMPL_ADD (array
, i
, strrchr
,
270 hwcap
& PPC_FEATURE_HAS_VSX
,
272 IFUNC_IMPL_ADD (array
, i
, strrchr
, 1,
275 /* Support sysdeps/powerpc/powerpc64/multiarch/strncat.c. */
276 IFUNC_IMPL (i
, name
, strncat
,
277 IFUNC_IMPL_ADD (array
, i
, strncat
,
278 hwcap
& PPC_FEATURE_HAS_VSX
,
280 IFUNC_IMPL_ADD (array
, i
, strncat
, 1,
283 /* Support sysdeps/powerpc/powerpc64/multiarch/strncpy.c. */
284 IFUNC_IMPL (i
, name
, strncpy
,
285 IFUNC_IMPL_ADD (array
, i
, strncpy
,
286 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
288 IFUNC_IMPL_ADD (array
, i
, strncpy
,
289 hwcap
& PPC_FEATURE_HAS_VSX
,
291 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1,
294 /* Support sysdeps/powerpc/powerpc64/multiarch/stpncpy.c. */
295 IFUNC_IMPL (i
, name
, stpncpy
,
296 IFUNC_IMPL_ADD (array
, i
, stpncpy
,
297 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
299 IFUNC_IMPL_ADD (array
, i
, stpncpy
,
300 hwcap
& PPC_FEATURE_HAS_VSX
,
302 IFUNC_IMPL_ADD (array
, i
, stpncpy
, 1,
305 /* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c. */
306 IFUNC_IMPL (i
, name
, strcmp
,
307 IFUNC_IMPL_ADD (array
, i
, strcmp
,
308 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
310 IFUNC_IMPL_ADD (array
, i
, strcmp
,
311 hwcap
& PPC_FEATURE_HAS_VSX
,
313 IFUNC_IMPL_ADD (array
, i
, strcmp
, 1,
316 /* Support sysdeps/powerpc/powerpc64/multiarch/strcat.c. */
317 IFUNC_IMPL (i
, name
, strcat
,
318 IFUNC_IMPL_ADD (array
, i
, strcat
,
319 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
321 IFUNC_IMPL_ADD (array
, i
, strcat
,
322 hwcap
& PPC_FEATURE_HAS_VSX
,
324 IFUNC_IMPL_ADD (array
, i
, strcat
, 1,
327 /* Support sysdeps/powerpc/powerpc64/multiarch/strspn.c. */
328 IFUNC_IMPL (i
, name
, strspn
,
329 IFUNC_IMPL_ADD (array
, i
, strspn
,
330 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
332 IFUNC_IMPL_ADD (array
, i
, strspn
, 1,
335 /* Support sysdeps/powerpc/powerpc64/multiarch/strcspn.c. */
336 IFUNC_IMPL (i
, name
, strcspn
,
337 IFUNC_IMPL_ADD (array
, i
, strcspn
,
338 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
340 IFUNC_IMPL_ADD (array
, i
, strcspn
, 1,
343 /* Support sysdeps/powerpc/powerpc64/multiarch/strstr.c. */
344 IFUNC_IMPL (i
, name
, strstr
,
345 IFUNC_IMPL_ADD (array
, i
, strstr
,
346 hwcap
& PPC_FEATURE_HAS_VSX
,
348 IFUNC_IMPL_ADD (array
, i
, strstr
, 1,
352 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasestr.c. */
353 IFUNC_IMPL (i
, name
, strcasestr
,
354 IFUNC_IMPL_ADD (array
, i
, strcasestr
,
355 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
357 IFUNC_IMPL_ADD (array
, i
, strcasestr
, 1,