This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch tuliom/multilib updated. glibc-2.17-390-gac33b12


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, tuliom/multilib has been updated
       via  ac33b12a3624c031d408dbb1ad5a550d72aabe3f (commit)
       via  f3bbf938200e09554b415c12c38d6b7fa1d485c9 (commit)
       via  003dad78402c0256c1d98fa13f441e7ab8d661c2 (commit)
       via  04fffa485cff72831ec156bd1210a616d0c0aeeb (commit)
       via  e567462074d37067fac1d2f70ab9ef036f9d72f8 (commit)
       via  39facb2f8d5e4a5d9ed0ddb45bc4253c518e55a3 (commit)
       via  e3fe5492234f7ad905e5f7dbd4fb3205d094d48b (commit)
      from  45f06f145fe4e1bd24ebaf38a4b8707a2e4c4b3b (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=ac33b12a3624c031d408dbb1ad5a550d72aabe3f

commit ac33b12a3624c031d408dbb1ad5a550d72aabe3f
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Apr 9 12:02:56 2013 -0500

    PowerPC: strncase ifunc for PowerPC32

diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 23be407..fa9c0f1 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -4,6 +4,7 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
 		   bzero-power4 bzero-power6 bzero-power7 \
 		   strncmp-power7 strncmp-power4 strlen-power7 \
                    strcasecmp-power7 strcasecmp_l-power7 \
+                   strncase-power7 strncase_l-power7 \
 		   strnlen-power7 strnlen-c \
 		   strchr-power7 \
 		   mempcpy-power7 mempcpy-c \
@@ -16,4 +17,7 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
 		   wcschr-power7 wcschr-power6 wcschr-c \
 		   wcsrchr-power7 wcsrchr-power6 wcsrchr-c \
 		   wcscpy-power7 wcscpy-power6 wcscpy-c
+
+CFLAGS-strncase-power7.c += -funroll-loops
+CFLAGS-strncase_l-power7.c += -funroll-loops
 endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 93eb739..f8c028f 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -135,6 +135,12 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 	      IFUNC_IMPL_ADD (array, i, strcasecmp_l, 1,
 			      __strcasecmp_l_ppc32))
 
