ce426f
From 8d960764b1afa3b64c3c388665499935a38b194e Mon Sep 17 00:00:00 2001
ce426f
From: Rajalakshmi Srinivasaraghavan <raji@linux.vnet.ibm.com>
ce426f
Date: Wed, 30 Jul 2014 08:12:17 -0500
ce426f
Subject: [PATCH] PowerPC: multiarch wordcopy for PowerPC64
ce426f
ce426f
commit e28bcd427b21b6c74021ca65736dd66474b09013
ce426f
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
ce426f
Date:   Fri Dec 13 14:54:08 2013 -0500
ce426f
ce426f
Added the following files apart from original commit.
ce426f
sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c
ce426f
sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c
ce426f
sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
ce426f
sysdeps/powerpc/power4/wordcopy.c
ce426f
sysdeps/powerpc/power6/wordcopy.c
ce426f
Removed the following files apart from original commit.
ce426f
sysdeps/powerpc/power4/wordcopy.c
ce426f
sysdeps/powerpc/powerpc64/power6/wordcopy.c
ce426f
---
ce426f
 string/wordcopy.c                                  |  38 ++--
ce426f
 sysdeps/powerpc/power4/wordcopy.c                  | 212 ++++++++++++++++++++
ce426f
 sysdeps/powerpc/power6/wordcopy.c                  | 221 +++++++++++++++++++++
ce426f
 .../powerpc32/power4/multiarch/wordcopy-power6.c   |  23 +++
ce426f
 .../powerpc32/power4/multiarch/wordcopy-power7.c   |  23 +++
ce426f
 .../powerpc32/power4/multiarch/wordcopy-ppc32.c    |  23 +++
ce426f
 sysdeps/powerpc/powerpc64/multiarch/Makefile       |   5 +-
ce426f
 .../powerpc/powerpc64/multiarch/wordcopy-power6.c  |  19 ++
ce426f
 .../powerpc/powerpc64/multiarch/wordcopy-power7.c  |  19 ++
ce426f
 .../powerpc/powerpc64/multiarch/wordcopy-ppc64.c   |  18 ++
ce426f
 sysdeps/powerpc/powerpc64/multiarch/wordcopy.c     |  86 ++++++++
ce426f
 sysdeps/powerpc/powerpc64/power4/wordcopy.c        |   1 -
ce426f
 sysdeps/powerpc/powerpc64/power6/wordcopy.c        | 217 --------------------
ce426f
 13 files changed, 669 insertions(+), 236 deletions(-)
ce426f
 create mode 100644 sysdeps/powerpc/power4/wordcopy.c
ce426f
 create mode 100644 sysdeps/powerpc/power6/wordcopy.c
ce426f
 create mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c
ce426f
 create mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c
ce426f
 create mode 100644 sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
ce426f
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/wordcopy-power6.c
ce426f
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/wordcopy-power7.c
ce426f
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
ce426f
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/wordcopy.c
ce426f
 delete mode 100644 sysdeps/powerpc/powerpc64/power4/wordcopy.c
ce426f
 delete mode 100644 sysdeps/powerpc/powerpc64/power6/wordcopy.c
ce426f
ce426f
diff --git glibc-2.17-c758a686/string/wordcopy.c glibc-2.17-c758a686/string/wordcopy.c
ce426f
index b171f27..ff4cce4 100644
ce426f
--- glibc-2.17-c758a686/string/wordcopy.c
ce426f
+++ glibc-2.17-c758a686/string/wordcopy.c
ce426f
@@ -1,5 +1,5 @@
ce426f
 /* _memcopy.c -- subroutines for memory copy functions.
ce426f
-   Copyright (C) 1991, 1996 Free Software Foundation, Inc.
ce426f
+   Copyright (C) 1991-2014 Free Software Foundation, Inc.
ce426f
    This file is part of the GNU C Library.
ce426f
    Contributed by Torbjorn Granlund (tege@sics.se).
ce426f
 
ce426f
@@ -26,11 +26,12 @@
ce426f
    block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
ce426f
    Both SRCP and DSTP should be aligned for memory operations on `op_t's.  */
ce426f
 
ce426f
+#ifndef WORDCOPY_FWD_ALIGNED
ce426f
+# define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned
ce426f
+#endif
ce426f
+
ce426f
 void
