]>
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-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
, hwcap2
& PPC_FEATURE2_ARCH_2_07
,
113 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
115 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap
& PPC_FEATURE_POWER4
,
117 IFUNC_IMPL_ADD (array
, i
, strncmp
, 1,
120 /* Support sysdeps/powerpc/powerpc64/multiarch/strchr.c. */
121 IFUNC_IMPL (i
, name
, strchr
,
122 IFUNC_IMPL_ADD (array
, i
, strchr
,
123 hwcap
& PPC_FEATURE_HAS_VSX
,
125 IFUNC_IMPL_ADD (array
, i
, strchr
, 1,
128 /* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c. */
129 IFUNC_IMPL (i
, name
, strchrnul
,
130 IFUNC_IMPL_ADD (array
, i
, strchrnul
,
131 hwcap
& PPC_FEATURE_HAS_VSX
,
133 IFUNC_IMPL_ADD (array
, i
, strchrnul
, 1,
137 /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */
138 IFUNC_IMPL (i
, name
, memcmp
,
139 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
141 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_POWER4
,
143 IFUNC_IMPL_ADD (array
, i
, memcmp
, 1, __memcmp_ppc
))
145 /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */
146 IFUNC_IMPL (i
, name
, bzero
,
147 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap2
& PPC_FEATURE2_ARCH_2_07
,
149 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_HAS_VSX
,
151 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_ARCH_2_05
,
153 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_POWER4
,
155 IFUNC_IMPL_ADD (array
, i
, bzero
, 1, __bzero_ppc
))
157 /* Support sysdeps/powerpc/powerpc64/multiarch/bcopy.c. */
158 IFUNC_IMPL (i
, name
, bcopy
,
159 IFUNC_IMPL_ADD (array
, i
, bcopy
, hwcap
& PPC_FEATURE_HAS_VSX
,
161 IFUNC_IMPL_ADD (array
, i
, bcopy
, 1, __bcopy_ppc
))
163 /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */
164 IFUNC_IMPL (i
, name
, mempcpy
,
165 IFUNC_IMPL_ADD (array
, i
, mempcpy
,
166 hwcap
& PPC_FEATURE_HAS_VSX
,
168 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1,
171 /* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */
172 IFUNC_IMPL (i
, name
, memchr
,
173 IFUNC_IMPL_ADD (array
, i
, memchr
,
174 hwcap
& PPC_FEATURE_HAS_VSX
,
176 IFUNC_IMPL_ADD (array
, i
, memchr
, 1,
179 /* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c. */
180 IFUNC_IMPL (i
, name
, memrchr
,
181 IFUNC_IMPL_ADD (array
, i
, memrchr
,
182 hwcap
& PPC_FEATURE_HAS_VSX
,
184 IFUNC_IMPL_ADD (array
, i
, memrchr
, 1,
187 /* Support sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c. */
188 IFUNC_IMPL (i
, name
, rawmemchr
,
189 IFUNC_IMPL_ADD (array
, i
, rawmemchr
,
190 hwcap
& PPC_FEATURE_HAS_VSX
,
192 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, 1,
195 /* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c. */
196 IFUNC_IMPL (i
, name
, strnlen
,
197 IFUNC_IMPL_ADD (array
, i
, strnlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
199 IFUNC_IMPL_ADD (array
, i
, strnlen
, 1,
202 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c. */
203 IFUNC_IMPL (i
, name
, strcasecmp
,
204 IFUNC_IMPL_ADD (array
, i
, strcasecmp
,
205 hwcap
& PPC_FEATURE_HAS_VSX
,
207 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, 1, __strcasecmp_ppc
))
209 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c. */
210 IFUNC_IMPL (i
, name
, strcasecmp_l
,
211 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
,
212 hwcap
& PPC_FEATURE_HAS_VSX
,
213 __strcasecmp_l_power7
)
214 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, 1,
217 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c. */
218 IFUNC_IMPL (i
, name
, strncasecmp
,
219 IFUNC_IMPL_ADD (array
, i
, strncasecmp
,
220 hwcap
& PPC_FEATURE_HAS_VSX
,
221 __strncasecmp_power7
)
222 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1, __strncasecmp_ppc
))
224 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase_l.c. */
225 IFUNC_IMPL (i
, name
, strncasecmp_l
,
226 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
,
227 hwcap
& PPC_FEATURE_HAS_VSX
,
228 __strncasecmp_l_power7
)
229 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
230 __strncasecmp_l_ppc
))
232 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
233 IFUNC_IMPL (i
, name
, wcschr
,
234 IFUNC_IMPL_ADD (array
, i
, wcschr
,
235 hwcap
& PPC_FEATURE_HAS_VSX
,
237 IFUNC_IMPL_ADD (array
, i
, wcschr
,
238 hwcap
& PPC_FEATURE_ARCH_2_05
,
240 IFUNC_IMPL_ADD (array
, i
, wcschr
, 1,
243 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
244 IFUNC_IMPL (i
, name
, wcsrchr
,
245 IFUNC_IMPL_ADD (array
, i
, wcsrchr
,
246 hwcap
& PPC_FEATURE_HAS_VSX
,
248 IFUNC_IMPL_ADD (array
, i
, wcsrchr
,
249 hwcap
& PPC_FEATURE_ARCH_2_05
,
251 IFUNC_IMPL_ADD (array
, i
, wcsrchr
, 1,
254 /* Support sysdeps/powerpc/powerpc64/multiarch/wcscpy.c. */
255 IFUNC_IMPL (i
, name
, wcscpy
,
256 IFUNC_IMPL_ADD (array
, i
, wcscpy
,
257 hwcap
& PPC_FEATURE_HAS_VSX
,
259 IFUNC_IMPL_ADD (array
, i
, wcscpy
,
260 hwcap
& PPC_FEATURE_ARCH_2_05
,
262 IFUNC_IMPL_ADD (array
, i
, wcscpy
, 1,
265 /* Support sysdeps/powerpc/powerpc64/multiarch/strrchr.c. */
266 IFUNC_IMPL (i
, name
, strrchr
,
267 IFUNC_IMPL_ADD (array
, i
, strrchr
,
268 hwcap
& PPC_FEATURE_HAS_VSX
,
270 IFUNC_IMPL_ADD (array
, i
, strrchr
, 1,
273 /* Support sysdeps/powerpc/powerpc64/multiarch/strncat.c. */
274 IFUNC_IMPL (i
, name
, strncat
,
275 IFUNC_IMPL_ADD (array
, i
, strncat
,
276 hwcap
& PPC_FEATURE_HAS_VSX
,
278 IFUNC_IMPL_ADD (array
, i
, strncat
, 1,
281 /* Support sysdeps/powerpc/powerpc64/multiarch/strncpy.c. */
282 IFUNC_IMPL (i
, name
, strncpy
,
283 IFUNC_IMPL_ADD (array
, i
, strncpy
,
284 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
286 IFUNC_IMPL_ADD (array
, i
, strncpy
,
287 hwcap
& PPC_FEATURE_HAS_VSX
,
289 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1,
292 /* Support sysdeps/powerpc/powerpc64/multiarch/stpncpy.c. */
293 IFUNC_IMPL (i
, name
, stpncpy
,
294 IFUNC_IMPL_ADD (array
, i
, stpncpy
,
295 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
297 IFUNC_IMPL_ADD (array
, i
, stpncpy
,
298 hwcap
& PPC_FEATURE_HAS_VSX
,
300 IFUNC_IMPL_ADD (array
, i
, stpncpy
, 1,
303 /* Support sysdeps/powerpc/powerpc64/multiarch/strcmp.c. */
304 IFUNC_IMPL (i
, name
, strcmp
,
305 IFUNC_IMPL_ADD (array
, i
, strcmp
,
306 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
308 IFUNC_IMPL_ADD (array
, i
, strcmp
,
309 hwcap
& PPC_FEATURE_HAS_VSX
,
311 IFUNC_IMPL_ADD (array
, i
, strcmp
, 1,
314 /* Support sysdeps/powerpc/powerpc64/multiarch/strcat.c. */
315 IFUNC_IMPL (i
, name
, strcat
,
316 IFUNC_IMPL_ADD (array
, i
, strcat
,
317 hwcap2
& PPC_FEATURE2_ARCH_2_07
,
319 IFUNC_IMPL_ADD (array
, i
, strcat
,
320 hwcap
& PPC_FEATURE_HAS_VSX
,
322 IFUNC_IMPL_ADD (array
, i
, strcat
, 1,
325 /* Support sysdeps/powerpc/powerpc64/multiarch/strstr.c. */
326 IFUNC_IMPL (i
, name
, strstr
,
327 IFUNC_IMPL_ADD (array
, i
, strstr
,
328 hwcap
& PPC_FEATURE_HAS_VSX
,
330 IFUNC_IMPL_ADD (array
, i
, strstr
, 1,