|
|
147e83 |
From 09f1f5cc860480fd09383bca00eb71e0f71aae79 Mon Sep 17 00:00:00 2001
|
|
|
147e83 |
From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
|
|
|
147e83 |
Date: Wed, 30 Jul 2014 05:17:26 -0500
|
|
|
147e83 |
Subject: [PATCH] PowerPC: multiarch mempcpy for PowerPC64
|
|
|
147e83 |
|
|
|
147e83 |
commit f00be62b08c1440800898339f74fb4db20b19eef
|
|
|
147e83 |
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
|
|
|
147e83 |
Date: Fri Dec 13 14:34:06 2013 -0500
|
|
|
147e83 |
|
|
|
147e83 |
Added sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c and
|
|
|
147e83 |
string/mempcpy.c apart from original commit.
|
|
|
147e83 |
---
|
|
|
147e83 |
string/mempcpy.c | 9 ++---
|
|
|
147e83 |
.../powerpc32/power4/multiarch/mempcpy-ppc32.c | 32 +++++++++++++++++
|
|
|
147e83 |
sysdeps/powerpc/powerpc64/multiarch/Makefile | 3 +-
|
|
|
147e83 |
.../powerpc/powerpc64/multiarch/ifunc-impl-list.c | 8 +++++
|
|
|
147e83 |
.../powerpc/powerpc64/multiarch/mempcpy-power7.S | 41 ++++++++++++++++++++++
|
|
|
147e83 |
.../powerpc/powerpc64/multiarch/mempcpy-ppc64.c | 19 ++++++++++
|
|
|
147e83 |
sysdeps/powerpc/powerpc64/multiarch/mempcpy.c | 38 ++++++++++++++++++++
|
|
|
147e83 |
7 files changed, 145 insertions(+), 5 deletions(-)
|
|
|
147e83 |
create mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c
|
|
|
147e83 |
create mode 100644 sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
|
|
|
147e83 |
create mode 100644 sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
|
|
|
147e83 |
create mode 100644 sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
|
|
|
147e83 |
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/string/mempcpy.c glibc-2.17-c758a686/string/mempcpy.c
|
|
|
147e83 |
index 2a542e3..7509c24 100644
|
|
|
147e83 |
--- glibc-2.17-c758a686/string/mempcpy.c
|
|
|
147e83 |
+++ glibc-2.17-c758a686/string/mempcpy.c
|
|
|
147e83 |
@@ -26,11 +26,12 @@
|
|
|
147e83 |
#undef mempcpy
|
|
|
147e83 |
#undef __mempcpy
|
|
|
147e83 |
|
|
|
147e83 |
+#ifndef MEMPCPY
|
|
|
147e83 |
+# define MEMPCPY __mempcpy
|
|
|
147e83 |
+#endif
|
|
|
147e83 |
+
|
|
|
147e83 |
void *
|
|
|
147e83 |
-__mempcpy (dstpp, srcpp, len)
|
|
|
147e83 |
- void *dstpp;
|
|
|
147e83 |
- const void *srcpp;
|
|
|
147e83 |
- size_t len;
|
|
|
147e83 |
+MEMPCPY (void *dstpp, const void *srcpp, size_t len)
|
|
|
147e83 |
{
|
|
|
147e83 |
unsigned long int dstp = (long int) dstpp;
|
|
|
147e83 |
unsigned long int srcp = (long int) srcpp;
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c
|
|
|
147e83 |
new file mode 100644
|
|
|
147e83 |
index 0000000..8dc77e9
|
|
|
147e83 |
--- /dev/null
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c
|
|
|
147e83 |
@@ -0,0 +1,32 @@
|
|
|
147e83 |
+/* PowerPC32 default implementation of mempcpy.
|
|
|
147e83 |
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
|
|
147e83 |
+ This file is part of the GNU C Library.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
+ License as published by the Free Software Foundation; either
|
|
|
147e83 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
+ Lesser General Public License for more details.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
+ License along with the GNU C Library; if not, see
|
|
|
147e83 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
+
|
|
|
147e83 |
+#define MEMPCPY __mempcpy_ppc
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef libc_hidden_def
|
|
|
147e83 |
+#define libc_hidden_def(name)
|
|
|
147e83 |
+#undef weak_alias
|
|
|
147e83 |
+#define weak_alias(a, b)
|
|
|
147e83 |
+
|
|
|
147e83 |
+#if defined SHARED
|
|
|
147e83 |
+# undef libc_hidden_builtin_def
|
|
|
147e83 |
+# define libc_hidden_builtin_def(name) \
|
|
|
147e83 |
+ __hidden_ver1 (__mempcpy_ppc, __GI_mempcpy, __mempcpy_ppc);
|
|
|
147e83 |
+#endif
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <string/mempcpy.c>
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
|
|
147e83 |
index 424d2cd..22560e8 100644
|
|
|
147e83 |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
|
|
|
147e83 |
@@ -2,5 +2,6 @@ ifeq ($(subdir),string)
|
|
|
147e83 |
sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
|
|
|
147e83 |
memcpy-power4 memcpy-ppc64 memcmp-power7 memcmp-power4 \
|
|
|
147e83 |
memcmp-ppc64 memset-power7 memset-power6 memset-power4 \
|
|
|
147e83 |
- memset-ppc64 bzero-power4 bzero-power6 bzero-power7
|
|
|
147e83 |
+ memset-ppc64 bzero-power4 bzero-power6 bzero-power7 \
|
|
|
147e83 |
+ mempcpy-power7 mempcpy-ppc64
|
|
|
147e83 |
endif
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
|
|
147e83 |
index 11e7063..c72c229 100644
|
|
|
147e83 |
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
|
|
|
147e83 |
@@ -90,5 +90,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
|
|
|
147e83 |
__bzero_power4)
|
|
|
147e83 |
IFUNC_IMPL_ADD (array, i, bzero, 1, __bzero_ppc))
|
|
|
147e83 |
|
|
|
147e83 |
+ /* Support sysdeps/powerpc/powerpc64/multiarch/mempcpy.c. */
|
|
|
147e83 |
+ IFUNC_IMPL (i, name, mempcpy,
|
|
|
147e83 |
+ IFUNC_IMPL_ADD (array, i, mempcpy,
|
|
|
147e83 |
+ hwcap & PPC_FEATURE_HAS_VSX,
|
|
|
147e83 |
+ __mempcpy_power7)
|
|
|
147e83 |
+ IFUNC_IMPL_ADD (array, i, mempcpy, 1,
|
|
|
147e83 |
+ __mempcpy_ppc))
|
|
|
147e83 |
+
|
|
|
147e83 |
return i;
|
|
|
147e83 |
}
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
|
|
|
147e83 |
new file mode 100644
|
|
|
147e83 |
index 0000000..6a79847
|
|
|
147e83 |
--- /dev/null
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy-power7.S
|
|
|
147e83 |
@@ -0,0 +1,41 @@
|
|
|
147e83 |
+/* Optimized mempcpy implementation for PowerPC/POWER7.
|
|
|
147e83 |
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
|
|
147e83 |
+ This file is part of the GNU C Library.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
+ License as published by the Free Software Foundation; either
|
|
|
147e83 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
+ Lesser General Public License for more details.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
+ License along with the GNU C Library; if not, see
|
|
|
147e83 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <sysdep.h>
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef EALIGN
|
|
|
147e83 |
+#define EALIGN(name, alignt, words) \
|
|
|
147e83 |
+ .section ".text"; \
|
|
|
147e83 |
+ ENTRY_2(__mempcpy_power7) \
|
|
|
147e83 |
+ .align ALIGNARG(alignt); \
|
|
|
147e83 |
+ EALIGN_W_##words; \
|
|
|
147e83 |
+ BODY_LABEL(__mempcpy_power7): \
|
|
|
147e83 |
+ cfi_startproc;
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef END_GEN_TB
|
|
|
147e83 |
+#define END_GEN_TB(name, mask) \
|
|
|
147e83 |
+ cfi_endproc; \
|
|
|
147e83 |
+ TRACEBACK_MASK(__mempcpy_power7,mask) \
|
|
|
147e83 |
+ END_2(__mempcpy_power7)
|
|
|
147e83 |
+
|
|
|
147e83 |
+#undef libc_hidden_builtin_def
|
|
|
147e83 |
+#define libc_hidden_builtin_def(name)
|
|
|
147e83 |
+#undef weak_alias
|
|
|
147e83 |
+#define weak_alias(name, alias)
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <sysdeps/powerpc/powerpc64/power7/mempcpy.S>
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
|
|
|
147e83 |
new file mode 100644
|
|
|
147e83 |
index 0000000..78260bb
|
|
|
147e83 |
--- /dev/null
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy-ppc64.c
|
|
|
147e83 |
@@ -0,0 +1,19 @@
|
|
|
147e83 |
+/* PowerPC64 default implementation of mempcpy.
|
|
|
147e83 |
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
|
|
147e83 |
+ This file is part of the GNU C Library.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
+ License as published by the Free Software Foundation; either
|
|
|
147e83 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
+ Lesser General Public License for more details.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
+ License along with the GNU C Library; if not, see
|
|
|
147e83 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
+
|
|
|
147e83 |
+#include <sysdeps/powerpc/powerpc32/power4/multiarch/mempcpy-ppc32.c>
|
|
|
147e83 |
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
|
|
|
147e83 |
new file mode 100644
|
|
|
147e83 |
index 0000000..38fbcc3
|
|
|
147e83 |
--- /dev/null
|
|
|
147e83 |
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/mempcpy.c
|
|
|
147e83 |
@@ -0,0 +1,38 @@
|
|
|
147e83 |
+/* Multiple versions of mempcpy.
|
|
|
147e83 |
+ Copyright (C) 2013-2014 Free Software Foundation, Inc.
|
|
|
147e83 |
+ This file is part of the GNU C Library.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
147e83 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
147e83 |
+ License as published by the Free Software Foundation; either
|
|
|
147e83 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
147e83 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
147e83 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
147e83 |
+ Lesser General Public License for more details.
|
|
|
147e83 |
+
|
|
|
147e83 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
147e83 |
+ License along with the GNU C Library; if not, see
|
|
|
147e83 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
147e83 |
+
|
|
|
147e83 |
+#ifndef NOT_IN_libc
|
|
|
147e83 |
+# include <string.h>
|
|
|
147e83 |
+# include <shlib-compat.h>
|
|
|
147e83 |
+# include "init-arch.h"
|
|
|
147e83 |
+
|
|
|
147e83 |
+extern __typeof (__mempcpy) __mempcpy_ppc attribute_hidden;
|
|
|
147e83 |
+extern __typeof (__mempcpy) __mempcpy_power7 attribute_hidden;
|
|
|
147e83 |
+
|
|
|
147e83 |
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
|
|
|
147e83 |
+ ifunc symbol properly. */
|
|
|
147e83 |
+libc_ifunc (__mempcpy,
|
|
|
147e83 |
+ (hwcap & PPC_FEATURE_HAS_VSX)
|
|
|
147e83 |
+ ? __mempcpy_power7
|
|
|
147e83 |
+ : __mempcpy_ppc);
|
|
|
147e83 |
+
|
|
|
147e83 |
+weak_alias (__mempcpy, mempcpy)
|
|
|
147e83 |
+libc_hidden_def (mempcpy)
|
|
|
147e83 |
+#else
|
|
|
147e83 |
+# include <string/mempcpy.c>
|
|
|
147e83 |
+#endif
|
|
|
147e83 |
--
|
|
|
147e83 |
1.8.3.1
|
|
|
147e83 |
|