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 ibm/2.19/master updated. glibc-2.19-14-ga52b3f7


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, ibm/2.19/master has been updated
       via  a52b3f7e4c4de8705370adda4b390293780dc768 (commit)
       via  09e09c2872ab52c8a42b907105343520019ca1d1 (commit)
       via  f510d35c58d16c32ce988d053c9a525b8e38fe47 (commit)
       via  afd75351c2f3cae4a2daf88c50faad889e3a0f2b (commit)
      from  e5829d82c88117c9f4752cedfefc8516cb9ffdf7 (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=a52b3f7e4c4de8705370adda4b390293780dc768

commit a52b3f7e4c4de8705370adda4b390293780dc768
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Wed Mar 12 08:55:50 2014 -0500

    PowerPC: Fix bzero definition for static libc for PPC32
    
    This patch fixes an issue for powerpc32-fpu static build which fails
    with an 'bzero' undefined reference. This patch adds bzero ifunc selector
    for static builds and fixes the '__bzero_ppc' reference to default
    memset symbol (since static memset build does not provide ifunc
    selector).
    
    Fixes BZ#16689.
    
    Backport of dd3946c615184e1957a0cb09352cac72be5d6d5b.

diff --git a/ChangeLog b/ChangeLog
index 93a4ddf..61b22d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2014-03-12  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
+	[BZ #16689]
+	* sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
+	(__bzero_ppc): Call memset@local instead of __memset_ppc@local for
+	static build.
+	* sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c: Build IFUNC
+	selector for static builds.
+
+2014-03-12  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
 	* sysdeps/powerpc/powerpc64/multiarch/strspn.c (strspn): Build IFUNC
 	selector for static builds.
 
diff --git a/NEWS b/NEWS
index fbd56f6..886624a 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.19.1
 
 * The following bugs are resolved with this release:
 
-  16545, 16683.
+  16545, 16683, 16689.
 
 Version 2.19
 
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
index 7a7cca9..80a2dc5 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero-ppc32.S
@@ -19,8 +19,17 @@
 
 #include <sysdep.h>
 
+/* memset ifunc selector is not built for static and memset@local
+   for shared builds makes the linker point the call to the ifunc
+   selector.  */
+#ifdef SHARED
+# define MEMSET __memset_ppc
+#else
+# define MEMSET memset
+#endif
+
 ENTRY (__bzero_ppc)
         mr      r5,r4
         li      r4,0
-        b       __memset_ppc@local
+        b       MEMSET@local
 END (__bzero_ppc)
diff --git a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
index 2a6298a..baaa6b4 100644
--- a/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
+++ b/sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c
@@ -17,7 +17,7 @@
    <http://www.gnu.org/licenses/>.  */
 
 /* Define multiple versions only for definition in libc.  */
-#if defined SHARED && !defined NOT_IN_libc
+#ifndef NOT_IN_libc
 # include <string.h>
 # include <strings.h>
 # include "init-arch.h"

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

commit 09e09c2872ab52c8a42b907105343520019ca1d1
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Tue Mar 11 16:17:50 2014 -0500

    PowerPC: Fix strspn for static build
    
    This patch makes the strspn ifunc selector build for static builds.
    
    This is a backport of 27c7220a483bda576533aa9a0a9b42175644b1a1

diff --git a/ChangeLog b/ChangeLog
index f971a03..93a4ddf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-03-12  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/powerpc64/multiarch/strspn.c (strspn): Build IFUNC
+	selector for static builds.
+
 2014-03-11  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
 	[BZ #16683]
diff --git a/sysdeps/powerpc/powerpc64/multiarch/strspn.c b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
index 44945f3..bf8c877 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/strspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
@@ -16,7 +16,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#if defined SHARED && !defined NOT_IN_libc
+#ifndef NOT_IN_libc
 # include <string.h>
 # include <shlib-compat.h>
 # include "init-arch.h"

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

commit f510d35c58d16c32ce988d053c9a525b8e38fe47
Author: Adhemerval Zanella <azanella@linux.vnet.ibm.com>
Date:   Mon Mar 10 15:26:20 2014 -0500

    PowerPC: Fix bzero definition for static libc for PPC64
    
    This patch fixes an issue for powerpc64[le] static build where __bzero
    is definied in multiple places (memset-ppc64.o and bzero.o). It is now
    defined only in bzero.o and memset-ppc64.o only defined __bzero_ppc for
    both dynamic and static library.
    
    Fixes BZ#16683.
    
    Backport of 4facea473059914983b7da8dd654c06b8e3dcc41

diff --git a/ChangeLog b/ChangeLog
index ce9bd4c..f971a03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-03-11  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+	[BZ #16683]
+	* sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S (__bzero_ppc):
+	Define it for static builds as well.
+	(NO_BZERO_IMPL): Likewise.
+
 2014-03-11  Vidya Ranganathan  <vidya@linux.vnet.ibm.com>
 
 	* sysdeps/powerpc/powerpc64/power7/strspn.S: New file: Optimization.
diff --git a/NEWS b/NEWS
index 7b52f1f..fbd56f6 100644
--- a/NEWS
+++ b/NEWS
@@ -9,7 +9,7 @@ Version 2.19.1
 
 * The following bugs are resolved with this release:
 
-  16545.
+  16545, 16683.
 
 Version 2.19
 
diff --git a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
index 5b234d9..65b3afe 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
+++ b/sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S
@@ -18,10 +18,9 @@
 
 #include <sysdep.h>
 
-#if defined SHARED && !defined NOT_IN_libc
-
 /* Copied from bzero.S to prevent the linker from inserting a stub
-   between bzero and memset.  */
+   between bzero and memset.  NOTE: this code should be positioned
+   before ENTRY/END_GEN_TB redefinition.  */
 ENTRY (__bzero_ppc)
         CALL_MCOUNT 3
         mr      r5,r4
@@ -29,6 +28,8 @@ ENTRY (__bzero_ppc)
         b       L(_memset)
 END_GEN_TB (__bzero_ppc,TB_TOCLESS)
 
+
+#if defined SHARED && !defined NOT_IN_libc
 # undef EALIGN
 # define EALIGN(name, alignt, words)				\
   .section ".text";						\
@@ -48,9 +49,9 @@ END_GEN_TB (__bzero_ppc,TB_TOCLESS)
 # undef libc_hidden_builtin_def
 # define libc_hidden_builtin_def(name)				\
   .globl __GI_memset; __GI_memset = __memset_ppc
+#endif
 
 /* Do not implement __bzero at powerpc64/memset.S.  */
-# define NO_BZERO_IMPL
-#endif
+#define NO_BZERO_IMPL
 
 #include <sysdeps/powerpc/powerpc64/memset.S>

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

commit afd75351c2f3cae4a2daf88c50faad889e3a0f2b
Author: Vidya Ranganathan <vidya@linux.vnet.ibm.com>
Date:   Mon Mar 10 12:20:36 2014 -0400

    PowerPC: strspn optimization for PPC64/POWER7
    
    The optimization is achieved by following techniques:
      > hashing of needle.
      > hashing avoids scanning of duplicate entries in needle across the string.
      > initializing the hash table with Vector instructions (VSX) by quadword access.
      > unrolling when scanning for character in string across hash table.

diff --git a/ChangeLog b/ChangeLog
index fbca13e..ce9bd4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2014-03-11  Vidya Ranganathan  <vidya@linux.vnet.ibm.com>
+
+	* sysdeps/powerpc/powerpc64/power7/strspn.S: New file: Optimization.
+	* sysdeps/powerpc/powerpc64/multiarch/strspn.c: New file:
+	multiarch strspn for PPC64.
+	* sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c: New file
+	* sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S: New file
+	* sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c:
+	(__libc_ifunc_impl_list): Likewise.
+	* sysdeps/powerpc/powerpc64/multiarch/Makefile: Add strspn
+	multiarch optimizations
+	* string/strspn.c (strspn): Using macro to redefine symbol name.
+
 2014-03-10  Vidya Ranganathan  <vidya@linux.vnet.ibm.com>
 	    Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
diff --git a/string/strspn.c b/string/strspn.c
index 37e8161..c2d6364 100644
--- a/string/strspn.c
+++ b/string/strspn.c
@@ -18,13 +18,14 @@
 #include <string.h>
 
 #undef strspn
+#ifndef STRSPN
+#define STRSPN strspn
+#endif
 
 /* Return the length of the maximum initial segment
    of S which contains only characters in ACCEPT.  */
 size_t
-strspn (s, accept)
-     const char *s;
-     const char *accept;
+STRSPN (const char *s, const char *accept)
 {
   const char *p;
   const char *a;
diff --git a/sysdeps/powerpc/powerpc64/multiarch/Makefile b/sysdeps/powerpc/powerpc64/multiarch/Makefile
index a03569e..3e8010c 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/Makefile
+++ b/sysdeps/powerpc/powerpc64/multiarch/Makefile
@@ -14,7 +14,8 @@ sysdep_routines += memcpy-power7 memcpy-a2 memcpy-power6 memcpy-cell \
 		   wcsrchr-ppc64 wcscpy-power7 wcscpy-power6 wcscpy-ppc64 \
 		   wordcopy-power7 wordcopy-power6 wordcopy-ppc64 \
 		   strcpy-power7 strcpy-ppc64 stpcpy-power7 stpcpy-ppc64 \
-		   strrchr-power7 strrchr-ppc64 strncat-power7 strncat-ppc64
+		   strrchr-power7 strrchr-ppc64 strncat-power7 strncat-ppc64 \
+		   strspn-power7 strspn-ppc64
 
 CFLAGS-strncase-power7.c += -mcpu=power7 -funroll-loops
 CFLAGS-strncase_l-power7.c += -mcpu=power7 -funroll-loops
diff --git a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
index 11a3bed..20d7918 100644
--- a/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/ifunc-impl-list.c
@@ -254,5 +254,13 @@ __libc_ifunc_impl_list (const char *name, struct libc_ifunc_impl *array,
 	      IFUNC_IMPL_ADD (array, i, strncat, 1,
 			      __strncat_ppc))
 
+  /* Support sysdeps/powerpc/powerpc64/multiarch/strspn.c.  */
+  IFUNC_IMPL (i, name, strspn,
+	      IFUNC_IMPL_ADD (array, i, strspn,
+			      hwcap & PPC_FEATURE_HAS_VSX,
+			      __strspn_power7)
+	      IFUNC_IMPL_ADD (array, i, strspn, 1,
+			      __strspn_ppc))
+
   return i;
 }
diff --git a/string/strspn.c b/sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S
similarity index 53%
copy from string/strspn.c
copy to sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S
index 37e8161..889dfee 100644
--- a/string/strspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
+/* Optimized strspn implementation for POWER7.
+   Copyright (C) 2014 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
@@ -15,32 +16,25 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
-
-#undef strspn
-
-/* Return the length of the maximum initial segment
-   of S which contains only characters in ACCEPT.  */
-size_t
-strspn (s, accept)
-     const char *s;
-     const char *accept;
-{
-  const char *p;
-  const char *a;
-  size_t count = 0;
-
-  for (p = s; *p != '\0'; ++p)
-    {
-      for (a = accept; *a != '\0'; ++a)
-	if (*p == *a)
-	  break;
-      if (*a == '\0')
-	return count;
-      else
-	++count;
-    }
-
-  return count;
-}
-libc_hidden_builtin_def (strspn)
+#include <sysdep.h>
+
+#undef EALIGN
+#define EALIGN(name, alignt, words)				\
+  .section ".text";						\
+  ENTRY_2(__strspn_power7)					\
+  .align ALIGNARG(alignt);					\
+  EALIGN_W_##words;						\
+  BODY_LABEL(__strspn_power7):					\
+  cfi_startproc;						\
+  LOCALENTRY(__strspn_power7)
+
+#undef END
+#define END(name)						\
+  cfi_endproc;							\
+  TRACEBACK(__strspn_power7)					\
+  END_2(__strspn_power7)
+
+#undef libc_hidden_builtin_def
+#define libc_hidden_builtin_def(name)
+
+#include <sysdeps/powerpc/powerpc64/power7/strspn.S>
diff --git a/string/strspn.c b/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
similarity index 59%
copy from string/strspn.c
copy to sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
index 37e8161..d543772 100644
--- a/string/strspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
+/* Copyright (C) 2014 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
@@ -17,30 +17,17 @@
 
 #include <string.h>
 
-#undef strspn
+#define STRSPN __strspn_ppc
+#undef weak_alias
+#define weak_alias(name, aliasname) \
+  extern __typeof (__strspn_ppc) aliasname \
+    __attribute__ ((weak, alias ("__strspn_ppc")));
+#if !defined(NOT_IN_libc) && defined(SHARED)
+# undef libc_hidden_builtin_def
+# define libc_hidden_builtin_def(name) \
+  __hidden_ver1(__strspn_ppc, __GI_strspn, __strspn_ppc);
+#endif
 
-/* Return the length of the maximum initial segment
-   of S which contains only characters in ACCEPT.  */
-size_t
-strspn (s, accept)
-     const char *s;
-     const char *accept;
-{
-  const char *p;
-  const char *a;
-  size_t count = 0;
+extern __typeof (strspn) __strspn_ppc attribute_hidden;
 
-  for (p = s; *p != '\0'; ++p)
-    {
-      for (a = accept; *a != '\0'; ++a)
-	if (*p == *a)
-	  break;
-      if (*a == '\0')
-	return count;
-      else
-	++count;
-    }
-
-  return count;
-}
-libc_hidden_builtin_def (strspn)
+#include <string/strspn.c>
diff --git a/string/strspn.c b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
similarity index 57%
copy from string/strspn.c
copy to sysdeps/powerpc/powerpc64/multiarch/strspn.c
index 37e8161..44945f3 100644
--- a/string/strspn.c
+++ b/sysdeps/powerpc/powerpc64/multiarch/strspn.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991-2014 Free Software Foundation, Inc.
+/* Multiple versions of strspn. PowerPC64 version.
+   Copyright (C) 2014 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
@@ -15,32 +16,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <string.h>
+#if defined SHARED && !defined NOT_IN_libc
+# include <string.h>
+# include <shlib-compat.h>
+# include "init-arch.h"
 
-#undef strspn
+extern __typeof (strspn) __strspn_ppc attribute_hidden;
+extern __typeof (strspn) __strspn_power7 attribute_hidden;
 
-/* Return the length of the maximum initial segment
-   of S which contains only characters in ACCEPT.  */
-size_t
-strspn (s, accept)
-     const char *s;
-     const char *accept;
-{
-  const char *p;
-  const char *a;
-  size_t count = 0;
-
-  for (p = s; *p != '\0'; ++p)
-    {
-      for (a = accept; *a != '\0'; ++a)
-	if (*p == *a)
-	  break;
-      if (*a == '\0')
-	return count;
-      else
-	++count;
-    }
-
-  return count;
-}
-libc_hidden_builtin_def (strspn)
+libc_ifunc (strspn,
+            (hwcap & PPC_FEATURE_HAS_VSX)
+            ? __strspn_power7
+            : __strspn_ppc);
+#endif
diff --git a/sysdeps/powerpc/powerpc64/power7/strspn.S b/sysdeps/powerpc/powerpc64/power7/strspn.S
new file mode 100644
index 0000000..d587a67
--- /dev/null
+++ b/sysdeps/powerpc/powerpc64/power7/strspn.S
@@ -0,0 +1,165 @@
+/* Optimized strspn implementation for PowerPC64/POWER7.
+
+   Copyright (C) 2014 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/>.  */
+
+/* size_t [r3] strspn (const char *string [r3],
+                       const char *needleAccept [r4]  */
+
+/* Performance gains are grabbed through following techniques:
+
+   > hashing of needle.
+   > hashing avoids scanning of duplicate entries in needle
+     across the string.
+   > initializing the hash table with Vector instructions
+     by quadword access.
+   > unrolling when scanning for character in string
+     across hash table.  */
+
+/* Algorithm is as below:
+   1. A empty hash table/dictionary is created comprising of
+      256 ascii character set
+   2. When hash entry is found in needle , the hash index
+      is initialized to 1
+   3. The string is scanned until end and for every character,
+      its corresponding hash index is compared.
+   4. initial length of string (count) until first hit of
+      accept needle to be found is set to 0
+   4. If hash index is set to 1 for the index of string,
+      count is returned.
+   5. Otherwise count is incremented and scanning continues
+      until end of string.  */
+
+#include <sysdep.h>
+
+#undef strspn
+
+	.machine  power7
+EALIGN(strspn, 4, 0)
+	CALL_MCOUNT 2
+
+	lbz r10, 0(r4)		/* load r10 with needle (r4)  */
+	addi r9, r1, -256	/* r9 is a hash of 256 bytes  */
+
+	li r5, 16		/* set r5 = 16 as offset  */
+	li r6, 32		/* set r6 = 32 as offset  */
+	li r8, 48		/* set r8 = 48 as offset  */
+
+/*Iniatliaze hash table with Zeroes in double indexed quadword accesses  */
+	xxlxor v0, v0, v0	/* prepare for initializing hash  */
+
+	stxvd2x v0, r0, r9	/* initialize 1st quadword  */
+	stxvd2x v0, r9, r5
+	stxvd2x v0, r9, r6
+	stxvd2x v0, r9, r8	/* initialize 4th quadword  */
+
+	addi r11, r9, 64	/* r11 is index to hash  */
+
+	stxvd2x v0, r0, r11	/* initialize 5th quadword  */
+	stxvd2x v0, r11, r5
+	stxvd2x v0, r11, r6
+	stxvd2x v0, r11, r8	/* initialize 8th quadword  */
+
+	addi r11, r9, 128	/* r11 is index to hash  */
+
+	stxvd2x v0, r0, r11	/* initialize 9th quadword  */
+	stxvd2x v0, r11, r5
+	stxvd2x v0, r11, r6
+	stxvd2x v0, r11, r8	/* initialize 12th quadword  */
+
+	addi r11, r9, 192	/* r11 is index to hash  */
+
+	stxvd2x v0, r0, r11	/* initialize 13th quadword  */
+	stxvd2x v0, r11, r5
+	stxvd2x v0, r11, r6
+	stxvd2x v0, r11, r8	/* initialize 16th quadword  */
+
+	li r8, 1		/* r8=1, marker into hash if found in
+				   needle  */
+
+	cmpdi cr7, r10, 0	/* accept needle is NULL  */
+	beq cr7, L(skipHashing)	/* if needle is NULL, skip hashing  */
+
+	.p2align 4		/* align section to 16 byte boundary  */
+L(hashing):
+	stbx r8, r9, r10	/* update hash with marker for the pivot of
+				   the needle  */
+	lbzu r10, 1(r4)		/* load needle into r10 and update to next  */
+	cmpdi cr7, r10, 0	/* if needle is has reached NULL, continue  */
+	bne cr7, L(hashing)	/* loop to hash the needle  */
+
+L(skipHashing):
+	li r10, 0		/* load counter = 0  */
+	b L(beginScan)
+
+	.p2align 4		/* align section to 16 byte boundary  */
+L(scanUnroll):
+	lbzx r8, r9, r8		/* load r8 with hash value at index  */
+	cmpwi cr7, r8, 0	/* if we hit marker in hash, we have found
+				   accept needle  */
+	beq cr7, L(ret1stIndex)	/* we have hit accept needle, return the
+				   count  */
+
+	lbz r8, 1(r3)		/* load string[1] into r8  */
+	addi r10, r10, 4	/* increment counter  */
+	lbzx r8, r9, r8		/* load r8 with hash value at index  */
+	cmpwi cr7, r8, 0	/* if we hit marker in hash, we have found
+				   accept needle  */
+	beq cr7, L(ret2ndIndex)	/* we have hit accept needle, return the
+				   count  */
+
+	lbz r8, 2(r3)		/* load string[2] into r8  */
+	lbzx r8, r9, r8		/* load r8 with hash value at index  */
+	cmpwi cr7, r8, 0	/* if we hit marker in hash, we have found
+				   accept needle  */
+	beq cr7, L(ret3rdIndex)	/* we have hit accept needle, return the
+				   count  */
+
+	lbz r8, 3(r3)		/* load string[3] into r8  */
+	lbzx r8, r9, r8		/* load r8 with hash value at index  */
+	addi r3, r3, 4		/* unroll factor , increment string by 4  */
+	cmpwi cr7, r8, 0	/* if we hit marker in hash, we have found
+				   accept needle  */
+	beq cr7,L(ret4thIndex)	/* we have hit accept needle, return the
+				   count  */
+
+L(beginScan):
+	lbz r8, 0(r3)		/* load string[0] into r8  */
+	addi r6, r10, 1		/* place holder for counter + 1  */
+	addi r5, r10, 2		/* place holder for counter + 2  */
+	addi r4, r10, 3		/* place holder for counter + 3  */
+	cmpdi cr7, r8, 0	/* if we hit marker in hash, we have found
+				   accept needle  */
+	bne cr7, L(scanUnroll)	/* continue scanning  */
+
+L(ret1stIndex):
+	mr r3, r10		/* update r3 for return  */
+	blr			/* return  */
+
+L(ret2ndIndex):
+	mr r3, r6		/* update r3 for return  */
+	blr			/* return  */
+
+L(ret3rdIndex):
+	mr r3, r5		/* update r3 for return  */
+	blr			/* return  */
+
+L(ret4thIndex):
+	mr r3, r4		/* update r3 for return  */
+	blr			/* done  */
+END(strspn)
+libc_hidden_builtin_def (strspn)

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

Summary of changes:
 ChangeLog                                          |   34 ++++
 NEWS                                               |    2 +-
 string/strspn.c                                    |    7 +-
 .../powerpc32/power4/multiarch/bzero-ppc32.S       |   11 ++-
 sysdeps/powerpc/powerpc32/power4/multiarch/bzero.c |    2 +-
 sysdeps/powerpc/powerpc64/multiarch/Makefile       |    3 +-
 .../powerpc/powerpc64/multiarch/ifunc-impl-list.c  |    8 +
 sysdeps/powerpc/powerpc64/multiarch/memset-ppc64.S |   11 +-
 .../powerpc/powerpc64/multiarch/strspn-power7.S    |   40 +++++
 sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c |   33 ++++
 sysdeps/powerpc/powerpc64/multiarch/strspn.c       |   31 ++++
 sysdeps/powerpc/powerpc64/power7/strspn.S          |  165 ++++++++++++++++++++
 12 files changed, 335 insertions(+), 12 deletions(-)
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strspn-power7.S
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strspn-ppc64.c
 create mode 100644 sysdeps/powerpc/powerpc64/multiarch/strspn.c
 create mode 100644 sysdeps/powerpc/powerpc64/power7/strspn.S


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]