1 /* Enumerate available IFUNC implementations of a function. x86-64 version.
2 Copyright (C) 2012-2013 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 supported on target machine and return the number of valid
33 __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
36 assert (max >= MAX_IFUNC);
40 /* Support sysdeps/x86_64/multiarch/memcmp.S. */
41 IFUNC_IMPL (i, name, memcmp,
42 IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSE4_1,
44 IFUNC_IMPL_ADD (array, i, memcmp, HAS_SSSE3, __memcmp_ssse3)
45 IFUNC_IMPL_ADD (array, i, memcmp, 1, __memcmp_sse2))
47 /* Support sysdeps/x86_64/multiarch/memmove_chk.S. */
48 IFUNC_IMPL (i, name, __memmove_chk,
49 IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3,
50 __memmove_chk_ssse3_back)
51 IFUNC_IMPL_ADD (array, i, __memmove_chk, HAS_SSSE3,
53 IFUNC_IMPL_ADD (array, i, __memmove_chk, 1,
56 /* Support sysdeps/x86_64/multiarch/memmove.S. */
57 IFUNC_IMPL (i, name, memmove,
58 IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3,
60 IFUNC_IMPL_ADD (array, i, memmove, HAS_SSSE3,
62 IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_sse2))
64 /* Support sysdeps/x86_64/multiarch/memset_chk.S. */
65 IFUNC_IMPL (i, name, __memset_chk,
66 IFUNC_IMPL_ADD (array, i, __memset_chk, 1, __memset_chk_sse2)
67 IFUNC_IMPL_ADD (array, i, __memset_chk, 1,
70 /* Support sysdeps/x86_64/multiarch/memset.S. */
71 IFUNC_IMPL (i, name, memset,
72 IFUNC_IMPL_ADD (array, i, memset, 1, __memset_sse2)
73 IFUNC_IMPL_ADD (array, i, memset, 1, __memset_x86_64))
75 /* Support sysdeps/x86_64/multiarch/rawmemchr.S. */
76 IFUNC_IMPL (i, name, rawmemchr,
77 IFUNC_IMPL_ADD (array, i, rawmemchr, HAS_SSE4_2,
79 IFUNC_IMPL_ADD (array, i, rawmemchr, 1, __rawmemchr_sse2))
81 /* Support sysdeps/x86_64/multiarch/stpncpy.S. */
82 IFUNC_IMPL (i, name, stpncpy,
83 IFUNC_IMPL_ADD (array, i, stpncpy, HAS_SSSE3,
85 IFUNC_IMPL_ADD (array, i, stpncpy, 1,
86 __stpncpy_sse2_unaligned)
87 IFUNC_IMPL_ADD (array, i, stpncpy, 1, __stpncpy_sse2))
89 /* Support sysdeps/x86_64/multiarch/stpcpy.S. */
90 IFUNC_IMPL (i, name, stpcpy,
91 IFUNC_IMPL_ADD (array, i, stpcpy, HAS_SSSE3, __stpcpy_ssse3)
92 IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2_unaligned)
93 IFUNC_IMPL_ADD (array, i, stpcpy, 1, __stpcpy_sse2))
95 /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */
96 IFUNC_IMPL (i, name, strcasecmp,
97 IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_AVX,
99 IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSE4_2,
101 IFUNC_IMPL_ADD (array, i, strcasecmp, HAS_SSSE3,
103 IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strcasecmp_sse2))
105 /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */
106 IFUNC_IMPL (i, name, strcasecmp_l,
107 IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_AVX,
109 IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSE4_2,
110 __strcasecmp_l_sse42)
111 IFUNC_IMPL_ADD (array, i, strcasecmp_l, HAS_SSSE3,
112 __strcasecmp_l_ssse3)
113 IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
114 __strcasecmp_l_sse2))
116 /* Support sysdeps/x86_64/multiarch/strcasestr.c. */
117 IFUNC_IMPL (i, name, strcasestr,
118 IFUNC_IMPL_ADD (array, i, strcasestr, HAS_SSE4_2,
120 IFUNC_IMPL_ADD (array, i, strcasestr, 1, __strcasestr_sse2))
122 /* Support sysdeps/x86_64/multiarch/strcat.S. */
123 IFUNC_IMPL (i, name, strcat,
124 IFUNC_IMPL_ADD (array, i, strcat, HAS_SSSE3, __strcat_ssse3)
125 IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2_unaligned)
126 IFUNC_IMPL_ADD (array, i, strcat, 1, __strcat_sse2))
128 /* Support sysdeps/x86_64/multiarch/strchr.S. */
129 IFUNC_IMPL (i, name, strchr,
130 IFUNC_IMPL_ADD (array, i, strchr, HAS_SSE4_2, __strchr_sse42)
131 IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2_no_bsf)
132 IFUNC_IMPL_ADD (array, i, strchr, 1, __strchr_sse2))
134 /* Support sysdeps/x86_64/multiarch/strcmp.S. */
135 IFUNC_IMPL (i, name, strcmp,
136 IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSE4_2, __strcmp_sse42)
137 IFUNC_IMPL_ADD (array, i, strcmp, HAS_SSSE3, __strcmp_ssse3)
138 IFUNC_IMPL_ADD (array, i, strcmp, 1, __strcmp_sse2))
140 /* Support sysdeps/x86_64/multiarch/strcpy.S. */
141 IFUNC_IMPL (i, name, strcpy,
142 IFUNC_IMPL_ADD (array, i, strcpy, HAS_SSSE3, __strcpy_ssse3)
143 IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2_unaligned)
144 IFUNC_IMPL_ADD (array, i, strcpy, 1, __strcpy_sse2))
146 /* Support sysdeps/x86_64/multiarch/strcspn.S. */
147 IFUNC_IMPL (i, name, strcspn,
148 IFUNC_IMPL_ADD (array, i, strcspn, HAS_SSE4_2,
150 IFUNC_IMPL_ADD (array, i, strcspn, 1, __strcspn_sse2))
152 /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
153 IFUNC_IMPL (i, name, strncasecmp,
154 IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_AVX,
156 IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSE4_2,
158 IFUNC_IMPL_ADD (array, i, strncasecmp, HAS_SSSE3,
160 IFUNC_IMPL_ADD (array, i, strncasecmp, 1,
163 /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
164 IFUNC_IMPL (i, name, strncasecmp_l,
165 IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_AVX,
167 IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_SSE4_2,
168 __strncasecmp_l_sse42)
169 IFUNC_IMPL_ADD (array, i, strncasecmp_l, HAS_SSSE3,
170 __strncasecmp_l_ssse3)
171 IFUNC_IMPL_ADD (array, i, strncasecmp_l, 1,
172 __strncasecmp_l_sse2))
174 /* Support sysdeps/x86_64/multiarch/strncat.S. */
175 IFUNC_IMPL (i, name, strncat,
176 IFUNC_IMPL_ADD (array, i, strncat, HAS_SSSE3,
178 IFUNC_IMPL_ADD (array, i, strncat, 1,
179 __strncat_sse2_unaligned)
180 IFUNC_IMPL_ADD (array, i, strncat, 1, __strncat_sse2))
182 /* Support sysdeps/x86_64/multiarch/strncpy.S. */
183 IFUNC_IMPL (i, name, strncpy,
184 IFUNC_IMPL_ADD (array, i, strncpy, HAS_SSSE3,
186 IFUNC_IMPL_ADD (array, i, strncpy, 1,
187 __strncpy_sse2_unaligned)
188 IFUNC_IMPL_ADD (array, i, strncpy, 1, __strncpy_sse2))
190 /* Support sysdeps/x86_64/multiarch/strnlen.S. */
191 IFUNC_IMPL (i, name, strnlen,
192 IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_sse2_no_bsf)
193 IFUNC_IMPL_ADD (array, i, strnlen, 1, __strnlen_sse2))
195 /* Support sysdeps/x86_64/multiarch/strpbrk.S. */
196 IFUNC_IMPL (i, name, strpbrk,
197 IFUNC_IMPL_ADD (array, i, strpbrk, HAS_SSE4_2,
199 IFUNC_IMPL_ADD (array, i, strpbrk, 1, __strpbrk_sse2))
201 /* Support sysdeps/x86_64/multiarch/strrchr.S. */
202 IFUNC_IMPL (i, name, strrchr,
203 IFUNC_IMPL_ADD (array, i, strrchr, HAS_SSE4_2,
205 IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_sse2_no_bsf)
206 IFUNC_IMPL_ADD (array, i, strrchr, 1, __strrchr_sse2))
208 /* Support sysdeps/x86_64/multiarch/strspn.S. */
209 IFUNC_IMPL (i, name, strspn,
210 IFUNC_IMPL_ADD (array, i, strspn, HAS_SSE4_2, __strspn_sse42)
211 IFUNC_IMPL_ADD (array, i, strspn, 1, __strspn_sse2))
213 /* Support sysdeps/x86_64/multiarch/strstr-c.c. */
214 IFUNC_IMPL (i, name, strstr,
215 IFUNC_IMPL_ADD (array, i, strstr, HAS_SSE4_2, __strstr_sse42)
216 IFUNC_IMPL_ADD (array, i, strstr, 1, __strstr_sse2))
218 /* Support sysdeps/x86_64/multiarch/wcscpy.S. */
219 IFUNC_IMPL (i, name, wcscpy,
220 IFUNC_IMPL_ADD (array, i, wcscpy, HAS_SSSE3, __wcscpy_ssse3)
221 IFUNC_IMPL_ADD (array, i, wcscpy, 1, __wcscpy_sse2))
223 /* Support sysdeps/x86_64/multiarch/wmemcmp.S. */
224 IFUNC_IMPL (i, name, wmemcmp,
225 IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSE4_1,
227 IFUNC_IMPL_ADD (array, i, wmemcmp, HAS_SSSE3,
229 IFUNC_IMPL_ADD (array, i, wmemcmp, 1, __wmemcmp_sse2))
232 /* Support sysdeps/x86_64/multiarch/memcpy_chk.S. */
233 IFUNC_IMPL (i, name, __memcpy_chk,
234 IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3,
235 __memcpy_chk_ssse3_back)
236 IFUNC_IMPL_ADD (array, i, __memcpy_chk, HAS_SSSE3,
238 IFUNC_IMPL_ADD (array, i, __memcpy_chk, 1,
241 /* Support sysdeps/x86_64/multiarch/memcpy.S. */
242 IFUNC_IMPL (i, name, memcpy,
243 IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3,
245 IFUNC_IMPL_ADD (array, i, memcpy, HAS_SSSE3, __memcpy_ssse3)
246 IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_sse2))
248 /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S. */
249 IFUNC_IMPL (i, name, __mempcpy_chk,
250 IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3,
251 __mempcpy_chk_ssse3_back)
252 IFUNC_IMPL_ADD (array, i, __mempcpy_chk, HAS_SSSE3,
254 IFUNC_IMPL_ADD (array, i, __mempcpy_chk, 1,
257 /* Support sysdeps/x86_64/multiarch/mempcpy.S. */
258 IFUNC_IMPL (i, name, mempcpy,
259 IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3,
260 __mempcpy_ssse3_back)
261 IFUNC_IMPL_ADD (array, i, mempcpy, HAS_SSSE3,
263 IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_sse2))
265 /* Support sysdeps/x86_64/multiarch/strlen.S. */
266 IFUNC_IMPL (i, name, strlen,
267 IFUNC_IMPL_ADD (array, i, strlen, HAS_SSE4_2, __strlen_sse42)
268 IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2_pminub)
269 IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2_no_bsf)
270 IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2)
271 IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_sse2))
273 /* Support sysdeps/x86_64/multiarch/strncmp.S. */
274 IFUNC_IMPL (i, name, strncmp,
275 IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSE4_2,
277 IFUNC_IMPL_ADD (array, i, strncmp, HAS_SSSE3,
279 IFUNC_IMPL_ADD (array, i, strncmp, 1, __strncmp_sse2))