]>
Commit | Line | Data |
---|---|---|
6a2c6952 | 1 | /* Enumerate available IFUNC implementations of a function. AARCH64 version. |
581c785b | 2 | Copyright (C) 2017-2022 Free Software Foundation, Inc. |
6a2c6952 SE |
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 | |
5a82c748 | 17 | <https://www.gnu.org/licenses/>. */ |
6a2c6952 SE |
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 | /* Maximum number of IFUNC implementations. */ | |
fa527f34 | 28 | #define MAX_IFUNC 7 |
6a2c6952 SE |
29 | |
30 | size_t | |
31 | __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array, | |
32 | size_t max) | |
33 | { | |
34 | assert (max >= MAX_IFUNC); | |
35 | ||
36 | size_t i = 0; | |
37 | ||
38 | INIT_ARCH (); | |
39 | ||
4f26956d | 40 | /* Support sysdeps/aarch64/multiarch/memcpy.c, memmove.c and memset.c. */ |
6a2c6952 | 41 | IFUNC_IMPL (i, name, memcpy, |
ab85da15 | 42 | IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_thunderx) |
04c6a807 | 43 | IFUNC_IMPL_ADD (array, i, memcpy, !bti, __memcpy_thunderx2) |
36ada5f6 | 44 | IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_falkor) |
4a733bf3 | 45 | IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_simd) |
fa527f34 NT |
46 | #if HAVE_AARCH64_SVE_ASM |
47 | IFUNC_IMPL_ADD (array, i, memcpy, sve, __memcpy_a64fx) | |
48 | #endif | |
6a2c6952 SE |
49 | IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_generic)) |
50 | IFUNC_IMPL (i, name, memmove, | |
ab85da15 | 51 | IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_thunderx) |
04c6a807 | 52 | IFUNC_IMPL_ADD (array, i, memmove, !bti, __memmove_thunderx2) |
dd5bc7f1 | 53 | IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_falkor) |
4a733bf3 | 54 | IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_simd) |
fa527f34 NT |
55 | #if HAVE_AARCH64_SVE_ASM |
56 | IFUNC_IMPL_ADD (array, i, memmove, sve, __memmove_a64fx) | |
57 | #endif | |
6a2c6952 | 58 | IFUNC_IMPL_ADD (array, i, memmove, 1, __memmove_generic)) |
5a67c4fa SP |
59 | IFUNC_IMPL (i, name, memset, |
60 | /* Enable this on non-falkor processors too so that other cores | |
61 | can do a comparative analysis with __memset_generic. */ | |
62 | IFUNC_IMPL_ADD (array, i, memset, (zva_size == 64), __memset_falkor) | |
c7d3890f | 63 | IFUNC_IMPL_ADD (array, i, memset, (zva_size == 64), __memset_emag) |
525de033 | 64 | IFUNC_IMPL_ADD (array, i, memset, 1, __memset_kunpeng) |
4f26956d NT |
65 | #if HAVE_AARCH64_SVE_ASM |
66 | IFUNC_IMPL_ADD (array, i, memset, sve, __memset_a64fx) | |
67 | #endif | |
5a67c4fa | 68 | IFUNC_IMPL_ADD (array, i, memset, 1, __memset_generic)) |
83d1cc42 | 69 | IFUNC_IMPL (i, name, memchr, |
04c6a807 | 70 | IFUNC_IMPL_ADD (array, i, memchr, !mte, __memchr_nosimd) |
83d1cc42 | 71 | IFUNC_IMPL_ADD (array, i, memchr, 1, __memchr_generic)) |
6a2c6952 | 72 | |
436e4d5b | 73 | IFUNC_IMPL (i, name, strlen, |
04c6a807 | 74 | IFUNC_IMPL_ADD (array, i, strlen, !mte, __strlen_asimd) |
f46ef33a | 75 | IFUNC_IMPL_ADD (array, i, strlen, 1, __strlen_mte)) |
436e4d5b | 76 | |
6a2c6952 SE |
77 | return i; |
78 | } |