1 | /* Enumerate available IFUNC implementations of a function. AARCH64 version. |
2 | Copyright (C) 2017-2024 Free Software Foundation, Inc. |
3 | This file is part of the GNU C Library. |
4 | |
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. |
9 | |
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. |
14 | |
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/>. */ |
18 | |
19 | #include <assert.h> |
20 | #include <string.h> |
21 | #include <wchar.h> |
22 | #include <ldsodefs.h> |
23 | #include <ifunc-impl-list.h> |
24 | #include <init-arch.h> |
25 | #include <stdio.h> |
26 | |
27 | size_t |
28 | __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, |
29 | size_t max) |
30 | { |
31 | size_t i = max; |
32 | |
33 | INIT_ARCH (); |
34 | |
35 | /* Support sysdeps/aarch64/multiarch/memcpy.c, memmove.c and memset.c. */ |
36 | IFUNC_IMPL (i, name, memcpy, |
37 | IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_thunderx) |
38 | IFUNC_IMPL_ADD (array, i, memcpy, !bti, __memcpy_thunderx2) |
39 | #if HAVE_AARCH64_SVE_ASM |
40 | IFUNC_IMPL_ADD (array, i, memcpy, sve && !bti, __memcpy_a64fx) |
41 | IFUNC_IMPL_ADD (array, i, memcpy, sve, __memcpy_sve) |
42 | #endif |
43 | IFUNC_IMPL_ADD (array, i, memcpy, mops, __memcpy_mops) |
44 | IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_generic)) |
45 | IFUNC_IMPL (i, name, memmove, |
46 | IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_thunderx) |
47 | IFUNC_IMPL_ADD (array, i, memmove, !bti, __memmove_thunderx2) |
48 | #if HAVE_AARCH64_SVE_ASM |
49 | IFUNC_IMPL_ADD (array, i, memmove, sve && !bti, __memmove_a64fx) |
50 | IFUNC_IMPL_ADD (array, i, memmove, sve, __memmove_sve) |
51 | #endif |
52 | IFUNC_IMPL_ADD (array, i, memmove, mops, __memmove_mops) |
53 | IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_generic)) |
54 | IFUNC_IMPL (i, name, memset, |
55 | IFUNC_IMPL_ADD (array, i, memset, (zva_size == 64), __memset_zva64) |
56 | IFUNC_IMPL_ADD (array, i, memset, 1, __memset_emag) |
57 | IFUNC_IMPL_ADD (array, i, memset, 1, __memset_kunpeng) |
58 | #if HAVE_AARCH64_SVE_ASM |
59 | IFUNC_IMPL_ADD (array, i, memset, sve && !bti && zva_size == 256, __memset_a64fx) |
60 | #endif |
61 | IFUNC_IMPL_ADD (array, i, memset, mops, __memset_mops) |
62 | IFUNC_IMPL_ADD (array, i, memset, 1, __memset_generic)) |
63 | IFUNC_IMPL (i, name, memchr, |
64 | IFUNC_IMPL_ADD (array, i, memchr, !mte, __memchr_nosimd) |
65 | IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_generic)) |
66 | |
67 | IFUNC_IMPL (i, name, strlen, |
68 | IFUNC_IMPL_ADD (array, i, strlen, !mte, __strlen_asimd) |
69 | IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_generic)) |
70 | |
71 | return 0; |
72 | } |
73 | |