1 /* Enumerate available IFUNC implementations of a function. x86-64 version.
2 Copyright (C) 2012-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/>. */
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_AVX
,
50 __memmove_chk_avx_unaligned
)
51 IFUNC_IMPL_ADD (array
, i
, __memmove_chk
, HAS_SSSE3
,
52 __memmove_chk_ssse3_back
)
53 IFUNC_IMPL_ADD (array
, i
, __memmove_chk
, HAS_SSSE3
,
55 IFUNC_IMPL_ADD (array
, i
, __memmove_chk
, 1,
58 /* Support sysdeps/x86_64/multiarch/memmove.S. */
59 IFUNC_IMPL (i
, name
, memmove
,
60 IFUNC_IMPL_ADD (array
, i
, memmove
, HAS_AVX
,
61 __memmove_avx_unaligned
)
62 IFUNC_IMPL_ADD (array
, i
, memmove
, HAS_SSSE3
,
64 IFUNC_IMPL_ADD (array
, i
, memmove
, HAS_SSSE3
,
66 IFUNC_IMPL_ADD (array
, i
, memmove
, 1, __memmove_sse2
))
68 #ifdef HAVE_AVX2_SUPPORT
69 /* Support sysdeps/x86_64/multiarch/memset_chk.S. */
70 IFUNC_IMPL (i
, name
, __memset_chk
,
71 IFUNC_IMPL_ADD (array
, i
, __memset_chk
, 1, __memset_chk_sse2
)
72 IFUNC_IMPL_ADD (array
, i
, __memset_chk
, HAS_AVX2
,
75 /* Support sysdeps/x86_64/multiarch/memset.S. */
76 IFUNC_IMPL (i
, name
, memset
,
77 IFUNC_IMPL_ADD (array
, i
, memset
, 1, __memset_sse2
)
78 IFUNC_IMPL_ADD (array
, i
, memset
, HAS_AVX2
, __memset_avx2
))
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
, 1, __strcasestr_sse2
))
120 /* Support sysdeps/x86_64/multiarch/strcat.S. */
121 IFUNC_IMPL (i
, name
, strcat
,
122 IFUNC_IMPL_ADD (array
, i
, strcat
, HAS_SSSE3
, __strcat_ssse3
)
123 IFUNC_IMPL_ADD (array
, i
, strcat
, 1, __strcat_sse2_unaligned
)
124 IFUNC_IMPL_ADD (array
, i
, strcat
, 1, __strcat_sse2
))
126 /* Support sysdeps/x86_64/multiarch/strchr.S. */
127 IFUNC_IMPL (i
, name
, strchr
,
128 IFUNC_IMPL_ADD (array
, i
, strchr
, 1, __strchr_sse2_no_bsf
)
129 IFUNC_IMPL_ADD (array
, i
, strchr
, 1, __strchr_sse2
))
131 /* Support sysdeps/x86_64/multiarch/strcmp.S. */
132 IFUNC_IMPL (i
, name
, strcmp
,
133 IFUNC_IMPL_ADD (array
, i
, strcmp
, HAS_SSE4_2
, __strcmp_sse42
)
134 IFUNC_IMPL_ADD (array
, i
, strcmp
, HAS_SSSE3
, __strcmp_ssse3
)
135 IFUNC_IMPL_ADD (array
, i
, strcmp
, 1, __strcmp_sse2_unaligned
)
136 IFUNC_IMPL_ADD (array
, i
, strcmp
, 1, __strcmp_sse2
))
138 /* Support sysdeps/x86_64/multiarch/strcpy.S. */
139 IFUNC_IMPL (i
, name
, strcpy
,
140 IFUNC_IMPL_ADD (array
, i
, strcpy
, HAS_SSSE3
, __strcpy_ssse3
)
141 IFUNC_IMPL_ADD (array
, i
, strcpy
, 1, __strcpy_sse2_unaligned
)
142 IFUNC_IMPL_ADD (array
, i
, strcpy
, 1, __strcpy_sse2
))
144 /* Support sysdeps/x86_64/multiarch/strcspn.S. */
145 IFUNC_IMPL (i
, name
, strcspn
,
146 IFUNC_IMPL_ADD (array
, i
, strcspn
, HAS_SSE4_2
,
148 IFUNC_IMPL_ADD (array
, i
, strcspn
, 1, __strcspn_sse2
))
150 /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
151 IFUNC_IMPL (i
, name
, strncasecmp
,
152 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, HAS_AVX
,
154 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, HAS_SSE4_2
,
156 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, HAS_SSSE3
,
158 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1,
161 /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
162 IFUNC_IMPL (i
, name
, strncasecmp_l
,
163 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, HAS_AVX
,
165 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, HAS_SSE4_2
,
166 __strncasecmp_l_sse42
)
167 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, HAS_SSSE3
,
168 __strncasecmp_l_ssse3
)
169 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
170 __strncasecmp_l_sse2
))
172 /* Support sysdeps/x86_64/multiarch/strncat.S. */
173 IFUNC_IMPL (i
, name
, strncat
,
174 IFUNC_IMPL_ADD (array
, i
, strncat
, HAS_SSSE3
,
176 IFUNC_IMPL_ADD (array
, i
, strncat
, 1,
177 __strncat_sse2_unaligned
)
178 IFUNC_IMPL_ADD (array
, i
, strncat
, 1, __strncat_sse2
))
180 /* Support sysdeps/x86_64/multiarch/strncpy.S. */
181 IFUNC_IMPL (i
, name
, strncpy
,
182 IFUNC_IMPL_ADD (array
, i
, strncpy
, HAS_SSSE3
,
184 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1,
185 __strncpy_sse2_unaligned
)
186 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1, __strncpy_sse2
))
188 /* Support sysdeps/x86_64/multiarch/strpbrk.S. */
189 IFUNC_IMPL (i
, name
, strpbrk
,
190 IFUNC_IMPL_ADD (array
, i
, strpbrk
, HAS_SSE4_2
,
192 IFUNC_IMPL_ADD (array
, i
, strpbrk
, 1, __strpbrk_sse2
))
195 /* Support sysdeps/x86_64/multiarch/strspn.S. */
196 IFUNC_IMPL (i
, name
, strspn
,
197 IFUNC_IMPL_ADD (array
, i
, strspn
, HAS_SSE4_2
, __strspn_sse42
)
198 IFUNC_IMPL_ADD (array
, i
, strspn
, 1, __strspn_sse2
))
200 /* Support sysdeps/x86_64/multiarch/strstr.c. */
201 IFUNC_IMPL (i
, name
, strstr
,
202 IFUNC_IMPL_ADD (array
, i
, strstr
, 1, __strstr_sse2_unaligned
)
203 IFUNC_IMPL_ADD (array
, i
, strstr
, 1, __strstr_sse2
))
205 /* Support sysdeps/x86_64/multiarch/wcscpy.S. */
206 IFUNC_IMPL (i
, name
, wcscpy
,
207 IFUNC_IMPL_ADD (array
, i
, wcscpy
, HAS_SSSE3
, __wcscpy_ssse3
)
208 IFUNC_IMPL_ADD (array
, i
, wcscpy
, 1, __wcscpy_sse2
))
210 /* Support sysdeps/x86_64/multiarch/wmemcmp.S. */
211 IFUNC_IMPL (i
, name
, wmemcmp
,
212 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, HAS_SSE4_1
,
214 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, HAS_SSSE3
,
216 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, 1, __wmemcmp_sse2
))
219 /* Support sysdeps/x86_64/multiarch/memcpy_chk.S. */
220 IFUNC_IMPL (i
, name
, __memcpy_chk
,
221 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, HAS_AVX
,
222 __memcpy_chk_avx_unaligned
)
223 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, HAS_SSSE3
,
224 __memcpy_chk_ssse3_back
)
225 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, HAS_SSSE3
,
227 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, 1,
230 /* Support sysdeps/x86_64/multiarch/memcpy.S. */
231 IFUNC_IMPL (i
, name
, memcpy
,
232 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_AVX
,
233 __memcpy_avx_unaligned
)
234 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_SSSE3
,
236 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_SSSE3
, __memcpy_ssse3
)
237 IFUNC_IMPL_ADD (array
, i
, memcpy
, 1, __memcpy_sse2_unaligned
)
238 IFUNC_IMPL_ADD (array
, i
, memcpy
, 1, __memcpy_sse2
))
240 /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S. */
241 IFUNC_IMPL (i
, name
, __mempcpy_chk
,
242 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, HAS_AVX
,
243 __mempcpy_chk_avx_unaligned
)
244 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, HAS_SSSE3
,
245 __mempcpy_chk_ssse3_back
)
246 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, HAS_SSSE3
,
248 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, 1,
251 /* Support sysdeps/x86_64/multiarch/mempcpy.S. */
252 IFUNC_IMPL (i
, name
, mempcpy
,
253 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_AVX
,
254 __mempcpy_avx_unaligned
)
255 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_SSSE3
,
256 __mempcpy_ssse3_back
)
257 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_SSSE3
,
259 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1, __mempcpy_sse2
))
261 /* Support sysdeps/x86_64/multiarch/strncmp.S. */
262 IFUNC_IMPL (i
, name
, strncmp
,
263 IFUNC_IMPL_ADD (array
, i
, strncmp
, HAS_SSE4_2
,
265 IFUNC_IMPL_ADD (array
, i
, strncmp
, HAS_SSSE3
,
267 IFUNC_IMPL_ADD (array
, i
, strncmp
, 1, __strncmp_sse2
))