+  IFUNC_IMPL (i, name, strncasecmp,
+	      IFUNC_IMPL_ADD (array, i, strncasecmp,
+			      hwcap & PPC_FEATURE_HAS_VSX,
+			      __strncasecmp_power7)
+	      IFUNC_IMPL_ADD (array, i, strcasecmp, 1, __strncasecmp_ppc32))
+
   IFUNC_IMPL (i, name, strnlen,
 	      IFUNC_IMPL_ADD (array, i, strnlen,
 			      hwcap & PPC_FEATURE_HAS_VSX,
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncase-power7.c b/sysdeps/powerpc/powerpc32/multiarch/strncase-power7.c
new file mode 100644
index 0000000..f938cb2
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncase-power7.c
@@ -0,0 +1,7 @@
+#include <string.h>
+
+__typeof (strncasecmp) __strncasecmp_power7
+  __attribute__ ((__target__ ("cpu=power7")));
+
+#define __strncasecmp __strncasecmp_power7
+#include <string/strncase.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncase.c b/sysdeps/powerpc/powerpc32/multiarch/strncase.c
new file mode 100644
index 0000000..9e31f1a
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncase.c
@@ -0,0 +1,41 @@
+/* Multiple versions of strncasecmp
+   Copyright (C) 2013 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/>.  */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strncasecmp __strncasecmp_ppc32
+extern __typeof (__strncasecmp) __strncasecmp_ppc32 attribute_hidden;
+extern __typeof (__strncasecmp) __strncasecmp_power7 attribute_hidden;
+#endif
+
+#include "string/strncase.c"
+#undef strncasecmp
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+   ifunc symbol properly.  */
+extern __typeof (__strncasecmp) __libc_strncasecmp;
+libc_ifunc (__libc_strncasecmp,
+	     (hwcap & PPC_FEATURE_HAS_VSX)
+             ? __strncasecmp_power7
+             : __strncasecmp_ppc32);
+weak_alias (__libc_strncasecmp, strncasecmp)
+#endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncase_l-power7.c b/sysdeps/powerpc/powerpc32/multiarch/strncase_l-power7.c
new file mode 100644
index 0000000..e5b13f8
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncase_l-power7.c
@@ -0,0 +1,8 @@
+#include <string.h>
+
+__typeof (strncasecmp_l) __strncasecmp_l_power7
+  __attribute__ ((__target__ ("cpu=power7")));
+
+#define __strncasecmp_l __strncasecmp_l_power7
+#define USE_IN_EXTENDED_LOCALE_MODEL    1
+#include "string/strncase.c"
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strncase_l.c b/sysdeps/powerpc/powerpc32/multiarch/strncase_l.c
new file mode 100644
index 0000000..b735dc9
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/strncase_l.c
@@ -0,0 +1,42 @@
+/* Multiple versions of strncasecmp_l
+   Copyright (C) 2013 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/>.  */
+
+#ifndef NOT_IN_libc
+# include <string.h>
+# define strncasecmp_l __strncasecmp_l_ppc32
+extern __typeof (__strncasecmp_l) __strncasecmp_l_ppc32 attribute_hidden;
+extern __typeof (__strncasecmp_l) __strncasecmp_l_power7 attribute_hidden;
+#endif
+
+#include "string/strncase_l.c"
+#undef strncasecmp_l
+
+#ifndef NOT_IN_libc
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+/* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
+   ifunc symbol properly.  */
+extern __typeof (__strncasecmp_l) __libc_strncasecmp_l;
+libc_ifunc (__libc_strncasecmp_l,
+	     (hwcap & PPC_FEATURE_HAS_VSX)
+             ? __strncasecmp_l_power7
+             : __strncasecmp_l_ppc32);
+
+weak_alias (__libc_strncasecmp_l, strncasecmp_l)
+#endif
diff --git a/sysdeps/powerpc/powerpc32/power7/Makefile b/sysdeps/powerpc/powerpc32/power7/Makefile
deleted file mode 100644
index 5e8f4a2..0000000
--- a/sysdeps/powerpc/powerpc32/power7/Makefile
+++ /dev/null
@@ -1,4 +0,0 @@
-ifeq ($(subdir),string)
-CFLAGS-strncase.c += -funroll-loops
-CFLAGS-strncase_l.c += -funroll-loops
-endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f3bbf938200e09554b415c12c38d6b7fa1d485c9

commit f3bbf938200e09554b415c12c38d6b7fa1d485c9
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Apr 9 12:02:04 2013 -0500

    PowerPC: strcasecmp ifunc cleaning

diff --git a/sysdeps/powerpc/powerpc32/multiarch/strcasecmp.c b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp.c
index b932f51..b74386f 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/strcasecmp.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp.c
@@ -17,20 +17,10 @@
    <http://www.gnu.org/licenses/>.  */
 
 #ifndef NOT_IN_libc
-# ifdef SHARED
-#  undef libc_hidden_builtin_def
-#  define libc_hidden_builtin_def(name) \
-  __hidden_ver1 (__strcasecmp_ppc32, __GI_strcasecmp, __strcasecmp_ppc32);
-# endif
-
-# undef strcasecmp
-# define strcasecmp __redirect_strcasecmp
 # include <string.h>
-# undef strcasecmp
 # define strcasecmp __strcasecmp_ppc32
-
-extern __typeof (__redirect_strcasecmp) __strcasecmp_ppc32 attribute_hidden;
-extern __typeof (__redirect_strcasecmp) __strcasecmp_power7 attribute_hidden;
+extern __typeof (__strcasecmp) __strcasecmp_ppc32 attribute_hidden;
+extern __typeof (__strcasecmp) __strcasecmp_power7 attribute_hidden;
 #endif
 
 #include "string/strcasecmp.c"
@@ -42,7 +32,7 @@ extern __typeof (__redirect_strcasecmp) __strcasecmp_power7 attribute_hidden;
 
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
-extern __typeof (__redirect_strcasecmp) __libc_strcasecmp;
+extern __typeof (__strcasecmp) __libc_strcasecmp;
 libc_ifunc (__libc_strcasecmp,
 	    (hwcap & PPC_FEATURE_HAS_VSX)
             ? __strcasecmp_power7
diff --git a/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l.c b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l.c
index 71e37cf..8cef4b4 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l.c
@@ -17,22 +17,10 @@
    <http://www.gnu.org/licenses/>.  */
 
 #ifndef NOT_IN_libc
-# ifdef SHARED
-#  undef libc_hidden_builtin_def
-#  define libc_hidden_builtin_def(name) \
-  __hidden_ver1 (__strcasecmp_l_ppc32, __GI_strcasecmp_l, __strcasecmp_l_ppc32);
-# endif
-
-/* Redefine memmove so that the compiler won't complain about the type
-   mismatch with the IFUNC selector in strong_alias, below.  */
-# undef strcasecmp_l
-# define strcasecmp_l __redirect_strcasecmp_l
 # include <string.h>
-# undef strcasecmp_l
 # define strcasecmp_l __strcasecmp_l_ppc32
-
-extern __typeof (__redirect_strcasecmp_l) __strcasecmp_l_ppc32 attribute_hidden;
-extern __typeof (__redirect_strcasecmp_l) __strcasecmp_l_power7 attribute_hidden;
+extern __typeof (__strcasecmp_l) __strcasecmp_l_ppc32 attribute_hidden;
+extern __typeof (__strcasecmp_l) __strcasecmp_l_power7 attribute_hidden;
 #endif
 
 #include "string/strcasecmp_l.c"
@@ -44,7 +32,7 @@ extern __typeof (__redirect_strcasecmp_l) __strcasecmp_l_power7 attribute_hidden
 
 /* Avoid DWARF definition DIE on ifunc symbol so that GDB can handle
    ifunc symbol properly.  */
-extern __typeof (__redirect_strcasecmp_l) __libc_strcasecmp_l;
+extern __typeof (__strcasecmp_l) __libc_strcasecmp_l;
 libc_ifunc (__libc_strcasecmp_l,
 	    (hwcap & PPC_FEATURE_HAS_VSX)
             ? __strcasecmp_l_power7

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=003dad78402c0256c1d98fa13f441e7ab8d661c2

commit 003dad78402c0256c1d98fa13f441e7ab8d661c2
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Apr 9 08:09:10 2013 -0500

    Fix ChangeLog tabs

diff --git a/ChangeLog b/ChangeLog
index 098973b..afbee49 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,23 +1,23 @@
 2013-03-07  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 	    Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
 
-     * sysdeps/powerpc/powerpc64/a2/memcpy.S: Moved to multiarch folder.
-     * sysdeps/powerpc/powerpc64/cell/memcpy.S: Moved to multiarch folder.
-     * sysdeps/powerpc/powerpc64/power4/memcpy.S: Moved to multiarch folder.
-     * sysdeps/powerpc/powerpc64/power6/memcpy.S: Moved to multiarch folder.
-     * sysdeps/powerpc/powerpc64/power7/memcpy.S: Moved to multiarch folder.
-     * sysdeps/powerpc/powerpc64/multiarch/Makefile: Multiarch makefile.
-     * sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S: Moved from a2 folder.
-     * sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S: Moved from cell
-     folder.
-     * sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S: Moved from power4
-     folder.
-     * sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S: Moved from power6
-     folder.
-     * sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S: Moved from power7
-     folder.
-     * sysdeps/powerpc/powerpc64/multiarch/memcpy.S: Multiarch implementation
-     using IFUNC extension.
+	* sysdeps/powerpc/powerpc64/a2/memcpy.S: Moved to multiarch folder.
+	* sysdeps/powerpc/powerpc64/cell/memcpy.S: Moved to multiarch folder.
+	* sysdeps/powerpc/powerpc64/power4/memcpy.S: Moved to multiarch folder.
+	* sysdeps/powerpc/powerpc64/power6/memcpy.S: Moved to multiarch folder.
+	* sysdeps/powerpc/powerpc64/power7/memcpy.S: Moved to multiarch folder.
+	* sysdeps/powerpc/powerpc64/multiarch/Makefile: Multiarch makefile.
+	* sysdeps/powerpc/powerpc64/multiarch/memcpy-a2.S: Moved from a2 folder.
+	* sysdeps/powerpc/powerpc64/multiarch/memcpy-cell.S: Moved from cell
+	folder.
+	* sysdeps/powerpc/powerpc64/multiarch/memcpy-power4.S: Moved from power4
+	folder.
+	* sysdeps/powerpc/powerpc64/multiarch/memcpy-power6.S: Moved from power6
+	folder.
+	* sysdeps/powerpc/powerpc64/multiarch/memcpy-power7.S: Moved from power7
+	folder.
+	* sysdeps/powerpc/powerpc64/multiarch/memcpy.S: Multiarch implementation
+	using IFUNC extension.
 
 2013-03-07  Tulio Magno Quites Machado Filho  <tuliom@linux.vnet.ibm.com>
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=04fffa485cff72831ec156bd1210a616d0c0aeeb

commit 04fffa485cff72831ec156bd1210a616d0c0aeeb
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Apr 9 08:07:11 2013 -0500

    PowerPC: wcscpy ifunc for PowerPC32

diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 19b11e1..23be407 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -14,5 +14,6 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
 		   wordcopy-power7 wordcopy-power6 wordcopy-power5 \
 		   wordcopy-power4 wordcopy-c \
 		   wcschr-power7 wcschr-power6 wcschr-c \
-		   wcsrchr-power7 wcsrchr-power6 wcsrchr-c
+		   wcsrchr-power7 wcsrchr-power6 wcsrchr-c \
+		   wcscpy-power7 wcscpy-power6 wcscpy-c
 endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index 0489e3d..93eb739 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -175,6 +175,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __wcsrchr_power6)
 	      IFUNC_IMPL_ADD (array, i, wcsrchr, 1,
 			      __wcsrchr_ppc32))
+
+  IFUNC_IMPL (i, name, wcscpy,
+	      IFUNC_IMPL_ADD (array, i, wcscpy,
+			      hwcap & PPC_FEATURE_HAS_VSX,
+			      __wcscpy_power7)
+	      IFUNC_IMPL_ADD (array, i, wcscpy,
+			      hwcap & PPC_FEATURE_ARCH_2_05,
+			      __wcscpy_power6)
+	      IFUNC_IMPL_ADD (array, i, wcscpy, 1,
+			      __wcscpy_ppc32))
 #endif
 
   return i;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcscpy-c.c b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-c.c
new file mode 100644
index 0000000..7948f8b
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-c.c
@@ -0,0 +1,9 @@
+#include <wchar.h>
+
+#ifndef NOT_IN_libc
+# define WCSCPY  __wcscpy_ppc32
+#endif
+
+extern __typeof (wcscpy) __wcscpy_ppc32;
+
+#include "wcsmbs/wcscpy.c"
diff --git a/sysdeps/powerpc/powerpc32/power6/wcscpy.c b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power6.c
similarity index 90%
rename from sysdeps/powerpc/powerpc32/power6/wcscpy.c
rename to sysdeps/powerpc/powerpc32/multiarch/wcscpy-power6.c
index 5950ef3..ee1b8c4 100644
--- a/sysdeps/powerpc/powerpc32/power6/wcscpy.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power6.c
@@ -19,12 +19,19 @@
 #include <stddef.h>
 #include <wchar.h>
 
+#ifdef WCSCPY
+# define __wcscpy_power6 WCSCPY
+#endif
+#ifndef WCSCPY_ARCH
+# define WCSCPY_ARCH "power6"
+#endif
+
+__typeof (wcscpy) __wcscpy_power6
+  __attribute__ ((__target__ ("cpu=" WCSCPY_ARCH)));
 
 /* Copy SRC to DEST.  */
 wchar_t *
-wcscpy (dest, src)
-     wchar_t *dest;
-     const wchar_t *src;
+__wcscpy_power6 (wchar_t *dest, const wchar_t *src)
 {
   wint_t c,d;
   wchar_t *wcp, *wcp2;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power7.c b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power7.c
new file mode 100644
index 0000000..5f786cf
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcscpy-power7.c
@@ -0,0 +1,3 @@
+#define WCSCPY      __wcscpy_power7
+#define WCSCPY_ARCH "power7"
+#include <sysdeps/powerpc/powerpc32/multiarch/wcscpy-power6.c>
diff --git a/wcsmbs/wcscpy.c b/sysdeps/powerpc/powerpc32/multiarch/wcscpy.c
similarity index 53%
copy from wcsmbs/wcscpy.c
copy to sysdeps/powerpc/powerpc32/multiarch/wcscpy.c
index 3b1e0c6..795babb 100644
--- a/wcsmbs/wcscpy.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcscpy.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+/* Multiple versions of wcscpy
+   Copyright (C) 2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -16,43 +16,21 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <stddef.h>
-#include <wchar.h>
-
-
-/* Copy SRC to DEST.  */
-wchar_t *
-wcscpy (dest, src)
-     wchar_t *dest;
-     const wchar_t *src;
-{
-  wint_t c;
-  wchar_t *wcp;
-
-  if (__alignof__ (wchar_t) >= sizeof (wchar_t))
-    {
-      const ptrdiff_t off = dest - src - 1;
-
-      wcp = (wchar_t *) src;
-
-      do
-	{
-	  c = *wcp++;
-	  wcp[off] = c;
-	}
-      while (c != L'\0');
-    }
-  else
-    {
-      wcp = dest;
-
-      do
-	{
-	  c = *src++;
-	  *wcp++ = c;
-	}
-      while (c != L'\0');
-    }
-
-  return dest;
-}
+#ifndef NOT_IN_libc
+# include <wchar.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (wcscpy) __wcscpy_ppc32 attribute_hidden;
+extern __typeof (wcscpy) __wcscpy_power6 attribute_hidden;
+extern __typeof (wcscpy) __wcscpy_power7 attribute_hidden;
+
+libc_ifunc (wcscpy,
+	     (hwcap & PPC_FEATURE_HAS_VSX)
+             ? __wcscpy_power7 :
+	       (hwcap & PPC_FEATURE_ARCH_2_05)
+	       ? __wcscpy_power6
+             : __wcscpy_ppc32);
+#else
+#include "wcsmbs/wcscpy.c"
+#endif
diff --git a/wcsmbs/wcscpy.c b/wcsmbs/wcscpy.c
index 3b1e0c6..6846c08 100644
--- a/wcsmbs/wcscpy.c
+++ b/wcsmbs/wcscpy.c
@@ -21,6 +21,10 @@
 
 
 /* Copy SRC to DEST.  */
+#ifdef WCSCPY
+# define wcscpy WCSCPY
+#endif
+
 wchar_t *
 wcscpy (dest, src)
      wchar_t *dest;

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e567462074d37067fac1d2f70ab9ef036f9d72f8

commit e567462074d37067fac1d2f70ab9ef036f9d72f8
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Apr 9 07:55:41 2013 -0500

    PowerPC: wcsrchr ifunc for PowerPC32

diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index 4fe9bd0..19b11e1 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -13,5 +13,6 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
 		   strchrnul-power7 strchrnul-c \
 		   wordcopy-power7 wordcopy-power6 wordcopy-power5 \
 		   wordcopy-power4 wordcopy-c \
-		   wcschr-power7 wcschr-power6 wcschr-c
+		   wcschr-power7 wcschr-power6 wcschr-c \
+		   wcsrchr-power7 wcsrchr-power6 wcsrchr-c
 endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index b92152e..0489e3d 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -165,6 +165,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __wcschr_power6)
 	      IFUNC_IMPL_ADD (array, i, wcschr, 1,
 			      __wcschr_ppc32))
+
+  IFUNC_IMPL (i, name, wcsrchr,
+	      IFUNC_IMPL_ADD (array, i, wcsrchr,
+			      hwcap & PPC_FEATURE_HAS_VSX,
+			      __wcsrchr_power7)
+	      IFUNC_IMPL_ADD (array, i, wcsrchr,
+			      hwcap & PPC_FEATURE_ARCH_2_05,
+			      __wcsrchr_power6)
+	      IFUNC_IMPL_ADD (array, i, wcsrchr, 1,
+			      __wcsrchr_ppc32))
 #endif
 
   return i;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-c.c b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-c.c
new file mode 100644
index 0000000..6c893fe
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-c.c
@@ -0,0 +1,9 @@
+#include <wchar.h>
+
+#ifndef NOT_IN_libc
+# define WCSRCHR  __wcsrchr_ppc32
+#endif
+
+extern __typeof (wcsrchr) __wcsrchr_ppc32;
+
+#include "wcsmbs/wcsrchr.c"
diff --git a/sysdeps/powerpc/powerpc32/power6/wcsrchr.c b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power6.c
similarity index 87%
rename from sysdeps/powerpc/powerpc32/power6/wcsrchr.c
rename to sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power6.c
index d0ff9f6..9da8edc 100644
--- a/sysdeps/powerpc/powerpc32/power6/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power6.c
@@ -18,12 +18,19 @@
 
 #include <wchar.h>
 
+#ifdef WCSRCHR
+# define __wcsrchr_power6 WCSRCHR
+#endif
+#ifndef WCSRCHR_ARCH
+# define WCSRCHR_ARCH "power6"
+#endif
+
+__typeof (wcsrchr) __wcsrchr_power6
+  __attribute__ ((__target__ ("cpu=" WCSRCHR_ARCH)));
 
 /* Find the last occurrence of WC in WCS.  */
 wchar_t *
-wcsrchr (wcs, wc)
-     register const wchar_t *wcs;
-     register const wchar_t wc;
+__wcsrchr_power6 (register const wchar_t *wcs, register const wchar_t wc)
 {
   register const wchar_t *wcs2 = wcs + 1;
   const wchar_t *retval = NULL;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power7.c b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power7.c
new file mode 100644
index 0000000..0c8fe9c
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power7.c
@@ -0,0 +1,3 @@
+#define WCSRCHR      __wcsrchr_power7
+#define WCSRCHR_ARCH "power7"
+#include <sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power6.c>
diff --git a/wcsmbs/wcsrchr.c b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr.c
similarity index 55%
copy from wcsmbs/wcsrchr.c
copy to sysdeps/powerpc/powerpc32/multiarch/wcsrchr.c
index 7c3bc96..0b06c28 100644
--- a/wcsmbs/wcsrchr.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcsrchr.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 1995-2013 Free Software Foundation, Inc.
+/* Multiple versions of wcsrchr
+   Copyright (C) 2013 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
-   Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu>
 
    The GNU C Library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -16,21 +16,21 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <wchar.h>
-
-
-/* Find the last occurrence of WC in WCS.  */
-wchar_t *
-wcsrchr (wcs, wc)
-     register const wchar_t *wcs;
-     register const wchar_t wc;
-{
-  const wchar_t *retval = NULL;
-
-  do
-    if (*wcs == wc)
-      retval = wcs;
-  while (*wcs++ != L'\0');
-
-  return (wchar_t *) retval;
-}
+#ifndef NOT_IN_libc
+# include <wchar.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (wcsrchr) __wcsrchr_ppc32 attribute_hidden;
+extern __typeof (wcsrchr) __wcsrchr_power6 attribute_hidden;
+extern __typeof (wcsrchr) __wcsrchr_power7 attribute_hidden;
+
+libc_ifunc (wcsrchr,
+	     (hwcap & PPC_FEATURE_HAS_VSX)
+             ? __wcsrchr_power7 :
+	       (hwcap & PPC_FEATURE_ARCH_2_05)
+	       ? __wcsrchr_power6
+             : __wcsrchr_ppc32);
+#else
+#include "wcsmbs/wcsrchr.c"
+#endif
diff --git a/wcsmbs/wcsrchr.c b/wcsmbs/wcsrchr.c
index 7c3bc96..78479c7 100644
--- a/wcsmbs/wcsrchr.c
+++ b/wcsmbs/wcsrchr.c
@@ -20,6 +20,10 @@
 
 
 /* Find the last occurrence of WC in WCS.  */
+#ifdef WCSRCHR
+# define wcsrchr WCSRCHR
+#endif
+
 wchar_t *
 wcsrchr (wcs, wc)
      register const wchar_t *wcs;

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=39facb2f8d5e4a5d9ed0ddb45bc4253c518e55a3

commit 39facb2f8d5e4a5d9ed0ddb45bc4253c518e55a3
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Mon Apr 8 19:32:56 2013 -0500

    PowerPC: wcschr ifunc for PowerPC32

diff --git a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
index faeef4a..b92152e 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/ifunc-impl-list.c
@@ -155,6 +155,16 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 			      __strchrnul_power7)
 	      IFUNC_IMPL_ADD (array, i, strchrnul, 1,
 			      __strchrnul_ppc32))
