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.26-34-g973da22


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  973da22a356ed072133562e6f1ecd833c31fa9a0 (commit)
      from  8537e0f6cf8a1c245612fd3437789d2e16278e3b (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=973da22a356ed072133562e6f1ecd833c31fa9a0

commit 973da22a356ed072133562e6f1ecd833c31fa9a0
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 19 06:54:03 2017 -0700

    i686: Implement IFUNC selectors in C
    
    	* sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add
    	bcopy-ia32, bzero-ia32, rawmemchr-ia32 memchr-ia32,
    	memcmp-ia32, memcpy-ia32, memmove-ia32, mempcpy-ia32,
    	memset-ia32, strcat-ia32, strchr-ia32, strrchr-ia32,
    	strcpy-ia32, strcmp-ia32, strcspn-ia32, strpbrk-ia32,
    	strspn-ia32, strlen-ia32, stpcpy-ia32, stpncpy-ia32,
    	memcpy_chk-nonshared, mempcpy_chk-nonshared,
    	memmove_chk-nonshared and memset_chk-nonshared
    	* sysdeps/i386/i686/multiarch/bcopy-ia32.S: New file.
    	* sysdeps/i386/i686/multiarch/bcopy.c: Likewise.
    	* sysdeps/i386/i686/multiarch/bzero-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/bzero.c: Likewise.
    	* sysdeps/i386/i686/multiarch/ifunc-memmove.h: Likewise.
    	* sysdeps/i386/i686/multiarch/ifunc-memset.h: Likewise.
    	* sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h: Likewise.
    	* sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h: Likewise.
    	* sysdeps/i386/i686/multiarch/ifunc-sse2.h: Likewise.
    	* sysdeps/i386/i686/multiarch/ifunc-sse4_2.h: Likewise.
    	* sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h: Likewise.
    	* sysdeps/i386/i686/multiarch/memchr-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memchr.c: Likewise.
    	* sysdeps/i386/i686/multiarch/memcmp-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memcmp.c: Likewise.
    	* sysdeps/i386/i686/multiarch/memcpy-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memcpy.c: Likewise.
    	* sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memcpy_chk.c: Likewise.
    	* sysdeps/i386/i686/multiarch/memmove-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memmove.c: Likewise.
    	* sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memmove_chk.c: Likewise.
    	* sysdeps/i386/i686/multiarch/mempcpy-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/mempcpy.c: Likewise.
    	* sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S: Likewise.
    	* sysdeps/i386/i686/multiarch/mempcpy_chk.c: Likewise.
    	* sysdeps/i386/i686/multiarch/memrchr.c: Likewise.
    	* sysdeps/i386/i686/multiarch/memset-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memset.c: Likewise.
    	* sysdeps/i386/i686/multiarch/memset_chk-nonshared.S: Likewise.
    	* sysdeps/i386/i686/multiarch/rawmemchr-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/rawmemchr.c: Likewise.
    	* sysdeps/i386/i686/multiarch/stpcpy-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/stpcpy-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/stpcpy.c: Likewise.
    	* sysdeps/i386/i686/multiarch/stpncpy-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/stpncpy.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strcasecmp.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strcasecmp_l.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strcat-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcat.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strchr-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strchr.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strcmp-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcmp.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strcpy-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcpy.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strcspn-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcspn.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strlen-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strlen.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strncase.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strncase_l.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strncat.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strncmp.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strncpy.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strnlen.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strpbrk-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strpbrk.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strrchr-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strrchr.c: Likewise.
    	* sysdeps/i386/i686/multiarch/strspn-ia32.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strspn.c: Likewise.
    	* sysdeps/i386/i686/multiarch/wcschr.c: Likewise.
    	* sysdeps/i386/i686/multiarch/wcscmp.c: Likewise.
    	* sysdeps/i386/i686/multiarch/wcscpy.c: Likewise.
    	* sysdeps/i386/i686/multiarch/wcslen.c: Likewise.
    	* sysdeps/i386/i686/multiarch/wcsrchr.c: Likewise.
    	* sysdeps/i386/i686/multiarch/wmemcmp.c: Likewise.
    	* sysdeps/i386/i686/multiarch/bcopy.S: Removed.
    	* sysdeps/i386/i686/multiarch/bzero.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memchr.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memmove.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
    	* sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
    	* sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memset.S: Likewise.
    	* sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
    	* sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
    	* sysdeps/i386/i686/multiarch/stpcpy.S: Likewise.
    	* sysdeps/i386/i686/multiarch/stpncpy.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcasecmp_l.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcat.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strlen.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strncase.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strncase_l.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strncat.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strncmp.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strncpy.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strpbrk.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
    	* sysdeps/i386/i686/multiarch/strspn.S: Likewise.
    	* sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
    	* sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
    	* sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
    	* sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
    	* sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
    	* sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.

diff --git a/ChangeLog b/ChangeLog
index 2684362..db25c7f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,124 @@
 2017-08-04  H.J. Lu  <hongjiu.lu@intel.com>
 
+	* sysdeps/i386/i686/multiarch/Makefile (sysdep_routines): Add
+	bcopy-ia32, bzero-ia32, rawmemchr-ia32 memchr-ia32,
+	memcmp-ia32, memcpy-ia32, memmove-ia32, mempcpy-ia32,
+	memset-ia32, strcat-ia32, strchr-ia32, strrchr-ia32,
+	strcpy-ia32, strcmp-ia32, strcspn-ia32, strpbrk-ia32,
+	strspn-ia32, strlen-ia32, stpcpy-ia32, stpncpy-ia32,
+	memcpy_chk-nonshared, mempcpy_chk-nonshared,
+	memmove_chk-nonshared and memset_chk-nonshared
+	* sysdeps/i386/i686/multiarch/bcopy-ia32.S: New file.
+	* sysdeps/i386/i686/multiarch/bcopy.c: Likewise.
+	* sysdeps/i386/i686/multiarch/bzero-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/bzero.c: Likewise.
+	* sysdeps/i386/i686/multiarch/ifunc-memmove.h: Likewise.
+	* sysdeps/i386/i686/multiarch/ifunc-memset.h: Likewise.
+	* sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h: Likewise.
+	* sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h: Likewise.
+	* sysdeps/i386/i686/multiarch/ifunc-sse2.h: Likewise.
+	* sysdeps/i386/i686/multiarch/ifunc-sse4_2.h: Likewise.
+	* sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h: Likewise.
+	* sysdeps/i386/i686/multiarch/memchr-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memchr.c: Likewise.
+	* sysdeps/i386/i686/multiarch/memcmp-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memcmp.c: Likewise.
+	* sysdeps/i386/i686/multiarch/memcpy-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memcpy.c: Likewise.
+	* sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memcpy_chk.c: Likewise.
+	* sysdeps/i386/i686/multiarch/memmove-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memmove.c: Likewise.
+	* sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memmove_chk.c: Likewise.
+	* sysdeps/i386/i686/multiarch/mempcpy-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/mempcpy.c: Likewise.
+	* sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S: Likewise.
+	* sysdeps/i386/i686/multiarch/mempcpy_chk.c: Likewise.
+	* sysdeps/i386/i686/multiarch/memrchr.c: Likewise.
+	* sysdeps/i386/i686/multiarch/memset-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memset.c: Likewise.
+	* sysdeps/i386/i686/multiarch/memset_chk-nonshared.S: Likewise.
+	* sysdeps/i386/i686/multiarch/rawmemchr-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/rawmemchr.c: Likewise.
+	* sysdeps/i386/i686/multiarch/stpcpy-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/stpcpy-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/stpcpy.c: Likewise.
+	* sysdeps/i386/i686/multiarch/stpncpy-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/stpncpy.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strcasecmp.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strcasecmp_l.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strcat-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcat.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strchr-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strchr.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strcmp-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcmp.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strcpy-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcpy.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strcspn-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcspn.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strlen-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strlen.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strncase.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strncase_l.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strncat.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strncmp.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strncpy.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strnlen.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strpbrk-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strpbrk.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strrchr-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strrchr.c: Likewise.
+	* sysdeps/i386/i686/multiarch/strspn-ia32.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strspn.c: Likewise.
+	* sysdeps/i386/i686/multiarch/wcschr.c: Likewise.
+	* sysdeps/i386/i686/multiarch/wcscmp.c: Likewise.
+	* sysdeps/i386/i686/multiarch/wcscpy.c: Likewise.
+	* sysdeps/i386/i686/multiarch/wcslen.c: Likewise.
+	* sysdeps/i386/i686/multiarch/wcsrchr.c: Likewise.
+	* sysdeps/i386/i686/multiarch/wmemcmp.c: Likewise.
+	* sysdeps/i386/i686/multiarch/bcopy.S: Removed.
+	* sysdeps/i386/i686/multiarch/bzero.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memchr.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memmove.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
+	* sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
+	* sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memset.S: Likewise.
+	* sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
+	* sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
+	* sysdeps/i386/i686/multiarch/stpcpy.S: Likewise.
+	* sysdeps/i386/i686/multiarch/stpncpy.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcasecmp_l.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcat.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strlen.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strncase.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strncase_l.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strncat.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strncmp.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strncpy.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strpbrk.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
+	* sysdeps/i386/i686/multiarch/strspn.S: Likewise.
+	* sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
+	* sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
+	* sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
+	* sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
+	* sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
+	* sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.
+
+2017-08-04  H.J. Lu  <hongjiu.lu@intel.com>
+
 	* sysdeps/x86_64/fpu/multiarch/Makefile (libmvec-sysdep_routines)
 	Add svml_d_cos2_core-sse2, svml_d_cos4_core-sse,
 	svml_d_cos8_core-avx2, svml_d_exp2_core-sse2,
diff --git a/sysdeps/i386/i686/multiarch/Makefile b/sysdeps/i386/i686/multiarch/Makefile
index 4a0c20c..bf75a99 100644
--- a/sysdeps/i386/i686/multiarch/Makefile
+++ b/sysdeps/i386/i686/multiarch/Makefile
@@ -24,7 +24,13 @@ sysdep_routines += bzero-sse2 memset-sse2 memcpy-ssse3 mempcpy-ssse3 \
 		   strcasecmp_l-sse4 strncase_l-sse4 \
 		   bcopy-sse2-unaligned memcpy-sse2-unaligned \
 		   mempcpy-sse2-unaligned memmove-sse2-unaligned \
-		   strcspn-c strpbrk-c strspn-c
+		   strcspn-c strpbrk-c strspn-c \
+		   bcopy-ia32 bzero-ia32 rawmemchr-ia32 \
+		   memchr-ia32 memcmp-ia32 memcpy-ia32 memmove-ia32 \
+		   mempcpy-ia32 memset-ia32 strcat-ia32 strchr-ia32 \
+		   strrchr-ia32 strcpy-ia32 strcmp-ia32 strcspn-ia32 \
+		   strpbrk-ia32 strspn-ia32 strlen-ia32 stpcpy-ia32 \
+		   stpncpy-ia32
 CFLAGS-varshift.c += -msse4
 CFLAGS-strcspn-c.c += -msse4
 CFLAGS-strpbrk-c.c += -msse4
@@ -42,3 +48,8 @@ libm-sysdep_routines += s_fma-fma s_fmaf-fma
 CFLAGS-s_fma-fma.c += -mavx -mfpmath=sse
 CFLAGS-s_fmaf-fma.c += -mavx -mfpmath=sse
 endif
+
+ifeq ($(subdir),debug)
+sysdep_routines += memcpy_chk-nonshared mempcpy_chk-nonshared \
+		   memmove_chk-nonshared memset_chk-nonshared
+endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/bcopy-ia32.S
similarity index 61%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/bcopy-ia32.S
index cf67333..606cd2e 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/bcopy-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcsrchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* bcopy optimized for i686.
+   Copyright (C) 2017 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
@@ -18,18 +16,5 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
-#endif
+#define bcopy __bcopy_ia32
+#include <sysdeps/i386/i686/bcopy.S>
diff --git a/sysdeps/i386/i686/multiarch/bcopy.S b/sysdeps/i386/i686/multiarch/bcopy.S
deleted file mode 100644
index 877f82c..0000000
--- a/sysdeps/i386/i686/multiarch/bcopy.S
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Multiple versions of bcopy
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib.  */
-#if IS_IN (libc)
-	.text
-ENTRY(bcopy)
-	.type	bcopy, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__bcopy_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__bcopy_sse2_unaligned)
-	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-	jnz	2f
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__bcopy_ssse3)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__bcopy_ssse3_rep)
-2:	ret
-END(bcopy)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __bcopy_ia32, @function; \
-	.p2align 4; \
-	.globl __bcopy_ia32; \
-	.hidden __bcopy_ia32; \
-	__bcopy_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __bcopy_ia32, .-__bcopy_ia32
-
-#endif
-
-#include "../bcopy.S"
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/bcopy.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/bcopy.c
index cf67333..70cd665 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/bcopy.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of bcopy.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define bcopy __redirect_bcopy
+# include <string.h>
+# undef bcopy
+
+# define SYMBOL_NAME bcopy
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_bcopy, bcopy, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strnlen.S b/sysdeps/i386/i686/multiarch/bzero-ia32.S
similarity index 60%
copy from sysdeps/i386/i686/multiarch/strnlen.S
copy to sysdeps/i386/i686/multiarch/bzero-ia32.S
index d241522..8df871f 100644
--- a/sysdeps/i386/i686/multiarch/strnlen.S
+++ b/sysdeps/i386/i686/multiarch/bzero-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of strnlen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* bzero optimized for i686.
+   Copyright (C) 2017 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
@@ -22,16 +20,19 @@
 #include <init-arch.h>
 
 #if IS_IN (libc)
-	.text
-ENTRY(__strnlen)
-	.type	__strnlen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strnlen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strnlen_sse2)
-2:	ret
-END(__strnlen)
-
-weak_alias(__strnlen, strnlen)
+# define __bzero __bzero_ia32
+
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI___bzero; __GI___bzero = __bzero
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias)
+
+# include <sysdeps/i386/i686/bzero.S>
 #endif
