diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-10-03 00:48:27 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2017-11-28 08:53:15 -0200 |
commit | 88684de7a68b88e8d7e29b2490bdb62994a5e97e (patch) | |
tree | ce595147b2092146aa4eb494e3c75303ec5bf573 /sysdeps/sparc/sparc64/multiarch/memcpy.c | |
parent | f9bb1ef233f7c99312ddc3efb6bc652537e077bc (diff) | |
download | glibc-88684de7a68b88e8d7e29b2490bdb62994a5e97e.tar.gz glibc-88684de7a68b88e8d7e29b2490bdb62994a5e97e.tar.xz glibc-88684de7a68b88e8d7e29b2490bdb62994a5e97e.zip |
sparc: Implement memcpy/mempcpy ifunc selection in C
This patch refactor the SPARC64 ifunc selector to a C implementation. The x86_64 implementation is used as default, which resulted in common definitions (ifunc-init.h) used on both architectures. No functional change is expected, including ifunc resolution rules. Checked on sparc64-linux-gnu, sparcv9-linux-gnu and x86_64-linux-gnu. * sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S: New file. * sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c: Likewise. * sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c: Likewise. * sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S: Likewise. * sysdeps/sparc/sparc64/multiarch/memcpy.c: Likewise. * sysdeps/sparc/sparc64/multiarch/mempcpy.c: Likewise. * sysdeps/sparc/sparc-ifunc.h (sparc_libc_ifunc_redirected): New macro. * sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile [$(subdir) = string] (sysdep_routines): Add memcpy-ultra1. * sysdeps/sparc/sparc64/multiarch/Makefile [$(subdir) = string] (sysdep_routines): Add memcpy-ultra1. * sysdeps/sparc/sparc64/multiarch/memcpy.S: Remove file. * sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S: Likewise. Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Diffstat (limited to 'sysdeps/sparc/sparc64/multiarch/memcpy.c')
-rw-r--r-- | sysdeps/sparc/sparc64/multiarch/memcpy.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.c b/sysdeps/sparc/sparc64/multiarch/memcpy.c new file mode 100644 index 0000000000..7d1cb2d57f --- /dev/null +++ b/sysdeps/sparc/sparc64/multiarch/memcpy.c @@ -0,0 +1,33 @@ +/* Multiple versions of memcpy. SPARC64/Linux version. + All versions must be listed in ifunc-impl-list.c. + Copyright (C) 2017 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library; if not, see + <http://www.gnu.org/licenses/>. */ + +#if IS_IN (libc) +# define memcpy __redirect_memcpy +# include <string.h> +# undef memcpy + +# include <sparc-ifunc.h> + +# define SYMBOL_NAME memcpy +# include "ifunc-memcpy.h" + +sparc_libc_ifunc_redirected (__redirect_memcpy, memcpy, IFUNC_SELECTOR) + +sparc_ifunc_redirected_hidden_def (__redirect_memcpy, memcpy) +#endif |