1 /* Enumerate available IFUNC implementations of a function. i686 version.
2 Copyright (C) 2012-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/>. */
22 #include <ifunc-impl-list.h>
23 #include "init-arch.h"
25 /* Maximum number of IFUNC implementations. */
28 /* Fill ARRAY of MAX elements with IFUNC implementations for function
29 NAME and return the number of valid entries. */
32 __libc_ifunc_impl_list (const char *name
, struct libc_ifunc_impl
*array
,
35 assert (max
>= MAX_IFUNC
);
39 /* Support sysdeps/i386/i686/multiarch/bcopy.S. */
40 IFUNC_IMPL (i
, name
, bcopy
,
41 IFUNC_IMPL_ADD (array
, i
, bcopy
, HAS_CPU_FEATURE (SSSE3
),
43 IFUNC_IMPL_ADD (array
, i
, bcopy
, HAS_CPU_FEATURE (SSSE3
),
45 IFUNC_IMPL_ADD (array
, i
, bcopy
, HAS_CPU_FEATURE (SSE2
),
46 __bcopy_sse2_unaligned
)
47 IFUNC_IMPL_ADD (array
, i
, bcopy
, 1, __bcopy_ia32
))
49 /* Support sysdeps/i386/i686/multiarch/bzero.S. */
50 IFUNC_IMPL (i
, name
, bzero
,
51 IFUNC_IMPL_ADD (array
, i
, bzero
, HAS_CPU_FEATURE (SSE2
),
53 IFUNC_IMPL_ADD (array
, i
, bzero
, HAS_CPU_FEATURE (SSE2
),
55 IFUNC_IMPL_ADD (array
, i
, bzero
, 1, __bzero_ia32
))
57 /* Support sysdeps/i386/i686/multiarch/memchr.S. */
58 IFUNC_IMPL (i
, name
, memchr
,
59 IFUNC_IMPL_ADD (array
, i
, memchr
, HAS_CPU_FEATURE (SSE2
),
61 IFUNC_IMPL_ADD (array
, i
, memchr
, HAS_CPU_FEATURE (SSE2
),
63 IFUNC_IMPL_ADD (array
, i
, memchr
, 1, __memchr_ia32
))
65 /* Support sysdeps/i386/i686/multiarch/memcmp.S. */
66 IFUNC_IMPL (i
, name
, memcmp
,
67 IFUNC_IMPL_ADD (array
, i
, memcmp
, HAS_CPU_FEATURE (SSE4_2
),
69 IFUNC_IMPL_ADD (array
, i
, memcmp
, HAS_CPU_FEATURE (SSSE3
),
71 IFUNC_IMPL_ADD (array
, i
, memcmp
, 1, __memcmp_ia32
))
73 /* Support sysdeps/i386/i686/multiarch/memmove_chk.S. */
74 IFUNC_IMPL (i
, name
, __memmove_chk
,
75 IFUNC_IMPL_ADD (array
, i
, __memmove_chk
,
76 HAS_CPU_FEATURE (SSSE3
),
77 __memmove_chk_ssse3_rep
)
78 IFUNC_IMPL_ADD (array
, i
, __memmove_chk
,
79 HAS_CPU_FEATURE (SSSE3
),
81 IFUNC_IMPL_ADD (array
, i
, __memmove_chk
,
82 HAS_CPU_FEATURE (SSE2
),
83 __memmove_chk_sse2_unaligned
)
84 IFUNC_IMPL_ADD (array
, i
, __memmove_chk
, 1,
87 /* Support sysdeps/i386/i686/multiarch/memmove.S. */
88 IFUNC_IMPL (i
, name
, memmove
,
89 IFUNC_IMPL_ADD (array
, i
, memmove
, HAS_CPU_FEATURE (SSSE3
),
91 IFUNC_IMPL_ADD (array
, i
, memmove
, HAS_CPU_FEATURE (SSSE3
),
93 IFUNC_IMPL_ADD (array
, i
, memmove
, HAS_CPU_FEATURE (SSE2
),
94 __memmove_sse2_unaligned
)
95 IFUNC_IMPL_ADD (array
, i
, memmove
, 1, __memmove_ia32
))
97 /* Support sysdeps/i386/i686/multiarch/memrchr.S. */
98 IFUNC_IMPL (i
, name
, memrchr
,
99 IFUNC_IMPL_ADD (array
, i
, memrchr
, HAS_CPU_FEATURE (SSE2
),
101 IFUNC_IMPL_ADD (array
, i
, memrchr
, HAS_CPU_FEATURE (SSE2
),
103 IFUNC_IMPL_ADD (array
, i
, memrchr
, 1, __memrchr_ia32
))
105 /* Support sysdeps/i386/i686/multiarch/memset_chk.S. */
106 IFUNC_IMPL (i
, name
, __memset_chk
,
107 IFUNC_IMPL_ADD (array
, i
, __memset_chk
,
108 HAS_CPU_FEATURE (SSE2
),
109 __memset_chk_sse2_rep
)
110 IFUNC_IMPL_ADD (array
, i
, __memset_chk
,
111 HAS_CPU_FEATURE (SSE2
),
113 IFUNC_IMPL_ADD (array
, i
, __memset_chk
, 1,
116 /* Support sysdeps/i386/i686/multiarch/memset.S. */
117 IFUNC_IMPL (i
, name
, memset
,
118 IFUNC_IMPL_ADD (array
, i
, memset
, HAS_CPU_FEATURE (SSE2
),
120 IFUNC_IMPL_ADD (array
, i
, memset
, HAS_CPU_FEATURE (SSE2
),
122 IFUNC_IMPL_ADD (array
, i
, memset
, 1, __memset_ia32
))
124 /* Support sysdeps/i386/i686/multiarch/rawmemchr.S. */
125 IFUNC_IMPL (i
, name
, rawmemchr
,
126 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, HAS_CPU_FEATURE (SSE2
),
127 __rawmemchr_sse2_bsf
)
128 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, HAS_CPU_FEATURE (SSE2
),
130 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, 1, __rawmemchr_ia32
))
132 /* Support sysdeps/i386/i686/multiarch/stpncpy.S. */
133 IFUNC_IMPL (i
, name
, stpncpy
,
134 IFUNC_IMPL_ADD (array
, i
, stpncpy
, HAS_CPU_FEATURE (SSSE3
),
136 IFUNC_IMPL_ADD (array
, i
, stpncpy
, HAS_CPU_FEATURE (SSE2
),
138 IFUNC_IMPL_ADD (array
, i
, stpncpy
, 1, __stpncpy_ia32
))
140 /* Support sysdeps/i386/i686/multiarch/stpcpy.S. */
141 IFUNC_IMPL (i
, name
, stpcpy
,
142 IFUNC_IMPL_ADD (array
, i
, stpcpy
, HAS_CPU_FEATURE (SSSE3
),
144 IFUNC_IMPL_ADD (array
, i
, stpcpy
, HAS_CPU_FEATURE (SSE2
),
146 IFUNC_IMPL_ADD (array
, i
, stpcpy
, 1, __stpcpy_ia32
))
148 /* Support sysdeps/i386/i686/multiarch/strcasecmp.S. */
149 IFUNC_IMPL (i
, name
, strcasecmp
,
150 IFUNC_IMPL_ADD (array
, i
, strcasecmp
,
151 HAS_CPU_FEATURE (SSE4_2
),
153 IFUNC_IMPL_ADD (array
, i
, strcasecmp
,
154 HAS_CPU_FEATURE (SSSE3
),
156 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, 1, __strcasecmp_ia32
))
158 /* Support sysdeps/i386/i686/multiarch/strcasecmp_l.S. */
159 IFUNC_IMPL (i
, name
, strcasecmp_l
,
160 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
,
161 HAS_CPU_FEATURE (SSE4_2
),
162 __strcasecmp_l_sse4_2
)
163 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
,
164 HAS_CPU_FEATURE (SSSE3
),
165 __strcasecmp_l_ssse3
)
166 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, 1,
167 __strcasecmp_l_ia32
))
169 /* Support sysdeps/i386/i686/multiarch/strcat.S. */
170 IFUNC_IMPL (i
, name
, strcat
,
171 IFUNC_IMPL_ADD (array
, i
, strcat
, HAS_CPU_FEATURE (SSSE3
),
173 IFUNC_IMPL_ADD (array
, i
, strcat
, HAS_CPU_FEATURE (SSE2
),
175 IFUNC_IMPL_ADD (array
, i
, strcat
, 1, __strcat_ia32
))
177 /* Support sysdeps/i386/i686/multiarch/strchr.S. */
178 IFUNC_IMPL (i
, name
, strchr
,
179 IFUNC_IMPL_ADD (array
, i
, strchr
, HAS_CPU_FEATURE (SSE2
),
181 IFUNC_IMPL_ADD (array
, i
, strchr
, HAS_CPU_FEATURE (SSE2
),
183 IFUNC_IMPL_ADD (array
, i
, strchr
, 1, __strchr_ia32
))
185 /* Support sysdeps/i386/i686/multiarch/strcmp.S. */
186 IFUNC_IMPL (i
, name
, strcmp
,
187 IFUNC_IMPL_ADD (array
, i
, strcmp
, HAS_CPU_FEATURE (SSE4_2
),
189 IFUNC_IMPL_ADD (array
, i
, strcmp
, HAS_CPU_FEATURE (SSSE3
),
191 IFUNC_IMPL_ADD (array
, i
, strcmp
, 1, __strcmp_ia32
))
193 /* Support sysdeps/i386/i686/multiarch/strcpy.S. */
194 IFUNC_IMPL (i
, name
, strcpy
,
195 IFUNC_IMPL_ADD (array
, i
, strcpy
, HAS_CPU_FEATURE (SSSE3
),
197 IFUNC_IMPL_ADD (array
, i
, strcpy
, HAS_CPU_FEATURE (SSE2
),
199 IFUNC_IMPL_ADD (array
, i
, strcpy
, 1, __strcpy_ia32
))
201 /* Support sysdeps/i386/i686/multiarch/strcspn.S. */
202 IFUNC_IMPL (i
, name
, strcspn
,
203 IFUNC_IMPL_ADD (array
, i
, strcspn
, HAS_CPU_FEATURE (SSE4_2
),
205 IFUNC_IMPL_ADD (array
, i
, strcspn
, 1, __strcspn_ia32
))
207 /* Support sysdeps/i386/i686/multiarch/strncase.S. */
208 IFUNC_IMPL (i
, name
, strncasecmp
,
209 IFUNC_IMPL_ADD (array
, i
, strncasecmp
,
210 HAS_CPU_FEATURE (SSE4_2
),
211 __strncasecmp_sse4_2
)
212 IFUNC_IMPL_ADD (array
, i
, strncasecmp
,
213 HAS_CPU_FEATURE (SSSE3
),
215 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1,
218 /* Support sysdeps/i386/i686/multiarch/strncase_l.S. */
219 IFUNC_IMPL (i
, name
, strncasecmp_l
,
220 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
,
221 HAS_CPU_FEATURE (SSE4_2
),
222 __strncasecmp_l_sse4_2
)
223 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
,
224 HAS_CPU_FEATURE (SSSE3
),
225 __strncasecmp_l_ssse3
)
226 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
227 __strncasecmp_l_ia32
))
229 /* Support sysdeps/i386/i686/multiarch/strncat.S. */
230 IFUNC_IMPL (i
, name
, strncat
,
231 IFUNC_IMPL_ADD (array
, i
, strncat
, HAS_CPU_FEATURE (SSSE3
),
233 IFUNC_IMPL_ADD (array
, i
, strncat
, HAS_CPU_FEATURE (SSE2
),
235 IFUNC_IMPL_ADD (array
, i
, strncat
, 1, __strncat_ia32
))
237 /* Support sysdeps/i386/i686/multiarch/strncpy.S. */
238 IFUNC_IMPL (i
, name
, strncpy
,
239 IFUNC_IMPL_ADD (array
, i
, strncpy
, HAS_CPU_FEATURE (SSSE3
),
241 IFUNC_IMPL_ADD (array
, i
, strncpy
, HAS_CPU_FEATURE (SSE2
),
243 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1, __strncpy_ia32
))
245 /* Support sysdeps/i386/i686/multiarch/strnlen.S. */
246 IFUNC_IMPL (i
, name
, strnlen
,
247 IFUNC_IMPL_ADD (array
, i
, strnlen
, HAS_CPU_FEATURE (SSE2
),
249 IFUNC_IMPL_ADD (array
, i
, strnlen
, 1, __strnlen_ia32
))
251 /* Support sysdeps/i386/i686/multiarch/strpbrk.S. */
252 IFUNC_IMPL (i
, name
, strpbrk
,
253 IFUNC_IMPL_ADD (array
, i
, strpbrk
, HAS_CPU_FEATURE (SSE4_2
),
255 IFUNC_IMPL_ADD (array
, i
, strpbrk
, 1, __strpbrk_ia32
))
257 /* Support sysdeps/i386/i686/multiarch/strrchr.S. */
258 IFUNC_IMPL (i
, name
, strrchr
,
259 IFUNC_IMPL_ADD (array
, i
, strrchr
, HAS_CPU_FEATURE (SSE2
),
261 IFUNC_IMPL_ADD (array
, i
, strrchr
, HAS_CPU_FEATURE (SSE2
),
263 IFUNC_IMPL_ADD (array
, i
, strrchr
, 1, __strrchr_ia32
))
265 /* Support sysdeps/i386/i686/multiarch/strspn.S. */
266 IFUNC_IMPL (i
, name
, strspn
,
267 IFUNC_IMPL_ADD (array
, i
, strspn
, HAS_CPU_FEATURE (SSE4_2
),
269 IFUNC_IMPL_ADD (array
, i
, strspn
, 1, __strspn_ia32
))
271 /* Support sysdeps/i386/i686/multiarch/wcschr.S. */
272 IFUNC_IMPL (i
, name
, wcschr
,
273 IFUNC_IMPL_ADD (array
, i
, wcschr
, HAS_CPU_FEATURE (SSE2
),
275 IFUNC_IMPL_ADD (array
, i
, wcschr
, 1, __wcschr_ia32
))
277 /* Support sysdeps/i386/i686/multiarch/wcscmp.S. */
278 IFUNC_IMPL (i
, name
, wcscmp
,
279 IFUNC_IMPL_ADD (array
, i
, wcscmp
, HAS_CPU_FEATURE (SSE2
),
281 IFUNC_IMPL_ADD (array
, i
, wcscmp
, 1, __wcscmp_ia32
))
283 /* Support sysdeps/i386/i686/multiarch/wcscpy.S. */
284 IFUNC_IMPL (i
, name
, wcscpy
,
285 IFUNC_IMPL_ADD (array
, i
, wcscpy
, HAS_CPU_FEATURE (SSSE3
),
287 IFUNC_IMPL_ADD (array
, i
, wcscpy
, 1, __wcscpy_ia32
))
289 /* Support sysdeps/i386/i686/multiarch/wcslen.S. */
290 IFUNC_IMPL (i
, name
, wcslen
,
291 IFUNC_IMPL_ADD (array
, i
, wcslen
, HAS_CPU_FEATURE (SSE2
),
293 IFUNC_IMPL_ADD (array
, i
, wcslen
, 1, __wcslen_ia32
))
295 /* Support sysdeps/i386/i686/multiarch/wcsrchr.S. */
296 IFUNC_IMPL (i
, name
, wcsrchr
,
297 IFUNC_IMPL_ADD (array
, i
, wcsrchr
, HAS_CPU_FEATURE (SSE2
),
299 IFUNC_IMPL_ADD (array
, i
, wcsrchr
, 1, __wcsrchr_ia32
))
301 /* Support sysdeps/i386/i686/multiarch/wmemcmp.S. */
302 IFUNC_IMPL (i
, name
, wmemcmp
,
303 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, HAS_CPU_FEATURE (SSE4_2
),
305 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, HAS_CPU_FEATURE (SSSE3
),
307 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, 1, __wmemcmp_ia32
))
310 /* Support sysdeps/i386/i686/multiarch/memcpy_chk.S. */
311 IFUNC_IMPL (i
, name
, __memcpy_chk
,
312 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
,
313 HAS_CPU_FEATURE (SSSE3
),
314 __memcpy_chk_ssse3_rep
)
315 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
,
316 HAS_CPU_FEATURE (SSSE3
),
318 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
,
319 HAS_CPU_FEATURE (SSE2
),
320 __memcpy_chk_sse2_unaligned
)
321 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, 1,
324 /* Support sysdeps/i386/i686/multiarch/memcpy.S. */
325 IFUNC_IMPL (i
, name
, memcpy
,
326 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_CPU_FEATURE (SSSE3
),
328 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_CPU_FEATURE (SSSE3
),
330 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_CPU_FEATURE (SSE2
),
331 __memcpy_sse2_unaligned
)
332 IFUNC_IMPL_ADD (array
, i
, memcpy
, 1, __memcpy_ia32
))
334 /* Support sysdeps/i386/i686/multiarch/mempcpy_chk.S. */
335 IFUNC_IMPL (i
, name
, __mempcpy_chk
,
336 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
,
337 HAS_CPU_FEATURE (SSSE3
),
338 __mempcpy_chk_ssse3_rep
)
339 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
,
340 HAS_CPU_FEATURE (SSSE3
),
342 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
,
343 HAS_CPU_FEATURE (SSE2
),
344 __mempcpy_chk_sse2_unaligned
)
345 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, 1,
348 /* Support sysdeps/i386/i686/multiarch/mempcpy.S. */
349 IFUNC_IMPL (i
, name
, mempcpy
,
350 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_CPU_FEATURE (SSSE3
),
352 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_CPU_FEATURE (SSSE3
),
354 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_CPU_FEATURE (SSE2
),
355 __mempcpy_sse2_unaligned
)
356 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1, __mempcpy_ia32
))
358 /* Support sysdeps/i386/i686/multiarch/strlen.S. */
359 IFUNC_IMPL (i
, name
, strlen
,
360 IFUNC_IMPL_ADD (array
, i
, strlen
, HAS_CPU_FEATURE (SSE2
),
362 IFUNC_IMPL_ADD (array
, i
, strlen
, HAS_CPU_FEATURE (SSE2
),
364 IFUNC_IMPL_ADD (array
, i
, strlen
, 1, __strlen_ia32
))
366 /* Support sysdeps/i386/i686/multiarch/strncmp.S. */
367 IFUNC_IMPL (i
, name
, strncmp
,
368 IFUNC_IMPL_ADD (array
, i
, strncmp
, HAS_CPU_FEATURE (SSE4_2
),
370 IFUNC_IMPL_ADD (array
, i
, strncmp
, HAS_CPU_FEATURE (SSSE3
),
372 IFUNC_IMPL_ADD (array
, i
, strncmp
, 1, __strncmp_ia32
))