This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 2/6] Add i686 multiarch __libc_func
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 26 Sep 2012 07:42:15 -0700
- Subject: [PATCH 2/6] Add i686 multiarch __libc_func
Hi,
This patch adds i686 multiarch __libc_func. OK to install?
Thanks.
H.J.
---
ChangeLog.test-ifunc | 12 +
sysdeps/i386/i686/multiarch/bcopy.S | 2 +
sysdeps/i386/i686/multiarch/bzero.S | 2 +
sysdeps/i386/i686/multiarch/libc-func.c | 928 ++++++++++++++++++++++++++++++++
sysdeps/i386/i686/multiarch/memcmp.S | 2 +
sysdeps/i386/i686/multiarch/memcpy.S | 2 +
sysdeps/i386/i686/multiarch/memmove.S | 2 +
sysdeps/i386/i686/multiarch/mempcpy.S | 2 +
sysdeps/i386/i686/multiarch/strcat.S | 2 +
sysdeps/i386/i686/multiarch/strcmp.S | 2 +
sysdeps/i386/i686/multiarch/strcpy.S | 2 +
11 files changed, 958 insertions(+)
create mode 100644 sysdeps/i386/i686/multiarch/libc-func.c
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 815076b..dbb3b44 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,17 @@
2012-09-26 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/i386/i686/multiarch/bcopy.S (__bcopy_ia32): Make it
+ global and hidden.
+ * sysdeps/i386/i686/multiarch/bzero.S (__bzero_ia32): Likewise.
+ * sysdeps/i386/i686/multiarch/memcmp.S (__memcmp_ia32): Likewise.
+ * sysdeps/i386/i686/multiarch/memcpy.S (__memcpy_ia32): Likewise.
+ * sysdeps/i386/i686/multiarch/memmove.S (__memmove_ia32): Likewise.
+ * sysdeps/i386/i686/multiarch/mempcpy.S (__mempcpy_ia32): Likewise.
+ * sysdeps/i386/i686/multiarch/strcat.S (STRCAT_IA32): Likewise.
+ * sysdeps/i386/i686/multiarch/strcmp.S (__STRCMP_IA32): Likewise.
+ * sysdeps/i386/i686/multiarch/strcpy.S (STRCPY_IA32): Likewise.
+ * sysdeps/i386/i686/multiarch/libc-func.c: New file.
+
* Rules (tests): Filter out $(tests-ifunc) if multi-arch isn't
enabled.
(xtests): Filter out $(xtests-ifunc) if multi-arch isn't enabled.
diff --git a/sysdeps/i386/i686/multiarch/bcopy.S b/sysdeps/i386/i686/multiarch/bcopy.S
index 9db3424..ca507b0 100644
--- a/sysdeps/i386/i686/multiarch/bcopy.S
+++ b/sysdeps/i386/i686/multiarch/bcopy.S
@@ -67,6 +67,8 @@ END(bcopy)
# define ENTRY(name) \
.type __bcopy_ia32, @function; \
.p2align 4; \
+ .globl __bcopy_ia32; \
+ .hidden __bcopy_ia32; \
__bcopy_ia32: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/i386/i686/multiarch/bzero.S b/sysdeps/i386/i686/multiarch/bzero.S
index 86db169..2226e7a 100644
--- a/sysdeps/i386/i686/multiarch/bzero.S
+++ b/sysdeps/i386/i686/multiarch/bzero.S
@@ -67,6 +67,8 @@ END(__bzero)
# define ENTRY(name) \
.type __bzero_ia32, @function; \
.p2align 4; \
+ .globl __bzero_ia32; \
+ .hidden __bzero_ia32; \
__bzero_ia32: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/i386/i686/multiarch/libc-func.c b/sysdeps/i386/i686/multiarch/libc-func.c
new file mode 100644
index 0000000..25b6003
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/libc-func.c
@@ -0,0 +1,928 @@
+/* Copyright (C) 2012 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, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+#include <libc-func.h>
+#include "init-arch.h"
+
+#define find_memcmp() NULL
+#define find_memchr() NULL
+#define find_memrchr() NULL
+#define find_rawmemchr() NULL
+#define find_memcpy() NULL
+#define find_memmove() NULL
+#define find_mempcpy() NULL
+#define find___memcpy_chk() NULL
+#define find___memmove_chk() NULL
+#define find___mempcpy_chk() NULL
+#define find_memset() NULL
+#define find_stpcpy() NULL
+#define find_stpncpy() NULL
+#define find_strcpy() NULL
+#define find_strncpy() NULL
+#define find_strcasecmp() NULL
+#define find_strcasecmp_l() NULL
+#define find_strncasecmp() NULL
+#define find_strncasecmp_l() NULL
+#define find_strcasestr() NULL
+#define find_strcat() NULL
+#define find_strncat() NULL
+#define find_strchr() NULL
+#define find_strrchr() NULL
+#define find_strcmp() NULL
+#define find_strncmp() NULL
+#define find_strcspn() NULL
+#define find_strlen() NULL
+#define find_strnlen() NULL
+#define find_strpbrk() NULL
+#define find_strspn() NULL
+#define find_strstr() NULL
+#define find_wcschr() NULL
+#define find_wcscmp() NULL
+#define find_wcscpy() NULL
+#define find_wcslen() NULL
+#define find_wcsrchr() NULL
+#define find_wmemcmp() NULL
+
+#ifndef NOT_IN_libc
+
+extern __typeof (memmove) __memmove_ia32;
+extern __typeof (memmove) __memmove_ssse3;
+extern __typeof (memmove) __memmove_ssse3_rep;
+
+static const struct libc_func_test memmove_list[] =
+{
+ LIBC_FUNC_INIT (__memmove_ssse3_rep),
+ LIBC_FUNC_INIT (__memmove_ssse3),
+ LIBC_FUNC_INIT (__memmove_ia32),
+ { NULL, NULL },
+};
+
+# undef find_memmove
+
+static const struct libc_func_test *
+find_memmove (void)
+{
+ return memmove_list + (HAS_SSSE3 ? 0 : 2);
+}
+
+extern void *__memmove_chk (void *, const void *, size_t, size_t);
+extern __typeof (__memmove_chk) __memmove_chk_ia32;
+extern __typeof (__memmove_chk) __memmove_chk_ssse3;
+extern __typeof (__memmove_chk) __memmove_chk_ssse3_rep;
+
+static const struct libc_func_test __memmove_chk_list[] =
+{
+ LIBC_FUNC_INIT (__memmove_chk_ssse3_rep),
+ LIBC_FUNC_INIT (__memmove_chk_ssse3),
+ LIBC_FUNC_INIT (__memmove_chk_ia32),
+ { NULL, NULL },
+};
+
+# undef find___memmove_chk
+
+static const struct libc_func_test *
+find___memmove_chk (void)
+{
+ return __memmove_chk_list + (HAS_SSSE3 ? 0 : 2);
+}
+
+extern __typeof (memchr) __memchr_ia32;
+extern __typeof (memchr) __memchr_sse2;
+extern __typeof (memchr) __memchr_sse2_bsf;
+
+static const struct libc_func_test memchr_list[] =
+{
+ LIBC_FUNC_INIT (__memchr_sse2_bsf),
+ LIBC_FUNC_INIT (__memchr_sse2),
+ LIBC_FUNC_INIT (__memchr_ia32),
+ { NULL, NULL },
+};
+
+# undef find_memchr
+
+static const struct libc_func_test *
+find_memchr (void)
+{
+ return memchr_list + (HAS_SSE2 ? 0 : 2);
+}
+
+extern __typeof (memrchr) __memrchr_ia32;
+extern __typeof (memrchr) __memrchr_sse2;
+extern __typeof (memrchr) __memrchr_sse2_bsf;
+
+static const struct libc_func_test memrchr_list[] =
+{
+ LIBC_FUNC_INIT (__memrchr_sse2_bsf),
+ LIBC_FUNC_INIT (__memrchr_sse2),
+ LIBC_FUNC_INIT (__memrchr_ia32),
+ { NULL, NULL },
+};
+
+# undef find_memrchr
+
+static const struct libc_func_test *
+find_memrchr (void)
+{
+ return memrchr_list + (HAS_SSE2 ? 0 : 2);
+}
+
+extern __typeof (rawmemchr) __rawmemchr_ia32;
+extern __typeof (rawmemchr) __rawmemchr_sse2;
+extern __typeof (rawmemchr) __rawmemchr_sse2_bsf;
+
+static const struct libc_func_test rawmemchr_list[] =
+{
+ LIBC_FUNC_INIT (__rawmemchr_sse2_bsf),
+ LIBC_FUNC_INIT (__rawmemchr_sse2),
+ LIBC_FUNC_INIT (__rawmemchr_ia32),
+ { NULL, NULL },
+};
+
+# undef find_rawmemchr
+
+static const struct libc_func_test *
+find_rawmemchr (void)
+{
+ return rawmemchr_list + (HAS_SSE2 ? 0 : 2);
+}
+
+extern __typeof (memcmp) __memcmp_ia32;
+extern __typeof (memcmp) __memcmp_ssse3;
+extern __typeof (memcmp) __memcmp_sse4_2;
+
+static const struct libc_func_test memcmp_list[] =
+{
+ LIBC_FUNC_INIT (__memcmp_sse4_2),
+ LIBC_FUNC_INIT (__memcmp_ssse3),
+ LIBC_FUNC_INIT (__memcmp_ia32),
+ { NULL, NULL },
+};
+
+# undef find_memcmp
+
+static const struct libc_func_test *
+find_memcmp (void)
+{
+ return memcmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+extern __typeof (memset) __memset_ia32;
+extern __typeof (memset) __memset_sse2;
+extern __typeof (memset) __memset_sse2_rep;
+
+static const struct libc_func_test memset_list[] =
+{
+ LIBC_FUNC_INIT (__memset_sse2_rep),
+ LIBC_FUNC_INIT (__memset_sse2),
+ LIBC_FUNC_INIT (__memset_ia32),
+ { NULL, NULL },
+};
+
+# undef find_memset
+
+static const struct libc_func_test *
+find_memset (void)
+{
+ return memset_list + (HAS_SSE2 ? 0 : 2);
+}
+
+extern __typeof (stpcpy) __stpcpy_ia32;
+extern __typeof (stpcpy) __stpcpy_sse2;
+extern __typeof (stpcpy) __stpcpy_ssse3;
+
+static const struct libc_func_test stpcpy_list[] =
+{
+ LIBC_FUNC_INIT (__stpcpy_ssse3),
+ LIBC_FUNC_INIT (__stpcpy_sse2),
+ LIBC_FUNC_INIT (__stpcpy_ia32),
+ { NULL, NULL },
+};
+
+# undef find_stpcpy
+
+static const struct libc_func_test *
+find_stpcpy (void)
+{
+ return stpcpy_list + (HAS_SSSE3 ? 0 : (HAS_SSE2 ? 1 : 2));
+}
+
+extern __typeof (stpncpy) __stpncpy_ia32;
+extern __typeof (stpncpy) __stpncpy_sse2;
+extern __typeof (stpncpy) __stpncpy_ssse3;
+
+static const struct libc_func_test stpncpy_list[] =
+{
+ LIBC_FUNC_INIT (__stpncpy_ssse3),
+ LIBC_FUNC_INIT (__stpncpy_sse2),
+ LIBC_FUNC_INIT (__stpncpy_ia32),
+ { NULL, NULL },
+};
+
+# undef find_stpncpy
+
+static const struct libc_func_test *
+find_stpncpy (void)
+{
+ return stpncpy_list + (HAS_SSSE3 ? 0 : (HAS_SSE2 ? 1 : 2));
+}
+
+extern __typeof (strcpy) __strcpy_ia32;
+extern __typeof (strcpy) __strcpy_sse2;
+extern __typeof (strcpy) __strcpy_ssse3;
+
+static const struct libc_func_test strcpy_list[] =
+{
+ LIBC_FUNC_INIT (__strcpy_ssse3),
+ LIBC_FUNC_INIT (__strcpy_sse2),
+ LIBC_FUNC_INIT (__strcpy_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strcpy
+
+static const struct libc_func_test *
+find_strcpy (void)
+{
+ return strcpy_list + (HAS_SSSE3 ? 0 : (HAS_SSE2 ? 1 : 2));
+}
+
+extern __typeof (strncpy) __strncpy_ia32;
+extern __typeof (strncpy) __strncpy_sse2;
+extern __typeof (strncpy) __strncpy_ssse3;
+
+static const struct libc_func_test strncpy_list[] =
+{
+ LIBC_FUNC_INIT (__strncpy_ssse3),
+ LIBC_FUNC_INIT (__strncpy_sse2),
+ LIBC_FUNC_INIT (__strncpy_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strncpy
+
+static const struct libc_func_test *
+find_strncpy (void)
+{
+ return strncpy_list + (HAS_SSSE3 ? 0 : (HAS_SSE2 ? 1 : 2));
+}
+
+extern __typeof (strcasecmp) __strcasecmp_ia32;
+extern __typeof (strcasecmp) __strcasecmp_ssse3;
+extern __typeof (strcasecmp) __strcasecmp_sse4_2;
+
+static const struct libc_func_test strcasecmp_list[] =
+{
+ LIBC_FUNC_INIT (__strcasecmp_sse4_2),
+ LIBC_FUNC_INIT (__strcasecmp_ssse3),
+ LIBC_FUNC_INIT (__strcasecmp_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strcasecmp
+
+static const struct libc_func_test *
+find_strcasecmp (void)
+{
+ return strcasecmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+extern __typeof (strcasecmp_l) __strcasecmp_l_ia32;
+extern __typeof (strcasecmp_l) __strcasecmp_l_ssse3;
+extern __typeof (strcasecmp_l) __strcasecmp_l_sse4_2;
+
+static const struct libc_func_test strcasecmp_l_list[] =
+{
+ LIBC_FUNC_INIT (__strcasecmp_l_sse4_2),
+ LIBC_FUNC_INIT (__strcasecmp_l_ssse3),
+ LIBC_FUNC_INIT (__strcasecmp_l_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strcasecmp_l
+
+static const struct libc_func_test *
+find_strcasecmp_l (void)
+{
+ return strcasecmp_l_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+extern __typeof (strncasecmp) __strncasecmp_ia32;
+extern __typeof (strncasecmp) __strncasecmp_ssse3;
+extern __typeof (strncasecmp) __strncasecmp_sse4_2;
+
+static const struct libc_func_test strncasecmp_list[] =
+{
+ LIBC_FUNC_INIT (__strncasecmp_sse4_2),
+ LIBC_FUNC_INIT (__strncasecmp_ssse3),
+ LIBC_FUNC_INIT (__strncasecmp_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strncasecmp
+
+static const struct libc_func_test *
+find_strncasecmp (void)
+{
+ return strncasecmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+extern __typeof (strncasecmp_l) __strncasecmp_l_ia32;
+extern __typeof (strncasecmp_l) __strncasecmp_l_ssse3;
+extern __typeof (strncasecmp_l) __strncasecmp_l_sse4_2;
+
+static const struct libc_func_test strncasecmp_l_list[] =
+{
+ LIBC_FUNC_INIT (__strncasecmp_l_sse4_2),
+ LIBC_FUNC_INIT (__strncasecmp_l_ssse3),
+ LIBC_FUNC_INIT (__strncasecmp_l_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strncasecmp_l
+
+static const struct libc_func_test *
+find_strncasecmp_l (void)
+{
+ return strncasecmp_l_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+extern __typeof (strcasestr) __strcasestr_ia32;
+extern __typeof (strcasestr) __strcasestr_sse42;
+
+static const struct libc_func_test strcasestr_list[] =
+{
+ LIBC_FUNC_INIT (__strcasestr_sse42),
+ LIBC_FUNC_INIT (__strcasestr_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strcasestr
+
+static const struct libc_func_test *
+find_strcasestr (void)
+{
+ return strcasestr_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (strcmp) __strcmp_ia32;
+extern __typeof (strcmp) __strcmp_ssse3;
+extern __typeof (strcmp) __strcmp_sse4_2;
+
+static const struct libc_func_test strcmp_list[] =
+{
+ LIBC_FUNC_INIT (__strcmp_sse4_2),
+ LIBC_FUNC_INIT (__strcmp_ssse3),
+ LIBC_FUNC_INIT (__strcmp_ia32),
+ { NULL, NULL },
+};
+
+extern __typeof (strcat) __strcat_ia32;
+extern __typeof (strcat) __strcat_sse2;
+extern __typeof (strcat) __strcat_ssse3;
+
+static const struct libc_func_test strcat_list[] =
+{
+ LIBC_FUNC_INIT (__strcat_ssse3),
+ LIBC_FUNC_INIT (__strcat_sse2),
+ LIBC_FUNC_INIT (__strcat_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strcat
+
+static const struct libc_func_test *
+find_strcat (void)
+{
+ return strcat_list + (HAS_SSSE3 ? 0 : (HAS_SSE2 ? 1 : 2));
+}
+
+extern __typeof (strncat) __strncat_ia32;
+extern __typeof (strncat) __strncat_sse2;
+extern __typeof (strncat) __strncat_ssse3;
+
+static const struct libc_func_test strncat_list[] =
+{
+ LIBC_FUNC_INIT (__strncat_ssse3),
+ LIBC_FUNC_INIT (__strncat_sse2),
+ LIBC_FUNC_INIT (__strncat_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strncat
+
+static const struct libc_func_test *
+find_strncat (void)
+{
+ return strncat_list + (HAS_SSSE3 ? 0 : (HAS_SSE2 ? 1 : 2));
+}
+
+# undef find_strcmp
+
+static const struct libc_func_test *
+find_strcmp (void)
+{
+ return strcmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+extern __typeof (strchr) __strchr_ia32;
+extern __typeof (strchr) __strchr_sse2;
+extern __typeof (strchr) __strchr_sse2_bsf;
+
+static const struct libc_func_test strchr_list[] =
+{
+ LIBC_FUNC_INIT (__strchr_sse2_bsf),
+ LIBC_FUNC_INIT (__strchr_sse2),
+ LIBC_FUNC_INIT (__strchr_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strchr
+
+static const struct libc_func_test *
+find_strchr (void)
+{
+ return strchr_list + (HAS_SSE2 ? 0 : 2);
+}
+
+extern __typeof (strrchr) __strrchr_ia32;
+extern __typeof (strrchr) __strrchr_sse2;
+extern __typeof (strrchr) __strrchr_sse2_bsf;
+
+static const struct libc_func_test strrchr_list[] =
+{
+ LIBC_FUNC_INIT (__strrchr_sse2_bsf),
+ LIBC_FUNC_INIT (__strrchr_sse2),
+ LIBC_FUNC_INIT (__strrchr_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strrchr
+
+static const struct libc_func_test *
+find_strrchr (void)
+{
+ return strrchr_list + (HAS_SSE2 ? 0 : 2);
+}
+
+extern __typeof (strcspn) __strcspn_ia32;
+extern __typeof (strcspn) __strcspn_sse42;
+
+static const struct libc_func_test strcspn_list[] =
+{
+ LIBC_FUNC_INIT (__strcspn_sse42),
+ LIBC_FUNC_INIT (__strcspn_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strcspn
+
+static const struct libc_func_test *
+find_strcspn (void)
+{
+ return strcspn_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (strnlen) __strnlen_ia32;
+extern __typeof (strnlen) __strnlen_sse2;
+
+static const struct libc_func_test strnlen_list[] =
+{
+ LIBC_FUNC_INIT (__strnlen_sse2),
+ LIBC_FUNC_INIT (__strnlen_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strnlen
+
+static const struct libc_func_test *
+find_strnlen (void)
+{
+ return strnlen_list + (HAS_SSE2 ? 0 : 1);
+}
+
+extern __typeof (strpbrk) __strpbrk_ia32;
+extern __typeof (strpbrk) __strpbrk_sse42;
+
+static const struct libc_func_test strpbrk_list[] =
+{
+ LIBC_FUNC_INIT (__strpbrk_sse42),
+ LIBC_FUNC_INIT (__strpbrk_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strpbrk
+
+static const struct libc_func_test *
+find_strpbrk (void)
+{
+ return strpbrk_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (strspn) __strspn_ia32;
+extern __typeof (strspn) __strspn_sse42;
+
+static const struct libc_func_test strspn_list[] =
+{
+ LIBC_FUNC_INIT (__strspn_sse42),
+ LIBC_FUNC_INIT (__strspn_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strspn
+
+static const struct libc_func_test *
+find_strspn (void)
+{
+ return strspn_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (strstr) __strstr_ia32;
+extern __typeof (strstr) __strstr_sse42;
+
+static const struct libc_func_test strstr_list[] =
+{
+ LIBC_FUNC_INIT (__strstr_sse42),
+ LIBC_FUNC_INIT (__strstr_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strstr
+
+static const struct libc_func_test *
+find_strstr (void)
+{
+ return strstr_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (wcschr) __wcschr_ia32;
+extern __typeof (wcschr) __wcschr_sse2;
+
+static const struct libc_func_test wcschr_list[] =
+{
+ LIBC_FUNC_INIT (__wcschr_sse2),
+ LIBC_FUNC_INIT (__wcschr_ia32),
+ { NULL, NULL },
+};
+
+# undef find_wcschr
+
+static const struct libc_func_test *
+find_wcschr (void)
+{
+ return wcschr_list + (HAS_SSE2 ? 0 : 1);
+}
+
+extern __typeof (wcscmp) __wcscmp_ia32;
+extern __typeof (wcscmp) __wcscmp_sse2;
+
+static const struct libc_func_test wcscmp_list[] =
+{
+ LIBC_FUNC_INIT (__wcscmp_sse2),
+ LIBC_FUNC_INIT (__wcscmp_ia32),
+ { NULL, NULL },
+};
+
+# undef find_wcscmp
+
+static const struct libc_func_test *
+find_wcscmp (void)
+{
+ return wcscmp_list + (HAS_SSE2 ? 0 : 1);
+}
+
+extern __typeof (wcscpy) __wcscpy_ia32;
+extern __typeof (wcscpy) __wcscpy_ssse3;
+
+static const struct libc_func_test wcscpy_list[] =
+{
+ LIBC_FUNC_INIT (__wcscpy_ssse3),
+ LIBC_FUNC_INIT (__wcscpy_ia32),
+ { NULL, NULL },
+};
+
+# undef find_wcscpy
+
+static const struct libc_func_test *
+find_wcscpy (void)
+{
+ return wcscpy_list + (HAS_SSSE3 ? 0 : 1);
+}
+
+extern __typeof (wcslen) __wcslen_ia32;
+extern __typeof (wcslen) __wcslen_sse2;
+
+static const struct libc_func_test wcslen_list[] =
+{
+ LIBC_FUNC_INIT (__wcslen_sse2),
+ LIBC_FUNC_INIT (__wcslen_ia32),
+ { NULL, NULL },
+};
+
+# undef find_wcslen
+
+static const struct libc_func_test *
+find_wcslen (void)
+{
+ return wcslen_list + (HAS_SSE2 ? 0 : 1);
+}
+
+extern __typeof (wcsrchr) __wcsrchr_ia32;
+extern __typeof (wcsrchr) __wcsrchr_sse2;
+
+static const struct libc_func_test wcsrchr_list[] =
+{
+ LIBC_FUNC_INIT (__wcsrchr_sse2),
+ LIBC_FUNC_INIT (__wcsrchr_ia32),
+ { NULL, NULL },
+};
+
+# undef find_wcsrchr
+
+static const struct libc_func_test *
+find_wcsrchr (void)
+{
+ return wcsrchr_list + (HAS_SSE2 ? 0 : 1);
+}
+
+extern __typeof (wmemcmp) __wmemcmp_ia32;
+extern __typeof (wmemcmp) __wmemcmp_ssse3;
+extern __typeof (wmemcmp) __wmemcmp_sse4_2;
+
+static const struct libc_func_test wmemcmp_list[] =
+{
+ LIBC_FUNC_INIT (__wmemcmp_sse4_2),
+ LIBC_FUNC_INIT (__wmemcmp_ssse3),
+ LIBC_FUNC_INIT (__wmemcmp_ia32),
+ { NULL, NULL },
+};
+
+# undef find_wmemcmp
+
+static const struct libc_func_test *
+find_wmemcmp (void)
+{
+ return wmemcmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+# ifdef SHARED
+extern __typeof (memcpy) __memcpy_ia32;
+extern __typeof (memcpy) __memcpy_ssse3;
+extern __typeof (memcpy) __memcpy_ssse3_rep;
+
+static const struct libc_func_test memcpy_list[] =
+{
+ LIBC_FUNC_INIT (__memcpy_ssse3_rep),
+ LIBC_FUNC_INIT (__memcpy_ssse3),
+ LIBC_FUNC_INIT (__memcpy_ia32),
+ { NULL, NULL },
+};
+
+# undef find_memcpy
+
+static const struct libc_func_test *
+find_memcpy (void)
+{
+ return memcpy_list + (HAS_SSSE3 ? 0 : 2);
+}
+
+extern __typeof (mempcpy) __mempcpy_ia32;
+extern __typeof (mempcpy) __mempcpy_ssse3;
+extern __typeof (mempcpy) __mempcpy_ssse3_rep;
+
+static const struct libc_func_test mempcpy_list[] =
+{
+ LIBC_FUNC_INIT (__mempcpy_ssse3_rep),
+ LIBC_FUNC_INIT (__mempcpy_ssse3),
+ LIBC_FUNC_INIT (__mempcpy_ia32),
+ { NULL, NULL },
+};
+
+# undef find_mempcpy
+
+static const struct libc_func_test *
+find_mempcpy (void)
+{
+ return mempcpy_list + (HAS_SSSE3 ? 0 : 2);
+}
+
+extern void *__memcpy_chk (void *, const void *, size_t, size_t);
+extern __typeof (__memcpy_chk) __memcpy_chk_ia32;
+extern __typeof (__memcpy_chk) __memcpy_chk_ssse3;
+extern __typeof (__memcpy_chk) __memcpy_chk_ssse3_rep;
+
+static const struct libc_func_test __memcpy_chk_list[] =
+{
+ LIBC_FUNC_INIT (__memcpy_chk_ssse3_rep),
+ LIBC_FUNC_INIT (__memcpy_chk_ssse3),
+ LIBC_FUNC_INIT (__memcpy_chk_ia32),
+ { NULL, NULL },
+};
+
+# undef find___memcpy_chk
+
+static const struct libc_func_test *
+find___memcpy_chk (void)
+{
+ return __memcpy_chk_list + (HAS_SSSE3 ? 0 : 2);
+}
+
+extern void *__mempcpy_chk (void *, const void *, size_t, size_t);
+extern __typeof (__mempcpy_chk) __mempcpy_chk_ia32;
+extern __typeof (__mempcpy_chk) __mempcpy_chk_ssse3;
+extern __typeof (__mempcpy_chk) __mempcpy_chk_ssse3_rep;
+
+static const struct libc_func_test __mempcpy_chk_list[] =
+{
+ LIBC_FUNC_INIT (__mempcpy_chk_ssse3_rep),
+ LIBC_FUNC_INIT (__mempcpy_chk_ssse3),
+ LIBC_FUNC_INIT (__mempcpy_chk_ia32),
+ { NULL, NULL },
+};
+
+# undef find___mempcpy_chk
+
+static const struct libc_func_test *
+find___mempcpy_chk (void)
+{
+ return __mempcpy_chk_list + (HAS_SSSE3 ? 0 : 2);
+}
+
+extern __typeof (strlen) __strlen_ia32;
+extern __typeof (strlen) __strlen_sse2;
+extern __typeof (strlen) __strlen_sse2_bsf;
+
+static const struct libc_func_test strlen_list[] =
+{
+ LIBC_FUNC_INIT (__strlen_sse2_bsf),
+ LIBC_FUNC_INIT (__strlen_sse2),
+ LIBC_FUNC_INIT (__strlen_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strlen
+
+static const struct libc_func_test *
+find_strlen (void)
+{
+ return strlen_list + (HAS_SSE2 ? 0 : 2);
+}
+
+extern __typeof (strncmp) __strncmp_ia32;
+extern __typeof (strncmp) __strncmp_ssse3;
+extern __typeof (strncmp) __strncmp_sse4_2;
+
+static const struct libc_func_test strncmp_list[] =
+{
+ LIBC_FUNC_INIT (__strncmp_sse4_2),
+ LIBC_FUNC_INIT (__strncmp_ssse3),
+ LIBC_FUNC_INIT (__strncmp_ia32),
+ { NULL, NULL },
+};
+
+# undef find_strncmp
+
+static const struct libc_func_test *
+find_strncmp (void)
+{
+ return strncmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+# endif /* SHARED */
+#endif /* NOT_IN_libc */
+
+const struct libc_func_test *
+__libc_func (const char *name)
+{
+ if (strcmp (name, "memcmp") == 0)
+ return find_memcmp ();
+
+ if (strcmp (name, "memchr") == 0)
+ return find_memchr ();
+
+ if (strcmp (name, "memrchr") == 0)
+ return find_memrchr ();
+
+ if (strcmp (name, "rawmemchr") == 0)
+ return find_rawmemchr ();
+
+ if (strcmp (name, "memcpy") == 0)
+ return find_memcpy ();
+
+ if (strcmp (name, "memmove") == 0)
+ return find_memmove ();
+
+ if (strcmp (name, "mempcpy") == 0)
+ return find_mempcpy ();
+
+ if (strcmp (name, "__memcpy_chk") == 0)
+ return find___memcpy_chk ();
+
+ if (strcmp (name, "__memmove_chk") == 0)
+ return find___memmove_chk ();
+
+ if (strcmp (name, "__mempcpy_chk") == 0)
+ return find___mempcpy_chk ();
+
+ if (strcmp (name, "memset") == 0)
+ return find_memset ();
+
+ if (strcmp (name, "stpcpy") == 0)
+ return find_stpcpy ();
+
+ if (strcmp (name, "stpncpy") == 0)
+ return find_stpncpy ();
+
+ if (strcmp (name, "strcpy") == 0)
+ return find_strcpy ();
+
+ if (strcmp (name, "strncpy") == 0)
+ return find_strncpy ();
+
+ if (strcmp (name, "strcasecmp") == 0)
+ return find_strcasecmp ();
+
+ if (strcmp (name, "strcasecmp_l") == 0)
+ return find_strcasecmp_l ();
+
+ if (strcmp (name, "strncasecmp") == 0)
+ return find_strncasecmp ();
+
+ if (strcmp (name, "strncasecmp_l") == 0)
+ return find_strncasecmp_l ();
+
+ if (strcmp (name, "strcasestr") == 0)
+ return find_strcasestr ();
+
+ if (strcmp (name, "strcat") == 0)
+ return find_strcat ();
+
+ if (strcmp (name, "strncat") == 0)
+ return find_strncat ();
+
+ if (strcmp (name, "strcmp") == 0)
+ return find_strcmp ();
+
+ if (strcmp (name, "strncmp") == 0)
+ return find_strncmp ();
+
+ if (strcmp (name, "strchr") == 0)
+ return find_strchr ();
+
+ if (strcmp (name, "strrchr") == 0)
+ return find_strrchr ();
+
+ if (strcmp (name, "strcspn") == 0)
+ return find_strcspn ();
+
+ if (strcmp (name, "strlen") == 0)
+ return find_strlen ();
+
+ if (strcmp (name, "strnlen") == 0)
+ return find_strnlen ();
+
+ if (strcmp (name, "strpbrk") == 0)
+ return find_strpbrk ();
+
+ if (strcmp (name, "strspn") == 0)
+ return find_strspn ();
+
+ if (strcmp (name, "strstr") == 0)
+ return find_strstr ();
+
+ if (strcmp (name, "wcschr") == 0)
+ return find_wcschr ();
+
+ if (strcmp (name, "wcscmp") == 0)
+ return find_wcscmp ();
+
+ if (strcmp (name, "wcscpy") == 0)
+ return find_wcscpy ();
+
+ if (strcmp (name, "wcslen") == 0)
+ return find_wcslen ();
+
+ if (strcmp (name, "wcsrchr") == 0)
+ return find_wcsrchr ();
+
+ if (strcmp (name, "wmemcmp") == 0)
+ return find_wmemcmp ();
+
+ return NULL;
+}
diff --git a/sysdeps/i386/i686/multiarch/memcmp.S b/sysdeps/i386/i686/multiarch/memcmp.S
index d8076b9..2756f0c 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.S
+++ b/sysdeps/i386/i686/multiarch/memcmp.S
@@ -67,6 +67,8 @@ END(memcmp)
# define ENTRY(name) \
.type __memcmp_ia32, @function; \
.p2align 4; \
+ .globl __memcmp_ia32; \
+ .hidden __memcmp_ia32; \
__memcmp_ia32: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/i386/i686/multiarch/memcpy.S b/sysdeps/i386/i686/multiarch/memcpy.S
index 558c04f..646e039 100644
--- a/sysdeps/i386/i686/multiarch/memcpy.S
+++ b/sysdeps/i386/i686/multiarch/memcpy.S
@@ -51,6 +51,8 @@ END(memcpy)
# define ENTRY(name) \
.type __memcpy_ia32, @function; \
.p2align 4; \
+ .globl __memcpy_ia32; \
+ .hidden __memcpy_ia32; \
__memcpy_ia32: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/i386/i686/multiarch/memmove.S b/sysdeps/i386/i686/multiarch/memmove.S
index b8892c0..de452e3 100644
--- a/sysdeps/i386/i686/multiarch/memmove.S
+++ b/sysdeps/i386/i686/multiarch/memmove.S
@@ -50,6 +50,8 @@ END(memmove)
# define ENTRY(name) \
.type __memmove_ia32, @function; \
.p2align 4; \
+ .globl __memmove_ia32; \
+ .hidden __memmove_ia32; \
__memmove_ia32: cfi_startproc; \
CALL_MCOUNT
# else
diff --git a/sysdeps/i386/i686/multiarch/mempcpy.S b/sysdeps/i386/i686/multiarch/mempcpy.S
index 95bda46..224fbe4 100644
--- a/sysdeps/i386/i686/multiarch/mempcpy.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy.S
@@ -51,6 +51,8 @@ END(__mempcpy)
# define ENTRY(name) \
.type __mempcpy_ia32, @function; \
.p2align 4; \
+ .globl __mempcpy_ia32; \
+ .hidden __mempcpy_ia32; \
__mempcpy_ia32: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/i386/i686/multiarch/strcat.S b/sysdeps/i386/i686/multiarch/strcat.S
index e68feca..4bfa21d 100644
--- a/sysdeps/i386/i686/multiarch/strcat.S
+++ b/sysdeps/i386/i686/multiarch/strcat.S
@@ -94,6 +94,8 @@ END(STRCAT)
# define ENTRY(name) \
.type STRCAT_IA32, @function; \
.align 16; \
+ .globl STRCAT_IA32; \
+ .hidden STRCAT_IA32; \
STRCAT_IA32: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/i386/i686/multiarch/strcmp.S b/sysdeps/i386/i686/multiarch/strcmp.S
index b3b9eb8..a94cd5b 100644
--- a/sysdeps/i386/i686/multiarch/strcmp.S
+++ b/sysdeps/i386/i686/multiarch/strcmp.S
@@ -95,6 +95,8 @@ END(STRCMP)
# define ENTRY(name) \
.type __STRCMP_IA32, @function; \
.p2align 4; \
+ .globl __STRCMP_IA32; \
+ .hidden __STRCMP_IA32; \
__STRCMP_IA32: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/i386/i686/multiarch/strcpy.S b/sysdeps/i386/i686/multiarch/strcpy.S
index 71eee76..de940dc 100644
--- a/sysdeps/i386/i686/multiarch/strcpy.S
+++ b/sysdeps/i386/i686/multiarch/strcpy.S
@@ -110,6 +110,8 @@ END(STRCPY)
# define ENTRY(name) \
.type STRCPY_IA32, @function; \
.align 16; \
+ .globl STRCPY_IA32; \
+ .hidden STRCPY_IA32; \
STRCPY_IA32: cfi_startproc; \
CALL_MCOUNT
# undef END
--
1.7.11.4