about summary refs log tree commit diff
path: root/sysdeps/sparc/sparc-ifunc.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-10-03 00:48:27 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2017-11-28 08:53:15 -0200
commit88684de7a68b88e8d7e29b2490bdb62994a5e97e (patch)
treece595147b2092146aa4eb494e3c75303ec5bf573 /sysdeps/sparc/sparc-ifunc.h
parentf9bb1ef233f7c99312ddc3efb6bc652537e077bc (diff)
downloadglibc-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/sparc-ifunc.h')
-rw-r--r--sysdeps/sparc/sparc-ifunc.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sysdeps/sparc/sparc-ifunc.h b/sysdeps/sparc/sparc-ifunc.h
index 4b1ea00bde..044fe365d6 100644
--- a/sysdeps/sparc/sparc-ifunc.h
+++ b/sysdeps/sparc/sparc-ifunc.h
@@ -161,10 +161,23 @@ END (__##name)
 
 
 #else	/* __ASSEMBLER__ */
+# define INIT_ARCH()
+
+# define sparc_libc_ifunc_redirected(redirected_name, name, expr)	\
+  __ifunc (redirected_name, name, expr(hwcap), int hwcap, INIT_ARCH)
 
 # define sparc_libm_ifunc(name, expr)				\
   __ifunc (name, name, expr, int hwcap, libm_ifunc_init)
 
 # define sparc_libc_ifunc(name, expr) sparc_libm_ifunc (name, expr)
 
+/* It essentially does libc_hidden_builtin_def (name) and redirect
+   the internal redirected symbol to ifunc implementation.  */
+# if defined SHARED
+#  define sparc_ifunc_redirected_hidden_def(redirect_name, name) \
+  __hidden_ver1 (name, __GI_##name, redirect_name) \
+    __attribute__ ((visibility ("hidden")));
+# else
+#  define sparc_ifunc_redirected_hidden_def(redirect_name, name)
+# endif
 #endif	/* __ASSEMBLER__ */