]>
git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/powerpc/powerpc32/power4/multiarch/ifunc-impl-list.c
1 /* Enumerate available IFUNC implementations of a function. PowerPC32 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/powerpc32/power4/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
, 1, __memcpy_ppc
))
62 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memset.c. */
63 IFUNC_IMPL (i
, name
, memset
,
64 IFUNC_IMPL_ADD (array
, i
, memset
, hwcap
& PPC_FEATURE_HAS_VSX
,
66 IFUNC_IMPL_ADD (array
, i
, memset
, hwcap
& PPC_FEATURE_ARCH_2_05
,
68 IFUNC_IMPL_ADD (array
, i
, memset
, 1, __memset_ppc
))
70 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c. */
71 IFUNC_IMPL (i
, name
, bzero
,
72 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_HAS_VSX
,
74 IFUNC_IMPL_ADD (array
, i
, bzero
, hwcap
& PPC_FEATURE_ARCH_2_05
,
76 IFUNC_IMPL_ADD (array
, i
, bzero
, 1, __bzero_ppc
))
80 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memcmp.c. */
81 IFUNC_IMPL (i
, name
, memcmp
,
82 IFUNC_IMPL_ADD (array
, i
, memcmp
, hwcap
& PPC_FEATURE_HAS_VSX
,
84 IFUNC_IMPL_ADD (array
, i
, memcmp
, 1, __memcmp_ppc
))
86 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy.c. */
87 IFUNC_IMPL (i
, name
, mempcpy
,
88 IFUNC_IMPL_ADD (array
, i
, mempcpy
,
89 hwcap
& PPC_FEATURE_HAS_VSX
,
91 IFUNC_IMPL_ADD (array
, i
, mempcpy
, 1,
94 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memchr.c. */
95 IFUNC_IMPL (i
, name
, memchr
,
96 IFUNC_IMPL_ADD (array
, i
, memchr
,
97 hwcap
& PPC_FEATURE_HAS_VSX
,
99 IFUNC_IMPL_ADD (array
, i
, memchr
, 1,
102 /* Support sysdeps/powerpc/powerpc32/power4/multiarch/memrchr.c. */
103 IFUNC_IMPL (i
, name
, memrchr
,
104 IFUNC_IMPL_ADD (array
, i
, memrchr
,
105 hwcap
& PPC_FEATURE_HAS_VSX
,
107 IFUNC_IMPL_ADD (array
, i
, memrchr
, 1,