diff --git a/sysdeps/i386/i686/multiarch/bzero.S b/sysdeps/i386/i686/multiarch/bzero.S
deleted file mode 100644
index 9dac490..0000000
--- a/sysdeps/i386/i686/multiarch/bzero.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Multiple versions of bzero
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib.  */
-#if IS_IN (libc)
-	.text
-ENTRY(__bzero)
-	.type	__bzero, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__bzero_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX ( __bzero_sse2)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__bzero_sse2_rep)
-2:	ret
-END(__bzero)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __bzero_ia32, @function; \
-	.p2align 4; \
-	.globl __bzero_ia32; \
-	.hidden __bzero_ia32; \
-	__bzero_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __bzero_ia32, .-__bzero_ia32
-
-# ifdef SHARED
-#  undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-#  define libc_hidden_builtin_def(name) \
-	.globl __GI___bzero; __GI___bzero = __bzero_ia32
-# endif
-#endif
-
-#include "../bzero.S"
diff --git a/sysdeps/i386/i686/multiarch/wcschr.S b/sysdeps/i386/i686/multiarch/bzero.c
similarity index 66%
rename from sysdeps/i386/i686/multiarch/wcschr.S
rename to sysdeps/i386/i686/multiarch/bzero.c
index d3c65a6..0b029fd 100644
--- a/sysdeps/i386/i686/multiarch/wcschr.S
+++ b/sysdeps/i386/i686/multiarch/bzero.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcschr
+/* Multiple versions of bzero.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,19 +17,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(__wcschr)
-	.type	wcschr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcschr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcschr_sse2)
-2:	ret
-END(__wcschr)
-weak_alias (__wcschr, wcschr)
+# define bzero __redirect_bzero
+# include <string.h>
+# undef bzero
+
+# define SYMBOL_NAME bzero
+# include "ifunc-memset.h"
+
+libc_ifunc_redirected (__redirect_bzero, __bzero, IFUNC_SELECTOR ());
+
+weak_alias (__bzero, bzero)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/ifunc-memmove.h b/sysdeps/i386/i686/multiarch/ifunc-memmove.h
new file mode 100644
index 0000000..9c71414
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/ifunc-memmove.h
@@ -0,0 +1,45 @@
+/* Common definition for memmove/memmove_chk ifunc selections.
+   All versions must be listed in ifunc-impl-list.c.
+   Copyright (C) 2017 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/>.  */
+
+#include <init-arch.h>
+
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_unaligned)
+  attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3_rep) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+  const struct cpu_features* cpu_features = __get_cpu_features ();
+
+  if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Unaligned_Load))
+    return OPTIMIZE (sse2_unaligned);
+
+  if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+    {
+      if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Rep_String))
+	return OPTIMIZE (ssse3_rep);
+
+      return OPTIMIZE (ssse3);
+    }
+
+  return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/ifunc-memset.h
similarity index 56%
copy from sysdeps/i386/i686/multiarch/memrchr.S
copy to sysdeps/i386/i686/multiarch/ifunc-memset.h
index d4253a5..77933fd 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/ifunc-memset.h
@@ -1,7 +1,6 @@
-/* Multiple versions of memrchr
+/* Common definition for memset/memset_chk ifunc selections.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,28 +17,24 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
 #include <init-arch.h>
 
-#if IS_IN (libc)
-	.text
-ENTRY(__memrchr)
-	.type	__memrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_rep) attribute_hidden;
 
-	LOAD_FUNC_GOT_EAX (__memrchr_sse2)
-	ret
+static inline void *
+IFUNC_SELECTOR (void)
+{
+  const struct cpu_features* cpu_features = __get_cpu_features ();
 
-2:	LOAD_FUNC_GOT_EAX (__memrchr_ia32)
-	ret
+  if (CPU_FEATURES_CPU_P (cpu_features, SSE2))
+    {
+      if (CPU_FEATURES_ARCH_P (cpu_features, Fast_Rep_String))
+	return OPTIMIZE (sse2_rep);
 
-3:	LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
-	ret
-END(__memrchr)
+      return OPTIMIZE (sse2);
+    }
 
-weak_alias(__memrchr, memrchr)
-#endif
+  return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h
similarity index 55%
copy from sysdeps/i386/i686/multiarch/memrchr.S
copy to sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h
index d4253a5..0b9b99d 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h
@@ -1,7 +1,6 @@
-/* Multiple versions of memrchr
+/* Common definition for ifunc selections optimized with SSE2 and BSF.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,28 +17,24 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
 #include <init-arch.h>
 
-#if IS_IN (libc)
-	.text
-ENTRY(__memrchr)
-	.type	__memrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2_bsf) attribute_hidden;
 
-	LOAD_FUNC_GOT_EAX (__memrchr_sse2)
-	ret
+static inline void *
+IFUNC_SELECTOR (void)
+{
+  const struct cpu_features* cpu_features = __get_cpu_features ();
 
-2:	LOAD_FUNC_GOT_EAX (__memrchr_ia32)
-	ret
+  if (CPU_FEATURES_CPU_P (cpu_features, SSE2))
+    {
+      if (CPU_FEATURES_ARCH_P (cpu_features, Slow_BSF))
+	return OPTIMIZE (sse2);
 
-3:	LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
-	ret
-END(__memrchr)
+      return OPTIMIZE (sse2_bsf);
+    }
 
-weak_alias(__memrchr, memrchr)
-#endif
+  return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h
similarity index 54%
copy from sysdeps/i386/i686/multiarch/memrchr.S
copy to sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h
index d4253a5..a4c3645 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h
@@ -1,7 +1,7 @@
-/* Multiple versions of memrchr
+/* Common definition for ifunc selections optimized with SSE2 and
+   SSSE3.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,28 +18,23 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
 #include <init-arch.h>
 
-#if IS_IN (libc)
-	.text
-ENTRY(__memrchr)
-	.type	__memrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
 
-	LOAD_FUNC_GOT_EAX (__memrchr_sse2)
-	ret
+static inline void *
+IFUNC_SELECTOR (void)
+{
+  const struct cpu_features* cpu_features = __get_cpu_features ();
 
-2:	LOAD_FUNC_GOT_EAX (__memrchr_ia32)
-	ret
+  if (CPU_FEATURES_CPU_P (cpu_features, SSE2)
+      && CPU_FEATURES_ARCH_P (cpu_features, Fast_Rep_String))
+    return OPTIMIZE (sse2);
 
-3:	LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
-	ret
-END(__memrchr)
+  if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+    return OPTIMIZE (ssse3);
 
-weak_alias(__memrchr, memrchr)
-#endif
+  return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/ifunc-sse2.h
similarity index 63%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/ifunc-sse2.h
index 6ef9b6e..f4868aa 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/ifunc-sse2.h
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Common definition for ifunc selections optimized with SSE2.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,18 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
 #include <init-arch.h>
 
-#if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
-
-weak_alias(__wcslen, wcslen)
-#endif
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse2) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+  const struct cpu_features* cpu_features = __get_cpu_features ();
+
+  if (CPU_FEATURES_CPU_P (cpu_features, SSE2))
+    return OPTIMIZE (sse2);
+
+  return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/ifunc-sse4_2.h
similarity index 63%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/ifunc-sse4_2.h
index 6ef9b6e..d4f883a 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/ifunc-sse4_2.h
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Common definition for ifunc selections optimized with SSE4_2.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,18 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
 #include <init-arch.h>
 
-#if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
-
-weak_alias(__wcslen, wcslen)
-#endif
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse42) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+  const struct cpu_features* cpu_features = __get_cpu_features ();
+
+  if (CPU_FEATURES_CPU_P (cpu_features, SSE4_2))
+    return OPTIMIZE (sse42);
+
+  return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h
similarity index 56%
copy from sysdeps/i386/i686/multiarch/memrchr.S
copy to sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h
index d4253a5..e19d413 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h
@@ -1,7 +1,7 @@
-/* Multiple versions of memrchr
+/* Common definition for ifunc selections optimized with SSSE3 and
+   SSE4_2.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,28 +18,22 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
 #include <init-arch.h>
 
-#if IS_IN (libc)
-	.text
-ENTRY(__memrchr)
-	.type	__memrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (sse4_2) attribute_hidden;
 
-	LOAD_FUNC_GOT_EAX (__memrchr_sse2)
-	ret
+static inline void *
+IFUNC_SELECTOR (void)
+{
+  const struct cpu_features* cpu_features = __get_cpu_features ();
 
-2:	LOAD_FUNC_GOT_EAX (__memrchr_ia32)
-	ret
+  if (CPU_FEATURES_CPU_P (cpu_features, SSE4_2))
+    return OPTIMIZE (sse4_2);
 
-3:	LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
-	ret
-END(__memrchr)
+  if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+    return OPTIMIZE (ssse3);
 
-weak_alias(__memrchr, memrchr)
-#endif
+  return OPTIMIZE (ia32);
+}
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/memchr-ia32.S
similarity index 59%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/memchr-ia32.S
index 6ef9b6e..2663821 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/memchr-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcslen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* memchr optimized for i686.
+   Copyright (C) 2017 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
@@ -18,20 +16,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define __memchr __memchr_ia32
+
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_memchr; __GI_memchr = __memchr
+# endif
 
-weak_alias(__wcslen, wcslen)
+# undef weak_alias
+# define weak_alias(original, alias)
 #endif
+
+#include <sysdeps/i386/memchr.S>
diff --git a/sysdeps/i386/i686/multiarch/memchr.S b/sysdeps/i386/i686/multiarch/memchr.S
deleted file mode 100644
index bd0dace..0000000
--- a/sysdeps/i386/i686/multiarch/memchr.S
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Multiple versions of memchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
-	.text
-ENTRY(__memchr)
-	.type	__memchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
-
-	LOAD_FUNC_GOT_EAX ( __memchr_sse2)
-	ret
-
-2:	LOAD_FUNC_GOT_EAX (__memchr_ia32)
-	ret
-
-3:	LOAD_FUNC_GOT_EAX (__memchr_sse2_bsf)
-	ret
-END(__memchr)
-
-weak_alias(__memchr, memchr)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __memchr_ia32, @function; \
-	.globl __memchr_ia32; \
-	.p2align 4; \
-	__memchr_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __memchr_ia32, .-__memchr_ia32
-
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-# define libc_hidden_builtin_def(name) \
-	.globl __GI_memchr; __GI_memchr = __memchr_ia32
-
-#endif
-#include "../../memchr.S"
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/memchr.c
similarity index 66%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/memchr.c
index 6ef9b6e..f7cbb14 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/memchr.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Multiple versions of memchr.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define memchr __redirect_memchr
+# include <string.h>
+# undef memchr
+
+# define SYMBOL_NAME memchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_memchr, __memchr, IFUNC_SELECTOR ());
 
-weak_alias(__wcslen, wcslen)
+weak_alias (__memchr, memchr)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
similarity index 59%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/memcmp-ia32.S
index 6ef9b6e..737a914 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcslen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* memcmp optimized for i686.
+   Copyright (C) 2017 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
@@ -18,20 +16,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define memcmp __memcmp_ia32
+
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_memcmp; __GI_memcmp = memcmp
+# endif
 
-weak_alias(__wcslen, wcslen)
+# undef weak_alias
+# define weak_alias(original, alias)
 #endif
+
+#include <sysdeps/i386/i686/memcmp.S>
diff --git a/sysdeps/i386/i686/multiarch/memcmp.S b/sysdeps/i386/i686/multiarch/memcmp.S
deleted file mode 100644
index 1fc5994..0000000
--- a/sysdeps/i386/i686/multiarch/memcmp.S
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Multiple versions of memcmp
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
-#if IS_IN (libc)
-	.text
-ENTRY(memcmp)
-	.type	memcmp, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__memcmp_ia32)
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memcmp_ssse3)
-	HAS_CPU_FEATURE (SSE4_2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memcmp_sse4_2)
-2:	ret
-END(memcmp)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __memcmp_ia32, @function; \
-	.p2align 4; \
-	.globl __memcmp_ia32; \
-	.hidden __memcmp_ia32; \
-	__memcmp_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __memcmp_ia32, .-__memcmp_ia32
-
-# ifdef SHARED
-#  undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-#  define libc_hidden_builtin_def(name) \
-	.globl __GI_memcmp; __GI_memcmp = __memcmp_ia32
-# endif
-#endif
-
-#include "../memcmp.S"
diff --git a/sysdeps/i386/i686/multiarch/strnlen.S b/sysdeps/i386/i686/multiarch/memcmp.c
similarity index 65%
copy from sysdeps/i386/i686/multiarch/strnlen.S
copy to sysdeps/i386/i686/multiarch/memcmp.c
index d241522..5763c94 100644
--- a/sysdeps/i386/i686/multiarch/strnlen.S
+++ b/sysdeps/i386/i686/multiarch/memcmp.c
@@ -1,7 +1,6 @@
-/* Multiple versions of strnlen
+/* Multiple versions of memcmp.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(__strnlen)
-	.type	__strnlen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strnlen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strnlen_sse2)
-2:	ret
-END(__strnlen)
+# define memcmp __redirect_memcmp
+# include <string.h>
+# undef memcmp
+
+# define SYMBOL_NAME memcmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_memcmp, memcmp, IFUNC_SELECTOR ());
 
-weak_alias(__strnlen, strnlen)
+weak_alias (memcmp, bcmp)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/memcpy-ia32.S
similarity index 59%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/memcpy-ia32.S
index 6ef9b6e..51ec4d4 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/memcpy-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcslen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* memcpy optimized for i686.
+   Copyright (C) 2017 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
@@ -18,20 +16,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+#if defined SHARED && IS_IN (libc)
+# define memcpy __memcpy_ia32
+# define __memcpy_chk __memcpy_chk_ia32
 
-#if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
-
-weak_alias(__wcslen, wcslen)
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+# define libc_hidden_builtin_def(name) \
+	.globl __GI_memcpy; __GI_memcpy = memcpy
 #endif
+
+#include <sysdeps/i386/i686/memcpy.S>
diff --git a/sysdeps/i386/i686/multiarch/memcpy.S b/sysdeps/i386/i686/multiarch/memcpy.S
deleted file mode 100644
index f725944..0000000
--- a/sysdeps/i386/i686/multiarch/memcpy.S
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Multiple versions of memcpy
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
-   DSO.  In static binaries we need memcpy before the initialization
-   happened.  */
-#if defined SHARED && IS_IN (libc)
-	.text
-ENTRY(memcpy)
-	.type	memcpy, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__memcpy_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memcpy_sse2_unaligned)
-	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-	jnz	2f
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memcpy_ssse3)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memcpy_ssse3_rep)
-2:	ret
-END(memcpy)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __memcpy_ia32, @function; \
-	.p2align 4; \
-	.globl __memcpy_ia32; \
-	.hidden __memcpy_ia32; \
-	__memcpy_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __memcpy_ia32, .-__memcpy_ia32
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
-	.type __memcpy_chk_ia32, @function; \
-	.globl __memcpy_chk_ia32; \
-	.p2align 4; \
-	__memcpy_chk_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
-	cfi_endproc; .size __memcpy_chk_ia32, .-__memcpy_chk_ia32
-
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-# define libc_hidden_builtin_def(name) \
-	.globl __GI_memcpy; __GI_memcpy = __memcpy_ia32
-#endif
-
-#include "../memcpy.S"
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/memcpy.c
similarity index 62%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/memcpy.c
index 6ef9b6e..3379122 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/memcpy.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Multiple versions of memcpy.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in lib and for
+   DSO.  In static binaries we need memcpy before the initialization
+   happened.  */
+#if defined SHARED && IS_IN (libc)
+# define memcpy __redirect_memcpy
+# include <string.h>
+# undef memcpy
 