+
+  IFUNC_IMPL (i, name, wcschr,
+	      IFUNC_IMPL_ADD (array, i, wcschr,
+			      hwcap & PPC_FEATURE_HAS_VSX,
+			      __wcschr_power7)
+	      IFUNC_IMPL_ADD (array, i, wcschr,
+			      hwcap & PPC_FEATURE_ARCH_2_05,
+			      __wcschr_power6)
+	      IFUNC_IMPL_ADD (array, i, wcschr, 1,
+			      __wcschr_ppc32))
 #endif
 
   return i;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcschr-c.c b/sysdeps/powerpc/powerpc32/multiarch/wcschr-c.c
new file mode 100644
index 0000000..19396d5
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcschr-c.c
@@ -0,0 +1,14 @@
+#include <wchar.h>
+
+#ifndef NOT_IN_libc
+# ifdef SHARED
+#   undef libc_hidden_def
+#   define libc_hidden_def(name)  \
+    __hidden_ver1 (__wcschr_ppc32, __GI_wcschr, __wcschr_ppc32);
+# endif
+# define WCSCHR  __wcschr_ppc32
+#endif
+
+extern __typeof (wcschr) __wcschr_ppc32;
+
+#include "wcsmbs/wcschr.c"
diff --git a/sysdeps/powerpc/powerpc32/power6/wcschr.c b/sysdeps/powerpc/powerpc32/multiarch/wcschr-power6.c
similarity index 88%
rename from sysdeps/powerpc/powerpc32/power6/wcschr.c
rename to sysdeps/powerpc/powerpc32/multiarch/wcschr-power6.c
index a989877..e6b8118 100644
--- a/sysdeps/powerpc/powerpc32/power6/wcschr.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcschr-power6.c
@@ -18,12 +18,19 @@
 
 #include <wchar.h>
 
