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/rawmemchr.S. */
65 IFUNC_IMPL (i
, name
, rawmemchr
,
66 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, HAS_SSE4_2
,
68 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, 1, __rawmemchr_sse2
))
70 /* Support sysdeps/x86_64/multiarch/stpncpy.S. */
71 IFUNC_IMPL (i
, name
, stpncpy
,
72 IFUNC_IMPL_ADD (array
, i
, stpncpy
, HAS_SSSE3
,
74 IFUNC_IMPL_ADD (array
, i
, stpncpy
, 1,
75 __stpncpy_sse2_unaligned
)
76 IFUNC_IMPL_ADD (array
, i
, stpncpy
, 1, __stpncpy_sse2
))
78 /* Support sysdeps/x86_64/multiarch/stpcpy.S. */
79 IFUNC_IMPL (i
, name
, stpcpy
,
80 IFUNC_IMPL_ADD (array
, i
, stpcpy
, HAS_SSSE3
, __stpcpy_ssse3
)
81 IFUNC_IMPL_ADD (array
, i
, stpcpy
, 1, __stpcpy_sse2_unaligned
)
82 IFUNC_IMPL_ADD (array
, i
, stpcpy
, 1, __stpcpy_sse2
))
84 /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */
85 IFUNC_IMPL (i
, name
, strcasecmp
,
86 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, HAS_AVX
,
88 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, HAS_SSE4_2
,
90 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, HAS_SSSE3
,
92 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, 1, __strcasecmp_sse2
))
94 /* Support sysdeps/x86_64/multiarch/strcasecmp_l.S. */
95 IFUNC_IMPL (i
, name
, strcasecmp_l
,
96 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, HAS_AVX
,
98 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, HAS_SSE4_2
,
100 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, HAS_SSSE3
,
101 __strcasecmp_l_ssse3
)
102 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, 1,
103 __strcasecmp_l_sse2
))
105 /* Support sysdeps/x86_64/multiarch/strcasestr.c. */
106 IFUNC_IMPL (i
, name
, strcasestr
,
107 IFUNC_IMPL_ADD (array
, i
, strcasestr
, HAS_SSE4_2
,
109 IFUNC_IMPL_ADD (array
, i
, strcasestr
, 1, __strcasestr_sse2
))
111 /* Support sysdeps/x86_64/multiarch/strcat.S. */
112 IFUNC_IMPL (i
, name
, strcat
,
113 IFUNC_IMPL_ADD (array
, i
, strcat
, HAS_SSSE3
, __strcat_ssse3
)
114 IFUNC_IMPL_ADD (array
, i
, strcat
, 1, __strcat_sse2_unaligned
)
115 IFUNC_IMPL_ADD (array
, i
, strcat
, 1, __strcat_sse2
))
117 /* Support sysdeps/x86_64/multiarch/strchr.S. */
118 IFUNC_IMPL (i
, name
, strchr
,
119 IFUNC_IMPL_ADD (array
, i
, strchr
, HAS_SSE4_2
, __strchr_sse42
)
120 IFUNC_IMPL_ADD (array
, i
, strchr
, 1, __strchr_sse2_no_bsf
)
121 IFUNC_IMPL_ADD (array
, i
, strchr
, 1, __strchr_sse2
))
123 /* Support sysdeps/x86_64/multiarch/strcmp.S. */
124 IFUNC_IMPL (i
, name
, strcmp
,
125 IFUNC_IMPL_ADD (array
, i
, strcmp
, HAS_SSE4_2
, __strcmp_sse42
)
126 IFUNC_IMPL_ADD (array
, i
, strcmp
, HAS_SSSE3
, __strcmp_ssse3
)
127 IFUNC_IMPL_ADD (array
, i
, strcmp
, 1, __strcmp_sse2
))
129 /* Support sysdeps/x86_64/multiarch/strcpy.S. */
130 IFUNC_IMPL (i
, name
, strcpy
,
131 IFUNC_IMPL_ADD (array
, i
, strcpy
, HAS_SSSE3
, __strcpy_ssse3
)
132 IFUNC_IMPL_ADD (array
, i
, strcpy
, 1, __strcpy_sse2_unaligned
)
133 IFUNC_IMPL_ADD (array
, i
, strcpy
, 1, __strcpy_sse2
))
135 /* Support sysdeps/x86_64/multiarch/strcspn.S. */
136 IFUNC_IMPL (i
, name
, strcspn
,
137 IFUNC_IMPL_ADD (array
, i
, strcspn
, HAS_SSE4_2
,
139 IFUNC_IMPL_ADD (array
, i
, strcspn
, 1, __strcspn_sse2
))
141 /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
142 IFUNC_IMPL (i
, name
, strncasecmp
,
143 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, HAS_AVX
,
145 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, HAS_SSE4_2
,
147 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, HAS_SSSE3
,
149 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1,
152 /* Support sysdeps/x86_64/multiarch/strncase_l.S. */
153 IFUNC_IMPL (i
, name
, strncasecmp_l
,
154 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, HAS_AVX
,
156 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, HAS_SSE4_2
,
157 __strncasecmp_l_sse42
)
158 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, HAS_SSSE3
,
159 __strncasecmp_l_ssse3
)
160 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
161 __strncasecmp_l_sse2
))
163 /* Support sysdeps/x86_64/multiarch/strncat.S. */
164 IFUNC_IMPL (i
, name
, strncat
,
165 IFUNC_IMPL_ADD (array
, i
, strncat
, HAS_SSSE3
,
167 IFUNC_IMPL_ADD (array
, i
, strncat
, 1,
168 __strncat_sse2_unaligned
)
169 IFUNC_IMPL_ADD (array
, i
, strncat
, 1, __strncat_sse2
))
171 /* Support sysdeps/x86_64/multiarch/strncpy.S. */
172 IFUNC_IMPL (i
, name
, strncpy
,
173 IFUNC_IMPL_ADD (array
, i
, strncpy
, HAS_SSSE3
,
175 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1,
176 __strncpy_sse2_unaligned
)
177 IFUNC_IMPL_ADD (array
, i
, strncpy
, 1, __strncpy_sse2
))
179 /* Support sysdeps/x86_64/multiarch/strpbrk.S. */
180 IFUNC_IMPL (i
, name
, strpbrk
,
181 IFUNC_IMPL_ADD (array
, i
, strpbrk
, HAS_SSE4_2
,
183 IFUNC_IMPL_ADD (array
, i
, strpbrk
, 1, __strpbrk_sse2
))
185 /* Support sysdeps/x86_64/multiarch/strrchr.S. */
186 IFUNC_IMPL (i
, name
, strrchr
,
187 IFUNC_IMPL_ADD (array
, i
, strrchr
, HAS_SSE4_2
,
189 IFUNC_IMPL_ADD (array
, i
, strrchr
, 1, __strrchr_sse2_no_bsf
)
190 IFUNC_IMPL_ADD (array
, i
, strrchr
, 1, __strrchr_sse2
))
192 /* Support sysdeps/x86_64/multiarch/strspn.S. */
193 IFUNC_IMPL (i
, name
, strspn
,
194 IFUNC_IMPL_ADD (array
, i
, strspn
, HAS_SSE4_2
, __strspn_sse42
)
195 IFUNC_IMPL_ADD (array
, i
, strspn
, 1, __strspn_sse2
))
197 /* Support sysdeps/x86_64/multiarch/strstr-c.c. */
198 IFUNC_IMPL (i
, name
, strstr
,
199 IFUNC_IMPL_ADD (array
, i
, strstr
, HAS_SSE4_2
, __strstr_sse42
)
200 IFUNC_IMPL_ADD (array
, i
, strstr
, 1, __strstr_sse2
))
202 /* Support sysdeps/x86_64/multiarch/wcscpy.S. */
203 IFUNC_IMPL (i
, name
, wcscpy
,
204 IFUNC_IMPL_ADD (array
, i
, wcscpy
, HAS_SSSE3
, __wcscpy_ssse3
)
205 IFUNC_IMPL_ADD (array
, i
, wcscpy
, 1, __wcscpy_sse2
))
207 /* Support sysdeps/x86_64/multiarch/wmemcmp.S. */
208 IFUNC_IMPL (i
, name
, wmemcmp
,
209 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, HAS_SSE4_1
,
211 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, HAS_SSSE3
,
213 IFUNC_IMPL_ADD (array
, i
, wmemcmp
, 1, __wmemcmp_sse2
))
216 /* Support sysdeps/x86_64/multiarch/memcpy_chk.S. */
217 IFUNC_IMPL (i
, name
, __memcpy_chk
,
218 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, HAS_SSSE3
,
219 __memcpy_chk_ssse3_back
)
220 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, HAS_SSSE3
,
222 IFUNC_IMPL_ADD (array
, i
, __memcpy_chk
, 1,
225 /* Support sysdeps/x86_64/multiarch/memcpy.S. */
226 IFUNC_IMPL (i
, name
, memcpy
,
227 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_SSSE3
,
229 IFUNC_IMPL_ADD (array
, i
, memcpy
, HAS_SSSE3
, __memcpy_ssse3
)
230 IFUNC_IMPL_ADD (array
, i
, memcpy
, 1, __memcpy_sse2
))
232 /* Support sysdeps/x86_64/multiarch/mempcpy_chk.S. */
233 IFUNC_IMPL (i
, name
, __mempcpy_chk
,
234 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, HAS_SSSE3
,
235 __mempcpy_chk_ssse3_back
)
236 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, HAS_SSSE3
,
238 IFUNC_IMPL_ADD (array
, i
, __mempcpy_chk
, 1,
241 /* Support sysdeps/x86_64/multiarch/mempcpy.S. */
242 IFUNC_IMPL (i
, name
, mempcpy
,
243 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_SSSE3
,
244 __mempcpy_ssse3_back
)
245 IFUNC_IMPL_ADD (array
, i
, mempcpy
, HAS_SSSE3
,
247 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1, __mempcpy_sse2
))
249 /* Support sysdeps/x86_64/multiarch/strncmp.S. */
250 IFUNC_IMPL (i
, name
, strncmp
,
251 IFUNC_IMPL_ADD (array
, i
, strncmp
, HAS_SSE4_2
,
253 IFUNC_IMPL_ADD (array
, i
, strncmp
, HAS_SSSE3
,
255 IFUNC_IMPL_ADD (array
, i
, strncmp
, 1, __strncmp_sse2
))