-#if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define SYMBOL_NAME memcpy
+# include "ifunc-memmove.h"
 
-weak_alias(__wcslen, wcslen)
+libc_ifunc_redirected (__redirect_memcpy, memcpy, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S
similarity index 61%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S
index cf67333..91c01f7 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcsrchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* Non-shared version of memcpy_chk for i686.
+   Copyright (C) 2017 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
@@ -18,18 +16,6 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/i386/memcpy_chk.S>
 #endif
diff --git a/sysdeps/i386/i686/multiarch/memcpy_chk.S b/sysdeps/i386/i686/multiarch/memcpy_chk.S
deleted file mode 100644
index 1b4fbe2..0000000
--- a/sysdeps/i386/i686/multiarch/memcpy_chk.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Multiple versions of __memcpy_chk
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
-   DSO.  There are no multiarch memcpy functions for static binaries.
- */
-#if IS_IN (libc)
-# ifdef SHARED
-	.text
-ENTRY(__memcpy_chk)
-	.type	__memcpy_chk, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__memcpy_chk_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memcpy_chk_sse2_unaligned)
-	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-	jnz	2f
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memcpy_chk_ssse3)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memcpy_chk_ssse3_rep)
-2:	ret
-END(__memcpy_chk)
-# else
-#  include "../memcpy_chk.S"
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/memcpy_chk.c
similarity index 64%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/memcpy_chk.c
index cf67333..6347c21 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/memcpy_chk.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of __memcpy_chk
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __memcpy_chk __redirect_memcpy_chk
+# include <string.h>
+# undef __memcpy_chk
 
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define SYMBOL_NAME memcpy_chk
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_memcpy_chk, __memcpy_chk,
+		       IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/memmove-ia32.S
similarity index 59%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/memmove-ia32.S
index 6ef9b6e..7f212dc 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/memmove-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcslen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* memmove optimized for i686.
+   Copyright (C) 2017 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
@@ -18,20 +16,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+#if defined SHARED && IS_IN (libc)
+# define memmove __memmove_ia32
+# define __memmove_chk __memmove_chk_ia32
 
-#if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
-
-weak_alias(__wcslen, wcslen)
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+# define libc_hidden_builtin_def(name) \
+	.globl __GI_memmove; __GI_memmove = memmove
 #endif
+
+#include <sysdeps/i386/i686/memmove.S>
diff --git a/sysdeps/i386/i686/multiarch/memmove.S b/sysdeps/i386/i686/multiarch/memmove.S
deleted file mode 100644
index 6eb418c..0000000
--- a/sysdeps/i386/i686/multiarch/memmove.S
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Multiple versions of memmove
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib.  */
-#if IS_IN (libc)
-	.text
-ENTRY(memmove)
-	.type	memmove, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__memmove_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memmove_sse2_unaligned)
-	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-	jnz	2f
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memmove_ssse3)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memmove_ssse3_rep)
-2:	ret
-END(memmove)
-
-# ifdef SHARED
-#  undef ENTRY
-#  define ENTRY(name) \
-	.type __memmove_ia32, @function; \
-	.p2align 4; \
-	.globl __memmove_ia32; \
-	.hidden __memmove_ia32; \
-	__memmove_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# else
-#  undef ENTRY
-#  define ENTRY(name) \
-	.type __memmove_ia32, @function; \
-	.globl __memmove_ia32; \
-	.p2align 4; \
-	__memmove_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# endif
-
-# undef END
-# define END(name) \
-	cfi_endproc; .size __memmove_ia32, .-__memmove_ia32
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
-	.type __memmove_chk_ia32, @function; \
-	.globl __memmove_chk_ia32; \
-	.p2align 4; \
-	__memmove_chk_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
-	cfi_endproc; .size __memmove_chk_ia32, .-__memmove_chk_ia32
-
-# ifdef SHARED
-#  undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-#  define libc_hidden_builtin_def(name) \
-	.globl __GI_memmove; __GI_memmove = __memmove_ia32
-# endif
-#endif
-
-#include "../memmove.S"
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/memmove.c
similarity index 62%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/memmove.c
index 6ef9b6e..1cbd87f 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/memmove.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Multiple versions of memmove.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in lib and for
+   DSO.  In static binaries we need memmove before the initialization
+   happened.  */
+#if defined SHARED && IS_IN (libc)
+# define memmove __redirect_memmove
+# include <string.h>
+# undef memmove
 
-#if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define SYMBOL_NAME memmove
+# include "ifunc-memmove.h"
 
-weak_alias(__wcslen, wcslen)
+libc_ifunc_redirected (__redirect_memmove, memmove, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S
similarity index 61%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S
index cf67333..514393d 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcsrchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* Non-shared version of memmmove_chk for i686.
+   Copyright (C) 2017 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
@@ -18,18 +16,6 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/i386/memmove_chk.S>
 #endif
diff --git a/sysdeps/i386/i686/multiarch/memmove_chk.S b/sysdeps/i386/i686/multiarch/memmove_chk.S
deleted file mode 100644
index 314834c..0000000
--- a/sysdeps/i386/i686/multiarch/memmove_chk.S
+++ /dev/null
@@ -1,94 +0,0 @@
-/* Multiple versions of __memmove_chk
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib.  */
-#if IS_IN (libc)
-	.text
-ENTRY(__memmove_chk)
-	.type	__memmove_chk, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__memmove_chk_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memmove_chk_sse2_unaligned)
-	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-	jnz	2f
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memmove_chk_ssse3)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memmove_chk_ssse3_rep)
-2:	ret
-END(__memmove_chk)
-
-# ifndef SHARED
-	.type __memmove_chk_sse2_unaligned, @function
-	.p2align 4;
-__memmove_chk_sse2_unaligned:
-	cfi_startproc
-	CALL_MCOUNT
-	movl	12(%esp), %eax
-	cmpl	%eax, 16(%esp)
-	jb	__chk_fail
-	jmp	__memmove_sse2_unaligned
-	cfi_endproc
-	.size __memmove_chk_sse2_unaligned, .-__memmove_chk_sse2_unaligned
-
-	.type __memmove_chk_ssse3, @function
-	.p2align 4;
-__memmove_chk_ssse3:
-	cfi_startproc
-	CALL_MCOUNT
-	movl	12(%esp), %eax
-	cmpl	%eax, 16(%esp)
-	jb	__chk_fail
-	jmp	__memmove_ssse3
-	cfi_endproc
-	.size __memmove_chk_ssse3, .-__memmove_chk_ssse3
-
-	.type __memmove_chk_ssse3_rep, @function
-	.p2align 4;
-__memmove_chk_ssse3_rep:
-	cfi_startproc
-	CALL_MCOUNT
-	movl	12(%esp), %eax
-	cmpl	%eax, 16(%esp)
-	jb	__chk_fail
-	jmp	__memmove_ssse3_rep
-	cfi_endproc
-	.size __memmove_chk_ssse3_rep, .-__memmove_chk_ssse3_rep
-
-	.type __memmove_chk_ia32, @function
-	.p2align 4;
-__memmove_chk_ia32:
-	cfi_startproc
-	CALL_MCOUNT
-	movl	12(%esp), %eax
-	cmpl	%eax, 16(%esp)
-	jb	__chk_fail
-	jmp	__memmove_ia32
-	cfi_endproc
-	.size __memmove_chk_ia32, .-__memmove_chk_ia32
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/memmove_chk.c
similarity index 64%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/memmove_chk.c
index 6ef9b6e..44339d6 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/memmove_chk.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Multiple versions of __memmove_chk
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __memmove_chk __redirect_memmove_chk
+# include <string.h>
+# undef __memmove_chk
 
-#if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define SYMBOL_NAME memmove_chk
+# include "ifunc-memmove.h"
 
-weak_alias(__wcslen, wcslen)
+libc_ifunc_redirected (__redirect_memmove_chk, __memmove_chk,
+		       IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strchr.S b/sysdeps/i386/i686/multiarch/mempcpy-ia32.S
similarity index 53%
rename from sysdeps/i386/i686/multiarch/strchr.S
rename to sysdeps/i386/i686/multiarch/mempcpy-ia32.S
index 5b97b1c..b6d5721 100644
--- a/sysdeps/i386/i686/multiarch/strchr.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of strchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* mempcpy optimized for i686.
+   Copyright (C) 2017 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
@@ -18,40 +16,22 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+#if defined SHARED && IS_IN (libc)
+# define __mempcpy __mempcpy_ia32
+# define __mempcpy_chk __mempcpy_chk_ia32
 
-#if IS_IN (libc)
-	.text
-ENTRY(strchr)
-	.type	strchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strchr_sse2_bsf)
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strchr_sse2)
-2:	ret
-END(strchr)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __strchr_ia32, @function; \
-	.globl __strchr_ia32; \
-	.p2align 4; \
-	__strchr_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __strchr_ia32, .-__strchr_ia32
+# undef libc_hidden_def
 # undef libc_hidden_builtin_def
 /* IFUNC doesn't work with the hidden functions in shared library since
    they will be called without setting up EBX needed for PLT which is
    used by IFUNC.  */
+# define libc_hidden_def(name) \
+	.globl __GI___mempcpy; __GI___mempcpy = __mempcpy
 # define libc_hidden_builtin_def(name) \
-	.globl __GI_strchr; __GI_strchr = __strchr_ia32
+	.globl __GI_mempcpy; __GI_mempcpy = __mempcpy
+
+# undef weak_alias
+# define weak_alias(original, alias)
 #endif
 
-#include "../../i586/strchr.S"
+#include <sysdeps/i386/i686/mempcpy.S>
diff --git a/sysdeps/i386/i686/multiarch/mempcpy.S b/sysdeps/i386/i686/multiarch/mempcpy.S
deleted file mode 100644
index 06e377f..0000000
--- a/sysdeps/i386/i686/multiarch/mempcpy.S
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Multiple versions of mempcpy
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
-   DSO.  In static binaries we need mempcpy before the initialization
-   happened.  */
-#if defined SHARED && IS_IN (libc)
-	.text
-ENTRY(__mempcpy)
-	.type	__mempcpy, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__mempcpy_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__mempcpy_sse2_unaligned)
-	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-	jnz	2f
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__mempcpy_ssse3)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__mempcpy_ssse3_rep)
-2:	ret
-END(__mempcpy)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __mempcpy_ia32, @function; \
-	.p2align 4; \
-	.globl __mempcpy_ia32; \
-	.hidden __mempcpy_ia32; \
-	__mempcpy_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __mempcpy_ia32, .-__mempcpy_ia32
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
-	.type __mempcpy_chk_ia32, @function; \
-	.globl __mempcpy_chk_ia32; \
-	.p2align 4; \
-	__mempcpy_chk_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
-	cfi_endproc; .size __mempcpy_chk_ia32, .-__mempcpy_chk_ia32
-
-# undef libc_hidden_def
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-# define libc_hidden_def(name) \
-	.globl __GI_mempcpy; __GI_mempcpy = __mempcpy_ia32
-# define libc_hidden_builtin_def(name) \
-	.globl __GI___mempcpy; __GI___mempcpy = __mempcpy_ia32
-#endif
-
-#include "../mempcpy.S"
diff --git a/sysdeps/i386/i686/multiarch/wcscmp.S b/sysdeps/i386/i686/multiarch/mempcpy.c
similarity index 56%
rename from sysdeps/i386/i686/multiarch/wcscmp.S
rename to sysdeps/i386/i686/multiarch/mempcpy.c
index 7118bdd..46d7f13 100644
--- a/sysdeps/i386/i686/multiarch/wcscmp.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcscmp
+/* Multiple versions of mempcpy.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,22 +17,22 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc and for the
-   DSO.  In static binaries, we need wcscmp before the initialization
+/* Define multiple versions only for the definition in lib and for
+   DSO.  In static binaries we need memcpy before the initialization
    happened.  */
-#if IS_IN (libc)
-	.text
-ENTRY(__wcscmp)
-	.type	__wcscmp, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcscmp_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcscmp_sse2)
-2:	ret
-END(__wcscmp)
-weak_alias (__wcscmp, wcscmp)
+#if defined SHARED && IS_IN (libc)
+# define mempcpy __redirect_mempcpy
+# define __mempcpy __redirect___mempcpy
+# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
+# include <string.h>
+# undef mempcpy
+# undef __mempcpy
+
+# define SYMBOL_NAME mempcpy
+# include "ifunc-memmove.h"
+
+libc_ifunc_redirected (__redirect_mempcpy, __mempcpy, IFUNC_SELECTOR ());
+
+weak_alias (__mempcpy, mempcpy)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S
similarity index 61%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S
index cf67333..6e31a5d 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcsrchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* Non-shared version of mempcpy_chk for i686.
+   Copyright (C) 2017 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
@@ -18,18 +16,6 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/i386/mempcpy_chk.S>
 #endif
diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk.S b/sysdeps/i386/i686/multiarch/mempcpy_chk.S
deleted file mode 100644
index e13e524..0000000
--- a/sysdeps/i386/i686/multiarch/mempcpy_chk.S
+++ /dev/null
@@ -1,50 +0,0 @@
-/* Multiple versions of __mempcpy_chk
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib and for
-   DSO.  There are no multiarch mempcpy functions for static binaries.
- */
-#if IS_IN (libc)
-# ifdef SHARED
-	.text
-ENTRY(__mempcpy_chk)
-	.type	__mempcpy_chk, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__mempcpy_chk_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__mempcpy_chk_sse2_unaligned)
-	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-	jnz	2f
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__mempcpy_chk_ssse3)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__mempcpy_chk_ssse3_rep)
-2:	ret
-END(__mempcpy_chk)
-# else
-#  include "../mempcpy_chk.S"
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/mempcpy_chk.c
similarity index 64%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/mempcpy_chk.c
index 6ef9b6e..c73273e 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy_chk.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Multiple versions of __mempcpy_chk
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __mempcpy_chk __redirect_mempcpy_chk
+# include <string.h>
+# undef __mempcpy_chk
 
-#if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define SYMBOL_NAME mempcpy_chk
+# include "ifunc-memmove.h"
 
-weak_alias(__wcslen, wcslen)
+libc_ifunc_redirected (__redirect_mempcpy_chk, __mempcpy_chk,
+		       IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/memrchr.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/memrchr.c
index cf67333..e8edba0 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/memrchr.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of memrchr.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define memrchr __redirect_memrchr
+# include <string.h>
+# undef memrchr
+
+# define SYMBOL_NAME memrchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_memrchr, __memrchr, IFUNC_SELECTOR ());
+
+weak_alias (__memrchr, memrchr)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/memset-ia32.S
similarity index 60%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/memset-ia32.S
index 6ef9b6e..a91f1b8 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/memset-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcslen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* memset optimized for i686.
+   Copyright (C) 2017 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
@@ -18,20 +16,18 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define memset __memset_ia32
+# define __memset_chk __memset_chk_ia32
 
-weak_alias(__wcslen, wcslen)
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_memset; __GI_memset = memset
+# endif
 #endif
+
+#include <sysdeps/i386/i686/memset.S>
diff --git a/sysdeps/i386/i686/multiarch/memset.S b/sysdeps/i386/i686/multiarch/memset.S
deleted file mode 100644
index f601663..0000000
--- a/sysdeps/i386/i686/multiarch/memset.S
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Multiple versions of memset
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib.  */
-#if IS_IN (libc)
-	.text
-ENTRY(memset)
-	.type	memset, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__memset_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memset_sse2)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memset_sse2_rep)
-2:	ret
-END(memset)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __memset_ia32, @function; \
-	.globl __memset_ia32; \
-	.p2align 4; \
-	__memset_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __memset_ia32, .-__memset_ia32
-
-# undef ENTRY_CHK
-# define ENTRY_CHK(name) \
-	.type __memset_chk_ia32, @function; \
-	.globl __memset_chk_ia32; \
-	.p2align 4; \
-	__memset_chk_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END_CHK
-# define END_CHK(name) \
-	cfi_endproc; .size __memset_chk_ia32, .-__memset_chk_ia32
-
-# ifdef SHARED
-#  undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-#  define libc_hidden_builtin_def(name) \
-	.globl __GI_memset; __GI_memset = __memset_ia32
-# endif
-
-# undef strong_alias
-# define strong_alias(original, alias)
-#endif
-
-#include "../memset.S"
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/memset.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/memset.c
index cf67333..0bc0418 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/memset.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of memset.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define memset __redirect_memset
+# include <string.h>
+# undef memset
+
+# define SYMBOL_NAME memset
+# include "ifunc-memset.h"
+
+libc_ifunc_redirected (__redirect_memset, memset, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/memset_chk-nonshared.S
similarity index 61%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/memset_chk-nonshared.S
index cf67333..038cff6 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/memset_chk-nonshared.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcsrchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* Non-shared version of memset_chk for i686.
+   Copyright (C) 2017 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
@@ -18,18 +16,6 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+#if IS_IN (libc) && !defined SHARED
+# include <sysdeps/i386/memset_chk.S>
 #endif
diff --git a/sysdeps/i386/i686/multiarch/memset_chk.S b/sysdeps/i386/i686/multiarch/memset_chk.S
deleted file mode 100644
index 0580991..0000000
--- a/sysdeps/i386/i686/multiarch/memset_chk.S
+++ /dev/null
@@ -1,78 +0,0 @@
-/* Multiple versions of __memset_chk
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in lib.  */
-#if IS_IN (libc)
-	.text
-ENTRY(__memset_chk)
-	.type	__memset_chk, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__memset_chk_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memset_chk_sse2)
-	HAS_ARCH_FEATURE (Fast_Rep_String)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__memset_chk_sse2_rep)
-2:	ret
-END(__memset_chk)
-
-# ifndef SHARED
-	.text
-	.type __memset_chk_sse2, @function
-	.p2align 4;
-__memset_chk_sse2:
-	cfi_startproc
-	CALL_MCOUNT
-	movl	12(%esp), %eax
-	cmpl	%eax, 16(%esp)
-	jb	__chk_fail
-	jmp	__memset_sse2
-	cfi_endproc
-	.size __memset_chk_sse2, .-__memset_chk_sse2
-
-	.type __memset_chk_sse2_rep, @function
-	.p2align 4;
-__memset_chk_sse2_rep:
-	cfi_startproc
-	CALL_MCOUNT
-	movl	12(%esp), %eax
-	cmpl	%eax, 16(%esp)
-	jb	__chk_fail
-	jmp	__memset_sse2_rep
-	cfi_endproc
-	.size __memset_chk_sse2_rep, .-__memset_chk_sse2_rep
-
-	.type __memset_chk_ia32, @function
-	.p2align 4;
-__memset_chk_ia32:
-	cfi_startproc
-	CALL_MCOUNT
-	movl	12(%esp), %eax
-	cmpl	%eax, 16(%esp)
-	jb	__chk_fail
-	jmp	__memset_ia32
-	cfi_endproc
-	.size __memset_chk_ia32, .-__memset_chk_ia32
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/memset_chk.c
similarity index 64%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/memset_chk.c
index cf67333..6996334 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/memset_chk.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of __memset_chk
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in libc.so. */
+#if IS_IN (libc) && defined SHARED
+# define __memset_chk __redirect_memset_chk
+# include <string.h>
+# undef __memset_chk
+
+# define SYMBOL_NAME memset_chk
+# include "ifunc-memset.h"
+
+libc_ifunc_redirected (__redirect_memset_chk, __memset_chk,
+		       IFUNC_SELECTOR ());
 
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strnlen.S b/sysdeps/i386/i686/multiarch/rawmemchr-ia32.S
similarity index 59%
copy from sysdeps/i386/i686/multiarch/strnlen.S
copy to sysdeps/i386/i686/multiarch/rawmemchr-ia32.S
index d241522..c182450 100644
--- a/sysdeps/i386/i686/multiarch/strnlen.S
+++ b/sysdeps/i386/i686/multiarch/rawmemchr-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of strnlen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* rawmemchr optimized for i686.
+   Copyright (C) 2017 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
@@ -18,20 +16,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__strnlen)
-	.type	__strnlen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strnlen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strnlen_sse2)
-2:	ret
-END(__strnlen)
+# define __rawmemchr __rawmemchr_ia32
+
+# ifdef SHARED
+#  undef libc_hidden_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_def(name) \
+	.globl __GI___rawmemchr; __GI___rawmemchr = __rawmemchr
+# endif
 
-weak_alias(__strnlen, strnlen)
+# undef weak_alias
+# define weak_alias(original, alias)
 #endif
+
+#include <sysdeps/i386/rawmemchr.S>
diff --git a/sysdeps/i386/i686/multiarch/rawmemchr.S b/sysdeps/i386/i686/multiarch/rawmemchr.S
deleted file mode 100644
index 0a41d63..0000000
--- a/sysdeps/i386/i686/multiarch/rawmemchr.S
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Multiple versions of rawmemchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
-	.text
-ENTRY(__rawmemchr)
-	.type	__rawmemchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
-
-	LOAD_FUNC_GOT_EAX (__rawmemchr_sse2)
-	ret
-
-2:	LOAD_FUNC_GOT_EAX (__rawmemchr_ia32)
-	ret
-
-3:	LOAD_FUNC_GOT_EAX (__rawmemchr_sse2_bsf)
-	ret
-END(__rawmemchr)
-
-weak_alias(__rawmemchr, rawmemchr)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __rawmemchr_ia32, @function; \
-	.globl __rawmemchr_ia32; \
-	.p2align 4; \
-	__rawmemchr_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __rawmemchr_ia32, .-__rawmemchr_ia32
-
-# undef libc_hidden_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-# define libc_hidden_def(name) \
-	.globl __GI___rawmemchr; __GI___rawmemchr = __rawmemchr_ia32
-
-#endif
-#include "../../rawmemchr.S"
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/rawmemchr.c
similarity index 62%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/rawmemchr.c
index 6ef9b6e..1cbc453 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/rawmemchr.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Multiple versions of rawmemchr.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define rawmemchr __redirect_rawmemchr
+# define __rawmemchr __redirect___rawmemchr
+# include <string.h>
+# undef rawmemchr
+# undef __rawmemchr
+
+# define SYMBOL_NAME rawmemchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_rawmemchr, __rawmemchr,
+		       IFUNC_SELECTOR ());
 
-weak_alias(__wcslen, wcslen)
+weak_alias (__rawmemchr, rawmemchr)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/stpcpy-ia32.S
similarity index 56%
copy from sysdeps/i386/i686/multiarch/memrchr.S
copy to sysdeps/i386/i686/multiarch/stpcpy-ia32.S
index d4253a5..679d530 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/stpcpy-ia32.S
@@ -1,7 +1,6 @@
-/* Multiple versions of memrchr
+/* stpcpy optimized for i686.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,28 +17,23 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__memrchr)
-	.type	__memrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
-
-	LOAD_FUNC_GOT_EAX (__memrchr_sse2)
-	ret
-
-2:	LOAD_FUNC_GOT_EAX (__memrchr_ia32)
-	ret
-
-3:	LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
-	ret
-END(__memrchr)
-
-weak_alias(__memrchr, memrchr)
+# define __stpcpy __stpcpy_ia32
+
+# ifdef SHARED
+#  undef libc_hidden_def
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_def(name) \
+	.globl __GI___stpcpy; __GI___stpcpy = __stpcpy
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_stpcpy; __GI_stpcpy = __stpcpy
+# endif
+
+# undef weak_alias
+# define weak_alias(original, alias)
 #endif
+
+#include <sysdeps/i386/i586/stpcpy.S>
diff --git a/sysdeps/i386/i686/multiarch/stpcpy.S b/sysdeps/i386/i686/multiarch/stpcpy.S
deleted file mode 100644
index ee81ab6..0000000
--- a/sysdeps/i386/i686/multiarch/stpcpy.S
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Multiple versions of stpcpy
-   All versions must be listed in ifunc-impl-list.c.  */
-#define USE_AS_STPCPY
-#define STRCPY __stpcpy
-#include "strcpy.S"
-
-weak_alias (__stpcpy, stpcpy)
-libc_hidden_def (__stpcpy)
-libc_hidden_builtin_def (stpcpy)
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/stpcpy.c
similarity index 61%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/stpcpy.c
index 6ef9b6e..32553b9 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/stpcpy.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Multiple versions of stpcpy.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define stpcpy __redirect_stpcpy
+# define __stpcpy __redirect___stpcpy
+# define NO_MEMPCPY_STPCPY_REDIRECT
+# define __NO_STRING_INLINES
+# include <string.h>
+# undef stpcpy
+# undef __stpcpy
+
+# define SYMBOL_NAME stpcpy
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_stpcpy, __stpcpy, IFUNC_SELECTOR ());
 
-weak_alias(__wcslen, wcslen)
+weak_alias (__stpcpy, stpcpy)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/stpncpy-ia32.S
similarity index 61%
copy from sysdeps/i386/i686/multiarch/memrchr.S
copy to sysdeps/i386/i686/multiarch/stpncpy-ia32.S
index d4253a5..d1be1fc 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/stpncpy-ia32.S
@@ -1,7 +1,6 @@
-/* Multiple versions of memrchr
+/* stpncpy optimized for i686.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,28 +17,21 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__memrchr)
-	.type	__memrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
-
-	LOAD_FUNC_GOT_EAX (__memrchr_sse2)
-	ret
-
-2:	LOAD_FUNC_GOT_EAX (__memrchr_ia32)
-	ret
-
-3:	LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
-	ret
-END(__memrchr)
-
-weak_alias(__memrchr, memrchr)
+# define __stpncpy __stpncpy_ia32
+
+# ifdef SHARED
+#  undef libc_hidden_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_def(name) \
+	.globl __GI___stpncpy; __GI___stpncpy = __stpncpy
+
+# undef weak_alias
+# define weak_alias(original, alias)
+# endif
+
 #endif
+
+#include <sysdeps/i386/stpncpy.S>
diff --git a/sysdeps/i386/i686/multiarch/stpncpy.S b/sysdeps/i386/i686/multiarch/stpncpy.S
deleted file mode 100644
index 2698ca6..0000000
--- a/sysdeps/i386/i686/multiarch/stpncpy.S
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Multiple versions of stpncpy
-   All versions must be listed in ifunc-impl-list.c.  */
-#define STRCPY __stpncpy
-#define USE_AS_STPCPY
-#define USE_AS_STRNCPY
-#include "strcpy.S"
-
-weak_alias (__stpncpy, stpncpy)
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/stpncpy.c
similarity index 64%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/stpncpy.c
index 6ef9b6e..ec9b888 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/stpncpy.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* Multiple versions of stpncpy.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,18 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define stpncpy __redirect_stpncpy
+# define __stpncpy __redirect___stpncpy
+# include <string.h>
+# undef stpncpy
+# undef __stpncpy
+
+# define SYMBOL_NAME stpncpy
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_stpncpy, __stpncpy, IFUNC_SELECTOR ());
 
