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 master updated. glibc-2.25-42-gf7db120


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  f7db120f67d853e0cfa272fa39c8b9be67c0a935 (commit)
      from  3172b27b2b3b0033e85ddf3566c7533a8f3b4bda (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=f7db120f67d853e0cfa272fa39c8b9be67c0a935

commit f7db120f67d853e0cfa272fa39c8b9be67c0a935
Author: Wilco Dijkstra <wdijkstr@arm.com>
Date:   Wed Feb 15 15:23:52 2017 +0000

    Remove the str(n)cmp inlines from string/bits/string2.h.  The strncmp
    optimization seems unlikely to ever be useful, but if it occurs in
    real code it should be added to GCC.  Expanding strcmp of small strings
    does appear useful (benchmarking shows it is 2-3x faster), so this would
    be useful to implement in GCC (PR 78809).
    
    	* string/bits/string2.h (strcmp): Remove define.
    	(__strcmp_cg): Likewise.
    	(strncmp): Likewise.

diff --git a/ChangeLog b/ChangeLog
index caf784e..3bc23fe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2017-02-15  Wilco Dijkstra  <wdijkstr@arm.com>
 
+	* string/bits/string2.h (strcmp): Remove define.
+	(__strcmp_cg): Likewise.
+	(strncmp): Likewise.
+
+2017-02-15  Wilco Dijkstra  <wdijkstr@arm.com>
+
 	* include/string.h: Add __cplusplus check.
 
 2017-02-15  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
diff --git a/string/bits/string2.h b/string/bits/string2.h
index 8b138a2..2d4eb41 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -92,64 +92,6 @@
 #endif
 
 
-/* Compare characters of S1 and S2.  */
-#ifndef _HAVE_STRING_ARCH_strcmp
-# define strcmp(s1, s2) \
-  __extension__								      \
-  ({ size_t __s1_len, __s2_len;						      \
-     (__builtin_constant_p (s1) && __builtin_constant_p (s2)		      \
-      && (__s1_len = strlen (s1), __s2_len = strlen (s2),		      \
-	  (!__string2_1bptr_p (s1) || __s1_len >= 4)			      \
-	  && (!__string2_1bptr_p (s2) || __s2_len >= 4))		      \
-      ? __builtin_strcmp (s1, s2)					      \
-      : (__builtin_constant_p (s1) && __string2_1bptr_p (s1)		      \
-	 && (__s1_len = strlen (s1), __s1_len < 4)			      \
-	 ? (__builtin_constant_p (s2) && __string2_1bptr_p (s2)		      \
-	    ? __builtin_strcmp (s1, s2)					      \
-	    : __strcmp_cg (s1, s2, __s1_len))				      \
-	 : (__builtin_constant_p (s2) && __string2_1bptr_p (s2)		      \
-	    && (__s2_len = strlen (s2), __s2_len < 4)			      \
-	    ? (__builtin_constant_p (s1) && __string2_1bptr_p (s1)	      \
-	       ? __builtin_strcmp (s1, s2)				      \
-	       : -__strcmp_cg (s2, s1, __s2_len))			      \
-            : __builtin_strcmp (s1, s2)))); })
-
-# define __strcmp_cg(s1, s2, l1) \
-  (__extension__ ({ const unsigned char *__s2 =				      \
-		      (const unsigned char *) (const char *) (s2);	      \
-		    int __result =					      \
-		      (((const unsigned char *) (const char *) (s1))[0]	      \
-		       - __s2[0]);					      \
-		    if (l1 > 0 && __result == 0)			      \
-		      {							      \
-			__result = (((const unsigned char *)		      \
-				     (const char *) (s1))[1] - __s2[1]);      \
-			if (l1 > 1 && __result == 0)			      \
-			  {						      \
-			    __result = (((const unsigned char *)	      \
-					 (const char *) (s1))[2] - __s2[2]);  \
-			    if (l1 > 2 && __result == 0)		      \
-			      __result = (((const unsigned char *)	      \
-					  (const char *)  (s1))[3]	      \
-					  - __s2[3]);			      \
-			  }						      \
-		      }							      \
-		    __result; }))
-#endif
-
-
-/* Compare N characters of S1 and S2.  */
-#ifndef _HAVE_STRING_ARCH_strncmp
-# define strncmp(s1, s2, n)						      \
-  (__extension__ (__builtin_constant_p (n)				      \
-		  && ((__builtin_constant_p (s1)			      \
-		       && strlen (s1) < ((size_t) (n)))			      \
-		      || (__builtin_constant_p (s2)			      \
-			  && strlen (s2) < ((size_t) (n))))		      \
-		  ? strcmp (s1, s2) : strncmp (s1, s2, n)))
-#endif
-
-
 /* Return the length of the initial segment of S which
    consists entirely of characters not in REJECT.  */
 #ifndef _HAVE_STRING_ARCH_strcspn

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

Summary of changes:
 ChangeLog             |    6 +++++
 string/bits/string2.h |   58 -------------------------------------------------
 2 files changed, 6 insertions(+), 58 deletions(-)


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]