This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.26.9000-839-g6905656
- From: azanella at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 28 Nov 2017 11:10:41 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.26.9000-839-g6905656
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 69056564042f3d43012814f92230d2c3f9ab7d7c (commit)
via 88684de7a68b88e8d7e29b2490bdb62994a5e97e (commit)
from f9bb1ef233f7c99312ddc3efb6bc652537e077bc (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=69056564042f3d43012814f92230d2c3f9ab7d7c
commit 69056564042f3d43012814f92230d2c3f9ab7d7c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue Oct 3 10:58:29 2017 -0300
sparc: Implement memset/bzero ifunc selection in C
This patch refactor the SPARC64 ifunc selector to a C implementation.
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/Makefile
[$(subdir) = string] (sysdep_routines): Add memset-ultra1.
* sysdeps/sparc/sparc64/multiarch/Makefile [$(subdir) = string]
(sysdep_routines): Add memset-ultra1.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S: New
file.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c: Likewise.
* sysdeps/sparc/sparc64/multiarch/ifunc-memset.h: Likewise.
* sysdeps/sparc/sparc64/multiarch/memset-ultra1.S: Likewise.
* sysdeps/sparc/sparc64/multiarch/memset.c: Likewise.
* sysdeps/sparc/sparc64/multiarch/bzero.c: Likewise.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S: Remove file.
* sysdeps/sparc/sparc64/multiarch/memset.S: Likewise.
Signed-off-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
diff --git a/ChangeLog b/ChangeLog
index 2b2baae..197c5d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,20 @@
2017-11-28 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+ * sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
+ [$(subdir) = string] (sysdep_routines): Add memset-ultra1.
+ * sysdeps/sparc/sparc64/multiarch/Makefile [$(subdir) = string]
+ (sysdep_routines): Add memset-ultra1.
+ * sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S: New
+ file.
+ * sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c: Likewise.
+ * sysdeps/sparc/sparc64/multiarch/ifunc-memset.h: Likewise.
+ * sysdeps/sparc/sparc64/multiarch/memset-ultra1.S: Likewise.
+ * sysdeps/sparc/sparc64/multiarch/memset.c: Likewise.
+ * sysdeps/sparc/sparc64/multiarch/bzero.c: Likewise.
+ * sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S: Remove file.
+ * sysdeps/sparc/sparc64/multiarch/memset.S: Likewise.
+
* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S: New
file.
* sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c: Likewise.
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
index ca44798..e12636b 100644
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
@@ -9,5 +9,5 @@ endif
ifeq ($(subdir),string)
sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \
memset-niagara1 memcpy-niagara4 memset-niagara4 \
- memcpy-ultra1
+ memcpy-ultra1 memset-ultra1
endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c
new file mode 100644
index 0000000..cf6803e
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/bzero.c>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S
new file mode 100644
index 0000000..257a094
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S
@@ -0,0 +1,30 @@
+/* Default SPARC memset 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)
+
+# define memset __memset_ultra1
+# define __bzero __bzero_ultra1
+# include <sysdeps/sparc/sparc32/sparcv9/memset.S>
+#endif
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S
deleted file mode 100644
index 8f82643..0000000
--- a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S
+++ /dev/null
@@ -1,4 +0,0 @@
-#define ASI_PNF 0x82
-#define ASI_BLK_P 0xf0
-#define XCC icc
-#include <sparc64/multiarch/memset.S>
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c
new file mode 100644
index 0000000..a6c5734
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/memset.c>
diff --git a/sysdeps/sparc/sparc64/multiarch/Makefile b/sysdeps/sparc/sparc64/multiarch/Makefile
index 4e52526..6e90cba 100644
--- a/sysdeps/sparc/sparc64/multiarch/Makefile
+++ b/sysdeps/sparc/sparc64/multiarch/Makefile
@@ -9,7 +9,7 @@ endif
ifeq ($(subdir),string)
sysdep_routines += memcpy-ultra3 memcpy-niagara1 memcpy-niagara2 \
memset-niagara1 memcpy-niagara4 memset-niagara4 \
- memcpy-ultra1
+ memcpy-ultra1 memset-ultra1
endif
ifeq ($(subdir),stdlib)
diff --git a/sysdeps/sparc/sparc64/multiarch/bzero.c b/sysdeps/sparc/sparc64/multiarch/bzero.c
new file mode 100644
index 0000000..4dd9b81
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/bzero.c
@@ -0,0 +1,33 @@
+/* Multiple versions of bzero. 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 bzero __redirect_bzero
+# include <string.h>
+# undef bzero
+
+# include <sparc-ifunc.h>
+
+# define SYMBOL_NAME bzero
+# include "ifunc-memset.h"
+
+sparc_libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR)
+weak_alias (__bzero, bzero)
+
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h
new file mode 100644
index 0000000..f3b9293
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memset.h
@@ -0,0 +1,34 @@
+/* Common definition for memset/bzero implementation.
+ 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/>. */
+
+#include <ifunc-init.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara4) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara1) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (int hwcap)
+{
+ if (hwcap & HWCAP_SPARC_CRYPTO)
+ return OPTIMIZE (niagara4);
+ if (hwcap & HWCAP_SPARC_BLKINIT)
+ return OPTIMIZE (niagara1);
+ return OPTIMIZE (ultra1);
+}
diff --git a/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S
new file mode 100644
index 0000000..dfa9e38
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memset-ultra1.S
@@ -0,0 +1,30 @@
+/* Default SPARC64 memset 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)
+
+# define memset __memset_ultra1
+# define __bzero __bzero_ultra1
+# include <sysdeps/sparc/sparc64/memset.S>
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memset.S b/sysdeps/sparc/sparc64/multiarch/memset.S
deleted file mode 100644
index 9469d5e..0000000
--- a/sysdeps/sparc/sparc64/multiarch/memset.S
+++ /dev/null
@@ -1,124 +0,0 @@
-/* Multiple versions of memset and bzero
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2017 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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/>. */
-
-#include <sysdep.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(memset)
- .type memset, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_CRYPTO, %o1
- andcc %o0, %o1, %g0
- be 1f
- andcc %o0, HWCAP_SPARC_BLKINIT, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__memset_niagara4), %o1
- xor %o1, %gdop_lox10(__memset_niagara4), %o1
-# else
- set __memset_niagara4, %o1
-# endif
- ba 10f
- nop
-1: be 9f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__memset_niagara1), %o1
- xor %o1, %gdop_lox10(__memset_niagara1), %o1
-# else
- set __memset_niagara1, %o1
-# endif
- ba 10f
- nop
-9:
-# ifdef SHARED
- sethi %gdop_hix22(__memset_ultra1), %o1
- xor %o1, %gdop_lox10(__memset_ultra1), %o1
-# else
- set __memset_ultra1, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(memset)
-
-ENTRY(__bzero)
- .type bzero, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_CRYPTO, %o1
- andcc %o0, %o1, %g0
- be 1f
- andcc %o0, HWCAP_SPARC_BLKINIT, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__bzero_niagara4), %o1
- xor %o1, %gdop_lox10(__bzero_niagara4), %o1
-# else
- set __bzero_niagara4, %o1
-# endif
- ba 10f
- nop
-1: be 9f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__bzero_niagara1), %o1
- xor %o1, %gdop_lox10(__bzero_niagara1), %o1
-# else
- set __bzero_niagara1, %o1
-# endif
- ba 10f
- nop
-9:
-# ifdef SHARED
- sethi %gdop_hix22(__bzero_ultra1), %o1
- xor %o1, %gdop_lox10(__bzero_ultra1), %o1
-# else
- set __bzero_ultra1, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__bzero)
-
-weak_alias (__bzero, bzero)
-
-# undef weak_alias
-# define weak_alias(a, b)
-
-libc_hidden_builtin_def (memset)
-
-#undef libc_hidden_builtin_def
-#define libc_hidden_builtin_def(name)
-
-#define memset __memset_ultra1
-#define __bzero __bzero_ultra1
-
-#endif
-
-#include "../memset.S"
diff --git a/sysdeps/sparc/sparc64/multiarch/memset.c b/sysdeps/sparc/sparc64/multiarch/memset.c
new file mode 100644
index 0000000..ab26af1
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memset.c
@@ -0,0 +1,33 @@
+/* Multiple versions of memset. 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 memset __redirect_memset
+# include <string.h>
+# undef memset
+
+# include <sparc-ifunc.h>
+
+# define SYMBOL_NAME memset
+# include "ifunc-memset.h"
+
+sparc_libc_ifunc_redirected (__redirect_memset, memset, IFUNC_SELECTOR)
+sparc_ifunc_redirected_hidden_def (__redirect_memset, memset)
+
+#endif
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=88684de7a68b88e8d7e29b2490bdb62994a5e97e
commit 88684de7a68b88e8d7e29b2490bdb62994a5e97e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Tue Oct 3 00:48:27 2017 -0300
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>
diff --git a/ChangeLog b/ChangeLog
index 2458b11..2b2baae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2017-11-28 Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ * 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.
+
2017-11-28 Joseph Myers <joseph@codesourcery.com>
* sysdeps/alpha/fpu/cfloat-compat.h: Include <libm-alias-float.h>.
diff --git a/sysdeps/sparc/sparc-ifunc.h b/sysdeps/sparc/sparc-ifunc.h
index 4b1ea00..044fe36 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__ */
diff --git a/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile b/sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile
index 4ad7aff..ca44798 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 0000000..d28a899
--- /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 14df91e..0000000
--- 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 0000000..369acac
--- /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 0000000..616a538
--- /dev/null
+++ b/sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c
@@ -0,0 +1 @@
+#include <sysdeps/sparc/sparc64/multiarch/mempcpy.c>
diff --git a/sysdeps/sparc/sparc64/multiarch/Makefile b/sysdeps/sparc/sparc64/multiarch/Makefile
index 55b757f..4e52526 100644
--- a/sysdeps/sparc/sparc64/multiarch/Makefile
+++ b/sysdeps/sparc/sparc64/multiarch/Makefile
@@ -8,7 +8,8 @@ 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
ifeq ($(subdir),stdlib)
diff --git a/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h b/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h
new file mode 100644
index 0000000..46f3795
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h
@@ -0,0 +1,40 @@
+/* Common definition for memcpy and mempcpy implementation.
+ 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/>. */
+
+#include <ifunc-init.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara4) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (niagara1) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ultra1) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (int hwcap)
+{
+ if (hwcap & HWCAP_SPARC_CRYPTO)
+ return OPTIMIZE (niagara4);
+ if (hwcap & HWCAP_SPARC_N2)
+ return OPTIMIZE (niagara2);
+ if (hwcap & HWCAP_SPARC_BLKINIT)
+ return OPTIMIZE (niagara1);
+ if (hwcap & HWCAP_SPARC_ULTRA3)
+ return OPTIMIZE (ultra3);
+ return OPTIMIZE (ultra1);
+}
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S
new file mode 100644
index 0000000..c5a4479
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S
@@ -0,0 +1,33 @@
+/* Default SPARC64 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/sparc64/memcpy.S>
+#endif
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.S b/sysdeps/sparc/sparc64/multiarch/memcpy.S
deleted file mode 100644
index b6396ee..0000000
--- a/sysdeps/sparc/sparc64/multiarch/memcpy.S
+++ /dev/null
@@ -1,167 +0,0 @@
-/* Multiple versions of memcpy
- All versions must be listed in ifunc-impl-list.c.
- Copyright (C) 2010-2017 Free Software Foundation, Inc.
- Contributed by David S. Miller (davem@davemloft.net)
- 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/>. */
-
-#include <sysdep.h>
-
-#if IS_IN (libc)
- .text
-ENTRY(memcpy)
- .type memcpy, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_CRYPTO, %o1
- andcc %o0, %o1, %g0
- be 1f
- andcc %o0, HWCAP_SPARC_N2, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_niagara4), %o1
- xor %o1, %gdop_lox10(__memcpy_niagara4), %o1
-# else
- set __memcpy_niagara4, %o1
-# endif
- ba 10f
- nop
-1: be 1f
- andcc %o0, HWCAP_SPARC_BLKINIT, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_niagara2), %o1
- xor %o1, %gdop_lox10(__memcpy_niagara2), %o1
-# else
- set __memcpy_niagara2, %o1
-# endif
- ba 10f
- nop
-1: be 1f
- andcc %o0, HWCAP_SPARC_ULTRA3, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_niagara1), %o1
- xor %o1, %gdop_lox10(__memcpy_niagara1), %o1
-# else
- set __memcpy_niagara1, %o1
-# endif
- ba 10f
- nop
-1: be 9f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_ultra3), %o1
- xor %o1, %gdop_lox10(__memcpy_ultra3), %o1
-# else
- set __memcpy_ultra3, %o1
-# endif
- ba 10f
- nop
-9:
-# ifdef SHARED
- sethi %gdop_hix22(__memcpy_ultra1), %o1
- xor %o1, %gdop_lox10(__memcpy_ultra1), %o1
-# else
- set __memcpy_ultra1, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(memcpy)
-
-ENTRY(__mempcpy)
- .type __mempcpy, @gnu_indirect_function
-# ifdef SHARED
- SETUP_PIC_REG_LEAF(o3, o5)
-# endif
- set HWCAP_SPARC_CRYPTO, %o1
- andcc %o0, %o1, %g0
- be 1f
- andcc %o0, HWCAP_SPARC_N2, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_niagara4), %o1
- xor %o1, %gdop_lox10(__mempcpy_niagara4), %o1
-# else
- set __mempcpy_niagara4, %o1
-# endif
- ba 10f
- nop
-1: be 1f
- andcc %o0, HWCAP_SPARC_BLKINIT, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_niagara2), %o1
- xor %o1, %gdop_lox10(__mempcpy_niagara2), %o1
-# else
- set __mempcpy_niagara2, %o1
-# endif
- ba 10f
- nop
-1: be 1f
- andcc %o0, HWCAP_SPARC_ULTRA3, %g0
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_niagara1), %o1
- xor %o1, %gdop_lox10(__mempcpy_niagara1), %o1
-# else
- set __mempcpy_niagara1, %o1
-# endif
- ba 10f
- nop
-1: be 9f
- nop
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_ultra3), %o1
- xor %o1, %gdop_lox10(__mempcpy_ultra3), %o1
-# else
- set __mempcpy_ultra3, %o1
-# endif
- ba 10f
- nop
-9:
-# ifdef SHARED
- sethi %gdop_hix22(__mempcpy_ultra1), %o1
- xor %o1, %gdop_lox10(__mempcpy_ultra1), %o1
-# else
- set __mempcpy_ultra1, %o1
-# endif
-10:
-# ifdef SHARED
- add %o3, %o1, %o1
-# endif
- retl
- mov %o1, %o0
-END(__mempcpy)
-
-libc_hidden_builtin_def (memcpy)
-
-libc_hidden_def (__mempcpy)
-weak_alias (__mempcpy, mempcpy)
-libc_hidden_builtin_def (mempcpy)
-
-#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 __mempcpy __mempcpy_ultra1
-
-#endif
-
-#include "../memcpy.S"
diff --git a/sysdeps/sparc/sparc64/multiarch/memcpy.c b/sysdeps/sparc/sparc64/multiarch/memcpy.c
new file mode 100644
index 0000000..7d1cb2d
--- /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
diff --git a/sysdeps/sparc/sparc64/multiarch/mempcpy.c b/sysdeps/sparc/sparc64/multiarch/mempcpy.c
new file mode 100644
index 0000000..53c415b
--- /dev/null
+++ b/sysdeps/sparc/sparc64/multiarch/mempcpy.c
@@ -0,0 +1,39 @@
+/* Multiple versions of mempcpy. 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 mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
+# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
+# include <string.h>
+# undef mempcpy
+# undef __mempcpy
+
+# include <sparc-ifunc.h>
+
+# define SYMBOL_NAME mempcpy
+# include "ifunc-memcpy.h"
+
+sparc_libc_ifunc_redirected (__redirect_mempcpy, __mempcpy, IFUNC_SELECTOR)
+
+sparc_ifunc_redirected_hidden_def (__redirect___mempcpy, __mempcpy)
+weak_alias (__mempcpy, mempcpy)
+sparc_ifunc_redirected_hidden_def (__redirect_mempcpy, mempcpy)
+#endif
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 34 ++++
sysdeps/sparc/sparc-ifunc.h | 13 ++
sysdeps/sparc/sparc32/sparcv9/multiarch/Makefile | 3 +-
sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c | 1 +
.../sparc32/sparcv9/multiarch/memcpy-ultra1.S | 33 ++++
sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S | 4 -
sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c | 1 +
sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c | 1 +
.../sparc32/sparcv9/multiarch/memset-ultra1.S | 30 ++++
sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S | 4 -
sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c | 1 +
sysdeps/sparc/sparc64/multiarch/Makefile | 3 +-
sysdeps/sparc/sparc64/multiarch/bzero.c | 33 ++++
sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h | 40 +++++
sysdeps/sparc/sparc64/multiarch/ifunc-memset.h | 34 ++++
sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S | 33 ++++
sysdeps/sparc/sparc64/multiarch/memcpy.S | 167 --------------------
sysdeps/sparc/sparc64/multiarch/memcpy.c | 33 ++++
sysdeps/sparc/sparc64/multiarch/mempcpy.c | 39 +++++
sysdeps/sparc/sparc64/multiarch/memset-ultra1.S | 30 ++++
sysdeps/sparc/sparc64/multiarch/memset.S | 124 ---------------
sysdeps/sparc/sparc64/multiarch/memset.c | 33 ++++
22 files changed, 393 insertions(+), 301 deletions(-)
create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/bzero.c
create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy-ultra1.S
delete mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.S
create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memcpy.c
create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/mempcpy.c
create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memset-ultra1.S
delete mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memset.S
create mode 100644 sysdeps/sparc/sparc32/sparcv9/multiarch/memset.c
create mode 100644 sysdeps/sparc/sparc64/multiarch/bzero.c
create mode 100644 sysdeps/sparc/sparc64/multiarch/ifunc-memcpy.h
create mode 100644 sysdeps/sparc/sparc64/multiarch/ifunc-memset.h
create mode 100644 sysdeps/sparc/sparc64/multiarch/memcpy-ultra1.S
delete mode 100644 sysdeps/sparc/sparc64/multiarch/memcpy.S
create mode 100644 sysdeps/sparc/sparc64/multiarch/memcpy.c
create mode 100644 sysdeps/sparc/sparc64/multiarch/mempcpy.c
create mode 100644 sysdeps/sparc/sparc64/multiarch/memset-ultra1.S
delete mode 100644 sysdeps/sparc/sparc64/multiarch/memset.S
create mode 100644 sysdeps/sparc/sparc64/multiarch/memset.c
hooks/post-receive
--
GNU C Library master sources