+#ifdef WCSCHR
+# define __wcschr_power6 WCSCHR
+#endif
+#ifndef WCSCHR_ARCH
+# define WCSCHR_ARCH "power6"
+#endif
+
+__typeof (wcschr) __wcschr_power6
+  __attribute__ ((__target__ ("cpu=" WCSCHR_ARCH)));
 
 /* Find the first occurrence of WC in WCS.  */
 wchar_t *
-wcschr (wcs, wc)
-     register const wchar_t *wcs;
-     register const wchar_t wc;
+__wcschr_power6 (register const wchar_t *wcs, register const wchar_t wc)
 {
   register const wchar_t *wcs2 = wcs + 1;
 
@@ -85,4 +92,3 @@ wcschr (wcs, wc)
 
   return NULL;
 }
-libc_hidden_def (wcschr)
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcschr-power7.c b/sysdeps/powerpc/powerpc32/multiarch/wcschr-power7.c
new file mode 100644
index 0000000..c573681
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcschr-power7.c
@@ -0,0 +1,3 @@
+#define WCSCHR      __wcschr_power7
+#define WCSCHR_ARCH "power7"
+#include <sysdeps/powerpc/powerpc32/multiarch/wcschr-power6.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wcschr.c b/sysdeps/powerpc/powerpc32/multiarch/wcschr.c
new file mode 100644
index 0000000..3c3e573
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wcschr.c
@@ -0,0 +1,36 @@
+/* Multiple versions of wcschr
+   Copyright (C) 2013 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/>.  */
+
+#ifndef NOT_IN_libc
+# include <wchar.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (wcschr) __wcschr_ppc32 attribute_hidden;
+extern __typeof (wcschr) __wcschr_power6 attribute_hidden;
+extern __typeof (wcschr) __wcschr_power7 attribute_hidden;
+
+libc_ifunc (wcschr,
+	     (hwcap & PPC_FEATURE_HAS_VSX)
+             ? __wcschr_power7 :
+	       (hwcap & PPC_FEATURE_ARCH_2_05)
+	       ? __wcschr_power6
+             : __wcschr_ppc32);
+#else
+#include "wcsmbs/wcschr.c"
+#endif

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e3fe5492234f7ad905e5f7dbd4fb3205d094d48b

