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>
24 #include <cpu-features.h>
27 __libc_ifunc_impl_list (const char *name
, struct libc_ifunc_impl
*array
,
32 const struct cpu_features
*features
= &GLRO(dl_powerpc_cpu_features
);
33 unsigned long int hwcap
= features
->hwcap
;
34 /* hwcap contains only the latest supported ISA, the code checks which is
35 and fills the previous supported ones. */
36 if (hwcap
& PPC_FEATURE_ARCH_2_06
)
37 hwcap
|= PPC_FEATURE_ARCH_2_05
| PPC_FEATURE_POWER5_PLUS
|
38 PPC_FEATURE_POWER5
| PPC_FEATURE_POWER4
;
39 else if (hwcap
& PPC_FEATURE_ARCH_2_05
)
40 hwcap
|= PPC_FEATURE_POWER5_PLUS
| PPC_FEATURE_POWER5
| PPC_FEATURE_POWER4
;
41 else if (hwcap
& PPC_FEATURE_POWER5_PLUS
)
42 hwcap
|= PPC_FEATURE_POWER5
| PPC_FEATURE_POWER4
;
43 else if (hwcap
& PPC_FEATURE_POWER5
)
44 hwcap
|= PPC_FEATURE_POWER4
;
47 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memcpy.c. */
48 IFUNC_IMPL (i
, name
, memcpy
,
49 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_HAS_VSX
,
51 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_ARCH_2_06
,
53 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_ARCH_2_05
,
55 IFUNC_IMPL_ADD (array
, i
, memcpy
, hwcap
& PPC_FEATURE_CELL_BE
,
57 IFUNC_IMPL_ADD (array
, i
, memcpy
, 1, __memcpy_ppc
))
59 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memmove.c. */
60 IFUNC_IMPL (i
, name
, memmove
,
61 IFUNC_IMPL_ADD (array
, i
, memmove
, hwcap
& PPC_FEATURE_HAS_VSX
,
63 IFUNC_IMPL_ADD (array
, i
, memmove
, 1, __memmove_ppc
))
65 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memset.c. */
66 IFUNC_IMPL (i
, name
, memset
,
67 IFUNC_IMPL_ADD (array
, i
, memset
, hwcap
& PPC_FEATURE_HAS_VSX
,
69 IFUNC_IMPL_ADD (array
, i
, memset
, hwcap
& PPC_FEATURE_ARCH_2_05
,
71 IFUNC_IMPL_ADD (array
, i
, memset
, 1, __memset_ppc
))
73 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strlen.c. */
74 IFUNC_IMPL (i
, name
, strlen
,
75 IFUNC_IMPL_ADD (array
, i
, strlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
77 IFUNC_IMPL_ADD (array
, i
, strlen
, 1,
80 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strnlen.c. */
81 IFUNC_IMPL (i
, name
, strnlen
,
82 IFUNC_IMPL_ADD (array
, i
, strnlen
, hwcap
& PPC_FEATURE_HAS_VSX
,
84 IFUNC_IMPL_ADD (array
, i
, strnlen
, 1,
88 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c. */
89 IFUNC_IMPL (i
, name
, memcmp
,
90 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
92 IFUNC_IMPL_ADD (array
, i
, memcmp
, 1, __memcmp_ppc
))
94 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c. */
95 IFUNC_IMPL (i
, name
, mempcpy
,
96 IFUNC_IMPL_ADD (array
, i
, mempcpy
,
97 hwcap
& PPC_FEATURE_HAS_VSX
,
99 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1,
102 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c. */
103 IFUNC_IMPL (i
, name
, memchr
,
104 IFUNC_IMPL_ADD (array
, i
, memchr
,
105 hwcap
& PPC_FEATURE_HAS_VSX
,
107 IFUNC_IMPL_ADD (array
, i
, memchr
, 1,
110 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c. */
111 IFUNC_IMPL (i
, name
, memrchr
,
112 IFUNC_IMPL_ADD (array
, i
, memrchr
,
113 hwcap
& PPC_FEATURE_HAS_VSX
,
115 IFUNC_IMPL_ADD (array
, i
, memrchr
, 1,
118 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/rawmemchr.c. */
119 IFUNC_IMPL (i
, name
, rawmemchr
,
120 IFUNC_IMPL_ADD (array
, i
, rawmemchr
,
121 hwcap
& PPC_FEATURE_HAS_VSX
,
123 IFUNC_IMPL_ADD (array
, i
, rawmemchr
, 1,
126 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp.c. */
127 IFUNC_IMPL (i
, name
, strcasecmp
,
128 IFUNC_IMPL_ADD (array
, i
, strcasecmp
,
129 hwcap
& PPC_FEATURE_HAS_VSX
,
131 IFUNC_IMPL_ADD (array
, i
, strcasecmp
, 1, __strcasecmp_ppc
))
133 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strcasecmp_l.c. */
134 IFUNC_IMPL (i
, name
, strcasecmp_l
,
135 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
,
136 hwcap
& PPC_FEATURE_HAS_VSX
,
137 __strcasecmp_l_power7
)
138 IFUNC_IMPL_ADD (array
, i
, strcasecmp_l
, 1,
141 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strncase.c. */
142 IFUNC_IMPL (i
, name
, strncasecmp
,
143 IFUNC_IMPL_ADD (array
, i
, strncasecmp
,
144 hwcap
& PPC_FEATURE_HAS_VSX
,
145 __strncasecmp_power7
)
146 IFUNC_IMPL_ADD (array
, i
, strncasecmp
, 1, __strncasecmp_ppc
))
148 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strncase_l.c. */
149 IFUNC_IMPL (i
, name
, strncasecmp_l
,
150 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
,
151 hwcap
& PPC_FEATURE_HAS_VSX
,
152 __strncasecmp_l_power7
)
153 IFUNC_IMPL_ADD (array
, i
, strncasecmp_l
, 1,
154 __strncasecmp_l_ppc
))
156 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strchrnul.c. */
157 IFUNC_IMPL (i
, name
, strchrnul
,
158 IFUNC_IMPL_ADD (array
, i
, strchrnul
,
159 hwcap
& PPC_FEATURE_HAS_VSX
,
161 IFUNC_IMPL_ADD (array
, i
, strchrnul
, 1,
164 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/strchr.c. */
165 IFUNC_IMPL (i
, name
, strchr
,
166 IFUNC_IMPL_ADD (array
, i
, strchr
,
167 hwcap
& PPC_FEATURE_HAS_VSX
,
169 IFUNC_IMPL_ADD (array
, i
, strchr
, 1,