about summary refs log tree commit diff
path: root/sysdeps/sparc/sparc32
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/sparc32
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/sparc32')
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile3
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S33
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S4
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c1
-rw-r--r--sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c1
5 files changed, 37 insertions, 5 deletions
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
index 4ad7aff914..ca44798b23 100644
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
@@ -8,5 +8,6 @@ endif
 
 ifeq ($(subdir),string)
 sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \
-		   memset-niagara1 memcpy-niagara4 memset-niagara4
+		   memset-niagara1 memcpy-niagara4 memset-niagara4 \
+		   memcpy-ultra1
 endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S
new file mode 100644
index 0000000000..d28a899cd6
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S
@@ -0,0 +1,33 @@
+/* Default SPARC32 memcpy implementation.
+   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)
+# include <sysdep.h>
+
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name)
+# undef weak_alias
+# define weak_alias(x, y)
+# undef libc_hidden_def
+# define libc_hidden_def(name)
+
+# define memcpy         __memcpy_ultra1
+# define __memcpy_large __memcpy_large_ultra1
+# define __mempcpy      __mempcpy_ultra1
+# include <sysdeps/sparc/sparc32/sparcv9/memcpy.S>
+#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S
deleted file mode 100644
index 14df91e005..0000000000
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#define ASI_PNF     0x82
-#define ASI_BLK_P   0xf0
-#define XCC icc
-#include <sparc64/multiarch/memcpy.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c
new file mode 100644
index 0000000000..369acac087
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/memcpy.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c
new file mode 100644
index 0000000000..616a538cb4
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/mempcpy.c>