-weak_alias(__wcslen, wcslen)
+weak_alias (__stpncpy, stpncpy)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strcasecmp.S b/sysdeps/i386/i686/multiarch/strcasecmp.c
similarity index 62%
rename from sysdeps/i386/i686/multiarch/strcasecmp.S
rename to sysdeps/i386/i686/multiarch/strcasecmp.c
index ec59276..fd9fae3 100644
--- a/sysdeps/i386/i686/multiarch/strcasecmp.S
+++ b/sysdeps/i386/i686/multiarch/strcasecmp.c
@@ -1,6 +1,6 @@
-/* Entry point for multi-version x86 strcasecmp.
+/* Multiple versions of strcasecmp.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
+   Copyright (C) 2017 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,23 +17,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in libc.  */
+#if IS_IN (libc)
+# define strcasecmp __redirect_strcasecmp
+# define __strcasecmp __redirect___strcasecmp
+# include <string.h>
+# undef strcasecmp
+# undef __strcasecmp
 
-	.text
-ENTRY(__strcasecmp)
-	.type	__strcasecmp, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strcasecmp_ia32)
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strcasecmp_ssse3)
-	HAS_CPU_FEATURE (SSE4_2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_SSE4_2)
-	jnz	2f
-	LOAD_FUNC_GOT_EAX (__strcasecmp_sse4_2)
-2:	ret
-END(__strcasecmp)
+# define SYMBOL_NAME strcasecmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strcasecmp, __strcasecmp,
+		       IFUNC_SELECTOR ());
 
 weak_alias (__strcasecmp, strcasecmp)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strcasecmp_l.S b/sysdeps/i386/i686/multiarch/strcasecmp_l.S
deleted file mode 100644
index 711c09b..0000000
--- a/sysdeps/i386/i686/multiarch/strcasecmp_l.S
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Multiple versions of strcasecmp_l
-   All versions must be listed in ifunc-impl-list.c.  */
-#define STRCMP __strcasecmp_l
-#define USE_AS_STRCASECMP_L
-#include "strcmp.S"
-
-weak_alias (__strcasecmp_l, strcasecmp_l)
diff --git a/sysdeps/i386/i686/multiarch/wmemcmp.S b/sysdeps/i386/i686/multiarch/strcasecmp_l.c
similarity index 60%
rename from sysdeps/i386/i686/multiarch/wmemcmp.S
rename to sysdeps/i386/i686/multiarch/strcasecmp_l.c
index 1b9a54a..56f21a7 100644
--- a/sysdeps/i386/i686/multiarch/wmemcmp.S
+++ b/sysdeps/i386/i686/multiarch/strcasecmp_l.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wmemcmp
+/* Multiple versions of strcasecmp_l.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,23 +17,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in libc.  */
+#if IS_IN (libc)
+# define strcasecmp_l __redirect_strcasecmp_l
+# define __strcasecmp_l __redirect___strcasecmp_l
+# include <string.h>
+# undef strcasecmp_l
+# undef __strcasecmp_l
 
-/* Define multiple versions only for the definition in libc. */
+# define SYMBOL_NAME strcasecmp_l
+# include "ifunc-ssse3-sse4_2.h"
 
-#if IS_IN (libc)
-	.text
-ENTRY(wmemcmp)
-	.type	wmemcmp, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wmemcmp_ia32)
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wmemcmp_ssse3)
-	HAS_CPU_FEATURE (SSE4_2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wmemcmp_sse4_2)
-2:	ret
-END(wmemcmp)
+libc_ifunc_redirected (__redirect_strcasecmp_l, __strcasecmp_l,
+		       IFUNC_SELECTOR ());
+
+weak_alias (__strcasecmp_l, strcasecmp_l)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/strcat-ia32.S
similarity index 64%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/strcat-ia32.S
index 6ef9b6e..81d0c8d 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/strcat-ia32.S
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* strcat optimized for i686.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define strcat __strcat_ia32
 
-weak_alias(__wcslen, wcslen)
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_strcat; __GI_strcat = strcat
+# endif
 #endif
+
+#include <sysdeps/i386/strcat.S>
diff --git a/sysdeps/i386/i686/multiarch/strcat.S b/sysdeps/i386/i686/multiarch/strcat.S
deleted file mode 100644
index 8412cb6..0000000
--- a/sysdeps/i386/i686/multiarch/strcat.S
+++ /dev/null
@@ -1,92 +0,0 @@
-/* Multiple versions of strcat
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#ifndef USE_AS_STRNCAT
-# ifndef STRCAT
-#  define STRCAT strcat
-# endif
-#endif
-
-#ifdef USE_AS_STRNCAT
-# define STRCAT_SSSE3	__strncat_ssse3
-# define STRCAT_SSE2		__strncat_sse2
-# define STRCAT_IA32		__strncat_ia32
-# define __GI_STRCAT		__GI_strncat
-#else
-# define STRCAT_SSSE3	__strcat_ssse3
-# define STRCAT_SSE2		__strcat_sse2
-# define STRCAT_IA32		__strcat_ia32
-# define __GI_STRCAT		__GI_strcat
-#endif
-
-
-/* Define multiple versions only for the definition in libc.  Don't
-   define multiple versions for strncat in static library since we
-   need strncat before the initialization happened.  */
-#if IS_IN (libc)
-
-	.text
-ENTRY(STRCAT)
-	.type	STRCAT, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (STRCAT_IA32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (STRCAT_SSE2)
-	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-	jnz	2f
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (STRCAT_SSSE3)
-2:	ret
-END(STRCAT)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type STRCAT_IA32, @function; \
-	.align 16; \
-	.globl STRCAT_IA32; \
-	.hidden STRCAT_IA32; \
-	STRCAT_IA32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size STRCAT_IA32, .-STRCAT_IA32
-
-# ifdef SHARED
-#  undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal strcat calls through a PLT.
-   The speedup we get from using SSSE3 instruction is likely eaten away
-   by the indirect call in the PLT.  */
-#  define libc_hidden_builtin_def(name) \
-	.globl __GI_STRCAT; __GI_STRCAT = STRCAT_IA32
-#  undef libc_hidden_def
-#  define libc_hidden_def(name) \
-	.globl __GI___STRCAT; __GI___STRCAT = STRCAT_IA32
-
-# endif
-#endif
-
-#ifndef USE_AS_STRNCAT
-# include "../../strcat.S"
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strcat.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strcat.c
index cf67333..f41cecf 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strcat.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strcat.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define strcat __redirect_strcat
+# include <string.h>
+# undef strcat
+
+# define SYMBOL_NAME strcat
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strcat, strcat, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/strchr-ia32.S
similarity index 59%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/strchr-ia32.S
index 6ef9b6e..4e55bf9 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/strchr-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcslen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* strchr optimized for i686.
+   Copyright (C) 2017 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
@@ -18,20 +16,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define strchr __strchr_ia32
+
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_strchr; __GI_strchr = strchr
+# endif
 
-weak_alias(__wcslen, wcslen)
+# undef weak_alias
+# define weak_alias(original, alias)
 #endif
+
+#include <sysdeps/i386/i586/strchr.S>
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strchr.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strchr.c
index cf67333..2029250 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strchr.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strchr.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define strchr __redirect_strchr
+# include <string.h>
+# undef strchr
+
+# define SYMBOL_NAME strchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_strchr, strchr, IFUNC_SELECTOR ());
+
+weak_alias (strchr, index)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/strcmp-ia32.S
similarity index 64%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/strcmp-ia32.S
index 6ef9b6e..2e87f19 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/strcmp-ia32.S
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* strcmp optimized for i686.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define strcmp __strcmp_ia32
 
-weak_alias(__wcslen, wcslen)
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_strcmp; __GI_strcmp = strcmp
+# endif
 #endif
+
+#include <sysdeps/i386/i686/strcmp.S>
diff --git a/sysdeps/i386/i686/multiarch/strcmp.S b/sysdeps/i386/i686/multiarch/strcmp.S
deleted file mode 100644
index 56de25a..0000000
--- a/sysdeps/i386/i686/multiarch/strcmp.S
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Multiple versions of strcmp
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2010-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#ifdef USE_AS_STRNCMP
-# define STRCMP			strncmp
-# define __GI_STRCMP		__GI_strncmp
-# define __STRCMP_IA32		__strncmp_ia32
-# define __STRCMP_SSSE3		__strncmp_ssse3
-# define __STRCMP_SSE4_2	__strncmp_sse4_2
-#elif defined USE_AS_STRCASECMP_L
-# define STRCMP			__strcasecmp_l
-# define __GI_STRCMP		__GI_strcasecmp_l
-# define __STRCMP_IA32		__strcasecmp_l_ia32
-# define __STRCMP_SSSE3		__strcasecmp_l_ssse3
-# define __STRCMP_SSE4_2	__strcasecmp_l_sse4_2
-#elif defined USE_AS_STRNCASECMP_L
-# define STRCMP			__strncasecmp_l
-# define __GI_STRCMP		__GI_strncasecmp_l
-# define __STRCMP_IA32		__strncasecmp_l_ia32
-# define __STRCMP_SSSE3		__strncasecmp_l_ssse3
-# define __STRCMP_SSE4_2	__strncasecmp_l_sse4_2
-#else
-# define STRCMP			strcmp
-# define __GI_STRCMP		__GI_strcmp
-# define __STRCMP_IA32		__strcmp_ia32
-# define __STRCMP_SSSE3		__strcmp_ssse3
-# define __STRCMP_SSE4_2	__strcmp_sse4_2
-#endif
-
-/* Define multiple versions only for the definition in libc.  Don't
-   define multiple versions for strncmp in static library since we
-   need strncmp before the initialization happened.  */
-#if (defined SHARED || !defined USE_AS_STRNCMP) && IS_IN (libc)
-	.text
-ENTRY(STRCMP)
-	.type	STRCMP, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__STRCMP_IA32)
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__STRCMP_SSSE3)
-	HAS_CPU_FEATURE (SSE4_2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_SSE4_2)
-	jnz	2f
-	LOAD_FUNC_GOT_EAX (__STRCMP_SSE4_2)
-2:	ret
-END(STRCMP)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __STRCMP_IA32, @function; \
-	.p2align 4; \
-	.globl __STRCMP_IA32; \
-	.hidden __STRCMP_IA32; \
-	__STRCMP_IA32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __STRCMP_IA32, .-__STRCMP_IA32
-
-# ifdef SHARED
-#  undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-#  define libc_hidden_builtin_def(name) \
-	.globl __GI_STRCMP; __GI_STRCMP = __STRCMP_IA32
-# endif
-#endif
-
-#if !defined USE_AS_STRNCMP && !defined USE_AS_STRCASECMP_L \
-    && !defined USE_AS_STRNCASECMP_L
-# include "../strcmp.S"
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strcmp.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strcmp.c
index cf67333..4388181 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strcmp.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strcmp.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define strcmp __redirect_strcmp
+# include <string.h>
+# undef strcmp
+
+# define SYMBOL_NAME strcmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strcmp, strcmp, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/strcpy-ia32.S
similarity index 64%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/strcpy-ia32.S
index 6ef9b6e..14205b8 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/strcpy-ia32.S
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* strcpy optimized for i686.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define strcpy __strcpy_ia32
 
-weak_alias(__wcslen, wcslen)
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_strcpy; __GI_strcpy = strcpy
+# endif
 #endif
