1 /* Enumerate available IFUNC implementations of a function. PowerPC32 version.
2 Copyright (C) 2013-2023 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 <https://www.gnu.org/licenses/>. */
23 #include <ifunc-impl-list.h>
26 __libc_ifunc_impl_list (const char *name
, struct libc_ifunc_impl
*array
,
31 unsigned long int hwcap
= GLRO(dl_hwcap
);
32 /* hwcap contains only the latest supported ISA, the code checks which is
33 and fills the previous supported ones. */
34 if (hwcap
& PPC_FEATURE_ARCH_2_06
)
35 hwcap
|= PPC_FEATURE_ARCH_2_05
| PPC_FEATURE_POWER5_PLUS
|
36 PPC_FEATURE_POWER5
| PPC_FEATURE_POWER4
;
37 else if (hwcap
& PPC_FEATURE_ARCH_2_05
)
38 hwcap
|= PPC_FEATURE_POWER5_PLUS
| PPC_FEATURE_POWER5
| PPC_FEATURE_POWER4
;
39 else if (hwcap
& PPC_FEATURE_POWER5_PLUS
)
40 hwcap
|= PPC_FEATURE_POWER5
| PPC_FEATURE_POWER4
;
41 else if (hwcap
& PPC_FEATURE_POWER5
)
42 hwcap
|= PPC_FEATURE_POWER4
;
45 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c. */
46 IFUNC_IMPL (i
, name
, memcpy
,
47 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_HAS_VSX
,
49 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_ARCH_2_06
,
51 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_ARCH_2_05
,
53 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_CELL_BE
,
55 IFUNC_IMPL_ADD (array
, i
, memcpy
, 1, __memcpy_ppc
))
57 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c. */
58 IFUNC_IMPL (i
, name
, memmove
,
59 IFUNC_IMPL_ADD (array
, i
, memmove
, hwcap
& PPC_FEATURE_HAS_VSX
,
61 IFUNC_IMPL_ADD (array
, i
, memmove
, 1, __memmove_ppc
))
63 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memset.c. */
64 IFUNC_IMPL (i
, name
, memset
,
65 IFUNC_IMPL_ADD (array
, i
, memset
, hwcap
& PPC_FEATURE_HAS_VSX
,
67 IFUNC_IMPL_ADD (array
, i
, memset
, hwcap
& PPC_FEATURE_ARCH_2_05
,
69 IFUNC_IMPL_ADD (array
, i
, memset
, 1, __memset_ppc
))
71 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c. */
72 IFUNC_IMPL (i
, name
, strlen
,
73 IFUNC_IMPL_ADD (array
, i
, strlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
75 IFUNC_IMPL_ADD (array
, i
, strlen
, 1,
78 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c. */
79 IFUNC_IMPL (i
, name
, strnlen
,
80 IFUNC_IMPL_ADD (array
, i
, strnlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
82 IFUNC_IMPL_ADD (array
, i
, strnlen
, 1,
85 /* Support sysdeps/powerpc/powerpc32/multiarch/strncmp.c. */
86 IFUNC_IMPL (i
, name
, strncmp
,
87 IFUNC_IMPL_ADD (array
, i
, strncmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
89 IFUNC_IMPL_ADD (array
, i
, strncmp
, 1,
93 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c. */
94 IFUNC_IMPL (i
, name
, memcmp
,
95 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
97 IFUNC_IMPL_ADD (array
, i
, memcmp
, 1, __memcmp_ppc
))
99 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c. */
100 IFUNC_IMPL (i
, name
, mempcpy
,
101 IFUNC_IMPL_ADD (array
, i
, mempcpy
,
102 hwcap
& PPC_FEATURE_HAS_VSX
,
104 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1,
107 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c. */
108 IFUNC_IMPL (i
, name
, memchr
,
109 IFUNC_IMPL_ADD (array
, i
, memchr
,
110 hwcap
& PPC_FEATURE_HAS_VSX
,
112 IFUNC_IMPL_ADD (array
, i
, memchr
, 1,
115 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c. */
116 IFUNC_IMPL (i
, name
, memrchr
,
117 IFUNC_IMPL_ADD (array
, i
, memrchr
,
118 hwcap
& PPC_FEATURE_HAS_VSX
,
120 IFUNC_IMPL_ADD (array
, i
, memrchr
, 1,
123 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c. */
124 IFUNC_IMPL (i
, name
, rawmemchr
,
125 IFUNC_IMPL_ADD (array
, i
, rawmemchr
,
126 hwcap
& PPC_FEATURE_HAS_VSX
,
128 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, 1,
131 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c. */
132 IFUNC_IMPL (i
, name
, strcasecmp
,
133 IFUNC_IMPL_ADD (array
, i
, strcasecmp
,
134 hwcap
& PPC_FEATURE_HAS_VSX
,
136 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, 1, __strcasecmp_ppc
))
138 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c. */
139 IFUNC_IMPL (i
, name
, strcasecmp_l
,
140 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
,
141 hwcap
& PPC_FEATURE_HAS_VSX
,
142 __strcasecmp_l_power7
)
143 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, 1,
146 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c. */
147 IFUNC_IMPL (i
, name
, strncasecmp
,
148 IFUNC_IMPL_ADD (array
, i
, strncasecmp
,
149 hwcap
& PPC_FEATURE_HAS_VSX
,
150 __strncasecmp_power7
)
151 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1, __strncasecmp_ppc
))
153 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c. */
154 IFUNC_IMPL (i
, name
, strncasecmp_l
,
155 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
,
156 hwcap
& PPC_FEATURE_HAS_VSX
,
157 __strncasecmp_l_power7
)
158 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
159 __strncasecmp_l_ppc
))
161 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c. */
162 IFUNC_IMPL (i
, name
, strchrnul
,
163 IFUNC_IMPL_ADD (array
, i
, strchrnul
,
164 hwcap
& PPC_FEATURE_HAS_VSX
,
166 IFUNC_IMPL_ADD (array
, i
, strchrnul
, 1,
169 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c. */
170 IFUNC_IMPL (i
, name
, strchr
,
171 IFUNC_IMPL_ADD (array
, i
, strchr
,
172 hwcap
& PPC_FEATURE_HAS_VSX
,
174 IFUNC_IMPL_ADD (array
, i
, strchr
, 1,