commit e3fe5492234f7ad905e5f7dbd4fb3205d094d48b
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Mon Apr 8 15:22:43 2013 -0500

    PowerPC: wordcopy function ifunc for PowerPC32

diff --git a/string/wordcopy.c b/string/wordcopy.c
index 726894b..1bf271c 100644
--- a/string/wordcopy.c
+++ b/string/wordcopy.c
@@ -26,11 +26,12 @@
    block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
    Both SRCP and DSTP should be aligned for memory operations on `op_t's.  */
 
+#ifdef WORDCOPY_FWD_ALIGNED
+# define _wordcopy_fwd_aligned WORDCOPY_FWD_ALIGNED
+#endif
+
 void
-_wordcopy_fwd_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_fwd_aligned (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1;
 
@@ -134,11 +135,12 @@ _wordcopy_fwd_aligned (dstp, srcp, len)
    DSTP should be aligned for memory operations on `op_t's, but SRCP must
    *not* be aligned.  */
 
+#ifdef WORDCOPY_FWD_DEST_ALIGNED
+# define _wordcopy_fwd_dest_aligned WORDCOPY_FWD_DEST_ALIGNED
+#endif
+
 void
-_wordcopy_fwd_dest_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_fwd_dest_aligned (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1, a2, a3;
   int sh_1, sh_2;
@@ -221,11 +223,12 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len)
    (not LEN bytes!).  Both SRCP and DSTP should be aligned for memory
    operations on `op_t's.  */
 
+#ifdef WORDCOPY_BWD_ALIGNED
+# define _wordcopy_bwd_aligned WORDCOPY_BWD_ALIGNED
+#endif
+
 void
-_wordcopy_bwd_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_bwd_aligned (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1;
 
@@ -329,11 +332,12 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
    words (not LEN bytes!).  DSTP should be aligned for memory
    operations on `op_t', but SRCP must *not* be aligned.  */
 
+#ifdef WORDCOPY_BWD_DEST_ALIGNED
+# define _wordcopy_bwd_dest_aligned WORDCOPY_BWD_DEST_ALIGNED
+#endif
+
 void