+
+#include <sysdeps/i386/i586/strcpy.S>
diff --git a/sysdeps/i386/i686/multiarch/strcpy.S b/sysdeps/i386/i686/multiarch/strcpy.S
deleted file mode 100644
index ffbc03c..0000000
--- a/sysdeps/i386/i686/multiarch/strcpy.S
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Multiple versions of strcpy
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if !defined (USE_AS_STPCPY) && !defined (USE_AS_STRNCPY)
-# ifndef STRCPY
-#  define STRCPY strcpy
-# endif
-#endif
-
-#ifdef USE_AS_STPCPY
-# ifdef USE_AS_STRNCPY
-#  define STRCPY_SSSE3	__stpncpy_ssse3
-#  define STRCPY_SSE2		__stpncpy_sse2
-#  define STRCPY_IA32		__stpncpy_ia32
-#  define __GI_STRCPY		__GI_stpncpy
-#  define __GI___STRCPY		__GI___stpncpy
-# else
-#  define STRCPY_SSSE3	__stpcpy_ssse3
-#  define STRCPY_SSE2		__stpcpy_sse2
-#  define STRCPY_IA32		__stpcpy_ia32
-#  define __GI_STRCPY		__GI_stpcpy
-#  define __GI___STRCPY		__GI___stpcpy
-# endif
-#else
-# ifdef USE_AS_STRNCPY
-#  define STRCPY_SSSE3	__strncpy_ssse3
-#  define STRCPY_SSE2		__strncpy_sse2
-#  define STRCPY_IA32		__strncpy_ia32
-#  define __GI_STRCPY		__GI_strncpy
-# else
-#  define STRCPY_SSSE3	__strcpy_ssse3
-#  define STRCPY_SSE2		__strcpy_sse2
-#  define STRCPY_IA32		__strcpy_ia32
-#  define __GI_STRCPY		__GI_strcpy
-# endif
-#endif
-
-
-/* Define multiple versions only for the definition in libc.  Don't
-   define multiple versions for strncpy in static library since we
-   need strncpy before the initialization happened.  */
-#if IS_IN (libc)
-
-	.text
-ENTRY(STRCPY)
-	.type	STRCPY, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (STRCPY_IA32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (STRCPY_SSE2)
-	HAS_ARCH_FEATURE (Fast_Unaligned_Load)
-	jnz	2f
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (STRCPY_SSSE3)
-2:	ret
-END(STRCPY)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type STRCPY_IA32, @function; \
-	.align 16; \
-	.globl STRCPY_IA32; \
-	.hidden STRCPY_IA32; \
-	STRCPY_IA32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size STRCPY_IA32, .-STRCPY_IA32
-
-# ifdef SHARED
-#  undef libc_hidden_builtin_def
-/* It doesn't make sense to send libc-internal strcpy calls through a PLT.
-   The speedup we get from using SSSE3 instruction is likely eaten away
-   by the indirect call in the PLT.  */
-#  define libc_hidden_builtin_def(name) \
-	.globl __GI_STRCPY; __GI_STRCPY = STRCPY_IA32
-#  undef libc_hidden_def
-#  define libc_hidden_def(name) \
-	.globl __GI___STRCPY; __GI___STRCPY = STRCPY_IA32
-
-# endif
-#endif
-
-#ifdef USE_AS_STPCPY
-# ifdef USE_AS_STRNCPY
-#  include "../../stpncpy.S"
-# else
-#  include "../../i586/stpcpy.S"
-# endif
-#else
-# ifndef USE_AS_STRNCPY
-#  include "../../i586/strcpy.S"
-# endif
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strcpy.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strcpy.c
index cf67333..e36d174 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strcpy.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strcpy.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define strcpy __redirect_strcpy
+# include <string.h>
+# undef strcpy
+
+# define SYMBOL_NAME strcpy
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strcpy, strcpy, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/strcspn-ia32.S
similarity index 63%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/strcspn-ia32.S
index 6ef9b6e..483a38d 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/strcspn-ia32.S
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* strcspn optimized for i686.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define strcspn __strcspn_ia32
 
-weak_alias(__wcslen, wcslen)
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_strcspn; __GI_strcspn = strcspn
+# endif
 #endif
+
+#include <sysdeps/i386/strcspn.S>
diff --git a/sysdeps/i386/i686/multiarch/strcspn.S b/sysdeps/i386/i686/multiarch/strcspn.S
deleted file mode 100644
index 21e5093..0000000
--- a/sysdeps/i386/i686/multiarch/strcspn.S
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Multiple versions of strcspn
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2009-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <config.h>
-#include <sysdep.h>
-#include <init-arch.h>
-
-#ifdef USE_AS_STRPBRK
-#define STRCSPN_SSE42	__strpbrk_sse42
-#define STRCSPN_IA32	__strpbrk_ia32
-#define __GI_STRCSPN	__GI_strpbrk
-#else
-#ifndef STRCSPN
-#define STRCSPN		strcspn
-#define STRCSPN_SSE42	__strcspn_sse42
-#define STRCSPN_IA32	__strcspn_ia32
-#define __GI_STRCSPN	__GI_strcspn
-#endif
-#endif
-
-/* Define multiple versions only for the definition in libc.  Don't
-   define multiple versions for strpbrk in static library since we
-   need strpbrk before the initialization happened.  */
-#if (defined SHARED || !defined USE_AS_STRPBRK) && IS_IN (libc)
-	.text
-ENTRY(STRCSPN)
-	.type	STRCSPN, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (STRCSPN_IA32)
-	HAS_CPU_FEATURE (SSE4_2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (STRCSPN_SSE42)
-2:	ret
-END(STRCSPN)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type STRCSPN_IA32, @function; \
-	.globl STRCSPN_IA32; \
-	.p2align 4; \
-	STRCSPN_IA32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size STRCSPN_IA32, .-STRCSPN_IA32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-# define libc_hidden_builtin_def(name) \
-	.globl __GI_STRCSPN; __GI_STRCSPN = STRCSPN_IA32
-#endif
-
-#ifdef USE_AS_STRPBRK
-#include "../../strpbrk.S"
-#else
-#include "../../strcspn.S"
-#endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strcspn.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strcspn.c
index cf67333..3cf1aa8 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strcspn.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strcspn.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define strcspn __redirect_strcspn
+# include <string.h>
+# undef strcspn
+
+# define SYMBOL_NAME strcspn
+# include "ifunc-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strcspn, strcspn, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strlen-ia32.S
similarity index 61%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strlen-ia32.S
index cf67333..c511783 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strlen-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcsrchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* strlen optimized for i686.
+   Copyright (C) 2017 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
@@ -18,18 +16,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+#if defined SHARED && IS_IN (libc)
+# define strlen __strlen_ia32
 
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+# define libc_hidden_builtin_def(name) \
+	.globl __GI_strlen; __GI_strlen = strlen
 #endif
+
+#include <sysdeps/i386/i586/strlen.S>
diff --git a/sysdeps/i386/i686/multiarch/strlen.S b/sysdeps/i386/i686/multiarch/strlen.S
deleted file mode 100644
index 77cf6bc..0000000
--- a/sysdeps/i386/i686/multiarch/strlen.S
+++ /dev/null
@@ -1,60 +0,0 @@
-/* Multiple versions of strlen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2009-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc and for the
-   DSO.  In static binaries, we need strlen before the initialization
-   happened.  */
-#if defined SHARED && IS_IN (libc)
-	.text
-ENTRY(strlen)
-	.type	strlen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strlen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strlen_sse2_bsf)
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strlen_sse2)
-2:	ret
-END(strlen)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __strlen_ia32, @function; \
-	.globl __strlen_ia32; \
-	.p2align 4; \
-	__strlen_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __strlen_ia32, .-__strlen_ia32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-# define libc_hidden_builtin_def(name) \
-	.globl __GI_strlen; __GI_strlen = __strlen_ia32
-#endif
-
-#include "../../i586/strlen.S"
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strlen.c
similarity index 66%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strlen.c
index cf67333..2968bcc 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strlen.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strlen.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in libc.so.  */
+#if defined SHARED && IS_IN (libc)
+# define strlen __redirect_strlen
+# include <string.h>
+# undef strlen
 
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define SYMBOL_NAME strlen
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_strlen, strlen, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strncase.S b/sysdeps/i386/i686/multiarch/strncase.c
similarity index 61%
rename from sysdeps/i386/i686/multiarch/strncase.S
rename to sysdeps/i386/i686/multiarch/strncase.c
index a56e63a..68922e4 100644
--- a/sysdeps/i386/i686/multiarch/strncase.S
+++ b/sysdeps/i386/i686/multiarch/strncase.c
@@ -1,6 +1,6 @@
-/* Entry point for multi-version x86 strncasecmp.
+/* Multiple versions of strncasecmp.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
+   Copyright (C) 2017 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,23 +17,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in libc.  */
+#if IS_IN (libc)
+# define strncasecmp __redirect_strncasecmp
+# define __strncasecmp __redirect___strncasecmp
+# include <string.h>
+# undef strncasecmp
+# undef __strncasecmp
 
-	.text
-ENTRY(__strncasecmp)
-	.type	__strncasecmp, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strncasecmp_ia32)
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strncasecmp_ssse3)
-	HAS_CPU_FEATURE (SSE4_2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_SSE4_2)
-	jnz	2f
-	LOAD_FUNC_GOT_EAX (__strncasecmp_sse4_2)
-2:	ret
-END(__strncasecmp)
+# define SYMBOL_NAME strncasecmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strncasecmp, __strncasecmp,
+		       IFUNC_SELECTOR ());
 
 weak_alias (__strncasecmp, strncasecmp)
+#endif
diff --git a/sysdeps/i386/i686/multiarch/strncase_l.S b/sysdeps/i386/i686/multiarch/strncase_l.S
deleted file mode 100644
index 8a74ee8..0000000
--- a/sysdeps/i386/i686/multiarch/strncase_l.S
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Multiple versions of strncasecmp_l
-   All versions must be listed in ifunc-impl-list.c.  */
-#define STRCMP __strncasecmp_l
-#define USE_AS_STRNCASECMP_L
-#include "strcmp.S"
-
-weak_alias (__strncasecmp_l, strncasecmp_l)
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/strncase_l.c
similarity index 60%
copy from sysdeps/i386/i686/multiarch/memrchr.S
copy to sysdeps/i386/i686/multiarch/strncase_l.c
index d4253a5..ab25cb9 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/strncase_l.c
@@ -1,7 +1,6 @@
-/* Multiple versions of memrchr
+/* Multiple versions of strncasecmp_l.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,28 +17,19 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(__memrchr)
-	.type	__memrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
-
-	LOAD_FUNC_GOT_EAX (__memrchr_sse2)
-	ret
+# define strncasecmp_l __redirect_strncasecmp_l
+# define __strncasecmp_l __redirect___strncasecmp_l
+# include <string.h>
+# undef strncasecmp_l
+# undef __strncasecmp_l
 
-2:	LOAD_FUNC_GOT_EAX (__memrchr_ia32)
-	ret
+# define SYMBOL_NAME strncasecmp_l
+# include "ifunc-ssse3-sse4_2.h"
 
-3:	LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
-	ret
-END(__memrchr)
+libc_ifunc_redirected (__redirect_strncasecmp_l, __strncasecmp_l,
+		       IFUNC_SELECTOR ());
 
-weak_alias(__memrchr, memrchr)
+weak_alias (__strncasecmp_l, strncasecmp_l)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strncat.S b/sysdeps/i386/i686/multiarch/strncat.S
deleted file mode 100644
index 5c1bf41..0000000
--- a/sysdeps/i386/i686/multiarch/strncat.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strncat
-   All versions must be listed in ifunc-impl-list.c.  */
-#define STRCAT strncat
-#define USE_AS_STRNCAT
-#include "strcat.S"
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strncat.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strncat.c
index cf67333..5acad3d 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strncat.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strcat.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define strncat __redirect_strncat
+# include <string.h>
+# undef strncat
+
+# define SYMBOL_NAME strncat
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strncat, strncat, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strncmp.S b/sysdeps/i386/i686/multiarch/strncmp.S
deleted file mode 100644
index 150d478..0000000
--- a/sysdeps/i386/i686/multiarch/strncmp.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strncmp
-   All versions must be listed in ifunc-impl-list.c.  */
-#define USE_AS_STRNCMP
-#define STRCMP	strncmp
-#include "strcmp.S"
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strncmp.c
similarity index 66%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strncmp.c
index cf67333..3fea85f 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strncmp.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strncmp.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
+/* Define multiple versions only for the definition in libc.so.  */
+#if defined SHARED && IS_IN (libc)
+# define strncmp __redirect_strncmp
+# include <string.h>
+# undef strncmp
 
-#if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define SYMBOL_NAME strncmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strncmp, strncmp, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strncpy.S b/sysdeps/i386/i686/multiarch/strncpy.S
deleted file mode 100644
index 9c257ef..0000000
--- a/sysdeps/i386/i686/multiarch/strncpy.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strncpy
-   All versions must be listed in ifunc-impl-list.c.  */
-#define USE_AS_STRNCPY
-#define STRCPY strncpy
-#include "strcpy.S"
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strncpy.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strncpy.c
index cf67333..24404f6 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strncpy.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strncpy.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define _HAVE_STRING_ARCH_strncpy 1
+# define strncpy __redirect_strncpy
+# include <string.h>
+# undef strncpy
+
+# define SYMBOL_NAME strncpy
+# include "ifunc-sse2-ssse3.h"
+
+libc_ifunc_redirected (__redirect_strncpy, strncpy, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcscpy.S b/sysdeps/i386/i686/multiarch/strnlen.c
similarity index 64%
rename from sysdeps/i386/i686/multiarch/wcscpy.S
rename to sysdeps/i386/i686/multiarch/strnlen.c
index cfc97dd..83930bc 100644
--- a/sysdeps/i386/i686/multiarch/wcscpy.S
+++ b/sysdeps/i386/i686/multiarch/strnlen.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcscpy
+/* Multiple versions of strnlen.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,19 +17,18 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc. */
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcscpy)
-	.type	wcscpy, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcscpy_ia32)
-	HAS_CPU_FEATURE (SSSE3)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcscpy_ssse3)
-2:	ret
-END(wcscpy)
+# define strnlen __redirect_strnlen
+# define __strnlen __redirect___strnlen
+# include <string.h>
+# undef __strnlen
+# undef strnlen
+
+# define SYMBOL_NAME strnlen
+# include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_strnlen, __strnlen, IFUNC_SELECTOR ());
+
+weak_alias (__strnlen, strnlen);
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/strpbrk-ia32.S
similarity index 63%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/strpbrk-ia32.S
index 6ef9b6e..506043f 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/strpbrk-ia32.S
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* strpbrk optimized for i686.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define strpbrk __strpbrk_ia32
 
-weak_alias(__wcslen, wcslen)
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_strpbrk; __GI_strpbrk = strpbrk
+# endif
 #endif
