1 /* Enumerate available IFUNC implementations of a function. x86-64 version.
2 Copyright (C) 2012-2014 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/stpncpy.S. */
65 IFUNC_IMPL (i
, name
, stpncpy
,
66 IFUNC_IMPL_ADD (array
, i
, stpncpy
, HAS_SSSE3
,
68 IFUNC_IMPL_ADD (array
, i
, stpncpy
, 1,
69 __stpncpy_sse2_unaligned
)
70 IFUNC_IMPL_ADD (array
, i
, stpncpy
, 1, __stpncpy_sse2
))
72 /* Support sysdeps/x86_64/multiarch/stpcpy.S. */
73 IFUNC_IMPL (i
, name
, stpcpy
,
74 IFUNC_IMPL_ADD (array
, i
, stpcpy
, HAS_SSSE3
, __stpcpy_ssse3
)
75 IFUNC_IMPL_ADD (array
, i
, stpcpy
, 1, __stpcpy_sse2_unaligned
)
76 IFUNC_IMPL_ADD (array
, i
, stpcpy
, 1, __stpcpy_sse2
))
78 /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */
79 IFUNC_IMPL (i
, name
, strcasecmp
,
80 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, HAS_AVX
,
82 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, HAS_SSE4_2
,
84 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, HAS_SSSE3
,
86 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, 1, __strcasecmp_sse2
))
88 /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */
89 IFUNC_IMPL (i
, name
, strcasecmp_l
,
90 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, HAS_AVX
,
92 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, HAS_SSE4_2
,
94 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, HAS_SSSE3
,
96 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, 1,
99 /* Support sysdeps/x86_64/multiarch/strcasestr.c. */
100 IFUNC_IMPL (i
, name
, strcasestr
,
101 IFUNC_IMPL_ADD (array
, i
, strcasestr
, 1, __strcasestr_sse2
))
103 /* Support sysdeps/x86_64/multiarch/strcat.S. */
104 IFUNC_IMPL (i
, name
, strcat
,
105 IFUNC_IMPL_ADD (array
, i
, strcat
, HAS_SSSE3
, __strcat_ssse3
)
106 IFUNC_IMPL_ADD (array
, i
, strcat
, 1, __strcat_sse2_unaligned
)
107 IFUNC_IMPL_ADD (array
, i
, strcat
, 1, __strcat_sse2
))
109 /* Support sysdeps/x86_64/multiarch/strchr.S. */
110 IFUNC_IMPL (i
, name
, strchr
,
111 IFUNC_IMPL_ADD (array
, i
, strchr
, 1, __strchr_sse2_no_bsf
)
112 IFUNC_IMPL_ADD (array
, i
, strchr
, 1, __strchr_sse2
))
114 /* Support sysdeps/x86_64/multiarch/strcmp.S. */
115 IFUNC_IMPL (i
, name
, strcmp
,
116 IFUNC_IMPL_ADD (array
, i
, strcmp
, HAS_SSE4_2
, __strcmp_sse42
)
117 IFUNC_IMPL_ADD (array
, i
, strcmp
, HAS_SSSE3
, __strcmp_ssse3
)
118 IFUNC_IMPL_ADD (array
, i
, strcmp
, 1, __strcmp_sse2_unaligned
)
119 IFUNC_IMPL_ADD (array
, i
, strcmp
, 1, __strcmp_sse2
))
121 /* Support sysdeps/x86_64/multiarch/strcpy.S. */
122 IFUNC_IMPL (i
, name
, strcpy
,
123 IFUNC_IMPL_ADD (array
, i
, strcpy
, HAS_SSSE3
, __strcpy_ssse3
)
124 IFUNC_IMPL_ADD (array
, i
, strcpy
, 1, __strcpy_sse2_unaligned
)
125 IFUNC_IMPL_ADD (array
, i
, strcpy
, 1, __strcpy_sse2
))
127 /* Support sysdeps/x86_64/multiarch/strcspn.S. */
128 IFUNC_IMPL (i
, name
, strcspn
,
129 IFUNC_IMPL_ADD (array
, i
, strcspn
, HAS_SSE4_2
,
131 IFUNC_IMPL_ADD (array
, i
, strcspn
, 1, __strcspn_sse2
))
133 /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
134 IFUNC_IMPL (i
, name
, strncasecmp
,
135 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, HAS_AVX
,
137 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, HAS_SSE4_2
,
139 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, HAS_SSSE3
,
141 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1,
144 /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
145 IFUNC_IMPL (i
, name
, strncasecmp_l
,
146 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, HAS_AVX
,
148 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, HAS_SSE4_2
,
149 __strncasecmp_l_sse42
)
150 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, HAS_SSSE3
,
151 __strncasecmp_l_ssse3
)
152 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
153 __strncasecmp_l_sse2
))
155 /* Support sysdeps/x86_64/multiarch/strncat.S. */
156 IFUNC_IMPL (i
, name
, strncat
,
157 IFUNC_IMPL_ADD (array
, i
, strncat
, HAS_SSSE3
,
159 IFUNC_IMPL_ADD (array
, i
, strncat
, 1,
160 __strncat_sse2_unaligned
)
161 IFUNC_IMPL_ADD (array
, i
, strncat
, 1, __strncat_sse2
))
163 /* Support sysdeps/x86_64/multiarch/strncpy.S. */
164 IFUNC_IMPL (i
, name
, strncpy
,
165 IFUNC_IMPL_ADD (array
, i
, strncpy
, HAS_SSSE3
,
167 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1,
168 __strncpy_sse2_unaligned
)
169 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1, __strncpy_sse2
))
171 /* Support sysdeps/x86_64/multiarch/strpbrk.S. */
172 IFUNC_IMPL (i
, name
, strpbrk
,
173 IFUNC_IMPL_ADD (array
, i
, strpbrk
, HAS_SSE4_2
,
175 IFUNC_IMPL_ADD (array
, i
, strpbrk
, 1, __strpbrk_sse2
))
178 /* Support sysdeps/x86_64/multiarch/strspn.S. */
179 IFUNC_IMPL (i
, name
, strspn
,
180 IFUNC_IMPL_ADD (array
, i
, strspn
, HAS_SSE4_2
, __strspn_sse42
)
181 IFUNC_IMPL_ADD (array
, i
, strspn
, 1, __strspn_sse2
))
183 /* Support sysdeps/x86_64/multiarch/strstr.c. */
184 IFUNC_IMPL (i
, name
, strstr
,
185 IFUNC_IMPL_ADD (array
, i
, strstr
, 1, __strstr_sse2_unaligned
)
186 IFUNC_IMPL_ADD (array
, i
, strstr
, 1, __strstr_sse2
))
188 /* Support sysdeps/x86_64/multiarch/wcscpy.S. */
189 IFUNC_IMPL (i
, name
, wcscpy
,
190 IFUNC_IMPL_ADD (array
, i
, wcscpy
, HAS_SSSE3
, __wcscpy_ssse3
)
191 IFUNC_IMPL_ADD (array
, i
, wcscpy
, 1, __wcscpy_sse2
))
193 /* Support sysdeps/x86_64/multiarch/wmemcmp.S. */
194 IFUNC_IMPL (i
, name
, wmemcmp
,
195 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, HAS_SSE4_1
,
197 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, HAS_SSSE3
,
199 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, 1, __wmemcmp_sse2
))
202 /* Support sysdeps/x86_64/multiarch/memcpy_chk.S. */
203 IFUNC_IMPL (i
, name
, __memcpy_chk
,
204 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, HAS_SSSE3
,
205 __memcpy_chk_ssse3_back
)
206 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, HAS_SSSE3
,
208 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, 1,
211 /* Support sysdeps/x86_64/multiarch/memcpy.S. */
212 IFUNC_IMPL (i
, name
, memcpy
,
213 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_SSSE3
,
215 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_SSSE3
, __memcpy_ssse3
)
216 IFUNC_IMPL_ADD (array
, i
, memcpy
, 1, __memcpy_sse2_unaligned
)
217 IFUNC_IMPL_ADD (array
, i
, memcpy
, 1, __memcpy_sse2
))
219 /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S. */
220 IFUNC_IMPL (i
, name
, __mempcpy_chk
,
221 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, HAS_SSSE3
,
222 __mempcpy_chk_ssse3_back
)
223 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, HAS_SSSE3
,
225 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, 1,
228 /* Support sysdeps/x86_64/multiarch/mempcpy.S. */
229 IFUNC_IMPL (i
, name
, mempcpy
,
230 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_SSSE3
,
231 __mempcpy_ssse3_back
)
232 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_SSSE3
,
234 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1, __mempcpy_sse2
))
236 /* Support sysdeps/x86_64/multiarch/strncmp.S. */
237 IFUNC_IMPL (i
, name
, strncmp
,
238 IFUNC_IMPL_ADD (array
, i
, strncmp
, HAS_SSE4_2
,
240 IFUNC_IMPL_ADD (array
, i
, strncmp
, HAS_SSSE3
,
242 IFUNC_IMPL_ADD (array
, i
, strncmp
, 1, __strncmp_sse2
))