1 /* Enumerate available IFUNC implementations of a function. PowerPC64 version.
2 Copyright (C) 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/>. */
23 #include <ifunc-impl-list.h>
25 /* Maximum number of IFUNC implementations. */
29 __libc_ifunc_impl_list (const char *name
, struct libc_ifunc_impl
*array
,
32 assert (max
>= MAX_IFUNC
);
36 unsigned long int hwcap
= GLRO(dl_hwcap
);
37 /* hwcap contains only the latest supported ISA, the code checks which is
38 and fills the previous supported ones. */
39 if (hwcap
& PPC_FEATURE_ARCH_2_06
)
40 hwcap
|= PPC_FEATURE_ARCH_2_05
| PPC_FEATURE_POWER5_PLUS
|
41 PPC_FEATURE_POWER5
| PPC_FEATURE_POWER4
;
42 else if (hwcap
& PPC_FEATURE_ARCH_2_05
)
43 hwcap
|= PPC_FEATURE_POWER5_PLUS
| PPC_FEATURE_POWER5
| PPC_FEATURE_POWER4
;
44 else if (hwcap
& PPC_FEATURE_POWER5_PLUS
)
45 hwcap
|= PPC_FEATURE_POWER5
| PPC_FEATURE_POWER4
;
46 else if (hwcap
& PPC_FEATURE_POWER5
)
47 hwcap
|= PPC_FEATURE_POWER4
;
50 /* Support sysdeps/powerpc/powerpc64/multiarch/memcpy.c. */
51 IFUNC_IMPL (i
, name
, memcpy
,
52 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_HAS_VSX
,
54 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_ARCH_2_06
,
56 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_ARCH_2_05
,
58 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_CELL_BE
,
60 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_POWER4
,
62 IFUNC_IMPL_ADD (array
, i
, memcpy
, 1, __memcpy_ppc
))
64 /* Support sysdeps/powerpc/powerpc64/multiarch/memset.c. */
65 IFUNC_IMPL (i
, name
, memset
,
66 IFUNC_IMPL_ADD (array
, i
, memset
, hwcap
& PPC_FEATURE_HAS_VSX
,
68 IFUNC_IMPL_ADD (array
, i
, memset
, hwcap
& PPC_FEATURE_ARCH_2_05
,
70 IFUNC_IMPL_ADD (array
, i
, memset
, hwcap
& PPC_FEATURE_POWER4
,
72 IFUNC_IMPL_ADD (array
, i
, memset
, 1, __memset_ppc
))
74 /* Support sysdeps/powerpc/powerpc64/multiarch/strlen.c. */
75 IFUNC_IMPL (i
, name
, strlen
,
76 IFUNC_IMPL_ADD (array
, i
, strlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
78 IFUNC_IMPL_ADD (array
, i
, strlen
, 1,
81 /* Support sysdeps/powerpc/powerpc64/multiarch/strncmp.c. */
82 IFUNC_IMPL (i
, name
, strncmp
,
83 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
85 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap
& PPC_FEATURE_POWER4
,
87 IFUNC_IMPL_ADD (array
, i
, strncmp
, 1,
90 /* Support sysdeps/powerpc/powerpc64/multiarch/strchr.c. */
91 IFUNC_IMPL (i
, name
, strchr
,
92 IFUNC_IMPL_ADD (array
, i
, strchr
,
93 hwcap
& PPC_FEATURE_HAS_VSX
,
95 IFUNC_IMPL_ADD (array
, i
, strchr
, 1,
98 /* Support sysdeps/powerpc/powerpc64/multiarch/strchrnul.c. */
99 IFUNC_IMPL (i
, name
, strchrnul
,
100 IFUNC_IMPL_ADD (array
, i
, strchrnul
,
101 hwcap
& PPC_FEATURE_HAS_VSX
,
103 IFUNC_IMPL_ADD (array
, i
, strchrnul
, 1,
107 /* Support sysdeps/powerpc/powerpc64/multiarch/memcmp.c. */
108 IFUNC_IMPL (i
, name
, memcmp
,
109 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
111 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_POWER4
,
113 IFUNC_IMPL_ADD (array
, i
, memcmp
, 1, __memcmp_ppc
))
115 /* Support sysdeps/powerpc/powerpc64/multiarch/bzero.c. */
116 IFUNC_IMPL (i
, name
, bzero
,
117 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_HAS_VSX
,
119 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_ARCH_2_05
,
121 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_POWER4
,
123 IFUNC_IMPL_ADD (array
, i
, bzero
, 1, __bzero_ppc
))
125 /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */
126 IFUNC_IMPL (i
, name
, mempcpy
,
127 IFUNC_IMPL_ADD (array
, i
, mempcpy
,
128 hwcap
& PPC_FEATURE_HAS_VSX
,
130 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1,
133 /* Support sysdeps/powerpc/powerpc64/multiarch/memchr.c. */
134 IFUNC_IMPL (i
, name
, memchr
,
135 IFUNC_IMPL_ADD (array
, i
, memchr
,
136 hwcap
& PPC_FEATURE_HAS_VSX
,
138 IFUNC_IMPL_ADD (array
, i
, memchr
, 1,
141 /* Support sysdeps/powerpc/powerpc64/multiarch/memrchr.c. */
142 IFUNC_IMPL (i
, name
, memrchr
,
143 IFUNC_IMPL_ADD (array
, i
, memrchr
,
144 hwcap
& PPC_FEATURE_HAS_VSX
,
146 IFUNC_IMPL_ADD (array
, i
, memrchr
, 1,
149 /* Support sysdeps/powerpc/powerpc64/multiarch/rawmemchr.c. */
150 IFUNC_IMPL (i
, name
, rawmemchr
,
151 IFUNC_IMPL_ADD (array
, i
, rawmemchr
,
152 hwcap
& PPC_FEATURE_HAS_VSX
,
154 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, 1,
157 /* Support sysdeps/powerpc/powerpc64/multiarch/strnlen.c. */
158 IFUNC_IMPL (i
, name
, strnlen
,
159 IFUNC_IMPL_ADD (array
, i
, strnlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
161 IFUNC_IMPL_ADD (array
, i
, strnlen
, 1,
164 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp.c. */
165 IFUNC_IMPL (i
, name
, strcasecmp
,
166 IFUNC_IMPL_ADD (array
, i
, strcasecmp
,
167 hwcap
& PPC_FEATURE_HAS_VSX
,
169 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, 1, __strcasecmp_ppc
))
171 /* Support sysdeps/powerpc/powerpc64/multiarch/strcasecmp_l.c. */
172 IFUNC_IMPL (i
, name
, strcasecmp_l
,
173 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
,
174 hwcap
& PPC_FEATURE_HAS_VSX
,
175 __strcasecmp_l_power7
)
176 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, 1,
179 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase.c. */
180 IFUNC_IMPL (i
, name
, strncasecmp
,
181 IFUNC_IMPL_ADD (array
, i
, strncasecmp
,
182 hwcap
& PPC_FEATURE_HAS_VSX
,
183 __strncasecmp_power7
)
184 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1, __strncasecmp_ppc
))
186 /* Support sysdeps/powerpc/powerpc64/multiarch/strncase_l.c. */
187 IFUNC_IMPL (i
, name
, strncasecmp_l
,
188 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
,
189 hwcap
& PPC_FEATURE_HAS_VSX
,
190 __strncasecmp_l_power7
)
191 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
192 __strncasecmp_l_ppc
))
194 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
195 IFUNC_IMPL (i
, name
, wcschr
,
196 IFUNC_IMPL_ADD (array
, i
, wcschr
,
197 hwcap
& PPC_FEATURE_HAS_VSX
,
199 IFUNC_IMPL_ADD (array
, i
, wcschr
,
200 hwcap
& PPC_FEATURE_ARCH_2_05
,
202 IFUNC_IMPL_ADD (array
, i
, wcschr
, 1,
205 /* Support sysdeps/powerpc/powerpc64/multiarch/wcschr.c. */
206 IFUNC_IMPL (i
, name
, wcsrchr
,
207 IFUNC_IMPL_ADD (array
, i
, wcsrchr
,
208 hwcap
& PPC_FEATURE_HAS_VSX
,
210 IFUNC_IMPL_ADD (array
, i
, wcsrchr
,
211 hwcap
& PPC_FEATURE_ARCH_2_05
,
213 IFUNC_IMPL_ADD (array
, i
, wcsrchr
, 1,