+
+#include <sysdeps/i386/strpbrk.S>
diff --git a/sysdeps/i386/i686/multiarch/strpbrk.S b/sysdeps/i386/i686/multiarch/strpbrk.S
deleted file mode 100644
index 7201d63..0000000
--- a/sysdeps/i386/i686/multiarch/strpbrk.S
+++ /dev/null
@@ -1,5 +0,0 @@
-/* Multiple versions of strpbrk
-   All versions must be listed in ifunc-impl-list.c.  */
-#define STRCSPN strpbrk
-#define USE_AS_STRPBRK
-#include "strcspn.S"
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strpbrk.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strpbrk.c
index cf67333..50bbb16 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strpbrk.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strpbrk.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define strpbrk __redirect_strpbrk
+# include <string.h>
+# undef strpbrk
+
+# define SYMBOL_NAME strpbrk
+# include "ifunc-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strpbrk, strpbrk, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/strrchr-ia32.S
similarity index 59%
copy from sysdeps/i386/i686/multiarch/wcslen.S
copy to sysdeps/i386/i686/multiarch/strrchr-ia32.S
index 6ef9b6e..a0effaa 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/strrchr-ia32.S
@@ -1,7 +1,5 @@
-/* Multiple versions of wcslen
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+/* strrchr optimized for i686.
+   Copyright (C) 2017 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
@@ -18,20 +16,20 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define strrchr __strrchr_ia32
+
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_strrchr; __GI_strrchr = strrchr
+# endif
 
-weak_alias(__wcslen, wcslen)
+# undef weak_alias
+# define weak_alias(original, alias)
 #endif
+
+#include <sysdeps/i386/strrchr.S>
diff --git a/sysdeps/i386/i686/multiarch/strrchr.S b/sysdeps/i386/i686/multiarch/strrchr.S
deleted file mode 100644
index d9281ea..0000000
--- a/sysdeps/i386/i686/multiarch/strrchr.S
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Multiple versions of strrchr
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <sysdep.h>
-#include <init-arch.h>
-
-#if IS_IN (libc)
-	.text
-ENTRY(strrchr)
-	.type	strrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strrchr_sse2_bsf)
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strrchr_sse2)
-2:	ret
-END(strrchr)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __strrchr_ia32, @function; \
-	.globl __strrchr_ia32; \
-	.p2align 4; \
-	__strrchr_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __strrchr_ia32, .-__strrchr_ia32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-# define libc_hidden_builtin_def(name) \
-	.globl __GI_strrchr; __GI_strrchr = __strrchr_ia32
-#endif
-
-#include "../../strrchr.S"
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strrchr.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strrchr.c
index cf67333..ffacd0e 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strrchr.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strrchr.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,16 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define strrchr __redirect_strrchr
+# include <string.h>
+# undef strrchr
+
+# define SYMBOL_NAME strrchr
+# include "ifunc-sse2-bsf.h"
+
+libc_ifunc_redirected (__redirect_strrchr, strrchr, IFUNC_SELECTOR ());
+
+weak_alias (strrchr, rindex)
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/strspn-ia32.S
similarity index 64%
rename from sysdeps/i386/i686/multiarch/wcslen.S
rename to sysdeps/i386/i686/multiarch/strspn-ia32.S
index 6ef9b6e..d2b9beb 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/strspn-ia32.S
@@ -1,7 +1,6 @@
-/* Multiple versions of wcslen
+/* strspn optimized for i686.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
 #if IS_IN (libc)
-	.text
-ENTRY(__wcslen)
-	.type	__wcslen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcslen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcslen_sse2)
-2:	ret
-END(__wcslen)
+# define strspn __strspn_ia32
 
-weak_alias(__wcslen, wcslen)
+# ifdef SHARED
+#  undef libc_hidden_builtin_def
+/* IFUNC doesn't work with the hidden functions in shared library since
+   they will be called without setting up EBX needed for PLT which is
+   used by IFUNC.  */
+#  define libc_hidden_builtin_def(name) \
+	.globl __GI_strspn; __GI_strspn = strspn
+# endif
 #endif
+
+#include <sysdeps/i386/strspn.S>
diff --git a/sysdeps/i386/i686/multiarch/strspn.S b/sysdeps/i386/i686/multiarch/strspn.S
deleted file mode 100644
index 1269062..0000000
--- a/sysdeps/i386/i686/multiarch/strspn.S
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Multiple versions of strspn
-   All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2009-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
-   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/>.  */
-
-#include <config.h>
-#include <sysdep.h>
-#include <init-arch.h>
-
-/* Define multiple versions only for the definition in libc.  */
-#if IS_IN (libc)
-	.text
-ENTRY(strspn)
-	.type	strspn, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strspn_ia32)
-	HAS_CPU_FEATURE (SSE4_2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strspn_sse42)
-2:	ret
-END(strspn)
-
-# undef ENTRY
-# define ENTRY(name) \
-	.type __strspn_ia32, @function; \
-	.globl __strspn_ia32; \
-	.p2align 4; \
-__strspn_ia32: cfi_startproc; \
-	CALL_MCOUNT
-# undef END
-# define END(name) \
-	cfi_endproc; .size __strspn_ia32, .-__strspn_ia32
-# undef libc_hidden_builtin_def
-/* IFUNC doesn't work with the hidden functions in shared library since
-   they will be called without setting up EBX needed for PLT which is
-   used by IFUNC.  */
-# define libc_hidden_builtin_def(name) \
-	.globl __GI_strspn; __GI_strspn = __strspn_ia32
-#endif
-
-#include "../../strspn.S"
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/strspn.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/strspn.c
index cf67333..e1a86df 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/strspn.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of strspn.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define strspn __redirect_strspn
+# include <string.h>
+# undef strspn
+
+# define SYMBOL_NAME strspn
+# include "ifunc-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_strspn, strspn, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strnlen.S b/sysdeps/i386/i686/multiarch/wcschr.c
similarity index 65%
copy from sysdeps/i386/i686/multiarch/strnlen.S
copy to sysdeps/i386/i686/multiarch/wcschr.c
index d241522..2dfd318 100644
--- a/sysdeps/i386/i686/multiarch/strnlen.S
+++ b/sysdeps/i386/i686/multiarch/wcschr.c
@@ -1,7 +1,6 @@
-/* Multiple versions of strnlen
+/* Multiple versions of wcschr.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(__strnlen)
-	.type	__strnlen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strnlen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strnlen_sse2)
-2:	ret
-END(__strnlen)
+# define wcschr __redirect_wcschr
+# define __wcschr __redirect___wcschr
+# include <wchar.h>
+# undef wcschr
+# undef __wcschr
+
+# define SYMBOL_NAME wcschr
+# include "ifunc-sse2.h"
 
-weak_alias(__strnlen, strnlen)
+libc_ifunc_redirected (__redirect_wcschr, __wcschr, IFUNC_SELECTOR ());
+weak_alias (__wcschr, wcschr);
 #endif
diff --git a/sysdeps/i386/i686/multiarch/strnlen.S b/sysdeps/i386/i686/multiarch/wcscmp.c
similarity index 65%
rename from sysdeps/i386/i686/multiarch/strnlen.S
rename to sysdeps/i386/i686/multiarch/wcscmp.c
index d241522..e14bd73 100644
--- a/sysdeps/i386/i686/multiarch/strnlen.S
+++ b/sysdeps/i386/i686/multiarch/wcscmp.c
@@ -1,7 +1,6 @@
-/* Multiple versions of strnlen
+/* Multiple versions of wcscmp.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,20 +17,17 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(__strnlen)
-	.type	__strnlen, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__strnlen_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__strnlen_sse2)
-2:	ret
-END(__strnlen)
+# define wcscmp __redirect_wcscmp
+# define __wcscmp __redirect___wcscmp
+# include <wchar.h>
+# undef wcscmp
+# undef __wcscmp
+
+# define SYMBOL_NAME wcscmp
+# include "ifunc-sse2.h"
 
-weak_alias(__strnlen, strnlen)
+libc_ifunc_redirected (__redirect_wcscmp, __wcscmp, IFUNC_SELECTOR ());
+weak_alias (__wcscmp, wcscmp);
 #endif
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/wcscpy.c
similarity index 55%
rename from sysdeps/i386/i686/multiarch/memrchr.S
rename to sysdeps/i386/i686/multiarch/wcscpy.c
index d4253a5..bc17f36 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/wcscpy.c
@@ -1,7 +1,6 @@
-/* Multiple versions of memrchr
+/* Multiple versions of wcscpy.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,28 +17,28 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
+/* Define multiple versions only for the definition in libc.  */
+#if IS_IN (libc)
+# define wcscpy __redirect_wcscpy
+# include <wchar.h>
+# undef wcscpy
+
+# define SYMBOL_NAME wcscpy
 #include <init-arch.h>
 