-_wordcopy_bwd_dest_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_bwd_dest_aligned (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1, a2, a3;
   int sh_1, sh_2;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/Makefile b/sysdeps/powerpc/powerpc32/multiarch/Makefile
index c3a3c58..4fe9bd0 100644
--- a/sysdeps/powerpc/powerpc32/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc32/multiarch/Makefile
@@ -10,5 +10,8 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
 		   memchr-power7 memchr-c \
 		   memrchr-power7 memrchr-c \
 		   rawmemchr-power7 rawmemchr-c \
-		   strchrnul-power7 strchrnul-c
+		   strchrnul-power7 strchrnul-c \
+		   wordcopy-power7 wordcopy-power6 wordcopy-power5 \
+		   wordcopy-power4 wordcopy-c \
+		   wcschr-power7 wcschr-power6 wcschr-c
 endif
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy-c.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-c.c
new file mode 100644
index 0000000..bf2456e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-c.c
@@ -0,0 +1,5 @@
+#define WORDCOPY_FWD_ALIGNED      _wordcopy_fwd_aligned_ppc32
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_ppc32
+#define WORDCOPY_BWD_ALIGNED      _wordcopy_bwd_aligned_ppc32
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_ppc32
+#include <string/wordcopy.c>
diff --git a/sysdeps/powerpc/powerpc32/power4/wordcopy.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power4.c
similarity index 77%
rename from sysdeps/powerpc/powerpc32/power4/wordcopy.c
rename to sysdeps/powerpc/powerpc32/multiarch/wordcopy-power4.c
index 6dd0fa3..a9dfb06 100644
--- a/sysdeps/powerpc/powerpc32/power4/wordcopy.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power4.c
@@ -22,22 +22,30 @@
 #include <stddef.h>
 #include <memcopy.h>
 
+#ifndef WORDCOPY_ARCH
+# define WORDCOPY_ARCH "power4"
+#endif
+
 /* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
    block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
    Both SRCP and DSTP should be aligned for memory operations on `op_t's.  */
 
+#ifdef WORDCOPY_FWD_ALIGNED
+# define _wordcopy_fwd_aligned_power4 WORDCOPY_FWD_ALIGNED
+#endif
+
+__typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power4
+  __attribute__ ((__target__ ("cpu=" WORDCOPY_ARCH)));
+
 void
-_wordcopy_fwd_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_fwd_aligned_power4 (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1;
 
   if (len & 1)
   {
     ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
-    
+
     if (len == 1)
       return;
     srcp += OPSIZ;
@@ -64,11 +72,15 @@ _wordcopy_fwd_aligned (dstp, srcp, len)
    DSTP should be aligned for memory operations on `op_t's, but SRCP must
    *not* be aligned.  */
 
+#ifdef WORDCOPY_FWD_DEST_ALIGNED
+# define _wordcopy_fwd_dest_aligned_power4 WORDCOPY_FWD_DEST_ALIGNED
+#endif
+
+__typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power4
+  __attribute__ ((__target__ ("cpu=" WORDCOPY_ARCH)));
+
 void
-_wordcopy_fwd_dest_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_fwd_dest_aligned_power4 (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1, a2;
   int sh_1, sh_2;
@@ -88,10 +100,10 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len)
   {
     a1 = ((op_t *) srcp)[1];
     ((op_t *) dstp)[0] = MERGE (a0, sh_1, a1, sh_2);
-    
+
     if (len == 1)
       return;
-    
+
     a0 = a1;
     srcp += OPSIZ;
     dstp += OPSIZ;
@@ -118,11 +130,15 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len)
    (not LEN bytes!).  Both SRCP and DSTP should be aligned for memory
    operations on `op_t's.  */
 
+#ifdef WORDCOPY_BWD_ALIGNED
+# define _wordcopy_bwd_aligned_power4 WORDCOPY_BWD_ALIGNED
+#endif
+
+__typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power4
+  __attribute__ ((__target__ ("cpu=" WORDCOPY_ARCH)));
+
 void
-_wordcopy_bwd_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_bwd_aligned_power4 (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1;
 
@@ -131,7 +147,7 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
     srcp -= OPSIZ;
     dstp -= OPSIZ;
     ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
-    
+
     if (len == 1)
       return;
     len -= 1;
@@ -157,11 +173,15 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
    words (not LEN bytes!).  DSTP should be aligned for memory
    operations on `op_t', but SRCP must *not* be aligned.  */
 
+#ifdef WORDCOPY_BWD_DEST_ALIGNED
+# define _wordcopy_bwd_dest_aligned_power4 WORDCOPY_BWD_DEST_ALIGNED
+#endif
+
+__typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power4
+  __attribute__ ((__target__ ("cpu=" WORDCOPY_ARCH)));
+
 void
-_wordcopy_bwd_dest_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_bwd_dest_aligned_power4 (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1, a2;
   int sh_1, sh_2;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power5.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power5.c
new file mode 100644
index 0000000..1bf4ec4
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power5.c
@@ -0,0 +1,6 @@
+#define WORDCOPY_FWD_ALIGNED      _wordcopy_fwd_aligned_power5
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_power5
+#define WORDCOPY_BWD_ALIGNED      _wordcopy_bwd_aligned_power5
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_power5
+#define WORDCOPY_ARCH             "power5"
+#include <sysdeps/powerpc/powerpc32/multiarch/wordcopy-power4.c>
diff --git a/sysdeps/powerpc/powerpc32/power6/wordcopy.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power6.c
similarity index 82%
rename from sysdeps/powerpc/powerpc32/power6/wordcopy.c
rename to sysdeps/powerpc/powerpc32/multiarch/wordcopy-power6.c
index bcb6176..2721d74 100644
--- a/sysdeps/powerpc/powerpc32/power6/wordcopy.c
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power6.c
@@ -23,22 +23,30 @@
 #include <stddef.h>
 #include <memcopy.h>
 
+#ifndef WORDCOPY_ARCH
+# define WORDCOPY_ARCH "power6"
+#endif
+
 /* _wordcopy_fwd_aligned -- Copy block beginning at SRCP to
    block beginning at DSTP with LEN `op_t' words (not LEN bytes!).
    Both SRCP and DSTP should be aligned for memory operations on `op_t's.  */
 
+#ifdef WORDCOPY_FWD_ALIGNED
+# define _wordcopy_fwd_aligned_power6 WORDCOPY_FWD_ALIGNED
+#endif
+
+__typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power6
+  __attribute__ ((__target__ ("cpu=" WORDCOPY_ARCH)));
+
 void
-_wordcopy_fwd_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_fwd_aligned_power6 (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1;
 
   if (len & 1)
   {
     ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
-    
+
     if (len == 1)
       return;
     srcp += OPSIZ;
@@ -65,6 +73,10 @@ _wordcopy_fwd_aligned (dstp, srcp, len)
    DSTP should be aligned for memory operations on `op_t's, but SRCP must
    *not* be aligned.  */
 
+#ifdef WORDCOPY_FWD_DEST_ALIGNED
+# define _wordcopy_fwd_dest_aligned_power6 WORDCOPY_FWD_DEST_ALIGNED
+#endif
+
 #define fwd_align_merge(align)                                         \
   do                                                                   \
     {                                                                  \
@@ -79,11 +91,11 @@ _wordcopy_fwd_aligned (dstp, srcp, len)
     }                                                                  \
   while (len != 0)
 
+__typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power6
+  __attribute__ ((__target__ ("cpu=" WORDCOPY_ARCH)));
+
 void
-_wordcopy_fwd_dest_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_fwd_dest_aligned_power6 (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1, a2;
   int sh_1, sh_2;
@@ -105,10 +117,10 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len)
   {
     a1 = ((op_t *) srcp)[1];
     ((op_t *) dstp)[0] = MERGE (a0, sh_1, a1, sh_2);
-    
+
     if (len == 1)
       return;
-    
+
     a0 = a1;
     srcp += OPSIZ;
     dstp += OPSIZ;
@@ -124,11 +136,15 @@ _wordcopy_fwd_dest_aligned (dstp, srcp, len)
    (not LEN bytes!).  Both SRCP and DSTP should be aligned for memory
    operations on `op_t's.  */
 
+#ifdef WORDCOPY_BWD_ALIGNED
+# define _wordcopy_bwd_aligned_power6 WORDCOPY_BWD_ALIGNED
+#endif
+
+__typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power6
+  __attribute__ ((__target__ ("cpu=" WORDCOPY_ARCH)));
+
 void
-_wordcopy_bwd_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_bwd_aligned_power6 (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1;
 
@@ -137,7 +153,7 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
     srcp -= OPSIZ;
     dstp -= OPSIZ;
     ((op_t *) dstp)[0] = ((op_t *) srcp)[0];
-    
+
     if (len == 1)
       return;
     len -= 1;
@@ -158,6 +174,16 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
   while (len != 0);
 }
 
+
+/* _wordcopy_bwd_dest_aligned -- Copy block finishing right
+   before SRCP to block finishing right before DSTP with LEN `op_t'
+   words (not LEN bytes!).  DSTP should be aligned for memory
+   operations on `op_t', but SRCP must *not* be aligned.  */
+
+#ifdef WORDCOPY_BWD_DEST_ALIGNED
+# define _wordcopy_bwd_dest_aligned_power6 WORDCOPY_BWD_DEST_ALIGNED
+#endif
+
 #define bwd_align_merge(align)                                         \
   do                                                                   \
     {                                                                  \
@@ -172,16 +198,11 @@ _wordcopy_bwd_aligned (dstp, srcp, len)
     }                                                                  \
   while (len != 0)
 
-/* _wordcopy_bwd_dest_aligned -- Copy block finishing right
-   before SRCP to block finishing right before DSTP with LEN `op_t'
-   words (not LEN bytes!).  DSTP should be aligned for memory
-   operations on `op_t', but SRCP must *not* be aligned.  */
+__typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power6
+  __attribute__ ((__target__ ("cpu=" WORDCOPY_ARCH)));
 
 void
-_wordcopy_bwd_dest_aligned (dstp, srcp, len)
-     long int dstp;
-     long int srcp;
-     size_t len;
+_wordcopy_bwd_dest_aligned_power6 (long int dstp, long int srcp, size_t len)
 {
   op_t a0, a1, a2;
   int sh_1, sh_2;
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power7.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power7.c
new file mode 100644
index 0000000..60fe8f8
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy-power7.c
@@ -0,0 +1,6 @@
+#define WORDCOPY_FWD_ALIGNED      _wordcopy_fwd_aligned_power7
+#define WORDCOPY_FWD_DEST_ALIGNED _wordcopy_fwd_dest_aligned_power7
+#define WORDCOPY_BWD_ALIGNED      _wordcopy_bwd_aligned_power7
+#define WORDCOPY_BWD_DEST_ALIGNED _wordcopy_bwd_dest_aligned_power7
+#define WORDCOPY_ARCH             "power7"
+#include <sysdeps/powerpc/powerpc32/multiarch/wordcopy-power6.c>
diff --git a/sysdeps/powerpc/powerpc32/multiarch/wordcopy.c b/sysdeps/powerpc/powerpc32/multiarch/wordcopy.c
new file mode 100644
index 0000000..17e4e4e
--- /dev/null
+++ b/sysdeps/powerpc/powerpc32/multiarch/wordcopy.c
@@ -0,0 +1,118 @@
+/* Multiple versions of memchr.
+   Copyright (C) 2013 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/>.  */
+
+#ifndef NOT_IN_libc
+# include <stddef.h>
+# include <memcopy.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
+
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_ppc32
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_aligned) _wordcopy_fwd_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_fwd_aligned,
+            (hwcap & PPC_FEATURE_HAS_VSX)
+            ? _wordcopy_fwd_aligned_power7 :
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
+              ? _wordcopy_fwd_aligned_power6 :
+		(hwcap & PPC_FEATURE_POWER5)
+		? _wordcopy_fwd_aligned_power5 :
+		  (hwcap & PPC_FEATURE_POWER4)
+	          ? _wordcopy_fwd_aligned_power4
+            : _wordcopy_fwd_aligned_ppc32);
+
+
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_ppc32
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_fwd_dest_aligned) _wordcopy_fwd_dest_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_fwd_dest_aligned,
+            (hwcap & PPC_FEATURE_HAS_VSX)
+            ? _wordcopy_fwd_dest_aligned_power7 :
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
+              ? _wordcopy_fwd_dest_aligned_power6 :
+		(hwcap & PPC_FEATURE_POWER5)
+		? _wordcopy_fwd_dest_aligned_power5 :
+		  (hwcap & PPC_FEATURE_POWER4)
+	          ? _wordcopy_fwd_dest_aligned_power4
+            : _wordcopy_fwd_dest_aligned_ppc32);
+
+
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_ppc32
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_aligned) _wordcopy_bwd_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_bwd_aligned,
+            (hwcap & PPC_FEATURE_HAS_VSX)
+            ? _wordcopy_bwd_aligned_power7 :
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
+              ? _wordcopy_bwd_aligned_power6 :
+		(hwcap & PPC_FEATURE_POWER5)
+		? _wordcopy_bwd_aligned_power5 :
+		  (hwcap & PPC_FEATURE_POWER4)
+	          ? _wordcopy_bwd_aligned_power4
+            : _wordcopy_bwd_aligned_ppc32);
+
+
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_ppc32
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power4
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power5
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power6
+attribute_hidden;
+extern __typeof (_wordcopy_bwd_dest_aligned) _wordcopy_bwd_dest_aligned_power7
+attribute_hidden;
+
+libc_ifunc (_wordcopy_bwd_dest_aligned,
+            (hwcap & PPC_FEATURE_HAS_VSX)
+            ? _wordcopy_bwd_dest_aligned_power7 :
+	      (hwcap & PPC_FEATURE_ARCH_2_05)
+              ? _wordcopy_bwd_dest_aligned_power6 :
+		(hwcap & PPC_FEATURE_POWER5)
+		? _wordcopy_bwd_dest_aligned_power5 :
+		  (hwcap & PPC_FEATURE_POWER4)
+	          ? _wordcopy_bwd_dest_aligned_power4
+            : _wordcopy_bwd_dest_aligned_ppc32);
+
+#else
+#include "string/wordcopy.c"
+#endif

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   34 ++--
 string/wordcopy.c                                  |   36 ++--
 sysdeps/powerpc/powerpc32/multiarch/Makefile       |   11 +-
 .../powerpc/powerpc32/multiarch/ifunc-impl-list.c  |   36 +++
 sysdeps/powerpc/powerpc32/multiarch/strcasecmp.c   |   16 +-
 sysdeps/powerpc/powerpc32/multiarch/strcasecmp_l.c |   18 +--
 .../powerpc/powerpc32/multiarch/strncase-power7.c  |    7 +
 sysdeps/powerpc/powerpc32/multiarch/strncase.c     |   41 ++++
 .../powerpc32/multiarch/strncase_l-power7.c        |    8 +
 sysdeps/powerpc/powerpc32/multiarch/strncase_l.c   |   42 ++++
 sysdeps/powerpc/powerpc32/multiarch/wcschr-c.c     |   14 ++
 .../powerpc/powerpc32/multiarch/wcschr-power6.c    |   94 ++++++++
 .../powerpc/powerpc32/multiarch/wcschr-power7.c    |    3 +
 sysdeps/powerpc/powerpc32/multiarch/wcschr.c       |   36 +++
 sysdeps/powerpc/powerpc32/multiarch/wcscpy-c.c     |    9 +
 .../powerpc/powerpc32/multiarch/wcscpy-power6.c    |  111 +++++++++
 .../powerpc/powerpc32/multiarch/wcscpy-power7.c    |    3 +
 sysdeps/powerpc/powerpc32/multiarch/wcscpy.c       |   36 +++
 sysdeps/powerpc/powerpc32/multiarch/wcsrchr-c.c    |    9 +
 .../powerpc/powerpc32/multiarch/wcsrchr-power6.c   |   95 ++++++++
 .../powerpc/powerpc32/multiarch/wcsrchr-power7.c   |    3 +
 sysdeps/powerpc/powerpc32/multiarch/wcsrchr.c      |   36 +++
 sysdeps/powerpc/powerpc32/multiarch/wordcopy-c.c   |    5 +
 .../powerpc/powerpc32/multiarch/wordcopy-power4.c  |  228 +++++++++++++++++++
 .../powerpc/powerpc32/multiarch/wordcopy-power5.c  |    6 +
 .../powerpc/powerpc32/multiarch/wordcopy-power6.c  |  238 ++++++++++++++++++++
 .../powerpc/powerpc32/multiarch/wordcopy-power7.c  |    6 +
 sysdeps/powerpc/powerpc32/multiarch/wordcopy.c     |  118 ++++++++++
 sysdeps/powerpc/powerpc32/power4/wordcopy.c        |  208 -----------------
 sysdeps/powerpc/powerpc32/power6/wcschr.c          |   88 -------
 sysdeps/powerpc/powerpc32/power6/wcscpy.c          |  104 ---------
 sysdeps/powerpc/powerpc32/power6/wcsrchr.c         |   88 -------
 sysdeps/powerpc/powerpc32/power6/wordcopy.c        |  217 ------------------
 sysdeps/powerpc/powerpc32/power7/Makefile          |    4 -
 wcsmbs/wcscpy.c                                    |    4 +
 wcsmbs/wcsrchr.c                                   |    4 +
 36 files changed, 1245 insertions(+), 771 deletions(-)
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/strncase-power7.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/strncase.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/strncase_l-power7.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/strncase_l.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcschr-c.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcschr-power6.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcschr-power7.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcschr.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcscpy-c.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcscpy-power6.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcscpy-power7.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcscpy.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcsrchr-c.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power6.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcsrchr-power7.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wcsrchr.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wordcopy-c.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wordcopy-power4.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wordcopy-power5.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wordcopy-power6.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wordcopy-power7.c
 create mode 100644 sysdeps/powerpc/powerpc32/multiarch/wordcopy.c
 delete mode 100644 sysdeps/powerpc/powerpc32/power4/wordcopy.c
 delete mode 100644 sysdeps/powerpc/powerpc32/power6/wcschr.c
 delete mode 100644 sysdeps/powerpc/powerpc32/power6/wcscpy.c
 delete mode 100644 sysdeps/powerpc/powerpc32/power6/wcsrchr.c
 delete mode 100644 sysdeps/powerpc/powerpc32/power6/wordcopy.c
 delete mode 100644 sysdeps/powerpc/powerpc32/power7/Makefile


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]