summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-02-20 09:40:26 +0000
committerUlrich Drepper <drepper@redhat.com>1999-02-20 09:40:26 +0000
commit57846308af51c23f3d442ad68ec667469961cb97 (patch)
treea889179cfc5b63f87cb738a5ae0587cd89805c9e
parent126b06f99e7c12d3b55df89343fed295390951d3 (diff)
downloadglibc-57846308af51c23f3d442ad68ec667469961cb97.tar.gz
glibc-57846308af51c23f3d442ad68ec667469961cb97.tar.xz
glibc-57846308af51c23f3d442ad68ec667469961cb97.zip
Update.
1999-02-20  Ulrich Drepper  <drepper@cygnus.com>

	* elf/dynamic-link.h (elf_get_dynamic_info): Use memset instead of
	loop to clear `info'.

	* sysdeps/i386/i486/bits/string.h: If fill byte is constant let gcc
	do the work and don't use inline assembler.
-rw-r--r--ChangeLog8
-rw-r--r--elf/dynamic-link.h8
-rw-r--r--sysdeps/i386/i486/bits/string.h73
3 files changed, 12 insertions, 77 deletions
diff --git a/ChangeLog b/ChangeLog
index fe594d9fe7..fe60d73595 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+1999-02-20  Ulrich Drepper  <drepper@cygnus.com>
+
+	* elf/dynamic-link.h (elf_get_dynamic_info): Use memset instead of
+	loop to clear `info'.
+
+	* sysdeps/i386/i486/bits/string.h: If fill byte is constant let gcc
+	do the work and don't use inline assembler.
+
 1999-02-19  Ulrich Drepper  <drepper@cygnus.com>
 
 	* elf/ldsodefs.h (_dl_signal_error): Mark as __noreturn__.
diff --git a/elf/dynamic-link.h b/elf/dynamic-link.h
index 89e15a4e6c..3d96ecc143 100644
--- a/elf/dynamic-link.h
+++ b/elf/dynamic-link.h
@@ -1,5 +1,5 @@
 /* Inline functions for dynamic linking.
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 1998, 1999 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
@@ -34,10 +34,8 @@ elf_get_dynamic_info (ElfW(Dyn) *dyn,
 		      ElfW(Dyn) *info[DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM
 				     + DT_EXTRANUM])
 {
-  unsigned int i;
-
-  for (i = 0; i < DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM + DT_EXTRANUM; ++i)
-    info[i] = NULL;
+  memset (info, '\0', ((DT_NUM + DT_PROCNUM + DT_VERSIONTAGNUM + DT_EXTRANUM)
+		       * sizeof (ElfW(Dyn) *)));
 
   if (! dyn)
     return;
diff --git a/sysdeps/i386/i486/bits/string.h b/sysdeps/i386/i486/bits/string.h
index 84421b40a2..6e5c3fed1f 100644
--- a/sysdeps/i386/i486/bits/string.h
+++ b/sysdeps/i386/i486/bits/string.h
@@ -190,20 +190,10 @@ memcmp (__const void *__s1, __const void *__s2, size_t __n)
 #define _HAVE_STRING_ARCH_memset 1
 #define memset(s, c, n) \
   (__extension__ (__builtin_constant_p (c)				      \
-		  ? (__builtin_constant_p (n)				      \
-		     ? __memset_cc (s, c, n)				      \
-		     : __memset_cg (s, c, n))				      \
+		  ? memset (s, c, n)					      \
 		  : (__builtin_constant_p (n)				      \
 		     ? __memset_gc (s, c, n)				      \
 		     : __memset_gg (s, c, n))))
-#define __memset_cc(s, c, n) \
-  ((n) == 0								      \
-   ? (s)								      \
-   : (((n) % 4 == 0)							      \
-      ? __memset_cc_by4 (s, c, n)					      \
-      : (((n) % 2== 0)							      \
-	 ? __memset_cc_by2 (s, c, n)					      \
-	 : __memset_cg (s, c, n))))
 #define __memset_gc(s, c, n) \
   ((n) == 0								      \
    ? (s)								      \
@@ -213,48 +203,6 @@ memcmp (__const void *__s1, __const void *__s2, size_t __n)
 	 ? __memset_gc_by2 (s, c, n)					      \
 	 : __memset_gg (s, c, n))))
 
-__STRING_INLINE void *__memset_cc_by4 (void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memset_cc_by4 (void *__s, int __c, size_t __n)
-{
-  register unsigned long int __d0;
-  register char *__tmp = __s;
-  __asm__ __volatile__
-    ("1:\n\t"
-     "movl	%2,(%0)\n\t"
-     "leal	4(%0),%0\n\t"
-     "decl	%1\n\t"
-     "jnz	1b"
-     : "=&r" (__tmp), "=&r" (__d0)
-     : "q" (0x01010101UL * (unsigned char) __c), "0" (__tmp), "1" (__n / 4)
-     : "memory", "cc");
-  return __s;
-}
-
-__STRING_INLINE void *__memset_cc_by2 (void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memset_cc_by2 (void *__s, int __c, size_t __n)
-{
-  register unsigned long int __d0;
-  register void *__tmp = __s;
-  __asm__ __volatile__
-    ("shrl	$1,%1\n\t"	/* may be divisible also by 4 */
-     "jz	2f\n"
-     "1:\n\t"
-     "movl	%2,(%0)\n\t"
-     "leal	4(%0),%0\n\t"
-     "decl	%1\n\t"
-     "jnz	1b\n"
-     "2:\n\t"
-     "movw	%w2,(%0)"
-     : "=&r" (__tmp), "=&r" (__d0)
-     : "q" (0x01010101UL * (unsigned char) __c), "0" (__tmp), "1" (__n / 2)
-     : "memory", "cc");
-  return __s;
-}
-
 __STRING_INLINE void *__memset_gc_by4 (void *__s, int __c, size_t __n);
 
 __STRING_INLINE void *
@@ -305,25 +253,6 @@ __memset_gc_by2 (void *__s, int __c, size_t __n)
   return __s;
 }
 
-__STRING_INLINE void *__memset_cg (void *__s, int __c, size_t __n);
-
-__STRING_INLINE void *
-__memset_cg (void *__s, int __c, size_t __n)
-{
-  register unsigned long __d0, __d1;
-  register void *__tmp = __s;
-  __asm__ __volatile__
-    ("shrl	$1,%%ecx\n\t"
-     "rep; stosw\n\t"
-     "jnc	1f\n\t"
-     "movb	%%al,(%%edi)\n"
-     "1:"
-     : "=&c" (__d0), "=&D" (__d1)
-     : "0" (__n), "1" (__tmp), "a" (0x0101U * (unsigned char) __c)
-     : "memory", "cc");
-  return __s;
-}
-
 __STRING_INLINE void *__memset_gg (void *__s, int __c, size_t __n);
 
 __STRING_INLINE void *