Update copyright dates with scripts/update-copyrights.
[glibc.git] / sysdeps / sparc / sparc64 / multiarch / ifunc-impl-list.c
blobe636d138ef0323e0785e56e40367381b998f98e4
1 /* Enumerate available IFUNC implementations of a function. sparc version.
2 Copyright (C) 2012-2015 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/>. */
19 #include <assert.h>
20 #include <string.h>
21 #include <wchar.h>
22 #include <ldsodefs.h>
23 #include <sysdep.h>
24 #include <ifunc-impl-list.h>
26 /* Fill ARRAY of MAX elements with IFUNC implementations for function
27 NAME and return the number of valid entries. */
29 size_t
30 __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
31 size_t max)
33 size_t i = 0;
34 int hwcap;
36 hwcap = GLRO(dl_hwcap);
38 IFUNC_IMPL (i, name, memcpy,
39 IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_CRYPTO,
40 __memcpy_niagara4)
41 IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_N2,
42 __memcpy_niagara2)
43 IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_BLKINIT,
44 __memcpy_niagara1)
45 IFUNC_IMPL_ADD (array, i, memcpy, hwcap & HWCAP_SPARC_ULTRA3,
46 __memcpy_ultra3)
47 IFUNC_IMPL_ADD (array, i, memcpy, 1, __memcpy_ultra1));
49 IFUNC_IMPL (i, name, mempcpy,
50 IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_CRYPTO,
51 __mempcpy_niagara4)
52 IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_N2,
53 __mempcpy_niagara2)
54 IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_BLKINIT,
55 __mempcpy_niagara1)
56 IFUNC_IMPL_ADD (array, i, mempcpy, hwcap & HWCAP_SPARC_ULTRA3,
57 __mempcpy_ultra3)
58 IFUNC_IMPL_ADD (array, i, mempcpy, 1, __mempcpy_ultra1));
60 IFUNC_IMPL (i, name, bzero,
61 IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_CRYPTO,
62 __bzero_niagara4)
63 IFUNC_IMPL_ADD (array, i, bzero, hwcap & HWCAP_SPARC_BLKINIT,
64 __bzero_niagara1)
65 IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ultra1));
67 IFUNC_IMPL (i, name, memset,
68 IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_CRYPTO,
69 __memset_niagara4)
70 IFUNC_IMPL_ADD (array, i, memset, hwcap & HWCAP_SPARC_BLKINIT,
71 __memset_niagara1)
72 IFUNC_IMPL_ADD (array, i, memset, 1, __memset_ultra1));
74 return i;