This is the mail archive of the libc-alpha@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]

[PATCH 2/2] Remove ancient GCC string inlines


Move mempcpy, strcpy and stpcpy inlines to string/string-inlines.c as they are no longer inlined. 
Passes AArch64, x86 and x64 regression.

OK for commit?

ChangeLog:
2016-02-19  Wilco Dijkstra  <wdijkstr@arm.com>

	[BZ #18712]
	* string/string-inlines.c (__STRING2_COPY_TYPE): Add, moved from string2.h.
	(__mempcpy_small): Likewise.
	(__strcpy_small): Likewise.
	(__stpcpy_small): Likewise.
	* string/bits/string2.h (__STRING2_COPY_TYPE): Remove.
	(__mempcpy_small): Remove.
	(__strcpy_small): Remove.
	(__stpcpy_small): Remove.
	* sysdeps/i386/string-inlines.c: Include string/string-inlines.c.

--

diff --git a/string/bits/string2.h b/string/bits/string2.h
index 183b89c4308c5c5e431877866ebbb558a8182c4a..4f71cb7e32fe9ac5176e57401f58346d7a439ee4 100644
--- a/string/bits/string2.h
+++ b/string/bits/string2.h
@@ -46,27 +46,6 @@
 # endif
 #endif
 
-#if _STRING_INLINE_unaligned
-/* If we can do unaligned memory accesses we must know the endianess.  */
-# include <endian.h>
-# include <bits/types.h>
-
-#else
-/* These are a few types we need for the optimizations if we cannot
-   use unaligned memory accesses.  */
-# define __STRING2_COPY_TYPE(N) \
-  typedef struct { unsigned char __arr[N]; }				      \
-    __attribute__ ((__packed__)) __STRING2_COPY_ARR##N
-__STRING2_COPY_TYPE (2);
-__STRING2_COPY_TYPE (3);
-__STRING2_COPY_TYPE (4);
-__STRING2_COPY_TYPE (5);
-__STRING2_COPY_TYPE (6);
-__STRING2_COPY_TYPE (7);
-__STRING2_COPY_TYPE (8);
-# undef __STRING2_COPY_TYPE
-#endif
-
 /* Dereferencing a pointer arg to run sizeof on it fails for the void
    pointer case, so we use this instead.
    Note that __x is evaluated twice. */
@@ -97,135 +76,10 @@ __STRING2_COPY_TYPE (8);
    we have to use the name `__mempcpy'.  */
 #   define mempcpy(dest, src, n) __mempcpy (dest, src, n)
 #  endif
-
-#  if defined _FORCE_INLINES
-#   if _STRING_INLINE_unaligned
-__STRING_INLINE void *__mempcpy_small (void *, char, char, char, char,
-				       __uint16_t, __uint16_t, __uint32_t,
-				       __uint32_t, size_t);
-__STRING_INLINE void *
-__mempcpy_small (void *__dest1,
-		 char __src0_1, char __src2_1, char __src4_1, char __src6_1,
-		 __uint16_t __src0_2, __uint16_t __src4_2,
-		 __uint32_t __src0_4, __uint32_t __src4_4,
-		 size_t __srclen)
-{
-  union {
-    __uint32_t __ui;
-    __uint16_t __usi;
-    unsigned char __uc;
-    unsigned char __c;
-  } *__u = __dest1;
-  switch ((unsigned int) __srclen)
-    {
-    case 1:
-      __u->__c = __src0_1;
-      __u = __extension__ ((void *) __u + 1);
-      break;
-    case 2:
-      __u->__usi = __src0_2;
-      __u = __extension__ ((void *) __u + 2);
-      break;
-    case 3:
-      __u->__usi = __src0_2;
-      __u = __extension__ ((void *) __u + 2);
-      __u->__c = __src2_1;
-      __u = __extension__ ((void *) __u + 1);
-      break;
-    case 4:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      break;
-    case 5:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__c = __src4_1;
-      __u = __extension__ ((void *) __u + 1);
-      break;
-    case 6:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__usi = __src4_2;
-      __u = __extension__ ((void *) __u + 2);
-      break;
-    case 7:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__usi = __src4_2;
-      __u = __extension__ ((void *) __u + 2);
-      __u->__c = __src6_1;
-      __u = __extension__ ((void *) __u + 1);
-      break;
-    case 8:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__ui = __src4_4;
-      __u = __extension__ ((void *) __u + 4);
-      break;
-    }
-  return (void *) __u;
-}
-#   else
-__STRING_INLINE void *__mempcpy_small (void *, char, __STRING2_COPY_ARR2,
-				       __STRING2_COPY_ARR3,
-				       __STRING2_COPY_ARR4,
-				       __STRING2_COPY_ARR5,
-				       __STRING2_COPY_ARR6,
-				       __STRING2_COPY_ARR7,
-				       __STRING2_COPY_ARR8, size_t);
-__STRING_INLINE void *
-__mempcpy_small (void *__dest, char __src1,
-		 __STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
-		 __STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
-		 __STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
-		 __STRING2_COPY_ARR8 __src8, size_t __srclen)
-{
-  union {
-    char __c;
-    __STRING2_COPY_ARR2 __sca2;
-    __STRING2_COPY_ARR3 __sca3;
-    __STRING2_COPY_ARR4 __sca4;
-    __STRING2_COPY_ARR5 __sca5;
-    __STRING2_COPY_ARR6 __sca6;
-    __STRING2_COPY_ARR7 __sca7;
-    __STRING2_COPY_ARR8 __sca8;
-  } *__u = __dest;
-  switch ((unsigned int) __srclen)
-    {
-    case 1:
-      __u->__c = __src1;
-      break;
-    case 2:
-      __extension__ __u->__sca2 = __src2;
-      break;
-    case 3:
-      __extension__ __u->__sca3 = __src3;
-      break;
-    case 4:
-      __extension__ __u->__sca4 = __src4;
-      break;
-    case 5:
-      __extension__ __u->__sca5 = __src5;
-      break;
-    case 6:
-      __extension__ __u->__sca6 = __src6;
-      break;
-    case 7:
-      __extension__ __u->__sca7 = __src7;
-      break;
-    case 8:
-      __extension__ __u->__sca8 = __src8;
-      break;
-    }
-  return __extension__ ((void *) __u + __srclen);
-}
-#   endif
-#  endif
 # endif
 #endif
 
 
-/* Return pointer to C in S.  */
 #ifndef _HAVE_STRING_ARCH_strchr
 extern void *__rawmemchr (const void *__s, int __c);
 # if __GNUC_PREREQ (3, 2)
@@ -243,121 +97,6 @@ extern void *__rawmemchr (const void *__s, int __c);
 #endif
 
 
-/* Copy SRC to DEST.  */
-#if defined _FORCE_INLINES
-# if _STRING_INLINE_unaligned
-__STRING_INLINE char *__strcpy_small (char *, __uint16_t, __uint16_t,
-				      __uint32_t, __uint32_t, size_t);
-__STRING_INLINE char *
-__strcpy_small (char *__dest,
-		__uint16_t __src0_2, __uint16_t __src4_2,
-		__uint32_t __src0_4, __uint32_t __src4_4,
-		size_t __srclen)
-{
-  union {
-    __uint32_t __ui;
-    __uint16_t __usi;
-    unsigned char __uc;
-  } *__u = (void *) __dest;
-  switch ((unsigned int) __srclen)
-    {
-    case 1:
-      __u->__uc = '\0';
-      break;
-    case 2:
-      __u->__usi = __src0_2;
-      break;
-    case 3:
-      __u->__usi = __src0_2;
-      __u = __extension__ ((void *) __u + 2);
-      __u->__uc = '\0';
-      break;
-    case 4:
-      __u->__ui = __src0_4;
-      break;
-    case 5:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__uc = '\0';
-      break;
-    case 6:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__usi = __src4_2;
-      break;
-    case 7:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__usi = __src4_2;
-      __u = __extension__ ((void *) __u + 2);
-      __u->__uc = '\0';
-      break;
-    case 8:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__ui = __src4_4;
-      break;
-    }
-  return __dest;
-}
-# else
-__STRING_INLINE char *__strcpy_small (char *, __STRING2_COPY_ARR2,
-				      __STRING2_COPY_ARR3,
-				      __STRING2_COPY_ARR4,
-				      __STRING2_COPY_ARR5,
-				      __STRING2_COPY_ARR6,
-				      __STRING2_COPY_ARR7,
-				      __STRING2_COPY_ARR8, size_t);
-__STRING_INLINE char *
-__strcpy_small (char *__dest,
-		__STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
-		__STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
-		__STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
-		__STRING2_COPY_ARR8 __src8, size_t __srclen)
-{
-  union {
-    char __c;
-    __STRING2_COPY_ARR2 __sca2;
-    __STRING2_COPY_ARR3 __sca3;
-    __STRING2_COPY_ARR4 __sca4;
-    __STRING2_COPY_ARR5 __sca5;
-    __STRING2_COPY_ARR6 __sca6;
-    __STRING2_COPY_ARR7 __sca7;
-    __STRING2_COPY_ARR8 __sca8;
-  } *__u = (void *) __dest;
-  switch ((unsigned int) __srclen)
-    {
-    case 1:
-      __u->__c = '\0';
-      break;
-    case 2:
-      __extension__ __u->__sca2 = __src2;
-      break;
-    case 3:
-      __extension__ __u->__sca3 = __src3;
-      break;
-    case 4:
-      __extension__ __u->__sca4 = __src4;
-      break;
-    case 5:
-      __extension__ __u->__sca5 = __src5;
-      break;
-    case 6:
-      __extension__ __u->__sca6 = __src6;
-      break;
-    case 7:
-      __extension__ __u->__sca7 = __src7;
-      break;
-    case 8:
-      __extension__ __u->__sca8 = __src8;
-      break;
-  }
-  return __dest;
-}
-# endif
-#endif
-
-
 /* Copy SRC to DEST, returning pointer to final NUL byte.  */
 #ifdef __USE_GNU
 # if !defined _HAVE_STRING_ARCH_stpcpy || defined _FORCE_INLINES
@@ -369,124 +108,6 @@ __strcpy_small (char *__dest,
    we have to use the name `__stpcpy'.  */
 #   define stpcpy(dest, src) __stpcpy (dest, src)
 #  endif
-
-#  if defined _FORCE_INLINES
-#   if _STRING_INLINE_unaligned
-__STRING_INLINE char *__stpcpy_small (char *, __uint16_t, __uint16_t,
-				      __uint32_t, __uint32_t, size_t);
-__STRING_INLINE char *
-__stpcpy_small (char *__dest,
-		__uint16_t __src0_2, __uint16_t __src4_2,
-		__uint32_t __src0_4, __uint32_t __src4_4,
-		size_t __srclen)
-{
-  union {
-    unsigned int __ui;
-    unsigned short int __usi;
-    unsigned char __uc;
-    char __c;
-  } *__u = (void *) __dest;
-  switch ((unsigned int) __srclen)
-    {
-    case 1:
-      __u->__uc = '\0';
-      break;
-    case 2:
-      __u->__usi = __src0_2;
-      __u = __extension__ ((void *) __u + 1);
-      break;
-    case 3:
-      __u->__usi = __src0_2;
-      __u = __extension__ ((void *) __u + 2);
-      __u->__uc = '\0';
-      break;
-    case 4:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 3);
-      break;
-    case 5:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__uc = '\0';
-      break;
-    case 6:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__usi = __src4_2;
-      __u = __extension__ ((void *) __u + 1);
-      break;
-    case 7:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__usi = __src4_2;
-      __u = __extension__ ((void *) __u + 2);
-      __u->__uc = '\0';
-      break;
-    case 8:
-      __u->__ui = __src0_4;
-      __u = __extension__ ((void *) __u + 4);
-      __u->__ui = __src4_4;
-      __u = __extension__ ((void *) __u + 3);
-      break;
-    }
-  return &__u->__c;
-}
-#   else
-__STRING_INLINE char *__stpcpy_small (char *, __STRING2_COPY_ARR2,
-				      __STRING2_COPY_ARR3,
-				      __STRING2_COPY_ARR4,
-				      __STRING2_COPY_ARR5,
-				      __STRING2_COPY_ARR6,
-				      __STRING2_COPY_ARR7,
-				      __STRING2_COPY_ARR8, size_t);
-__STRING_INLINE char *
-__stpcpy_small (char *__dest,
-		__STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
-		__STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
-		__STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
-		__STRING2_COPY_ARR8 __src8, size_t __srclen)
-{
-  union {
-    char __c;
-    __STRING2_COPY_ARR2 __sca2;
-    __STRING2_COPY_ARR3 __sca3;
-    __STRING2_COPY_ARR4 __sca4;
-    __STRING2_COPY_ARR5 __sca5;
-    __STRING2_COPY_ARR6 __sca6;
-    __STRING2_COPY_ARR7 __sca7;
-    __STRING2_COPY_ARR8 __sca8;
-  } *__u = (void *) __dest;
-  switch ((unsigned int) __srclen)
-    {
-    case 1:
-      __u->__c = '\0';
-      break;
-    case 2:
-      __extension__ __u->__sca2 = __src2;
-      break;
-    case 3:
-      __extension__ __u->__sca3 = __src3;
-      break;
-    case 4:
-      __extension__ __u->__sca4 = __src4;
-      break;
-    case 5:
-      __extension__ __u->__sca5 = __src5;
-      break;
-    case 6:
-      __extension__ __u->__sca6 = __src6;
-      break;
-    case 7:
-      __extension__ __u->__sca7 = __src7;
-      break;
-    case 8:
-      __extension__ __u->__sca8 = __src8;
-      break;
-  }
-  return __dest + __srclen - 1;
-}
-#   endif
-#  endif
 # endif
 #endif
 
