This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 3/6] Add x86_64 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:48 -0700
- Subject: [PATCH 3/6] Add x86_64 multiarch __libc_func
Hi,
This patch adds x86_64 multiarch __libc_func. OK to install?
Thanks.
H.J.
---
ChangeLog.test-ifunc | 21 +
sysdeps/x86_64/multiarch/libc-func.c | 789 ++++++++++++++++++++++++++++++++
sysdeps/x86_64/multiarch/memcmp.S | 2 +
sysdeps/x86_64/multiarch/memcpy.S | 2 +
sysdeps/x86_64/multiarch/mempcpy.S | 2 +
sysdeps/x86_64/multiarch/rawmemchr.S | 4 +
sysdeps/x86_64/multiarch/strcat.S | 2 +
sysdeps/x86_64/multiarch/strchr.S | 4 +
sysdeps/x86_64/multiarch/strcmp-sse42.S | 2 +
sysdeps/x86_64/multiarch/strcmp.S | 6 +
sysdeps/x86_64/multiarch/strcpy.S | 2 +
sysdeps/x86_64/multiarch/strlen.S | 2 +
sysdeps/x86_64/multiarch/strrchr.S | 4 +
13 files changed, 842 insertions(+)
create mode 100644 sysdeps/x86_64/multiarch/libc-func.c
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index dbb3b44..83577d9 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,26 @@
2012-09-26 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-func.c: New file.
+ * sysdeps/x86_64/multiarch/memcmp.S (__memcmp_sse2): Make it
+ global and hidden.
+ * sysdeps/x86_64/multiarch/memcpy.S (__memcpy_sse2): Likewise.
+ * sysdeps/x86_64/multiarch/mempcpy.S (__mempcpy_sse2): Likewise.
+ * sysdeps/x86_64/multiarch/rawmemchr.S (__rawmemchr_sse42):
+ Likewise.
+ (__rawmemchr_sse2): Likewise.
+ * sysdeps/x86_64/multiarch/strcat.S (STRCAT_SSE2): Likewise.
+ * sysdeps/x86_64/multiarch/strchr.S (__strchr_sse42): Likewise.
+ (__strchr_sse2): Likewise.
+ * sysdeps/x86_64/multiarch/strcmp-sse42.S (STRCMP_SSE42): Likewise.
+ * sysdeps/x86_64/multiarch/strcmp.S (STRCMP_SSE2): Likewise.
+ (__strcasecmp_sse2): Likewise.
+ (__strncasecmp_sse2): Likewise.
+ * sysdeps/x86_64/multiarch/strcpy.S (STRCPY_SSE2): Likewise.
+ * sysdeps/x86_64/multiarch/strlen.S (__strlen_sse2): Likewise.
+ global and hidden.
+ * sysdeps/x86_64/multiarch/strrchr.S (__strrchr_sse42): Likewise.
+ (__strrchr_sse2): Likewise.
+
* sysdeps/i386/i686/multiarch/bcopy.S (__bcopy_ia32): Make it
global and hidden.
* sysdeps/i386/i686/multiarch/bzero.S (__bzero_ia32): Likewise.
diff --git a/sysdeps/x86_64/multiarch/libc-func.c b/sysdeps/x86_64/multiarch/libc-func.c
new file mode 100644
index 0000000..f2903e6
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/libc-func.c
@@ -0,0 +1,789 @@
+/* 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_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_rawmemchr() 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_strcat() NULL
+#define find_strncat() NULL
+#define find_strcmp() NULL
+#define find_strncasecmp() NULL
+#define find_strncasecmp_l() NULL
+#define find_strncmp() NULL
+#define find_strcasestr() NULL
+#define find_strchr() NULL
+#define find_strcspn() NULL
+#define find_strlen() NULL
+#define find_strpbrk() NULL
+#define find_strrchr() NULL
+#define find_strspn() NULL
+#define find_strstr() NULL
+#define find_wcscpy() NULL
+#define find_wmemcmp() NULL
+
+#ifndef NOT_IN_libc
+
+extern __typeof (memmove) __memmove_sse2;
+extern __typeof (memmove) __memmove_ssse3;
+extern __typeof (memmove) __memmove_ssse3_back;
+
+static const struct libc_func_test memmove_list[] =
+{
+ LIBC_FUNC_INIT (__memmove_ssse3_back),
+ LIBC_FUNC_INIT (__memmove_ssse3),
+ LIBC_FUNC_INIT (__memmove_sse2),
+ { NULL, NULL },
+};
+
+# undef find_memmove
+
+static const struct libc_func_test *
+find_memmove (void)
+{
+ return memmove_list + (HAS_SSSE3 ? 0 : 2);
+}
+
+extern __typeof (memset) __memset_x86_64;
+extern __typeof (memset) __memset_sse2;
+
+static const struct libc_func_test memset_list[] =
+{
+ LIBC_FUNC_INIT (__memset_x86_64),
+ LIBC_FUNC_INIT (__memset_sse2),
+ { NULL, NULL },
+};
+
+extern void *__memmove_chk (void *, const void *, size_t, size_t);
+extern __typeof (__memmove_chk) __memmove_chk_sse2;
+extern __typeof (__memmove_chk) __memmove_chk_ssse3;
+extern __typeof (__memmove_chk) __memmove_chk_ssse3_back;
+
+static const struct libc_func_test __memmove_chk_list[] =
+{
+ LIBC_FUNC_INIT (__memmove_chk_ssse3_back),
+ LIBC_FUNC_INIT (__memmove_chk_ssse3),
+ LIBC_FUNC_INIT (__memmove_chk_sse2),
+ { NULL, NULL },
+};
+
+# undef find___memmove_chk
+
+static const struct libc_func_test *
+find___memmove_chk (void)
+{
+ return __memmove_chk_list + (HAS_SSSE3 ? 0 : 2);
+}
+
+# undef find_memset
+
+static const struct libc_func_test *
+find_memset (void)
+{
+ return memset_list;
+}
+
+extern __typeof (rawmemchr) __rawmemchr_sse2;
+extern __typeof (rawmemchr) __rawmemchr_sse42;
+
+static const struct libc_func_test rawmemchr_list[] =
+{
+ LIBC_FUNC_INIT (__rawmemchr_sse42),
+ LIBC_FUNC_INIT (__rawmemchr_sse2),
+ { NULL, NULL },
+};
+
+# undef find_rawmemchr
+
+static const struct libc_func_test *
+find_rawmemchr (void)
+{
+ return rawmemchr_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (stpcpy) __stpcpy_sse2;
+extern __typeof (stpcpy) __stpcpy_sse2_unaligned;
+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_sse2_unaligned),
+ { NULL, NULL },
+};
+
+# undef find_stpcpy
+
+static const struct libc_func_test *
+find_stpcpy (void)
+{
+ return stpcpy_list + (HAS_SSSE3 ? 0 : 1);
+}
+
+extern __typeof (stpncpy) __stpncpy_sse2;
+extern __typeof (stpncpy) __stpncpy_sse2_unaligned;
+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_sse2_unaligned),
+ { NULL, NULL },
+};
+
+# undef find_stpncpy
+
+static const struct libc_func_test *
+find_stpncpy (void)
+{
+ return stpncpy_list + (HAS_SSSE3 ? 0 : 1);
+}
+
+extern __typeof (strcpy) __strcpy_sse2;
+extern __typeof (strcpy) __strcpy_sse2_unaligned;
+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_sse2_unaligned),
+ { NULL, NULL },
+};
+
+# undef find_strcpy
+
+static const struct libc_func_test *
+find_strcpy (void)
+{
+ return strcpy_list + (HAS_SSSE3 ? 0 : 1);
+}
+
+extern __typeof (strncpy) __strncpy_sse2;
+extern __typeof (strncpy) __strncpy_sse2_unaligned;
+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_sse2_unaligned),
+ { NULL, NULL },
+};
+
+# undef find_strncpy
+
+static const struct libc_func_test *
+find_strncpy (void)
+{
+ return strncpy_list + (HAS_SSSE3 ? 0 : 1);
+}
+
+extern __typeof (strcasecmp) __strcasecmp_sse2;
+extern __typeof (strcasecmp) __strcasecmp_ssse3;
+extern __typeof (strcasecmp) __strcasecmp_sse42;
+extern __typeof (strcasecmp) __strcasecmp_avx;
+
+static const struct libc_func_test strcasecmp_list[] =
+{
+ LIBC_FUNC_INIT (__strcasecmp_avx),
+ LIBC_FUNC_INIT (__strcasecmp_sse42),
+ LIBC_FUNC_INIT (__strcasecmp_ssse3),
+ LIBC_FUNC_INIT (__strcasecmp_sse2),
+ { NULL, NULL },
+};
+
+# undef find_strcasecmp
+
+static const struct libc_func_test *
+find_strcasecmp (void)
+{
+ return strcasecmp_list + (HAS_AVX
+ ? 0
+ : (HAS_SSE4_2
+ ? 1 : (HAS_SSSE3
+ ? 2 : 3)));
+}
+
+extern __typeof (strcasecmp_l) __strcasecmp_l_sse2;
+extern __typeof (strcasecmp_l) __strcasecmp_l_ssse3;
+extern __typeof (strcasecmp_l) __strcasecmp_l_sse42;
+extern __typeof (strcasecmp_l) __strcasecmp_l_avx;
+
+static const struct libc_func_test strcasecmp_l_list[] =
+{
+ LIBC_FUNC_INIT (__strcasecmp_l_avx),
+ LIBC_FUNC_INIT (__strcasecmp_l_sse42),
+ LIBC_FUNC_INIT (__strcasecmp_l_ssse3),
+ LIBC_FUNC_INIT (__strcasecmp_l_sse2),
+ { NULL, NULL },
+};
+
+# undef find_strcasecmp_l
+
+static const struct libc_func_test *
+find_strcasecmp_l (void)
+{
+ return strcasecmp_l_list + (HAS_AVX
+ ? 0 : (HAS_SSE4_2
+ ? 1 : (HAS_SSSE3
+ ? 2 : 3)));
+}
+
+extern __typeof (strcat) __strcat_sse2;
+extern __typeof (strcat) __strcat_sse2_unaligned;
+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_sse2_unaligned),
+ { NULL, NULL },
+};
+
+# undef find_strcat
+
+static const struct libc_func_test *
+find_strcat (void)
+{
+ return strcat_list + (HAS_SSSE3 ? 0 : 1);
+}
+
+extern __typeof (strncat) __strncat_sse2;
+extern __typeof (strncat) __strncat_sse2_unaligned;
+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_sse2_unaligned),
+ { NULL, NULL },
+};
+
+# undef find_strncat
+
+static const struct libc_func_test *
+find_strncat (void)
+{
+ return strncat_list + (HAS_SSSE3 ? 0 : 1);
+}
+
+extern __typeof (strcmp) __strcmp_sse2;
+extern __typeof (strcmp) __strcmp_ssse3;
+extern __typeof (strcmp) __strcmp_sse42;
+
+static const struct libc_func_test strcmp_list[] =
+{
+ LIBC_FUNC_INIT (__strcmp_sse42),
+ LIBC_FUNC_INIT (__strcmp_ssse3),
+ LIBC_FUNC_INIT (__strcmp_sse2),
+ { NULL, NULL },
+};
+
+# 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 (strncasecmp) __strncasecmp_sse2;
+extern __typeof (strncasecmp) __strncasecmp_ssse3;
+extern __typeof (strncasecmp) __strncasecmp_sse42;
+extern __typeof (strncasecmp) __strncasecmp_avx;
+
+static const struct libc_func_test strncasecmp_list[] =
+{
+ LIBC_FUNC_INIT (__strncasecmp_avx),
+ LIBC_FUNC_INIT (__strncasecmp_sse42),
+ LIBC_FUNC_INIT (__strncasecmp_ssse3),
+ LIBC_FUNC_INIT (__strncasecmp_sse2),
+ { NULL, NULL },
+};
+
+# undef find_strncasecmp
+
+static const struct libc_func_test *
+find_strncasecmp (void)
+{
+ return strncasecmp_list + (HAS_AVX
+ ? 0 : (HAS_SSE4_2
+ ? 1 : (HAS_SSSE3
+ ? 2 : 3)));
+}
+
+extern __typeof (strncasecmp_l) __strncasecmp_l_sse2;
+extern __typeof (strncasecmp_l) __strncasecmp_l_ssse3;
+extern __typeof (strncasecmp_l) __strncasecmp_l_sse42;
+extern __typeof (strncasecmp_l) __strncasecmp_l_avx;
+
+static const struct libc_func_test strncasecmp_l_list[] =
+{
+ LIBC_FUNC_INIT (__strncasecmp_l_avx),
+ LIBC_FUNC_INIT (__strncasecmp_l_sse42),
+ LIBC_FUNC_INIT (__strncasecmp_l_ssse3),
+ LIBC_FUNC_INIT (__strncasecmp_l_sse2),
+ { NULL, NULL },
+};
+
+# undef find_strncasecmp_l
+
+static const struct libc_func_test *
+find_strncasecmp_l (void)
+{
+ return strncasecmp_l_list + (HAS_AVX
+ ? 0 : (HAS_SSE4_2
+ ? 1 : (HAS_SSSE3
+ ? 2 : 3)));
+}
+
+extern __typeof (strncmp) __strncmp_sse2;
+extern __typeof (strncmp) __strncmp_ssse3;
+extern __typeof (strncmp) __strncmp_sse42;
+
+static const struct libc_func_test strncmp_list[] =
+{
+ LIBC_FUNC_INIT (__strncmp_sse42),
+ LIBC_FUNC_INIT (__strncmp_ssse3),
+ LIBC_FUNC_INIT (__strncmp_sse2),
+ { 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));
+}
+
+extern __typeof (strcasestr) __strcasestr_sse2;
+extern __typeof (strcasestr) __strcasestr_sse42;
+
+static const struct libc_func_test strcasestr_list[] =
+{
+ LIBC_FUNC_INIT (__strcasestr_sse42),
+ LIBC_FUNC_INIT (__strcasestr_sse2),
+ { NULL, NULL },
+};
+
+# undef find_strcasestr
+
+static const struct libc_func_test *
+find_strcasestr (void)
+{
+ return strcasestr_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (strchr) __strchr_sse2;
+extern __typeof (strchr) __strchr_sse2_no_bsf;
+extern __typeof (strchr) __strchr_sse42;
+
+static const struct libc_func_test strchr_list[] =
+{
+ LIBC_FUNC_INIT (__strchr_sse42),
+ LIBC_FUNC_INIT (__strchr_sse2),
+ LIBC_FUNC_INIT (__strchr_sse2_no_bsf),
+ { NULL, NULL },
+};
+
+# undef find_strchr
+
+static const struct libc_func_test *
+find_strchr (void)
+{
+ return strchr_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (strcspn) __strcspn_sse2;
+extern __typeof (strcspn) __strcspn_sse42;
+
+static const struct libc_func_test strcspn_list[] =
+{
+ LIBC_FUNC_INIT (__strcspn_sse42),
+ LIBC_FUNC_INIT (__strcspn_sse2),
+ { NULL, NULL },
+};
+
+# undef find_strcspn
+
+static const struct libc_func_test *
+find_strcspn (void)
+{
+ return strcspn_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (strpbrk) __strpbrk_sse2;
+extern __typeof (strpbrk) __strpbrk_sse42;
+
+static const struct libc_func_test strpbrk_list[] =
+{
+ LIBC_FUNC_INIT (__strpbrk_sse42),
+ LIBC_FUNC_INIT (__strpbrk_sse2),
+ { NULL, NULL },
+};
+
+# undef find_strpbrk
+
+static const struct libc_func_test *
+find_strpbrk (void)
+{
+ return strpbrk_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (strrchr) __strrchr_sse2;
+extern __typeof (strrchr) __strrchr_sse2_no_bsf;
+extern __typeof (strrchr) __strrchr_sse42;
+
+static const struct libc_func_test strrchr_list[] =
+{
+ LIBC_FUNC_INIT (__strrchr_sse42),
+ LIBC_FUNC_INIT (__strrchr_sse2),
+ LIBC_FUNC_INIT (__strrchr_sse2_no_bsf),
+ { NULL, NULL },
+};
+
+# undef find_strrchr
+
+static const struct libc_func_test *
+find_strrchr (void)
+{
+ return strrchr_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (strspn) __strspn_sse2;
+extern __typeof (strspn) __strspn_sse42;
+
+static const struct libc_func_test strspn_list[] =
+{
+ LIBC_FUNC_INIT (__strspn_sse42),
+ LIBC_FUNC_INIT (__strspn_sse2),
+ { 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_sse2;
+extern __typeof (strstr) __strstr_sse42;
+
+static const struct libc_func_test strstr_list[] =
+{
+ LIBC_FUNC_INIT (__strstr_sse42),
+ LIBC_FUNC_INIT (__strstr_sse2),
+ { NULL, NULL },
+};
+
+# undef find_strstr
+
+static const struct libc_func_test *
+find_strstr (void)
+{
+ return strstr_list + (HAS_SSE4_2 ? 0 : 1);
+}
+
+extern __typeof (wcscpy) __wcscpy_sse2;
+extern __typeof (wcscpy) __wcscpy_ssse3;
+
+static const struct libc_func_test wcscpy_list[] =
+{
+ LIBC_FUNC_INIT (__wcscpy_ssse3),
+ LIBC_FUNC_INIT (__wcscpy_sse2),
+ { NULL, NULL },
+};
+
+# undef find_wcscpy
+
+static const struct libc_func_test *
+find_wcscpy (void)
+{
+ return wcscpy_list + (HAS_SSSE3 ? 0 : 1);
+}
+
+extern __typeof (wmemcmp) __wmemcmp_sse2;
+extern __typeof (wmemcmp) __wmemcmp_ssse3;
+extern __typeof (wmemcmp) __wmemcmp_sse4_1;
+
+static const struct libc_func_test wmemcmp_list[] =
+{
+ LIBC_FUNC_INIT (__wmemcmp_sse4_1),
+ LIBC_FUNC_INIT (__wmemcmp_ssse3),
+ LIBC_FUNC_INIT (__wmemcmp_sse2),
+ { NULL, NULL },
+};
+
+# undef find_wmemcmp
+
+static const struct libc_func_test *
+find_wmemcmp (void)
+{
+ return wmemcmp_list + (HAS_SSE4_1 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+# ifdef SHARED
+extern __typeof (memcmp) __memcmp_sse2;
+extern __typeof (memcmp) __memcmp_ssse3;
+extern __typeof (memcmp) __memcmp_sse4_1;
+
+static const struct libc_func_test memcmp_list[] =
+{
+ LIBC_FUNC_INIT (__memcmp_sse4_1),
+ LIBC_FUNC_INIT (__memcmp_ssse3),
+ LIBC_FUNC_INIT (__memcmp_sse2),
+ { NULL, NULL },
+};
+
+# undef find_memcmp
+
+static const struct libc_func_test *
+find_memcmp (void)
+{
+ return memcmp_list + (HAS_SSE4_1 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+extern __typeof (memcpy) __memcpy_sse2;
+extern __typeof (memcpy) __memcpy_ssse3;
+extern __typeof (memcpy) __memcpy_ssse3_back;
+
+static const struct libc_func_test memcpy_list[] =
+{
+ LIBC_FUNC_INIT (__memcpy_ssse3_back),
+ LIBC_FUNC_INIT (__memcpy_ssse3),
+ LIBC_FUNC_INIT (__memcpy_sse2),
+ { 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_sse2;
+extern __typeof (mempcpy) __mempcpy_ssse3;
+extern __typeof (mempcpy) __mempcpy_ssse3_back;
+
+static const struct libc_func_test mempcpy_list[] =
+{
+ LIBC_FUNC_INIT (__mempcpy_ssse3_back),
+ LIBC_FUNC_INIT (__mempcpy_ssse3),
+ LIBC_FUNC_INIT (__mempcpy_sse2),
+ { 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_sse2;
+extern __typeof (__memcpy_chk) __memcpy_chk_ssse3;
+extern __typeof (__memcpy_chk) __memcpy_chk_ssse3_back;
+
+static const struct libc_func_test __memcpy_chk_list[] =
+{
+ LIBC_FUNC_INIT (__memcpy_chk_ssse3_back),
+ LIBC_FUNC_INIT (__memcpy_chk_ssse3),
+ LIBC_FUNC_INIT (__memcpy_chk_sse2),
+ { 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_sse2;
+extern __typeof (__mempcpy_chk) __mempcpy_chk_ssse3;
+extern __typeof (__mempcpy_chk) __mempcpy_chk_ssse3_back;
+
+static const struct libc_func_test __mempcpy_chk_list[] =
+{
+ LIBC_FUNC_INIT (__mempcpy_chk_ssse3_back),
+ LIBC_FUNC_INIT (__mempcpy_chk_ssse3),
+ LIBC_FUNC_INIT (__mempcpy_chk_sse2),
+ { 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_sse2;
+extern __typeof (strlen) __strlen_sse2_no_bsf;
+extern __typeof (strlen) __strlen_sse2_pminub;
+extern __typeof (strlen) __strlen_sse42;
+
+static const struct libc_func_test strlen_list[] =
+{
+ LIBC_FUNC_INIT (__strlen_sse42),
+ LIBC_FUNC_INIT (__strlen_sse2),
+ LIBC_FUNC_INIT (__strlen_sse2_no_bsf),
+ LIBC_FUNC_INIT (__strlen_sse2_pminub),
+ { NULL, NULL },
+};
+
+# undef find_strlen
+
+static const struct libc_func_test *
+find_strlen (void)
+{
+ return strlen_list + (HAS_SSE4_2 ? 0 : 1);
+}
+# 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, "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, "rawmemchr") == 0)
+ return find_rawmemchr ();
+
+ 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, "strcat") == 0)
+ return find_strcat ();
+
+ if (strcmp (name, "strcmp") == 0)
+ return find_strcmp ();
+
+ if (strcmp (name, "strncasecmp") == 0)
+ return find_strncasecmp ();
+
+ if (strcmp (name, "strncasecmp_l") == 0)
+ return find_strncasecmp_l ();
+
+ if (strcmp (name, "strncat") == 0)
+ return find_strncat ();
+
+ if (strcmp (name, "strncmp") == 0)
+ return find_strncmp ();
+
+ if (strcmp (name, "strcasestr") == 0)
+ return find_strcasestr ();
+
+ if (strcmp (name, "strchr") == 0)
+ return find_strchr ();
+
+ if (strcmp (name, "strcspn") == 0)
+ return find_strcspn ();
+
+ if (strcmp (name, "strlen") == 0)
+ return find_strlen ();
+
+ if (strcmp (name, "strpbrk") == 0)
+ return find_strpbrk ();
+
+ if (strcmp (name, "strrchr") == 0)
+ return find_strrchr ();
+
+ if (strcmp (name, "strspn") == 0)
+ return find_strspn ();
+
+ if (strcmp (name, "strstr") == 0)
+ return find_strstr ();
+
+ if (strcmp (name, "wcscpy") == 0)
+ return find_wcscpy ();
+
+ if (strcmp (name, "wmemcmp") == 0)
+ return find_wmemcmp ();
+
+ return NULL;
+}
diff --git a/sysdeps/x86_64/multiarch/memcmp.S b/sysdeps/x86_64/multiarch/memcmp.S
index b2bc4d7..f2c9b30 100644
--- a/sysdeps/x86_64/multiarch/memcmp.S
+++ b/sysdeps/x86_64/multiarch/memcmp.S
@@ -48,6 +48,8 @@ END(memcmp)
# define ENTRY(name) \
.type __memcmp_sse2, @function; \
.p2align 4; \
+ .globl __memcmp_sse2; \
+ .hidden __memcmp_sse2; \
__memcmp_sse2: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/x86_64/multiarch/memcpy.S b/sysdeps/x86_64/multiarch/memcpy.S
index a77cdfb..0c1c1e6 100644
--- a/sysdeps/x86_64/multiarch/memcpy.S
+++ b/sysdeps/x86_64/multiarch/memcpy.S
@@ -45,6 +45,8 @@ END(__new_memcpy)
# undef ENTRY
# define ENTRY(name) \
.type __memcpy_sse2, @function; \
+ .globl __memcpy_sse2; \
+ .hidden __memcpy_sse2; \
.p2align 4; \
__memcpy_sse2: cfi_startproc; \
CALL_MCOUNT
diff --git a/sysdeps/x86_64/multiarch/mempcpy.S b/sysdeps/x86_64/multiarch/mempcpy.S
index caa435b..2fac9d7 100644
--- a/sysdeps/x86_64/multiarch/mempcpy.S
+++ b/sysdeps/x86_64/multiarch/mempcpy.S
@@ -43,6 +43,8 @@ END(__mempcpy)
# define ENTRY(name) \
.type __mempcpy_sse2, @function; \
.p2align 4; \
+ .globl __mempcpy_sse2; \
+ .hidden __mempcpy_sse2; \
__mempcpy_sse2: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/x86_64/multiarch/rawmemchr.S b/sysdeps/x86_64/multiarch/rawmemchr.S
index c4157ad..ebcc17e 100644
--- a/sysdeps/x86_64/multiarch/rawmemchr.S
+++ b/sysdeps/x86_64/multiarch/rawmemchr.S
@@ -44,6 +44,8 @@ strong_alias (rawmemchr, __rawmemchr)
.section .text.sse4.2,"ax",@progbits
.align 16
.type __rawmemchr_sse42, @function
+ .globl __rawmemchr_sse42
+ .hidden __rawmemchr_sse42
__rawmemchr_sse42:
cfi_startproc
CALL_MCOUNT
@@ -81,6 +83,8 @@ __rawmemchr_sse42:
# define ENTRY(name) \
.type __rawmemchr_sse2, @function; \
.align 16; \
+ .globl __rawmemchr_sse2; \
+ .hidden __rawmemchr_sse2; \
__rawmemchr_sse2: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/x86_64/multiarch/strcat.S b/sysdeps/x86_64/multiarch/strcat.S
index 0c256de..1ba69b6 100644
--- a/sysdeps/x86_64/multiarch/strcat.S
+++ b/sysdeps/x86_64/multiarch/strcat.S
@@ -63,6 +63,8 @@ END(STRCAT)
# define ENTRY(name) \
.type STRCAT_SSE2, @function; \
.align 16; \
+ .globl STRCAT_SSE2; \
+ .hidden STRCAT_SSE2; \
STRCAT_SSE2: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/x86_64/multiarch/strchr.S b/sysdeps/x86_64/multiarch/strchr.S
index b9f88e4..5c8aa7c 100644
--- a/sysdeps/x86_64/multiarch/strchr.S
+++ b/sysdeps/x86_64/multiarch/strchr.S
@@ -82,6 +82,8 @@ END(strchr)
.section .text.sse4.2,"ax",@progbits
.align 16
.type __strchr_sse42, @function
+ .globl __strchr_sse42
+ .hidden __strchr_sse42
__strchr_sse42:
cfi_startproc
CALL_MCOUNT
@@ -164,6 +166,8 @@ L(loop_exit):
# define ENTRY(name) \
.type __strchr_sse2, @function; \
.align 16; \
+ .globl __strchr_sse2; \
+ .hidden __strchr_sse2; \
__strchr_sse2: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/x86_64/multiarch/strcmp-sse42.S b/sysdeps/x86_64/multiarch/strcmp-sse42.S
index 9d00bbc..4fadfcb 100644
--- a/sysdeps/x86_64/multiarch/strcmp-sse42.S
+++ b/sysdeps/x86_64/multiarch/strcmp-sse42.S
@@ -48,6 +48,8 @@
.section .text.SECTION,"ax",@progbits
.align 16
.type STRCMP_SSE42, @function
+ .globl STRCMP_SSE42
+ .hidden STRCMP_SSE42
#ifdef USE_AS_STRCASECMP_L
ENTRY (GLABEL(__strcasecmp))
movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
diff --git a/sysdeps/x86_64/multiarch/strcmp.S b/sysdeps/x86_64/multiarch/strcmp.S
index d366d09..fb9b0fb 100644
--- a/sysdeps/x86_64/multiarch/strcmp.S
+++ b/sysdeps/x86_64/multiarch/strcmp.S
@@ -171,6 +171,8 @@ weak_alias (__strncasecmp, strncasecmp)
# define ENTRY(name) \
.type STRCMP_SSE2, @function; \
.align 16; \
+ .globl STRCMP_SSE2; \
+ .hidden STRCMP_SSE2; \
STRCMP_SSE2: cfi_startproc; \
CALL_MCOUNT
# undef END
@@ -181,6 +183,8 @@ weak_alias (__strncasecmp, strncasecmp)
# define ENTRY2(name) \
.type __strcasecmp_sse2, @function; \
.align 16; \
+ .globl __strcasecmp_sse2; \
+ .hidden __strcasecmp_sse2; \
__strcasecmp_sse2: cfi_startproc; \
CALL_MCOUNT
# define END2(name) \
@@ -191,6 +195,8 @@ weak_alias (__strncasecmp, strncasecmp)
# define ENTRY2(name) \
.type __strncasecmp_sse2, @function; \
.align 16; \
+ .globl __strncasecmp_sse2; \
+ .hidden __strncasecmp_sse2; \
__strncasecmp_sse2: cfi_startproc; \
CALL_MCOUNT
# define END2(name) \
diff --git a/sysdeps/x86_64/multiarch/strcpy.S b/sysdeps/x86_64/multiarch/strcpy.S
index 7be1b8b..b97215e 100644
--- a/sysdeps/x86_64/multiarch/strcpy.S
+++ b/sysdeps/x86_64/multiarch/strcpy.S
@@ -77,6 +77,8 @@ END(STRCPY)
# define ENTRY(name) \
.type STRCPY_SSE2, @function; \
.align 16; \
+ .globl STRCPY_SSE2; \
+ .hidden STRCPY_SSE2; \
STRCPY_SSE2: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/x86_64/multiarch/strlen.S b/sysdeps/x86_64/multiarch/strlen.S
index 0c46b4f..bab0ac3 100644
--- a/sysdeps/x86_64/multiarch/strlen.S
+++ b/sysdeps/x86_64/multiarch/strlen.S
@@ -49,6 +49,8 @@ END(strlen)
# define ENTRY(name) \
.type __strlen_sse2, @function; \
.align 16; \
+ .globl __strlen_sse2; \
+ .hidden __strlen_sse2; \
__strlen_sse2: cfi_startproc; \
CALL_MCOUNT
# undef END
diff --git a/sysdeps/x86_64/multiarch/strrchr.S b/sysdeps/x86_64/multiarch/strrchr.S
index c87d8fa..1ccaf4a 100644
--- a/sysdeps/x86_64/multiarch/strrchr.S
+++ b/sysdeps/x86_64/multiarch/strrchr.S
@@ -87,6 +87,8 @@ END(strrchr)
.section .text.sse4.2,"ax",@progbits
.align 16
.type __strrchr_sse42, @function
+ .globl __strrchr_sse42
+ .hidden __strrchr_sse42
__strrchr_sse42:
cfi_startproc
CALL_MCOUNT
@@ -265,6 +267,8 @@ L(psrldq_table):
# define ENTRY(name) \
.type __strrchr_sse2, @function; \
.align 16; \
+ .globl __strrchr_sse2; \
+ .hidden __strrchr_sse2; \
__strrchr_sse2: cfi_startproc; \
CALL_MCOUNT
# undef END
--
1.7.11.4