-#if IS_IN (libc)
-	.text
-ENTRY(__memrchr)
-	.type	__memrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	HAS_ARCH_FEATURE (Slow_BSF)
-	jz	3f
-
-	LOAD_FUNC_GOT_EAX (__memrchr_sse2)
-	ret
-
-2:	LOAD_FUNC_GOT_EAX (__memrchr_ia32)
-	ret
-
-3:	LOAD_FUNC_GOT_EAX (__memrchr_sse2_bsf)
-	ret
-END(__memrchr)
-
-weak_alias(__memrchr, memrchr)
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ia32) attribute_hidden;
+extern __typeof (REDIRECT_NAME) OPTIMIZE (ssse3) attribute_hidden;
+
+static inline void *
+IFUNC_SELECTOR (void)
+{
+  const struct cpu_features* cpu_features = __get_cpu_features ();
+
+  if (CPU_FEATURES_CPU_P (cpu_features, SSSE3))
+    return OPTIMIZE (ssse3);
+
+  return OPTIMIZE (ia32);
+}
+
+libc_ifunc_redirected (__redirect_wcscpy, wcscpy, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/wcslen.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/wcslen.c
index cf67333..4870e64 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/wcslen.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of wcslen.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,15 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define __wcslen __redirect_wcslen
+# include <wchar.h>
+# undef __wcslen
+
+# define SYMBOL_NAME wcslen
+# include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_wcslen, __wcslen, IFUNC_SELECTOR ());
+weak_alias (__wcslen, wcslen);
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/wcsrchr.c
similarity index 67%
copy from sysdeps/i386/i686/multiarch/wcsrchr.S
copy to sysdeps/i386/i686/multiarch/wcsrchr.c
index cf67333..3169feb 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/wcsrchr.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of wcsrchr.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define wcsrchr __redirect_wcsrchr
+# include <wchar.h>
+# undef wcsrchr
+
+# define SYMBOL_NAME wcsrchr
+# include "ifunc-sse2.h"
+
+libc_ifunc_redirected (__redirect_wcsrchr, wcsrchr, IFUNC_SELECTOR ());
 #endif
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/wmemcmp.c
similarity index 67%
rename from sysdeps/i386/i686/multiarch/wcsrchr.S
rename to sysdeps/i386/i686/multiarch/wmemcmp.c
index cf67333..ca61408 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/wmemcmp.c
@@ -1,7 +1,6 @@
-/* Multiple versions of wcsrchr
+/* Multiple versions of wmemcmp.
    All versions must be listed in ifunc-impl-list.c.
-   Copyright (C) 2011-2017 Free Software Foundation, Inc.
-   Contributed by Intel Corporation.
+   Copyright (C) 2017 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
@@ -18,18 +17,14 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
-#include <sysdep.h>
-#include <init-arch.h>
-
+/* Define multiple versions only for the definition in libc.  */
 #if IS_IN (libc)
-	.text
-ENTRY(wcsrchr)
-	.type	wcsrchr, @gnu_indirect_function
-	LOAD_GOT_AND_RTLD_GLOBAL_RO
-	LOAD_FUNC_GOT_EAX (__wcsrchr_ia32)
-	HAS_CPU_FEATURE (SSE2)
-	jz	2f
-	LOAD_FUNC_GOT_EAX (__wcsrchr_sse2)
-2:	ret
-END(wcsrchr)
+# define wmemcmp __redirect_wmemcmp
+# include <wchar.h>
+# undef wmemcmp
+
+# define SYMBOL_NAME wmemcmp
+# include "ifunc-ssse3-sse4_2.h"
+
+libc_ifunc_redirected (__redirect_wmemcmp, wmemcmp, IFUNC_SELECTOR ());
 #endif

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

Summary of changes:
 ChangeLog                                          |  119 ++++++++++++++++++++
 sysdeps/i386/i686/multiarch/Makefile               |   13 ++-
 sysdeps/i386/i686/multiarch/bcopy-ia32.S           |   20 ++++
 sysdeps/i386/i686/multiarch/bcopy.S                |   59 ----------
 sysdeps/i386/i686/multiarch/bcopy.c                |   30 +++++
 sysdeps/i386/i686/multiarch/bzero-ia32.S           |   38 ++++++
 sysdeps/i386/i686/multiarch/bzero.S                |   62 ----------
 sysdeps/i386/i686/multiarch/bzero.c                |   32 +++++
 sysdeps/i386/i686/multiarch/ifunc-memmove.h        |   45 ++++++++
 sysdeps/i386/i686/multiarch/ifunc-memset.h         |   40 +++++++
 sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h       |   40 +++++++
 sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h     |   40 +++++++
 sysdeps/i386/i686/multiarch/ifunc-sse2.h           |   34 ++++++
 sysdeps/i386/i686/multiarch/ifunc-sse4_2.h         |   34 ++++++
 sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h   |   39 +++++++
 sysdeps/i386/i686/multiarch/memchr-ia32.S          |   35 ++++++
 sysdeps/i386/i686/multiarch/memchr.S               |   65 -----------
 sysdeps/i386/i686/multiarch/memchr.c               |   32 +++++
 sysdeps/i386/i686/multiarch/memcmp-ia32.S          |   35 ++++++
 sysdeps/i386/i686/multiarch/memcmp.S               |   62 ----------
 sysdeps/i386/i686/multiarch/memcmp.c               |   32 +++++
 sysdeps/i386/i686/multiarch/memcpy-ia32.S          |   31 +++++
 sysdeps/i386/i686/multiarch/memcpy.S               |   78 -------------
 sysdeps/i386/i686/multiarch/memcpy.c               |   32 +++++
 sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S |   21 ++++
 sysdeps/i386/i686/multiarch/memcpy_chk.S           |   50 --------
 .../{x86_64 => i386/i686}/multiarch/memcpy_chk.c   |    0
 sysdeps/i386/i686/multiarch/memmove-ia32.S         |   31 +++++
 sysdeps/i386/i686/multiarch/memmove.S              |   89 ---------------
 sysdeps/i386/i686/multiarch/memmove.c              |   32 +++++
 .../i386/i686/multiarch/memmove_chk-nonshared.S    |   21 ++++
 sysdeps/i386/i686/multiarch/memmove_chk.S          |   94 ---------------
 .../{x86_64 => i386/i686}/multiarch/memmove_chk.c  |    0
 sysdeps/i386/i686/multiarch/mempcpy-ia32.S         |   37 ++++++
 sysdeps/i386/i686/multiarch/mempcpy.S              |   81 -------------
 sysdeps/i386/i686/multiarch/mempcpy.c              |   38 ++++++
 .../i386/i686/multiarch/mempcpy_chk-nonshared.S    |   21 ++++
 sysdeps/i386/i686/multiarch/mempcpy_chk.S          |   50 --------
 .../{x86_64 => i386/i686}/multiarch/mempcpy_chk.c  |    0
 sysdeps/i386/i686/multiarch/memrchr.S              |   45 --------
 sysdeps/i386/i686/multiarch/memrchr.c              |   32 +++++
 sysdeps/i386/i686/multiarch/memset-ia32.S          |   33 ++++++
 sysdeps/i386/i686/multiarch/memset.S               |   75 ------------
 sysdeps/i386/i686/multiarch/memset.c               |   30 +++++
 sysdeps/i386/i686/multiarch/memset_chk-nonshared.S |   21 ++++
 sysdeps/i386/i686/multiarch/memset_chk.S           |   78 -------------
 sysdeps/i386/i686/multiarch/memset_chk.c           |   32 +++++
 sysdeps/i386/i686/multiarch/rawmemchr-ia32.S       |   35 ++++++
 sysdeps/i386/i686/multiarch/rawmemchr.S            |   65 -----------
 sysdeps/i386/i686/multiarch/rawmemchr.c            |   35 ++++++
 sysdeps/i386/i686/multiarch/stpcpy-ia32.S          |   39 +++++++
 sysdeps/i386/i686/multiarch/stpcpy.S               |    9 --
 sysdeps/i386/i686/multiarch/stpcpy.c               |   36 ++++++
 sysdeps/i386/i686/multiarch/stpncpy-ia32.S         |   37 ++++++
 sysdeps/i386/i686/multiarch/stpncpy.S              |    8 --
 sysdeps/i386/i686/multiarch/stpncpy.c              |   34 ++++++
 sysdeps/i386/i686/multiarch/strcasecmp.S           |   39 -------
 sysdeps/i386/i686/multiarch/strcasecmp.c           |   35 ++++++
 sysdeps/i386/i686/multiarch/strcasecmp_l.S         |    7 -
 sysdeps/i386/i686/multiarch/strcasecmp_l.c         |   35 ++++++
 sysdeps/i386/i686/multiarch/strcat-ia32.S          |   33 ++++++
 sysdeps/i386/i686/multiarch/strcat.S               |   92 ---------------
 sysdeps/i386/i686/multiarch/strcat.c               |   30 +++++
 sysdeps/i386/i686/multiarch/strchr-ia32.S          |   35 ++++++
 sysdeps/i386/i686/multiarch/strchr.S               |   57 ----------
 sysdeps/i386/i686/multiarch/strchr.c               |   32 +++++
 sysdeps/i386/i686/multiarch/strcmp-ia32.S          |   33 ++++++
 sysdeps/i386/i686/multiarch/strcmp.S               |   95 ----------------
 sysdeps/i386/i686/multiarch/strcmp.c               |   30 +++++
 sysdeps/i386/i686/multiarch/strcpy-ia32.S          |   33 ++++++
 sysdeps/i386/i686/multiarch/strcpy.S               |  116 -------------------
 sysdeps/i386/i686/multiarch/strcpy.c               |   30 +++++
 sysdeps/i386/i686/multiarch/strcspn-ia32.S         |   33 ++++++
 sysdeps/i386/i686/multiarch/strcspn.S              |   75 ------------
 sysdeps/i386/i686/multiarch/strcspn.c              |   30 +++++
 sysdeps/i386/i686/multiarch/strlen-ia32.S          |   30 +++++
 sysdeps/i386/i686/multiarch/strlen.S               |   60 ----------
 sysdeps/i386/i686/multiarch/strlen.c               |   30 +++++
 sysdeps/i386/i686/multiarch/strncase.S             |   39 -------
 sysdeps/i386/i686/multiarch/strncase.c             |   35 ++++++
 sysdeps/i386/i686/multiarch/strncase_l.S           |    7 -
 sysdeps/i386/i686/multiarch/strncase_l.c           |   35 ++++++
 sysdeps/i386/i686/multiarch/strncat.S              |    5 -
 sysdeps/i386/i686/multiarch/strncat.c              |   30 +++++
 sysdeps/i386/i686/multiarch/strncmp.S              |    5 -
 sysdeps/i386/i686/multiarch/strncmp.c              |   30 +++++
 sysdeps/i386/i686/multiarch/strncpy.S              |    5 -
 sysdeps/i386/i686/multiarch/strncpy.c              |   31 +++++
 sysdeps/i386/i686/multiarch/strnlen.S              |   37 ------
 sysdeps/i386/i686/multiarch/strnlen.c              |   34 ++++++
 sysdeps/i386/i686/multiarch/strpbrk-ia32.S         |   33 ++++++
 sysdeps/i386/i686/multiarch/strpbrk.S              |    5 -
 sysdeps/i386/i686/multiarch/strpbrk.c              |   30 +++++
 sysdeps/i386/i686/multiarch/strrchr-ia32.S         |   35 ++++++
 sysdeps/i386/i686/multiarch/strrchr.S              |   57 ----------
 sysdeps/i386/i686/multiarch/strrchr.c              |   32 +++++
 sysdeps/i386/i686/multiarch/strspn-ia32.S          |   33 ++++++
 sysdeps/i386/i686/multiarch/strspn.S               |   56 ---------
 sysdeps/i386/i686/multiarch/strspn.c               |   30 +++++
 sysdeps/i386/i686/multiarch/wcschr.S               |   36 ------
 sysdeps/i386/i686/multiarch/wcschr.c               |   33 ++++++
 sysdeps/i386/i686/multiarch/wcscmp.S               |   39 -------
 sysdeps/i386/i686/multiarch/wcscmp.c               |   33 ++++++
 sysdeps/i386/i686/multiarch/wcscpy.S               |   36 ------
 sysdeps/i386/i686/multiarch/wcscpy.c               |   44 +++++++
 sysdeps/i386/i686/multiarch/wcslen.S               |   37 ------
 sysdeps/i386/i686/multiarch/wcslen.c               |   31 +++++
 sysdeps/i386/i686/multiarch/wcsrchr.S              |   35 ------
 sysdeps/i386/i686/multiarch/wcsrchr.c              |   30 +++++
 sysdeps/i386/i686/multiarch/wmemcmp.S              |   40 -------
 sysdeps/i386/i686/multiarch/wmemcmp.c              |   30 +++++
 111 files changed, 2323 insertions(+), 1951 deletions(-)
 create mode 100644 sysdeps/i386/i686/multiarch/bcopy-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/bcopy.S
 create mode 100644 sysdeps/i386/i686/multiarch/bcopy.c
 create mode 100644 sysdeps/i386/i686/multiarch/bzero-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/bzero.S
 create mode 100644 sysdeps/i386/i686/multiarch/bzero.c
 create mode 100644 sysdeps/i386/i686/multiarch/ifunc-memmove.h
 create mode 100644 sysdeps/i386/i686/multiarch/ifunc-memset.h
 create mode 100644 sysdeps/i386/i686/multiarch/ifunc-sse2-bsf.h
 create mode 100644 sysdeps/i386/i686/multiarch/ifunc-sse2-ssse3.h
 create mode 100644 sysdeps/i386/i686/multiarch/ifunc-sse2.h
 create mode 100644 sysdeps/i386/i686/multiarch/ifunc-sse4_2.h
 create mode 100644 sysdeps/i386/i686/multiarch/ifunc-ssse3-sse4_2.h
 create mode 100644 sysdeps/i386/i686/multiarch/memchr-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memchr.S
 create mode 100644 sysdeps/i386/i686/multiarch/memchr.c
 create mode 100644 sysdeps/i386/i686/multiarch/memcmp-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memcmp.S
 create mode 100644 sysdeps/i386/i686/multiarch/memcmp.c
 create mode 100644 sysdeps/i386/i686/multiarch/memcpy-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memcpy.S
 create mode 100644 sysdeps/i386/i686/multiarch/memcpy.c
 create mode 100644 sysdeps/i386/i686/multiarch/memcpy_chk-nonshared.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memcpy_chk.S
 copy sysdeps/{x86_64 => i386/i686}/multiarch/memcpy_chk.c (100%)
 create mode 100644 sysdeps/i386/i686/multiarch/memmove-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memmove.S
 create mode 100644 sysdeps/i386/i686/multiarch/memmove.c
 create mode 100644 sysdeps/i386/i686/multiarch/memmove_chk-nonshared.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memmove_chk.S
 copy sysdeps/{x86_64 => i386/i686}/multiarch/memmove_chk.c (100%)
 create mode 100644 sysdeps/i386/i686/multiarch/mempcpy-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/mempcpy.S
 create mode 100644 sysdeps/i386/i686/multiarch/mempcpy.c
 create mode 100644 sysdeps/i386/i686/multiarch/mempcpy_chk-nonshared.S
 delete mode 100644 sysdeps/i386/i686/multiarch/mempcpy_chk.S
 copy sysdeps/{x86_64 => i386/i686}/multiarch/mempcpy_chk.c (100%)
 delete mode 100644 sysdeps/i386/i686/multiarch/memrchr.S
 create mode 100644 sysdeps/i386/i686/multiarch/memrchr.c
 create mode 100644 sysdeps/i386/i686/multiarch/memset-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memset.S
 create mode 100644 sysdeps/i386/i686/multiarch/memset.c
 create mode 100644 sysdeps/i386/i686/multiarch/memset_chk-nonshared.S
 delete mode 100644 sysdeps/i386/i686/multiarch/memset_chk.S
 create mode 100644 sysdeps/i386/i686/multiarch/memset_chk.c
 create mode 100644 sysdeps/i386/i686/multiarch/rawmemchr-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/rawmemchr.S
 create mode 100644 sysdeps/i386/i686/multiarch/rawmemchr.c
 create mode 100644 sysdeps/i386/i686/multiarch/stpcpy-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/stpcpy.S
 create mode 100644 sysdeps/i386/i686/multiarch/stpcpy.c
 create mode 100644 sysdeps/i386/i686/multiarch/stpncpy-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/stpncpy.S
 create mode 100644 sysdeps/i386/i686/multiarch/stpncpy.c
 delete mode 100644 sysdeps/i386/i686/multiarch/strcasecmp.S
 create mode 100644 sysdeps/i386/i686/multiarch/strcasecmp.c
 delete mode 100644 sysdeps/i386/i686/multiarch/strcasecmp_l.S
 create mode 100644 sysdeps/i386/i686/multiarch/strcasecmp_l.c
 create mode 100644 sysdeps/i386/i686/multiarch/strcat-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/strcat.S
 create mode 100644 sysdeps/i386/i686/multiarch/strcat.c
 create mode 100644 sysdeps/i386/i686/multiarch/strchr-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/strchr.S
 create mode 100644 sysdeps/i386/i686/multiarch/strchr.c
 create mode 100644 sysdeps/i386/i686/multiarch/strcmp-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/strcmp.S
 create mode 100644 sysdeps/i386/i686/multiarch/strcmp.c
 create mode 100644 sysdeps/i386/i686/multiarch/strcpy-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/strcpy.S
 create mode 100644 sysdeps/i386/i686/multiarch/strcpy.c
 create mode 100644 sysdeps/i386/i686/multiarch/strcspn-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/strcspn.S
 create mode 100644 sysdeps/i386/i686/multiarch/strcspn.c
 create mode 100644 sysdeps/i386/i686/multiarch/strlen-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/strlen.S
 create mode 100644 sysdeps/i386/i686/multiarch/strlen.c
 delete mode 100644 sysdeps/i386/i686/multiarch/strncase.S
 create mode 100644 sysdeps/i386/i686/multiarch/strncase.c
 delete mode 100644 sysdeps/i386/i686/multiarch/strncase_l.S
 create mode 100644 sysdeps/i386/i686/multiarch/strncase_l.c
 delete mode 100644 sysdeps/i386/i686/multiarch/strncat.S
 create mode 100644 sysdeps/i386/i686/multiarch/strncat.c
 delete mode 100644 sysdeps/i386/i686/multiarch/strncmp.S
 create mode 100644 sysdeps/i386/i686/multiarch/strncmp.c
 delete mode 100644 sysdeps/i386/i686/multiarch/strncpy.S
 create mode 100644 sysdeps/i386/i686/multiarch/strncpy.c
 delete mode 100644 sysdeps/i386/i686/multiarch/strnlen.S
 create mode 100644 sysdeps/i386/i686/multiarch/strnlen.c
 create mode 100644 sysdeps/i386/i686/multiarch/strpbrk-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/strpbrk.S
 create mode 100644 sysdeps/i386/i686/multiarch/strpbrk.c
 create mode 100644 sysdeps/i386/i686/multiarch/strrchr-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/strrchr.S
 create mode 100644 sysdeps/i386/i686/multiarch/strrchr.c
 create mode 100644 sysdeps/i386/i686/multiarch/strspn-ia32.S
 delete mode 100644 sysdeps/i386/i686/multiarch/strspn.S
 create mode 100644 sysdeps/i386/i686/multiarch/strspn.c
 delete mode 100644 sysdeps/i386/i686/multiarch/wcschr.S
 create mode 100644 sysdeps/i386/i686/multiarch/wcschr.c
 delete mode 100644 sysdeps/i386/i686/multiarch/wcscmp.S
 create mode 100644 sysdeps/i386/i686/multiarch/wcscmp.c
 delete mode 100644 sysdeps/i386/i686/multiarch/wcscpy.S
 create mode 100644 sysdeps/i386/i686/multiarch/wcscpy.c
 delete mode 100644 sysdeps/i386/i686/multiarch/wcslen.S
 create mode 100644 sysdeps/i386/i686/multiarch/wcslen.c
 delete mode 100644 sysdeps/i386/i686/multiarch/wcsrchr.S
 create mode 100644 sysdeps/i386/i686/multiarch/wcsrchr.c
 delete mode 100644 sysdeps/i386/i686/multiarch/wmemcmp.S
 create mode 100644 sysdeps/i386/i686/multiarch/wmemcmp.c


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]