ce426f
-_wordcopy_fwd_aligned (dstp, srcp, len)
ce426f
-     long int dstp;
ce426f
-     long int srcp;
ce426f
-     size_t len;
ce426f
+WORDCOPY_FWD_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
 {
ce426f
   op_t a0, a1;
ce426f
 
ce426f
@@ -134,11 +135,12 @@ _wordcopy_fwd_aligned (dstp, srcp, len)
ce426f
    DSTP should be aligned for memory operations on `op_t's, but SRCP must
ce426f
    *not* be aligned.  */
ce426f
 
ce426f
+#ifndef WORDCOPY_FWD_DEST_ALIGNED
ce426f
+# define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned
ce426f
+#endif
ce426f
+
ce426f
 void
ce426f
-_wordcopy_fwd_dest_aligned (dstp, srcp, len)
ce426f
-     long int dstp;
ce426f
-     long int srcp;
ce426f
-     size_t len;
ce426f
+WORDCOPY_FWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
 {
ce426f
   op_t a0, a1, a2, a3;
ce426f
   int sh_1, sh_2;
ce426f
@@ -221,11 +223,12 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len)
ce426f
    (not LEN bytes!).  Both SRCP and DSTP should be aligned for memory
ce426f
    operations on `op_t's.  */
ce426f
 
ce426f
+#ifndef WORDCOPY_BWD_ALIGNED
ce426f
+# define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned
ce426f
+#endif
ce426f
+
ce426f
 void
ce426f
-_wordcopy_bwd_aligned (dstp, srcp, len)
ce426f
-     long int dstp;
ce426f
-     long int srcp;
ce426f
-     size_t len;
ce426f
+WORDCOPY_BWD_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
 {
ce426f
   op_t a0, a1;
ce426f
 
ce426f
@@ -329,11 +332,12 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
ce426f
    words (not LEN bytes!).  DSTP should be aligned for memory
ce426f
    operations on `op_t', but SRCP must *not* be aligned.  */
ce426f
 
ce426f
+#ifndef WORDCOPY_BWD_DEST_ALIGNED
ce426f
+# define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned
ce426f
+#endif
ce426f
+
ce426f
 void
ce426f
-_wordcopy_bwd_dest_aligned (dstp, srcp, len)
ce426f
-     long int dstp;
ce426f
-     long int srcp;
ce426f
-     size_t len;
ce426f
+WORDCOPY_BWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
 {
ce426f
   op_t a0, a1, a2, a3;
ce426f
   int sh_1, sh_2;
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/power4/wordcopy.c glibc-2.17-c758a686/sysdeps/powerpc/power4/wordcopy.c
ce426f
new file mode 100644
ce426f
index 0000000..263b444
ce426f
--- /dev/null
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/power4/wordcopy.c
ce426f
@@ -0,0 +1,212 @@
ce426f
+/* _memcopy.c -- subroutines for memory copy functions.
ce426f
+   Copyright (C) 1991-2014 Free Software Foundation, Inc.
ce426f
+   This file is part of the GNU C Library.
ce426f
+   Contributed by Torbjorn Granlund (tege@sics.se).
ce426f
+
ce426f
+   The GNU C Library is free software; you can redistribute it and/or
ce426f
+   modify it under the terms of the GNU Lesser General Public
ce426f
+   License as published by the Free Software Foundation; either
ce426f
+   version 2.1 of the License, or (at your option) any later version.
ce426f
+
ce426f
+   The GNU C Library is distributed in the hope that it will be useful,
ce426f
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
+   Lesser General Public License for more details.
ce426f
+
ce426f
+   You should have received a copy of the GNU Lesser General Public
ce426f
+   License along with the GNU C Library; if not, see
ce426f
+   <http://www.gnu.org/licenses/>.  */
ce426f
+
ce426f
+/* BE VERY CAREFUL IF YOU CHANGE THIS CODE...!  */
ce426f
+
ce426f
+#include <stddef.h>
ce426f
+#include <memcopy.h>
ce426f
+
ce426f
+/* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
ce426f
+   block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
ce426f
+   Both SRCP and DSTP should be aligned for memory operations on `op_t's.  */
ce426f
+
ce426f
+#ifndef WORDCOPY_FWD_ALIGNED
ce426f
+# define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned
ce426f
+#endif
ce426f
+
ce426f
+void
ce426f
+WORDCOPY_FWD_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
+{
ce426f
+  op_t a0, a1;
ce426f
+
ce426f
+  if (len & 1)
ce426f
+  {
ce426f
+    ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
ce426f
+
ce426f
+    if (len == 1)
ce426f
+      return;
ce426f
+    srcp += OPSIZ;
ce426f
+    dstp += OPSIZ;
ce426f
+    len -= 1;
ce426f
+  }
ce426f
+
ce426f
+  do
ce426f
+    {
ce426f
+      a0 = ((op_t *) srcp)[0];
ce426f
+      a1 = ((op_t *) srcp)[1];
ce426f
+      ((op_t *) dstp)[0] = a0;
ce426f
+      ((op_t *) dstp)[1] = a1;
ce426f
+
ce426f
+      srcp += 2 * OPSIZ;
ce426f
+      dstp += 2 * OPSIZ;
ce426f
+      len -= 2;
ce426f
+    }
ce426f
+  while (len != 0);
ce426f
+}
ce426f
+
ce426f
+/* _wordcopy_fwd_dest_aligned -- Copy block beginning at SRCP to
ce426f
+   block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
ce426f
+   DSTP should be aligned for memory operations on `op_t's, but SRCP must
ce426f
+   *not* be aligned.  */
ce426f
+
ce426f
+#ifndef WORDCOPY_FWD_DEST_ALIGNED
ce426f
+# define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned
ce426f
+#endif
ce426f
+
ce426f
+void
ce426f
+WORDCOPY_FWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
+{
ce426f
+  op_t a0, a1, a2;
ce426f
+  int sh_1, sh_2;
ce426f
+
ce426f
+  /* Calculate how to shift a word read at the memory operation
ce426f
+     aligned srcp to make it aligned for copy.  */
ce426f
+
ce426f
+  sh_1 = 8 * (srcp % OPSIZ);
ce426f
+  sh_2 = 8 * OPSIZ - sh_1;
ce426f
+
ce426f
+  /* Make SRCP aligned by rounding it down to the beginning of the `op_t'
ce426f
+     it points in the middle of.  */
ce426f
+  srcp &= -OPSIZ;
ce426f
+  a0 = ((op_t *) srcp)[0];
ce426f
+
ce426f
+  if (len & 1)
ce426f
+  {
ce426f
+    a1 = ((op_t *) srcp)[1];
ce426f
+    ((op_t *) dstp)[0] = MERGE (a0, sh_1, a1, sh_2);
ce426f
+
ce426f
+    if (len == 1)
ce426f
+      return;
ce426f
+
ce426f
+    a0 = a1;
ce426f
+    srcp += OPSIZ;
ce426f
+    dstp += OPSIZ;
ce426f
+    len -= 1;
ce426f
+  }
ce426f
+
ce426f
+  do
ce426f
+    {
ce426f
+      a1 = ((op_t *) srcp)[1];
ce426f
+      a2 = ((op_t *) srcp)[2];
ce426f
+      ((op_t *) dstp)[0] = MERGE (a0, sh_1, a1, sh_2);
ce426f
+      ((op_t *) dstp)[1] = MERGE (a1, sh_1, a2, sh_2);
ce426f
+      a0 = a2;
ce426f
+
ce426f
+      srcp += 2 * OPSIZ;
ce426f
+      dstp += 2 * OPSIZ;
ce426f
+      len -= 2;
ce426f
+    }
ce426f
+  while (len != 0);
ce426f
+}
ce426f
+
ce426f
+/* _wordcopy_bwd_aligned -- Copy block finishing right before
ce426f
+   SRCP to block finishing right before DSTP with LEN `op_t' words
ce426f
+   (not LEN bytes!).  Both SRCP and DSTP should be aligned for memory
ce426f
+   operations on `op_t's.  */
ce426f
+
ce426f
+#ifndef WORDCOPY_BWD_ALIGNED
ce426f
+# define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned
ce426f
+#endif
ce426f
+
ce426f
+void
ce426f
+WORDCOPY_BWD_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
+{
ce426f
+  op_t a0, a1;
ce426f
+
ce426f
+  if (len & 1)
ce426f
+  {
ce426f
+    srcp -= OPSIZ;
ce426f
+    dstp -= OPSIZ;
ce426f
+    ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
ce426f
+
ce426f
+    if (len == 1)
ce426f
+      return;
ce426f
+    len -= 1;
ce426f
+  }
ce426f
+
ce426f
+  do
ce426f
+    {
ce426f
+      srcp -= 2 * OPSIZ;
ce426f
+      dstp -= 2 * OPSIZ;
ce426f
+
ce426f
+      a1 = ((op_t *) srcp)[1];
ce426f
+      a0 = ((op_t *) srcp)[0];
ce426f
+      ((op_t *) dstp)[1] = a1;
ce426f
+      ((op_t *) dstp)[0] = a0;
ce426f
+
ce426f
+      len -= 2;
ce426f
+    }
ce426f
+  while (len != 0);
ce426f
+}
ce426f
+
ce426f
+/* _wordcopy_bwd_dest_aligned -- Copy block finishing right
ce426f
+   before SRCP to block finishing right before DSTP with LEN `op_t'
ce426f
+   words (not LEN bytes!).  DSTP should be aligned for memory
ce426f
+   operations on `op_t', but SRCP must *not* be aligned.  */
ce426f
+
ce426f
+#ifndef WORDCOPY_BWD_DEST_ALIGNED
ce426f
+# define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned
ce426f
+#endif
ce426f
+
ce426f
+void
ce426f
+WORDCOPY_BWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
+{
ce426f
+  op_t a0, a1, a2;
ce426f
+  int sh_1, sh_2;
ce426f
+
ce426f
+  /* Calculate how to shift a word read at the memory operation
ce426f
+     aligned srcp to make it aligned for copy.  */
ce426f
+
ce426f
+  sh_1 = 8 * (srcp % OPSIZ);
ce426f
+  sh_2 = 8 * OPSIZ - sh_1;
ce426f
+
ce426f
+  /* Make srcp aligned by rounding it down to the beginning of the op_t
ce426f
+     it points in the middle of.  */
ce426f
+  srcp &= -OPSIZ;
ce426f
+  a2 = ((op_t *) srcp)[0];
ce426f
+
ce426f
+  if (len & 1)
ce426f
+  {
ce426f
+    srcp -= OPSIZ;
ce426f
+    dstp -= OPSIZ;
ce426f
+    a1 = ((op_t *) srcp)[0];
ce426f
+    ((op_t *) dstp)[0] = MERGE (a1, sh_1, a2, sh_2);
ce426f
+
ce426f
+    if (len == 1)
ce426f
+      return;
ce426f
+
ce426f
+    a2 = a1;
ce426f
+    len -= 1;
ce426f
+  }
ce426f
+
ce426f
+  do
ce426f
+    {
ce426f
+      srcp -= 2 * OPSIZ;
ce426f
+      dstp -= 2 * OPSIZ;
ce426f
+
ce426f
+      a1 = ((op_t *) srcp)[1];
ce426f
+      a0 = ((op_t *) srcp)[0];
ce426f
+      ((op_t *) dstp)[1] = MERGE (a1, sh_1, a2, sh_2);
ce426f
+      ((op_t *) dstp)[0] = MERGE (a0, sh_1, a1, sh_2);
ce426f
+      a2 = a0;
ce426f
+
ce426f
+      len -= 2;
ce426f
+    }
ce426f
+  while (len != 0);
ce426f
+}
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/power6/wordcopy.c glibc-2.17-c758a686/sysdeps/powerpc/power6/wordcopy.c
ce426f
new file mode 100644
ce426f
index 0000000..c32e6dd
ce426f
--- /dev/null
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/power6/wordcopy.c
ce426f
@@ -0,0 +1,221 @@
ce426f
+/* _memcopy.c -- subroutines for memory copy functions.
ce426f
+   Copyright (C) 1991-2014 Free Software Foundation, Inc.
ce426f
+   This file is part of the GNU C Library.
ce426f
+   Contributed by Torbjorn Granlund (tege@sics.se).
ce426f
+   Updated for POWER6 by Steven Munroe (sjmunroe@us.ibm.com).
ce426f
+
ce426f
+   The GNU C Library is free software; you can redistribute it and/or
ce426f
+   modify it under the terms of the GNU Lesser General Public
ce426f
+   License as published by the Free Software Foundation; either
ce426f
+   version 2.1 of the License, or (at your option) any later version.
ce426f
+
ce426f
+   The GNU C Library is distributed in the hope that it will be useful,
ce426f
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
+   Lesser General Public License for more details.
ce426f
+
ce426f
+   You should have received a copy of the GNU Lesser General Public
ce426f
+   License along with the GNU C Library; if not, see
ce426f
+   <http://www.gnu.org/licenses/>.  */
ce426f
+
ce426f
+/* BE VERY CAREFUL IF YOU CHANGE THIS CODE...!  */
ce426f
+
ce426f
+#include <stddef.h>
ce426f
+#include <memcopy.h>
ce426f
+
ce426f
+/* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
ce426f
+   block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
ce426f
+   Both SRCP and DSTP should be aligned for memory operations on `op_t's.  */
ce426f
+
ce426f
+#ifndef WORDCOPY_FWD_ALIGNED
ce426f
+# define WORDCOPY_FWD_ALIGNED _wordcopy_fwd_aligned
ce426f
+#endif
ce426f
+
ce426f
+void
ce426f
+WORDCOPY_FWD_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
+{
ce426f
+  op_t a0, a1;
ce426f
+
ce426f
+  if (len & 1)
ce426f
+  {
ce426f
+    ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
ce426f
+
ce426f
+    if (len == 1)
ce426f
+      return;
ce426f
+    srcp += OPSIZ;
ce426f
+    dstp += OPSIZ;
ce426f
+    len -= 1;
ce426f
+  }
ce426f
+
ce426f
+  do
ce426f
+    {
ce426f
+      a0 = ((op_t *) srcp)[0];
ce426f
+      a1 = ((op_t *) srcp)[1];
ce426f
+      ((op_t *) dstp)[0] = a0;
ce426f
+      ((op_t *) dstp)[1] = a1;
ce426f
+
ce426f
+      srcp += 2 * OPSIZ;
ce426f
+      dstp += 2 * OPSIZ;
ce426f
+      len -= 2;
ce426f
+    }
ce426f
+  while (len != 0);
ce426f
+}
ce426f
+
ce426f
+/* _wordcopy_fwd_dest_aligned -- Copy block beginning at SRCP to
ce426f
+   block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
ce426f
+   DSTP should be aligned for memory operations on `op_t's, but SRCP must
ce426f
+   *not* be aligned.  */
ce426f
+
ce426f
+#define fwd_align_merge(align)                                         \
ce426f
+  do                                                                   \
ce426f
+    {                                                                  \
ce426f
+      a1 = ((op_t *) srcp)[1];                                         \
ce426f
+      a2 = ((op_t *) srcp)[2];                                         \
ce426f
+      ((op_t *) dstp)[0] = MERGE (a0, align*8, a1, (__WORDSIZE-align*8)); \
ce426f
+      ((op_t *) dstp)[1] = MERGE (a1, align*8, a2, (__WORDSIZE-align*8)); \
ce426f
+      a0 = a2;                                                         \
ce426f
+      srcp += 2 * OPSIZ;                                               \
ce426f
+      dstp += 2 * OPSIZ;                                               \
ce426f
+      len -= 2;                                                                \
ce426f
+    }                                                                  \
ce426f
+  while (len != 0)
ce426f
+
ce426f
+#ifndef WORDCOPY_FWD_DEST_ALIGNED
ce426f
+# define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned
ce426f
+#endif
ce426f
+
ce426f
+void
ce426f
+WORDCOPY_FWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
+{
ce426f
+  op_t a0, a1, a2;
ce426f
+  int sh_1, sh_2;
ce426f
+  int align;
ce426f
+
ce426f
+  /* Calculate how to shift a word read at the memory operation
ce426f
+     aligned srcp to make it aligned for copy.  */
ce426f
+
ce426f
+  align = srcp % OPSIZ;
ce426f
+  sh_1 = 8 * (srcp % OPSIZ);
ce426f
+  sh_2 = 8 * OPSIZ - sh_1;
ce426f
+
ce426f
+  /* Make SRCP aligned by rounding it down to the beginning of the `op_t'
ce426f
+     it points in the middle of.  */
ce426f
+  srcp &= -OPSIZ;
ce426f
+  a0 = ((op_t *) srcp)[0];
ce426f
+
ce426f
+  if (len & 1)
ce426f
+  {
ce426f
+    a1 = ((op_t *) srcp)[1];
ce426f
+    ((op_t *) dstp)[0] = MERGE (a0, sh_1, a1, sh_2);
ce426f
+
ce426f
+    if (len == 1)
ce426f
+      return;
ce426f
+
ce426f
+    a0 = a1;
ce426f
+    srcp += OPSIZ;
ce426f
+    dstp += OPSIZ;
ce426f
+    len -= 1;
ce426f
+  }
ce426f
+
ce426f
+  fwd_align_merge (align);
ce426f
+
ce426f
+}
ce426f
+
ce426f
+/* _wordcopy_bwd_aligned -- Copy block finishing right before
ce426f
+   SRCP to block finishing right before DSTP with LEN `op_t' words
ce426f
+   (not LEN bytes!).  Both SRCP and DSTP should be aligned for memory
ce426f
+   operations on `op_t's.  */
ce426f
+
ce426f
+#ifndef WORDCOPY_BWD_ALIGNED
ce426f
+# define WORDCOPY_BWD_ALIGNED _wordcopy_bwd_aligned
ce426f
+#endif
ce426f
+
ce426f
+void
ce426f
+WORDCOPY_BWD_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
+{
ce426f
+  op_t a0, a1;
ce426f
+
ce426f
+  if (len & 1)
ce426f
+  {
ce426f
+    srcp -= OPSIZ;
ce426f
+    dstp -= OPSIZ;
ce426f
+    ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
ce426f
+
ce426f
+    if (len == 1)
ce426f
+      return;
ce426f
+    len -= 1;
ce426f
+  }
ce426f
+
ce426f
+  do
ce426f
+    {
ce426f
+      srcp -= 2 * OPSIZ;
ce426f
+      dstp -= 2 * OPSIZ;
ce426f
+
ce426f
+      a1 = ((op_t *) srcp)[1];
ce426f
+      a0 = ((op_t *) srcp)[0];
ce426f
+      ((op_t *) dstp)[1] = a1;
ce426f
+      ((op_t *) dstp)[0] = a0;
ce426f
+
ce426f
+      len -= 2;
ce426f
+    }
ce426f
+  while (len != 0);
ce426f
+}
ce426f
+
ce426f
+#define bwd_align_merge(align)                                         \
ce426f
+  do                                                                   \
ce426f
+    {                                                                  \
ce426f
+      srcp -= 2 * OPSIZ;                                               \
ce426f
+      dstp -= 2 * OPSIZ;                                               \
ce426f
+      a1 = ((op_t *) srcp)[1];                                         \
ce426f
+      a0 = ((op_t *) srcp)[0];                                         \
ce426f
+      ((op_t *) dstp)[1] = MERGE (a1, align*8, a2, (__WORDSIZE-align*8)); \
ce426f
+      ((op_t *) dstp)[0] = MERGE (a0, align*8, a1, (__WORDSIZE-align*8)); \
ce426f
+      a2 = a0;                                                         \
ce426f
+      len -= 2;                                                                \
ce426f
+    }                                                                  \
ce426f
+  while (len != 0)
ce426f
+
ce426f
+/* _wordcopy_bwd_dest_aligned -- Copy block finishing right
ce426f
+   before SRCP to block finishing right before DSTP with LEN `op_t'
ce426f
+   words (not LEN bytes!).  DSTP should be aligned for memory
ce426f
+   operations on `op_t', but SRCP must *not* be aligned.  */
ce426f
+
ce426f
+#ifndef WORDCOPY_BWD_DEST_ALIGNED
ce426f
+# define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned
ce426f
+#endif
ce426f
+
ce426f
+void
ce426f
+WORDCOPY_BWD_DEST_ALIGNED (long int dstp, long int srcp, size_t len)
ce426f
+{
ce426f
+  op_t a0, a1, a2;
ce426f
+  int sh_1, sh_2;
ce426f
+  int align;
ce426f
+
ce426f
+  /* Calculate how to shift a word read at the memory operation
ce426f
+     aligned srcp to make it aligned for copy.  */
ce426f
+
ce426f
+  align = srcp % OPSIZ;
ce426f
+  sh_1 = 8 * (srcp % OPSIZ);
ce426f
+  sh_2 = 8 * OPSIZ - sh_1;
ce426f
+
ce426f
+  /* Make srcp aligned by rounding it down to the beginning of the op_t
ce426f
+     it points in the middle of.  */
ce426f
+  srcp &= -OPSIZ;
ce426f
+  a2 = ((op_t *) srcp)[0];
ce426f
+
ce426f
+  if (len & 1)
ce426f
+  {
ce426f
+    srcp -= OPSIZ;
ce426f
+    dstp -= OPSIZ;
ce426f
+    a1 = ((op_t *) srcp)[0];
ce426f
+    ((op_t *) dstp)[0] = MERGE (a1, sh_1, a2, sh_2);
ce426f
+
ce426f
+    if (len == 1)
ce426f
+      return;
ce426f
+
ce426f
+    a2 = a1;
ce426f
+    len -= 1;
ce426f
+  }
ce426f
+
ce426f
+  bwd_align_merge (align);
ce426f
+}
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c
ce426f
new file mode 100644
ce426f
index 0000000..c5c6eb7
ce426f
--- /dev/null
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c
ce426f
@@ -0,0 +1,23 @@
ce426f
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
ce426f
+   This file is part of the GNU C Library.
ce426f
+
ce426f
+   The GNU C Library is free software; you can redistribute it and/or
ce426f
+   modify it under the terms of the GNU Lesser General Public
ce426f
+   License as published by the Free Software Foundation; either
ce426f
+   version 2.1 of the License, or (at your option) any later version.
ce426f
+
ce426f
+   The GNU C Library is distributed in the hope that it will be useful,
ce426f
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
+   Lesser General Public License for more details.
ce426f
+
ce426f
+   You should have received a copy of the GNU Lesser General Public
ce426f
+   License along with the GNU C Library; if not, see
ce426f
+   <http://www.gnu.org/licenses/>.  */
ce426f
+
ce426f
+#define WORDCOPY_FWD_ALIGNED      _wordcopy_fwd_aligned_power6
ce426f
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_power6
ce426f
+#define WORDCOPY_BWD_ALIGNED      _wordcopy_bwd_aligned_power6
ce426f
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_power6
ce426f
+
ce426f
+#include <sysdeps/powerpc/power6/wordcopy.c>
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c
ce426f
new file mode 100644
ce426f
index 0000000..841d1a2
ce426f
--- /dev/null
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c
ce426f
@@ -0,0 +1,23 @@
ce426f
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
ce426f
+   This file is part of the GNU C Library.
ce426f
+
ce426f
+   The GNU C Library is free software; you can redistribute it and/or
ce426f
+   modify it under the terms of the GNU Lesser General Public
ce426f
+   License as published by the Free Software Foundation; either
ce426f
+   version 2.1 of the License, or (at your option) any later version.
ce426f
+
ce426f
+   The GNU C Library is distributed in the hope that it will be useful,
ce426f
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
+   Lesser General Public License for more details.
ce426f
+
ce426f
+   You should have received a copy of the GNU Lesser General Public
ce426f
+   License along with the GNU C Library; if not, see
ce426f
+   <http://www.gnu.org/licenses/>.  */
ce426f
+
ce426f
+#define WORDCOPY_FWD_ALIGNED      _wordcopy_fwd_aligned_power7
ce426f
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_power7
ce426f
+#define WORDCOPY_BWD_ALIGNED      _wordcopy_bwd_aligned_power7
ce426f
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_power7
ce426f
+
ce426f
+#include <sysdeps/powerpc/power6/wordcopy.c>
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
ce426f
new file mode 100644
ce426f
index 0000000..ccd24ad
ce426f
--- /dev/null
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c
ce426f
@@ -0,0 +1,23 @@
ce426f
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
ce426f
+   This file is part of the GNU C Library.
ce426f
+
ce426f
+   The GNU C Library is free software; you can redistribute it and/or
ce426f
+   modify it under the terms of the GNU Lesser General Public
ce426f
+   License as published by the Free Software Foundation; either
ce426f
+   version 2.1 of the License, or (at your option) any later version.
ce426f
+
ce426f
+   The GNU C Library is distributed in the hope that it will be useful,
ce426f
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
+   Lesser General Public License for more details.
ce426f
+
ce426f
+   You should have received a copy of the GNU Lesser General Public
ce426f
+   License along with the GNU C Library; if not, see
ce426f
+   <http://www.gnu.org/licenses/>.  */
ce426f
+
ce426f
+#define WORDCOPY_FWD_ALIGNED      _wordcopy_fwd_aligned_ppc
ce426f
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_ppc
ce426f
+#define WORDCOPY_BWD_ALIGNED      _wordcopy_bwd_aligned_ppc
ce426f
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_ppc
ce426f
+
ce426f
+#include <sysdeps/powerpc/power4/wordcopy.c>
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
ce426f
index 7113212..8dceb09 100644
ce426f
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/Makefile
ce426f
@@ -11,7 +11,8 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
ce426f
                   strncmp-power4 strncmp-ppc64 strchr-power7 strchr-ppc64 \
ce426f
                   strchrnul-power7 strchrnul-ppc64 wcschr-power7 \
ce426f
                   wcschr-power6 wcschr-ppc64 wcsrchr-power7 wcsrchr-power6 \
ce426f
-                  wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64
ce426f
+                  wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64 \
ce426f
+                  wordcopy-power7 wordcopy-power6 wordcopy-ppc64
ce426f
 
ce426f
 CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
ce426f
 CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
ce426f
@@ -21,4 +22,6 @@ CFLAGS-wcsrchr-power7.c += -mcpu=power7
ce426f
 CFLAGS-wcsrchr-power6.c += -mcpu=power6
ce426f
 CFLAGS-wcscpy-power7.c += -mcpu=power7
ce426f
 CFLAGS-wcscpy-power6.c += -mcpu=power6
ce426f
+CFLAGS-wordcopy-power7.c += -mcpu=power7
ce426f
+CFLAGS-wordcopy-power6.c += -mcpu=power6
ce426f
 endif
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power6.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power6.c
ce426f
new file mode 100644
ce426f
index 0000000..2a65b52
ce426f
--- /dev/null
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power6.c
ce426f
@@ -0,0 +1,19 @@
ce426f
+/* wordcopy routines for powerpc64/power6.
ce426f
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
ce426f
+   This file is part of the GNU C Library.
ce426f
+
ce426f
+   The GNU C Library is free software; you can redistribute it and/or
ce426f
+   modify it under the terms of the GNU Lesser General Public
ce426f
+   License as published by the Free Software Foundation; either
ce426f
+   version 2.1 of the License, or (at your option) any later version.
ce426f
+
ce426f
+   The GNU C Library is distributed in the hope that it will be useful,
ce426f
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
+   Lesser General Public License for more details.
ce426f
+
ce426f
+   You should have received a copy of the GNU Lesser General Public
ce426f
+   License along with the GNU C Library; see the file COPYING.LIB.  If
ce426f
+   not, see <http://www.gnu.org/licenses/>.  */
ce426f
+
ce426f
+#include <sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power6.c>
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power7.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power7.c
ce426f
new file mode 100644
ce426f
index 0000000..e804f88
ce426f
--- /dev/null
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy-power7.c
ce426f
@@ -0,0 +1,19 @@
ce426f
+/* wordcopy routines for powerpc64/power7.
ce426f
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
ce426f
+   This file is part of the GNU C Library.
ce426f
+
ce426f
+   The GNU C Library is free software; you can redistribute it and/or
ce426f
+   modify it under the terms of the GNU Lesser General Public
ce426f
+   License as published by the Free Software Foundation; either
ce426f
+   version 2.1 of the License, or (at your option) any later version.
ce426f
+
ce426f
+   The GNU C Library is distributed in the hope that it will be useful,
ce426f
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
+   Lesser General Public License for more details.
ce426f
+
ce426f
+   You should have received a copy of the GNU Lesser General Public
ce426f
+   License along with the GNU C Library; see the file COPYING.LIB.  If
ce426f
+   not, see <http://www.gnu.org/licenses/>.  */
ce426f
+
ce426f
+#include <sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-power7.c>
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
ce426f
new file mode 100644
ce426f
index 0000000..0584277
ce426f
--- /dev/null
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy-ppc64.c
ce426f
@@ -0,0 +1,18 @@
ce426f
+/* Copyright (C) 2013-2014 Free Software Foundation, Inc.
ce426f
+   This file is part of the GNU C Library.
ce426f
+
ce426f
+   The GNU C Library is free software; you can redistribute it and/or
ce426f
+   modify it under the terms of the GNU Lesser General Public
ce426f
+   License as published by the Free Software Foundation; either
ce426f
+   version 2.1 of the License, or (at your option) any later version.
ce426f
+
ce426f
+   The GNU C Library is distributed in the hope that it will be useful,
ce426f
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
+   Lesser General Public License for more details.
ce426f
+
ce426f
+   You should have received a copy of the GNU Lesser General Public
ce426f
+   License along with the GNU C Library; if not, see
ce426f
+   <http://www.gnu.org/licenses/>.  */
ce426f
+
ce426f
+#include <sysdeps/powerpc/powerpc32/power4/multiarch/wordcopy-ppc32.c>
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c
ce426f
new file mode 100644
ce426f
index 0000000..889be25
ce426f
--- /dev/null
ce426f
+++ glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/multiarch/wordcopy.c
ce426f
@@ -0,0 +1,86 @@
ce426f
+/* Multiple versions of wordcopy functions.
ce426f
+   Copyright (C) 2013-2014 Free Software Foundation, Inc.
ce426f
+   This file is part of the GNU C Library.
ce426f
+
ce426f
+   The GNU C Library is free software; you can redistribute it and/or
ce426f
+   modify it under the terms of the GNU Lesser General Public
ce426f
+   License as published by the Free Software Foundation; either
ce426f
+   version 2.1 of the License, or (at your option) any later version.
ce426f
+
ce426f
+   The GNU C Library is distributed in the hope that it will be useful,
ce426f
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
+   Lesser General Public License for more details.
ce426f
+
ce426f
+   You should have received a copy of the GNU Lesser General Public
ce426f
+   License along with the GNU C Library; if not, see
ce426f
+   <http://www.gnu.org/licenses/>.  */
ce426f
+
ce426f
+#ifndef NOT_IN_libc
ce426f
+# include <stddef.h>
ce426f
+# include <memcopy.h>
ce426f
+# include <shlib-compat.h>
ce426f
+# include "init-arch.h"
ce426f
+
ce426f
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_ppc
ce426f
+attribute_hidden;
ce426f
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power6
ce426f
+attribute_hidden;
ce426f
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power7
ce426f
+attribute_hidden;
ce426f
+
ce426f
+libc_ifunc (_wordcopy_fwd_aligned,
ce426f
+            (hwcap & PPC_FEATURE_HAS_VSX)
ce426f
+            ? _wordcopy_fwd_aligned_power7 :
ce426f
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
ce426f
+              ? _wordcopy_fwd_aligned_power6
ce426f
+            : _wordcopy_fwd_aligned_ppc);
ce426f
+
ce426f
+
ce426f
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_ppc
ce426f
+attribute_hidden;
ce426f
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power6
ce426f
+attribute_hidden;
ce426f
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power7
ce426f
+attribute_hidden;
ce426f
+
ce426f
+libc_ifunc (_wordcopy_fwd_dest_aligned,
ce426f
+            (hwcap & PPC_FEATURE_HAS_VSX)
ce426f
+            ? _wordcopy_fwd_dest_aligned_power7 :
ce426f
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
ce426f
+              ? _wordcopy_fwd_dest_aligned_power6
ce426f
+            : _wordcopy_fwd_dest_aligned_ppc);
ce426f
+
ce426f
+
ce426f
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_ppc
ce426f
+attribute_hidden;
ce426f
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power6
ce426f
+attribute_hidden;
ce426f
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power7
ce426f
+attribute_hidden;
ce426f
+
ce426f
+libc_ifunc (_wordcopy_bwd_aligned,
ce426f
+            (hwcap & PPC_FEATURE_HAS_VSX)
ce426f
+            ? _wordcopy_bwd_aligned_power7 :
ce426f
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
ce426f
+              ? _wordcopy_bwd_aligned_power6
ce426f
+            : _wordcopy_bwd_aligned_ppc);
ce426f
+
ce426f
+
ce426f
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_ppc
ce426f
+attribute_hidden;
ce426f
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power6
ce426f
+attribute_hidden;
ce426f
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power7
ce426f
+attribute_hidden;
ce426f
+
ce426f
+libc_ifunc (_wordcopy_bwd_dest_aligned,
ce426f
+            (hwcap & PPC_FEATURE_HAS_VSX)
ce426f
+            ? _wordcopy_bwd_dest_aligned_power7 :
ce426f
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
ce426f
+              ? _wordcopy_bwd_dest_aligned_power6
ce426f
+            : _wordcopy_bwd_dest_aligned_ppc);
ce426f
+
ce426f
+#else
ce426f
+#include <sysdeps/powerpc/power4/wordcopy.c>
ce426f
+#endif
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/wordcopy.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/wordcopy.c
ce426f
deleted file mode 100644
ce426f
index f427b48..0000000
ce426f
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power4/wordcopy.c
ce426f
+++ /dev/null
ce426f
@@ -1 +0,0 @@
ce426f
-#include "../../powerpc32/power4/wordcopy.c"
ce426f
diff --git glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/wordcopy.c glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/wordcopy.c
ce426f
deleted file mode 100644
ce426f
index 4c72404..0000000
ce426f
--- glibc-2.17-c758a686/sysdeps/powerpc/powerpc64/power6/wordcopy.c
ce426f
+++ /dev/null
ce426f
@@ -1,217 +0,0 @@
ce426f
-/* _memcopy.c -- subroutines for memory copy functions.
ce426f
-   Copyright (C) 1991-2012 Free Software Foundation, Inc.
ce426f
-   This file is part of the GNU C Library.
ce426f
-   Contributed by Torbjorn Granlund (tege@sics.se).
ce426f
-
ce426f
-   The GNU C Library is free software; you can redistribute it and/or
ce426f
-   modify it under the terms of the GNU Lesser General Public
ce426f
-   License as published by the Free Software Foundation; either
ce426f
-   version 2.1 of the License, or (at your option) any later version.
ce426f
-
ce426f
-   The GNU C Library is distributed in the hope that it will be useful,
ce426f
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
ce426f
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
ce426f
-   Lesser General Public License for more details.
ce426f
-
ce426f
-   You should have received a copy of the GNU Lesser General Public
ce426f
-   License along with the GNU C Library; if not, see
ce426f
-   <http://www.gnu.org/licenses/>.  */
ce426f
-
ce426f
-/* BE VERY CAREFUL IF YOU CHANGE THIS CODE...!  */
ce426f
-
ce426f
-#include <stddef.h>
ce426f
-#include <memcopy.h>
ce426f
-
ce426f
-/* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
ce426f
-   block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
ce426f
-   Both SRCP and DSTP should be aligned for memory operations on `op_t's.  */
ce426f
-
ce426f
-void
ce426f
-_wordcopy_fwd_aligned (dstp, srcp, len)
ce426f
-     long int dstp;
ce426f
-     long int srcp;
ce426f
-     size_t len;
ce426f
-{
ce426f
-  op_t a0, a1;
ce426f
-
ce426f
-  if (len & 1)
ce426f
-  {
ce426f
-    ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
ce426f
-    
ce426f
-    if (len == 1)
ce426f
-      return;
ce426f
-    srcp += OPSIZ;
ce426f
-    dstp += OPSIZ;
ce426f
-    len -= 1;
ce426f
-  }
ce426f
-
ce426f
-  do
ce426f
-    {
ce426f
-      a0 = ((op_t *) srcp)[0];
ce426f
-      a1 = ((op_t *) srcp)[1];
ce426f
-      ((op_t *) dstp)[0] = a0;
ce426f
-      ((op_t *) dstp)[1] = a1;
ce426f
-
ce426f
-      srcp += 2 * OPSIZ;
ce426f
-      dstp += 2 * OPSIZ;
ce426f
-      len -= 2;
ce426f
-    }
ce426f
-  while (len != 0);
ce426f
-}
ce426f
-
ce426f
-#define fwd_align_merge(align)                                         \
ce426f
-  do                                                                   \
ce426f
-    {                                                                  \
ce426f
-      a1 = ((op_t *) srcp)[1];                                         \
ce426f
-      a2 = ((op_t *) srcp)[2];                                         \
ce426f
-      ((op_t *) dstp)[0] = MERGE (a0, align*8, a1, (64-align*8));      \
ce426f
-      ((op_t *) dstp)[1] = MERGE (a1, align*8, a2, (64-align*8));      \
ce426f
-      a0 = a2;                                                         \
ce426f
-      srcp += 2 * OPSIZ;                                               \
ce426f
-      dstp += 2 * OPSIZ;                                               \
ce426f
-      len -= 2;                                                                \
ce426f
-    }                                                                  \
ce426f
-  while (len != 0)
ce426f
-
ce426f
-
ce426f
-/* _wordcopy_fwd_dest_aligned -- Copy block beginning at SRCP to
ce426f
-   block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
ce426f
-   DSTP should be aligned for memory operations on `op_t's, but SRCP must
ce426f
-   *not* be aligned.  */
ce426f
-
ce426f
-void
ce426f
-_wordcopy_fwd_dest_aligned (dstp, srcp, len)
ce426f
-     long int dstp;
ce426f
-     long int srcp;
ce426f
-     size_t len;
ce426f
-{
ce426f
-  op_t a0, a1, a2;
ce426f
-  int sh_1, sh_2;
ce426f
-  int align;
ce426f
-
ce426f
-  /* Calculate how to shift a word read at the memory operation
ce426f
-     aligned srcp to make it aligned for copy.  */
ce426f
-
ce426f
-  align = srcp % OPSIZ;
ce426f
-  sh_1 = 8 * (srcp % OPSIZ);
ce426f
-  sh_2 = 8 * OPSIZ - sh_1;
ce426f
-
ce426f
-  /* Make SRCP aligned by rounding it down to the beginning of the `op_t'
ce426f
-     it points in the middle of.  */
ce426f
-  srcp &= -OPSIZ;
ce426f
-  a0 = ((op_t *) srcp)[0];
ce426f
-
ce426f
-  if (len & 1)
ce426f
-  {
ce426f
-    a1 = ((op_t *) srcp)[1];
ce426f
-    ((op_t *) dstp)[0] = MERGE (a0, sh_1, a1, sh_2);
ce426f
-    
ce426f
-    if (len == 1)
ce426f
-      return;
ce426f
-    
ce426f
-    a0 = a1;
ce426f
-    srcp += OPSIZ;
ce426f
-    dstp += OPSIZ;
ce426f
-    len -= 1;
ce426f
-  }
ce426f
-
ce426f
-  fwd_align_merge (align);
ce426f
-
ce426f
-}
ce426f
-
ce426f
-/* _wordcopy_bwd_aligned -- Copy block finishing right before
ce426f
-   SRCP to block finishing right before DSTP with LEN `op_t' words
ce426f
-   (not LEN bytes!).  Both SRCP and DSTP should be aligned for memory
ce426f
-   operations on `op_t's.  */
ce426f
-
ce426f
-void
ce426f
-_wordcopy_bwd_aligned (dstp, srcp, len)
ce426f
-     long int dstp;
ce426f
-     long int srcp;
ce426f
-     size_t len;
ce426f
-{
ce426f
-  op_t a0, a1;
ce426f
-
ce426f
-  if (len & 1)
ce426f
-  {
ce426f
-    srcp -= OPSIZ;
ce426f
-    dstp -= OPSIZ;
ce426f
-    ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
ce426f
-    
ce426f
-    if (len == 1)
ce426f
-      return;
ce426f
-    len -= 1;
ce426f
-  }
ce426f
-
ce426f
-  do
ce426f
-    {
ce426f
-      srcp -= 2 * OPSIZ;
ce426f
-      dstp -= 2 * OPSIZ;
ce426f
-
ce426f
-      a1 = ((op_t *) srcp)[1];
ce426f
-      a0 = ((op_t *) srcp)[0];
ce426f
-      ((op_t *) dstp)[1] = a1;
ce426f
-      ((op_t *) dstp)[0] = a0;
ce426f
-
ce426f
-      len -= 2;
ce426f
-    }
ce426f
-  while (len != 0);
ce426f
-}
ce426f
-
ce426f
-#define bwd_align_merge(align)                                         \
ce426f
-  do                                                                   \
ce426f
-    {                                                                  \
ce426f
-      srcp -= 2 * OPSIZ;                                               \
ce426f
-      dstp -= 2 * OPSIZ;                                               \
ce426f
-      a1 = ((op_t *) srcp)[1];                                         \
ce426f
-      a0 = ((op_t *) srcp)[0];                                         \
ce426f
-      ((op_t *) dstp)[1] = MERGE (a1, align*8, a2, (64-align*8));      \
ce426f
-      ((op_t *) dstp)[0] = MERGE (a0, align*8, a1, (64-align*8));      \
ce426f
-      a2 = a0;                                                         \
ce426f
-      len -= 2;                                                                \
ce426f
-    }                                                                  \
ce426f
-  while (len != 0)
ce426f
-
ce426f
-/* _wordcopy_bwd_dest_aligned -- Copy block finishing right
ce426f
-   before SRCP to block finishing right before DSTP with LEN `op_t'
ce426f
-   words (not LEN bytes!).  DSTP should be aligned for memory
ce426f
-   operations on `op_t', but SRCP must *not* be aligned.  */
ce426f
-
ce426f
-void
ce426f
-_wordcopy_bwd_dest_aligned (dstp, srcp, len)
ce426f
-     long int dstp;
ce426f
-     long int srcp;
ce426f
-     size_t len;
ce426f
-{
ce426f
-  op_t a0, a1, a2;
ce426f
-  int sh_1, sh_2;
ce426f
-  int align;
ce426f
-
ce426f
-  /* Calculate how to shift a word read at the memory operation
ce426f
-     aligned srcp to make it aligned for copy.  */
ce426f
-
ce426f
-  align = srcp % OPSIZ;
ce426f
-  sh_1 = 8 * (srcp % OPSIZ);
ce426f
-  sh_2 = 8 * OPSIZ - sh_1;
ce426f
-
ce426f
-  /* Make srcp aligned by rounding it down to the beginning of the op_t
ce426f
-     it points in the middle of.  */
ce426f
-  srcp &= -OPSIZ;
ce426f
-  a2 = ((op_t *) srcp)[0];
ce426f
-
ce426f
-  if (len & 1)
ce426f
-  {
ce426f
-    srcp -= OPSIZ;
ce426f
-    dstp -= OPSIZ;
ce426f
-    a1 = ((op_t *) srcp)[0];
ce426f
-    ((op_t *) dstp)[0] = MERGE (a1, sh_1, a2, sh_2);
ce426f
-
ce426f
-    if (len == 1)
ce426f
-      return;
ce426f
-
ce426f
-    a2 = a1;
ce426f
-    len -= 1;
ce426f
-  }
ce426f
-
ce426f
-  bwd_align_merge (align);
ce426f
-}
ce426f
-- 
ce426f
1.8.3.1
ce426f