diff --git a/string/string-inlines.c b/string/string-inlines.c
index 16db3ea308a81d5714cea9e44a252050bf6b9ded..05139563ebbe9fc6ba4cd07ebfcdc2370f68f101 100644
--- a/string/string-inlines.c
+++ b/string/string-inlines.c
@@ -32,3 +32,349 @@
 #undef __NO_INLINE__
 #include <bits/string.h>
 #include <bits/string2.h>
+
+/* These are a few types we need for the optimizations if we cannot
+   use unaligned memory accesses.  */
+# define __STRING2_COPY_TYPE(N) \
+  typedef struct { unsigned char __arr[N]; }				      \
+    __attribute__ ((__packed__)) __STRING2_COPY_ARR##N
+__STRING2_COPY_TYPE (2);
+__STRING2_COPY_TYPE (3);
+__STRING2_COPY_TYPE (4);
+__STRING2_COPY_TYPE (5);
+__STRING2_COPY_TYPE (6);
+__STRING2_COPY_TYPE (7);
+__STRING2_COPY_TYPE (8);
+# undef __STRING2_COPY_TYPE
+
+
+#if _STRING_INLINE_unaligned
+__STRING_INLINE void *__mempcpy_small (void *, char, char, char, char,
+				       __uint16_t, __uint16_t, __uint32_t,
+				       __uint32_t, size_t);
+__STRING_INLINE void *
+__mempcpy_small (void *__dest1,
+		 char __src0_1, char __src2_1, char __src4_1, char __src6_1,
+		 __uint16_t __src0_2, __uint16_t __src4_2,
+		 __uint32_t __src0_4, __uint32_t __src4_4,
+		 size_t __srclen)
+{
+  union {
+    __uint32_t __ui;
+    __uint16_t __usi;
+    unsigned char __uc;
+    unsigned char __c;
+  } *__u = __dest1;
+  switch ((unsigned int) __srclen)
+    {
+    case 1:
+      __u->__c = __src0_1;
+      __u = __extension__ ((void *) __u + 1);
+      break;
+    case 2:
+      __u->__usi = __src0_2;
+      __u = __extension__ ((void *) __u + 2);
+      break;
+    case 3:
+      __u->__usi = __src0_2;
+      __u = __extension__ ((void *) __u + 2);
+      __u->__c = __src2_1;
+      __u = __extension__ ((void *) __u + 1);
+      break;
+    case 4:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      break;
+    case 5:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__c = __src4_1;
+      __u = __extension__ ((void *) __u + 1);
+      break;
+    case 6:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__usi = __src4_2;
+      __u = __extension__ ((void *) __u + 2);
+      break;
+    case 7:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__usi = __src4_2;
+      __u = __extension__ ((void *) __u + 2);
+      __u->__c = __src6_1;
+      __u = __extension__ ((void *) __u + 1);
+      break;
+    case 8:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__ui = __src4_4;
+      __u = __extension__ ((void *) __u + 4);
+      break;
+    }
+  return (void *) __u;
+}
+
+#else
+
+__STRING_INLINE void *
+__mempcpy_small (void *__dest, char __src1,
+		 __STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
+		 __STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
+		 __STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
+		 __STRING2_COPY_ARR8 __src8, size_t __srclen)
+{
+  union {
+    char __c;
+    __STRING2_COPY_ARR2 __sca2;
+    __STRING2_COPY_ARR3 __sca3;
+    __STRING2_COPY_ARR4 __sca4;
+    __STRING2_COPY_ARR5 __sca5;
+    __STRING2_COPY_ARR6 __sca6;
+    __STRING2_COPY_ARR7 __sca7;
+    __STRING2_COPY_ARR8 __sca8;
+  } *__u = __dest;
+  switch ((unsigned int) __srclen)
+    {
+    case 1:
+      __u->__c = __src1;
+      break;
+    case 2:
+      __extension__ __u->__sca2 = __src2;
+      break;
+    case 3:
+      __extension__ __u->__sca3 = __src3;
+      break;
+    case 4:
+      __extension__ __u->__sca4 = __src4;
+      break;
+    case 5:
+      __extension__ __u->__sca5 = __src5;
+      break;
+    case 6:
+      __extension__ __u->__sca6 = __src6;
+      break;
+    case 7:
+      __extension__ __u->__sca7 = __src7;
+      break;
+    case 8:
+      __extension__ __u->__sca8 = __src8;
+      break;
+    }
+  return __extension__ ((void *) __u + __srclen);
+}
+#endif
+
+# if _STRING_INLINE_unaligned
+__STRING_INLINE char *
+__strcpy_small (char *__dest,
+		__uint16_t __src0_2, __uint16_t __src4_2,
+		__uint32_t __src0_4, __uint32_t __src4_4,
+		size_t __srclen)
+{
+  union {
+    __uint32_t __ui;
+    __uint16_t __usi;
+    unsigned char __uc;
+  } *__u = (void *) __dest;
+  switch ((unsigned int) __srclen)
+    {
+    case 1:
+      __u->__uc = '\0';
+      break;
+    case 2:
+      __u->__usi = __src0_2;
+      break;
+    case 3:
+      __u->__usi = __src0_2;
+      __u = __extension__ ((void *) __u + 2);
+      __u->__uc = '\0';
+      break;
+    case 4:
+      __u->__ui = __src0_4;
+      break;
+    case 5:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__uc = '\0';
+      break;
+    case 6:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__usi = __src4_2;
+      break;
+    case 7:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__usi = __src4_2;
+      __u = __extension__ ((void *) __u + 2);
+      __u->__uc = '\0';
+      break;
+    case 8:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__ui = __src4_4;
+      break;
+    }
+  return __dest;
+}
+
+#else
+
+__STRING_INLINE char *
+__strcpy_small (char *__dest,
+		__STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
+		__STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
+		__STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
+		__STRING2_COPY_ARR8 __src8, size_t __srclen)
+{
+  union {
+    char __c;
+    __STRING2_COPY_ARR2 __sca2;
+    __STRING2_COPY_ARR3 __sca3;
+    __STRING2_COPY_ARR4 __sca4;
+    __STRING2_COPY_ARR5 __sca5;
+    __STRING2_COPY_ARR6 __sca6;
+    __STRING2_COPY_ARR7 __sca7;
+    __STRING2_COPY_ARR8 __sca8;
+  } *__u = (void *) __dest;
+  switch ((unsigned int) __srclen)
+    {
+    case 1:
+      __u->__c = '\0';
+      break;
+    case 2:
+      __extension__ __u->__sca2 = __src2;
+      break;
+    case 3:
+      __extension__ __u->__sca3 = __src3;
+      break;
+    case 4:
+      __extension__ __u->__sca4 = __src4;
+      break;
+    case 5:
+      __extension__ __u->__sca5 = __src5;
+      break;
+    case 6:
+      __extension__ __u->__sca6 = __src6;
+      break;
+    case 7:
+      __extension__ __u->__sca7 = __src7;
+      break;
+    case 8:
+      __extension__ __u->__sca8 = __src8;
+      break;
+  }
+  return __dest;
+}
+#endif
+
+
+#if _STRING_INLINE_unaligned
+__STRING_INLINE char *
+__stpcpy_small (char *__dest,
+		__uint16_t __src0_2, __uint16_t __src4_2,
+		__uint32_t __src0_4, __uint32_t __src4_4,
+		size_t __srclen)
+{
+  union {
+    unsigned int __ui;
+    unsigned short int __usi;
+    unsigned char __uc;
+    char __c;
+  } *__u = (void *) __dest;
+  switch ((unsigned int) __srclen)
+    {
+    case 1:
+      __u->__uc = '\0';
+      break;
+    case 2:
+      __u->__usi = __src0_2;
+      __u = __extension__ ((void *) __u + 1);
+      break;
+    case 3:
+      __u->__usi = __src0_2;
+      __u = __extension__ ((void *) __u + 2);
+      __u->__uc = '\0';
+      break;
+    case 4:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 3);
+      break;
+    case 5:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__uc = '\0';
+      break;
+    case 6:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__usi = __src4_2;
+      __u = __extension__ ((void *) __u + 1);
+      break;
+    case 7:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__usi = __src4_2;
+      __u = __extension__ ((void *) __u + 2);
+      __u->__uc = '\0';
+      break;
+    case 8:
+      __u->__ui = __src0_4;
+      __u = __extension__ ((void *) __u + 4);
+      __u->__ui = __src4_4;
+      __u = __extension__ ((void *) __u + 3);
+      break;
+    }
+  return &__u->__c;
+}
+
+#else
+
+__STRING_INLINE char *
+__stpcpy_small (char *__dest,
+		__STRING2_COPY_ARR2 __src2, __STRING2_COPY_ARR3 __src3,
+		__STRING2_COPY_ARR4 __src4, __STRING2_COPY_ARR5 __src5,
+		__STRING2_COPY_ARR6 __src6, __STRING2_COPY_ARR7 __src7,
+		__STRING2_COPY_ARR8 __src8, size_t __srclen)
+{
+  union {
+    char __c;
+    __STRING2_COPY_ARR2 __sca2;
+    __STRING2_COPY_ARR3 __sca3;
+    __STRING2_COPY_ARR4 __sca4;
+    __STRING2_COPY_ARR5 __sca5;
+    __STRING2_COPY_ARR6 __sca6;
+    __STRING2_COPY_ARR7 __sca7;
+    __STRING2_COPY_ARR8 __sca8;
+  } *__u = (void *) __dest;
+  switch ((unsigned int) __srclen)
+    {
+    case 1:
+      __u->__c = '\0';
+      break;
+    case 2:
+      __extension__ __u->__sca2 = __src2;
+      break;
+    case 3:
+      __extension__ __u->__sca3 = __src3;
+      break;
+    case 4:
+      __extension__ __u->__sca4 = __src4;
+      break;
+    case 5:
+      __extension__ __u->__sca5 = __src5;
+      break;
+    case 6:
+      __extension__ __u->__sca6 = __src6;
+      break;
+    case 7:
+      __extension__ __u->__sca7 = __src7;
+      break;
+    case 8:
+      __extension__ __u->__sca8 = __src8;
+      break;
+  }
+  return __dest + __srclen - 1;
+}
+#endif
diff --git a/sysdeps/i386/string-inlines.c b/sysdeps/i386/string-inlines.c
index c7de270c0a240d3dbb7415e36503bc2e4e10ada1..42aecca5f65e03a8d15f2b3853cd2d41860cf478 100644
--- a/sysdeps/i386/string-inlines.c
+++ b/sysdeps/i386/string-inlines.c
@@ -19,23 +19,11 @@
     functions.  These functions are declared additionally here if
     inlining is not possible.  */
 
-#undef __USE_STRING_INLINES
-#define __USE_STRING_INLINES
-#define _FORCE_INLINES
-#define __STRING_INLINE /* empty */
-#define __NO_INLINE__
-
 /* This is to avoid PLT entries for the x86 version.  */
 #define __memcpy_g __memcpy_g_internal
 #define __strchr_g __strchr_g_internal
 
-#include <string.h>
-#undef index
-#undef rindex
-
-#undef __NO_INLINE__
-#include <bits/string.h>
-#include <bits/string2.h>
+#include <string/string-inlines.c>
 
 void *
 (__memcpy_c) (void *d, const void *s, size_t n)


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