This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch hjl/ifunc/test created. glibc-2.16-ports-merge-401-g06931c2
- From: hjl at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 21 Sep 2012 22:22:28 -0000
- Subject: GNU C Library master sources branch hjl/ifunc/test created. glibc-2.16-ports-merge-401-g06931c2
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, hjl/ifunc/test has been created
at 06931c26e241d8b0b6d0950ea2d384b7da17e5ed (commit)
- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=06931c26e241d8b0b6d0950ea2d384b7da17e5ed
commit 06931c26e241d8b0b6d0950ea2d384b7da17e5ed
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 21 15:20:04 2012 -0700
Add WIDE and USE_FOR_STRCHRNUL support to ifunc tests
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index f889d1e..c75a857 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,29 @@
2012-09-21 H.J. Lu <hongjiu.lu@intel.com>
+ * string/test-memcmp.c (TEST_NAME): Defined to "wmemcmp" if
+ WIDE is defined.
+ * string/test-rawmemchr.c (TEST_NAME): New macro.
+ * string/test-strchr.c (TEST_NAME): Properly defined for WIDE
+ and USE_FOR_STRCHRNUL.
+ * string/test-strcmp.c (TEST_NAME): Defined to "wstrcmp" if
+ WIDE is defined.
+ * string/test-strchr.c (TEST_NAME): Defined only if WIDE and
+ USE_FOR_STRCHRNUL aren't defined.
+ * string/test-strcpy.c (TEST_NAME): Defined to "wcscpy" if WIDE
+ is defined.
+ * string/test-string.h (FOR_EACH_IMPL): Use func_list only if
+ TEST_MULTIARCH and TEST_NAME are defined.
+ (func_list): Defined only if TEST_MULTIARCH and TEST_NAME are
+ defined.
+ (impl_count): Likewise.
+ (impl_array): Likewise.
+ (test_init): Set func_list only if TEST_MULTIARCH and TEST_NAME
+ are defined.
+ * string/test-strrchr.c (TEST_NAME): Defined to "wcsrchr" if
+ WIDE is defined.
+
+2012-09-21 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (__strcasecmp_avx): New.
(strcasecmp_list): Add __strcasecmp_avx.
(find_strcasecmp): Support __strcasecmp_avx.
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 2e8c711..fc9d4d2 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -19,7 +19,11 @@
<http://www.gnu.org/licenses/>. */
#define TEST_MAIN
-#define TEST_NAME "memcmp"
+#ifdef WIDE
+# define TEST_NAME "wmemcmp"
+#else
+# define TEST_NAME "memcmp"
+#endif
#include "test-string.h"
#ifdef WIDE
# include <inttypes.h>
diff --git a/string/test-rawmemchr.c b/string/test-rawmemchr.c
index c8000d6..8c43ce4 100644
--- a/string/test-rawmemchr.c
+++ b/string/test-rawmemchr.c
@@ -20,6 +20,7 @@
#include <assert.h>
#define TEST_MAIN
+#define TEST_NAME "rawmemchr"
#include "test-string.h"
typedef char *(*proto_t) (const char *, int);
diff --git a/string/test-strchr.c b/string/test-strchr.c
index a8f8760..aa9b895 100644
--- a/string/test-strchr.c
+++ b/string/test-strchr.c
@@ -19,7 +19,15 @@
<http://www.gnu.org/licenses/>. */
#define TEST_MAIN
-#define TEST_NAME "strchr"
+#ifndef WIDE
+# ifdef USE_FOR_STRCHRNUL
+# define TEST_NAME "strchrnul"
+# else
+# define TEST_NAME "strchr"
+# endif
+#else
+# define TEST_NAME "wcschr"
+#endif
#include "test-string.h"
#ifndef WIDE
diff --git a/string/test-strcmp.c b/string/test-strcmp.c
index 043af65..f186fd6 100644
--- a/string/test-strcmp.c
+++ b/string/test-strcmp.c
@@ -20,7 +20,7 @@
#define TEST_MAIN
#ifdef WIDE
-# define TEST_NAME "wstrcmp"
+# define TEST_NAME "wcscmp"
#else
# define TEST_NAME "strcmp"
#endif
diff --git a/string/test-strcpy.c b/string/test-strcpy.c
index 5493f2a..224e466 100644
--- a/string/test-strcpy.c
+++ b/string/test-strcpy.c
@@ -42,7 +42,11 @@
#ifndef STRCPY_RESULT
# define STRCPY_RESULT(dst, len) dst
# define TEST_MAIN
-# define TEST_NAME "strcpy"
+# ifndef WIDE
+# define TEST_NAME "strcpy"
+# else
+# define TEST_NAME "wcscpy"
+# endif
# include "test-string.h"
# ifndef WIDE
# define SIMPLE_STRCPY simple_strcpy
diff --git a/string/test-string.h b/string/test-string.h
index 042ea58..e365ed0 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -107,7 +107,12 @@ size_t iterations = 100000;
#define CALL(impl, ...) \
(* (proto_t) (impl)->fn) (__VA_ARGS__)
-#define FOR_EACH_IMPL(impl, notall) \
+#if defined TEST_MULTIARCH && defined TEST_NAME
+static const struct libc_func_test *func_list;
+static int impl_count = -1;
+static impl_t *impl_array;
+
+# define FOR_EACH_IMPL(impl, notall) \
impl_t *impl; \
int count; \
if (impl_count == -1) \
@@ -150,6 +155,11 @@ size_t iterations = 100000;
impl = impl_array; \
for (count = 0; count < impl_count; ++count, ++impl) \
if (!notall || impl->test)
+#else
+# define FOR_EACH_IMPL(impl, notall) \
+ for (impl_t *impl = __start_impls; impl < __stop_impls; ++impl) \
+ if (!notall || impl->test)
+#endif
#define HP_TIMING_BEST(best_time, start, end) \
do \
@@ -165,14 +175,10 @@ size_t iterations = 100000;
# define BUF1PAGES 1
#endif
-static const struct libc_func_test *func_list;
-static int impl_count = -1;
-static impl_t *impl_array;
-
static void
test_init (void)
{
-#ifdef TEST_MULTIARCH
+#if defined TEST_MULTIARCH && defined TEST_NAME
func_list = __libc_func (TEST_NAME);
#endif
diff --git a/string/test-strlen.c b/string/test-strlen.c
index 68925fc..8c74a8e 100644
--- a/string/test-strlen.c
+++ b/string/test-strlen.c
@@ -19,7 +19,11 @@
<http://www.gnu.org/licenses/>. */
#define TEST_MAIN
-#define TEST_NAME "strlen"
+#ifndef WIDE
+# define TEST_NAME "strlen"
+#else
+# define TEST_NAME "wcslen"
+#endif
#include "test-string.h"
#ifndef WIDE
diff --git a/string/test-strrchr.c b/string/test-strrchr.c
index d419915..734d0c5 100644
--- a/string/test-strrchr.c
+++ b/string/test-strrchr.c
@@ -20,7 +20,11 @@
<http://www.gnu.org/licenses/>. */
#define TEST_MAIN
-#define TEST_NAME "strrchr"
+#ifdef WIDE
+# define TEST_NAME "wcsrchr"
+#else
+# define TEST_NAME "strrchr"
+#endif
#include "test-string.h"
#ifdef WIDE
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9728fd2ccffac52c3ab3212158646b2e170c76a1
commit 9728fd2ccffac52c3ab3212158646b2e170c76a1
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 21 14:37:45 2012 -0700
Add more x86-64 ifunc tests
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index fec3056..f889d1e 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,30 @@
2012-09-21 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (__strcasecmp_avx): New.
+ (strcasecmp_list): Add __strcasecmp_avx.
+ (find_strcasecmp): Support __strcasecmp_avx.
+ (__strcasecmp_l_avx): New.
+ (strcasecmp_l_list): Add __strcasecmp_l_avx.
+ (find_strcasecmp_l): Support __strcasecmp_l_avx.
+ (__strncasecmp_avx): New.
+ (strncasecmp_list): Add __strncasecmp_avx.
+ (find_strncasecmp): Support __strncasecmp_avx.
+ (__strncasecmp_l_avx): New.
+ (strncasecmp_l_list): Add __strncasecmp_l_avx.
+ (find_strncasecmp_l): Support __strncasecmp_l_avx.
+ (__strchr_sse2_no_bsf): New.
+ (strchr_list): Add __strchr_sse2_no_bsf.
+ (__strrchr_sse2_no_bsf): New.
+ (strrchr_list): Add __strrchr_sse2_no_bsf.
+ (__memcmp_ssse3): New.
+ (memcmp_list): Add __memcmp_ssse3.
+ (find_memcmp): Support __memcmp_ssse3.
+ (__strlen_sse2_pminub): New.
+ (strlen_list): Add __strlen_sse2_pminub.
+ (find_strlen): Support __strlen_sse2_pminub.
+
+2012-09-21 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (__strlen_no_bsf): Renamed
to ...
(__strlen_sse2_no_bsf): This.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index e602307..6267e23 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -213,9 +213,11 @@ find_strncpy (void)
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),
@@ -227,15 +229,21 @@ static const struct libc_func_test strcasecmp_list[] =
static const struct libc_func_test *
find_strcasecmp (void)
{
- return strcasecmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+ 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),
@@ -247,7 +255,10 @@ static const struct libc_func_test strcasecmp_l_list[] =
static const struct libc_func_test *
find_strcasecmp_l (void)
{
- return strcasecmp_l_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+ return strcasecmp_l_list + (HAS_AVX
+ ? 0 : (HAS_SSE4_2
+ ? 1 : (HAS_SSSE3
+ ? 2 : 3)));
}
extern __typeof (strcat) __strcat_sse2;
@@ -313,9 +324,11 @@ find_strcmp (void)
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),
@@ -327,15 +340,20 @@ static const struct libc_func_test strncasecmp_list[] =
static const struct libc_func_test *
find_strncasecmp (void)
{
- return strncasecmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+ 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),
@@ -347,7 +365,10 @@ static const struct libc_func_test strncasecmp_l_list[] =
static const struct libc_func_test *
find_strncasecmp_l (void)
{
- return strncasecmp_l_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+ return strncasecmp_l_list + (HAS_AVX
+ ? 0 : (HAS_SSE4_2
+ ? 1 : (HAS_SSSE3
+ ? 2 : 3)));
}
extern __typeof (strncmp) __strncmp_sse2;
@@ -389,12 +410,14 @@ find_strcasestr (void)
}
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 },
};
@@ -443,12 +466,14 @@ find_strpbrk (void)
}
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 },
};
@@ -498,11 +523,13 @@ find_strstr (void)
# 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 },
};
@@ -512,7 +539,7 @@ static const struct libc_func_test memcmp_list[] =
static const struct libc_func_test *
find_memcmp (void)
{
- return memcmp_list + (HAS_SSE4_1 ? 0 : 1);
+ return memcmp_list + (HAS_SSE4_1 ? 0 : (HAS_SSSE3 ? 1 : 2));
}
extern __typeof (memcpy) __memcpy_sse2;
@@ -599,6 +626,7 @@ find___mempcpy_chk (void)
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[] =
@@ -606,6 +634,7 @@ 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 },
};
@@ -614,7 +643,7 @@ static const struct libc_func_test strlen_list[] =
static const struct libc_func_test *
find_strlen (void)
{
- return strlen_list + (HAS_SSE4_2 ? 0 : 2);
+ return strlen_list + (HAS_SSE4_2 ? 0 : 1);
}
# endif /* SHARED */
#endif /* NOT_IN_libc */
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=36bb237798b5a6540b5596e5470259e1104275dc
commit 36bb237798b5a6540b5596e5470259e1104275dc
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 21 14:13:46 2012 -0700
Fix build on x86-64
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index d1ccdff..fec3056 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,3 +1,12 @@
+2012-09-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/multiarch/libc-test.c (__strlen_no_bsf): Renamed
+ to ...
+ (__strlen_sse2_no_bsf): This.
+ (strlen_list): Updated.
+ * sysdeps/x86_64/multiarch/strcmp-sse42.S (STRCMP_SSE42): Make
+ it global and hidden.
+
2011-08-11 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/i386/i686/multiarch/libc-test.c (strcat_list): New.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 92db4ae..e602307 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -598,14 +598,14 @@ find___mempcpy_chk (void)
}
extern __typeof (strlen) __strlen_sse2;
-extern __typeof (strlen) __strlen_no_bsf;
+extern __typeof (strlen) __strlen_sse2_no_bsf;
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_no_bsf),
+ LIBC_FUNC_INIT (__strlen_sse2_no_bsf),
{ NULL, NULL },
};
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
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2822bf78679f0662bce894fc54d2206ca8648789
commit 2822bf78679f0662bce894fc54d2206ca8648789
Merge: 4c8c94b 4315310
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Sep 21 13:58:12 2012 -0700
Merge remote-tracking branch 'origin/master' into hjl/ifunc/test
Conflicts:
config.h.in
sysdeps/x86_64/multiarch/strcmp.S
diff --cc config.h.in
index bae5aeb,10a9925..564bbd2
--- a/config.h.in
+++ b/config.h.in
@@@ -204,9 -167,16 +167,19 @@@
/* Define if `.ctors' and `.dtors' sections shouldn't be used. */
#undef NO_CTORS_DTORS_SECTIONS
+ /* Define if obsolete RPC code should be made available for user-level code
+ to link against. */
+ #undef LINK_OBSOLETE_RPC
+
+ /* Define if Systemtap <sys/sdt.h> probes should be defined. */
+ #undef USE_STAP_PROBE
+
+ /* Define if library functions should try to contact the nscd daemon. */
+ #undef USE_NSCD
+
+/* Define if optimizations for multiple architectures should be tested. */
+#undef TEST_MULTIARCH
+
/*
*/
diff --cc config.make.in
index a808a9f,b6d1c94..c887ca9
--- a/config.make.in
+++ b/config.make.in
@@@ -76,10 -75,8 +75,9 @@@ static-libgcc = @libc_cv_gcc_static_lib
versioning = @VERSIONING@
oldest-abi = @oldest_abi@
- no-whole-archive = @no_whole_archive@
exceptions = @exceptions@
multi-arch = @multi_arch@
+test-multi-arch = @test_multi_arch@
mach-interface-list = @mach_interface_list@
diff --cc configure
index 3f26a9c,739d2bd..e1f1b2e
--- a/configure
+++ b/configure
@@@ -693,8 -654,9 +654,10 @@@ multi_arc
base_machine
add_on_subdirs
add_ons
+ build_nscd
+ link_obsolete_rpc
libc_cv_nss_crypt
+test_multi_arch
all_warnings
force_install
bindnow
@@@ -795,8 -748,11 +749,12 @@@ enable_force_instal
enable_kernel
enable_all_warnings
enable_multi_arch
+enable_test_multi_arch
enable_nss_crypt
+ enable_obsolete_rpc
+ enable_systemtap
+ enable_build_nscd
+ enable_nscd
with_cpu
'
ac_precious_vars='build_alias
@@@ -1455,10 -1407,12 +1409,15 @@@ Optional Features
--enable-all-warnings enable all useful warnings gcc can issue
--enable-multi-arch enable single DSO with optimizations for multiple
architectures
+ --enable-test-multi-arch
+ enable test of optimizations for multiple
+ architectures
--enable-nss-crypt enable libcrypt to use nss
+ --enable-obsolete-rpc build and install the obsolete RPC code for
+ link-time usage
+ --enable-systemtap enable systemtap static probe points [default=no]
+ --disable-build-nscd disable building and installing the nscd daemon
+ --disable-nscd library functions will not contact the nscd daemon
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
diff --cc string/test-memccpy.c
index c5676cf,8fa96bc..c24c72f
--- a/string/test-memccpy.c
+++ b/string/test-memccpy.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "memccpy"
#include "test-string.h"
void *simple_memccpy (void *, const void *, int, size_t);
diff --cc string/test-memchr.c
index ab510ef,315726d..977159e
--- a/string/test-memchr.c
+++ b/string/test-memchr.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "memchr"
#include "test-string.h"
typedef char *(*proto_t) (const char *, int, size_t);
diff --cc string/test-memcmp.c
index 4fbfa54,69076d0..2e8c711
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@@ -14,19 -15,46 +15,47 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "memcmp"
#include "test-string.h"
-
- typedef int (*proto_t) (const char *, const char *, size_t);
- int simple_memcmp (const char *, const char *, size_t);
-
- IMPL (simple_memcmp, 0)
- IMPL (memcmp, 1)
+ #ifdef WIDE
+ # include <inttypes.h>
+ # include <wchar.h>
+
+ # define MEMCMP wmemcmp
+ # define MEMCPY wmemcpy
+ # define SIMPLE_MEMCMP simple_wmemcmp
+ # define CHAR wchar_t
+ # define UCHAR wchar_t
+ # define CHARBYTES 4
+ # define CHAR__MIN WCHAR_MIN
+ # define CHAR__MAX WCHAR_MAX
+ int
+ simple_wmemcmp (const wchar_t *s1, const wchar_t *s2, size_t n)
+ {
+ int ret = 0;
+ /* Warning!
+ wmemcmp has to use SIGNED comparison for elements.
+ memcmp has to use UNSIGNED comparison for elemnts.
+ */
+ while (n-- && (ret = *s1 < *s2 ? -1 : *s1 == *s2 ? 0 : 1) == 0) {s1++; s2++;}
+ return ret;
+ }
+ #else
+ # include <limits.h>
+
+ # define MEMCMP memcmp
+ # define MEMCPY memcpy
+ # define SIMPLE_MEMCMP simple_memcmp
+ # define CHAR char
+ # define MAX_CHAR 255
+ # define UCHAR unsigned char
+ # define CHARBYTES 1
+ # define CHAR__MIN CHAR_MIN
+ # define CHAR__MAX CHAR_MAX
int
simple_memcmp (const char *s1, const char *s2, size_t n)
diff --cc string/test-memmem.c
index 4402623,4076029..132f8ff
--- a/string/test-memmem.c
+++ b/string/test-memmem.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "memmem"
#define BUF1PAGES 20
#define ITERATIONS 500
#include "test-string.h"
diff --cc string/test-memmove.c
index cf3fa1e,7d10712..64e3e6c
--- a/string/test-memmove.c
+++ b/string/test-memmove.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "memmove"
#include "test-string.h"
typedef char *(*proto_t) (char *, const char *, size_t);
diff --cc string/test-memset.c
index cdc51d0,839b8a1..31ca342
--- a/string/test-memset.c
+++ b/string/test-memset.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "memset"
#define MIN_PAGE_SIZE 131072
#include "test-string.h"
diff --cc string/test-strcasestr.c
index 9981c23,6c1a878..8cf194f
--- a/string/test-strcasestr.c
+++ b/string/test-strcasestr.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strcasestr"
#include "test-string.h"
diff --cc string/test-strcat.c
index 83b133a,7dcd7bc..37b1b8f
--- a/string/test-strcat.c
+++ b/string/test-strcat.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strcat"
#include "test-string.h"
typedef char *(*proto_t) (char *, const char *);
diff --cc string/test-strchr.c
index 200327c,e544aa7..a8f8760
--- a/string/test-strchr.c
+++ b/string/test-strchr.c
@@@ -14,50 -15,78 +15,79 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strchr"
#include "test-string.h"
- typedef char *(*proto_t) (const char *, int);
- char *simple_strchr (const char *, int);
- char *stupid_strchr (const char *, int);
-
- IMPL (stupid_strchr, 0)
- IMPL (simple_strchr, 0)
- IMPL (strchr, 1)
-
- char *
- simple_strchr (const char *s, int c)
+ #ifndef WIDE
+ # ifdef USE_FOR_STRCHRNUL
+ # define STRCHR strchrnul
+ # define stupid_STRCHR stupid_STRCHRNUL
+ # define simple_STRCHR simple_STRCHRNUL
+ # else
+ # define STRCHR strchr
+ # endif
+ # define STRLEN strlen
+ # define CHAR char
+ # define BIG_CHAR CHAR_MAX
+ # define MIDDLE_CHAR 127
+ # define SMALL_CHAR 23
+ # define UCHAR unsigned char
+ #else
+ # include <wchar.h>
+ # define STRCHR wcschr
+ # define STRLEN wcslen
+ # define CHAR wchar_t
+ # define BIG_CHAR WCHAR_MAX
+ # define MIDDLE_CHAR 1121
+ # define SMALL_CHAR 851
+ # define UCHAR wchar_t
+ #endif
+
+ #ifdef USE_FOR_STRCHRNUL
+ # define NULLRET(endptr) endptr
+ #else
+ # define NULLRET(endptr) NULL
+ #endif
+
+
+ typedef CHAR *(*proto_t) (const CHAR *, int);
+
+ CHAR *
+ simple_STRCHR (const CHAR *s, int c)
{
- for (; *s != (char) c; ++s)
+ for (; *s != (CHAR) c; ++s)
if (*s == '\0')
- return NULL;
- return (char *) s;
+ return NULLRET ((CHAR *) s);
+ return (CHAR *) s;
}
- char *
- stupid_strchr (const char *s, int c)
+ CHAR *
+ stupid_STRCHR (const CHAR *s, int c)
{
- size_t n = strlen (s) + 1;
+ size_t n = STRLEN (s) + 1;
while (n--)
- if (*s++ == (char) c)
- return (char *) s - 1;
- return NULL;
+ if (*s++ == (CHAR) c)
+ return (CHAR *) s - 1;
+ return NULLRET ((CHAR *) s - 1);
}
+ IMPL (stupid_STRCHR, 0)
+ IMPL (simple_STRCHR, 0)
+ IMPL (STRCHR, 1)
+
static void
- do_one_test (impl_t *impl, const char *s, int c, char *exp_res)
+ do_one_test (impl_t *impl, const CHAR *s, int c, const CHAR *exp_res)
{
- char *res = CALL (impl, s, c);
+ CHAR *res = CALL (impl, s, c);
if (res != exp_res)
{
- error (0, 0, "Wrong result in function %s %p %p", impl->name,
- res, exp_res);
+ error (0, 0, "Wrong result in function %s %#x %p %p", impl->name,
+ c, res, exp_res);
ret = 1;
return;
}
diff --cc string/test-strcmp.c
index d8a85c9,000c510..043af65
--- a/string/test-strcmp.c
+++ b/string/test-strcmp.c
@@@ -15,16 -15,10 +15,15 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#ifdef WIDE
+# define TEST_NAME "wstrcmp"
+#else
+# define TEST_NAME "strcmp"
+#endif
#include "test-string.h"
#ifdef WIDE
diff --cc string/test-strcpy.c
index 7a4e3be,3a0b118..5493f2a
--- a/string/test-strcpy.c
+++ b/string/test-strcpy.c
@@@ -21,18 -42,24 +42,25 @@@
#ifndef STRCPY_RESULT
# define STRCPY_RESULT(dst, len) dst
# define TEST_MAIN
+# define TEST_NAME "strcpy"
# include "test-string.h"
+ # ifndef WIDE
+ # define SIMPLE_STRCPY simple_strcpy
+ # define STRCPY strcpy
+ # else
+ # define SIMPLE_STRCPY simple_wcscpy
+ # define STRCPY wcscpy
+ # endif
- char *simple_strcpy (char *, const char *);
+ CHAR *SIMPLE_STRCPY (CHAR *, const CHAR *);
- IMPL (simple_strcpy, 0)
- IMPL (strcpy, 1)
+ IMPL (SIMPLE_STRCPY, 0)
+ IMPL (STRCPY, 1)
- char *
- simple_strcpy (char *dst, const char *src)
+ CHAR *
+ SIMPLE_STRCPY (CHAR *dst, const CHAR *src)
{
- char *ret = dst;
+ CHAR *ret = dst;
while ((*dst++ = *src++) != '\0');
return ret;
}
diff --cc string/test-strlen.c
index feb1c5d,0ac5184..68925fc
--- a/string/test-strlen.c
+++ b/string/test-strlen.c
@@@ -14,26 -15,29 +15,30 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strlen"
#include "test-string.h"
- typedef size_t (*proto_t) (const char *);
- size_t simple_strlen (const char *);
- size_t builtin_strlen (const char *);
+ #ifndef WIDE
+ # define STRLEN strlen
+ # define CHAR char
+ # define MAX_CHAR CHAR_MAX
+ #else
+ # include <wchar.h>
+ # define STRLEN wcslen
+ # define CHAR wchar_t
+ # define MAX_CHAR WCHAR_MAX
+ #endif
- IMPL (simple_strlen, 0)
- IMPL (builtin_strlen, 0)
- IMPL (strlen, 1)
+ typedef size_t (*proto_t) (const CHAR *);
size_t
- simple_strlen (const char *s)
+ simple_STRLEN (const CHAR *s)
{
- const char *p;
+ const CHAR *p;
for (p = s; *p; ++p);
return p - s;
diff --cc string/test-strncat.c
index 59306a6,69c8c0b..60ab9c4
--- a/string/test-strncat.c
+++ b/string/test-strncat.c
@@@ -13,12 -13,10 +13,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strncat"
#include "test-string.h"
typedef char *(*proto_t) (char *, const char *, size_t);
diff --cc string/test-strncmp.c
index 50156c7,266781b..8b54f50
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strncmp"
#include "test-string.h"
typedef int (*proto_t) (const char *, const char *, size_t);
diff --cc string/test-strnlen.c
index d078729,547df45..99c8eb2
--- a/string/test-strnlen.c
+++ b/string/test-strnlen.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strnlen"
#include "test-string.h"
typedef size_t (*proto_t) (const char *, size_t);
diff --cc string/test-strrchr.c
index 64af621,c63c8de..d419915
--- a/string/test-strrchr.c
+++ b/string/test-strrchr.c
@@@ -14,30 -16,45 +16,46 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strrchr"
#include "test-string.h"
- typedef char *(*proto_t) (const char *, int);
- char *simple_strrchr (const char *, int);
-
- IMPL (simple_strrchr, 0)
- IMPL (strrchr, 1)
-
- char *
- simple_strrchr (const char *s, int c)
+ #ifdef WIDE
+ # include <wchar.h>
+ # define SIMPLE_STRRCHR simple_wcsrchr
+ # define STRRCHR wcsrchr
+ # define CHAR wchar_t
+ # define UCHAR wchar_t
+ # define BIG_CHAR WCHAR_MAX
+ # define SMALL_CHAR 1273
+ #else
+ # define SIMPLE_STRRCHR simple_strrchr
+ # define STRRCHR strrchr
+ # define CHAR char
+ # define UCHAR unsigned char
+ # define BIG_CHAR CHAR_MAX
+ # define SMALL_CHAR 127
+ #endif
+
+ typedef CHAR *(*proto_t) (const CHAR *, int);
+ CHAR *SIMPLE_STRRCHR (const CHAR *, int);
+
+ IMPL (SIMPLE_STRRCHR, 0)
+ IMPL (STRRCHR, 1)
+
+ CHAR *
+ SIMPLE_STRRCHR (const CHAR *s, int c)
{
- const char *ret = NULL;
+ const CHAR *ret = NULL;
for (; *s != '\0'; ++s)
- if (*s == (char) c)
+ if (*s == (CHAR) c)
ret = s;
- return (char *) (c == '\0' ? s : ret);
+ return (CHAR *) (c == '\0' ? s : ret);
}
static void
diff --cc string/test-strspn.c
index ad7b845,743bc0a..e2d9ae1
--- a/string/test-strspn.c
+++ b/string/test-strspn.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strspn"
#include "test-string.h"
typedef size_t (*proto_t) (const char *, const char *);
diff --cc string/test-strstr.c
index 6116d70,6be4601..b3afdf4
--- a/string/test-strstr.c
+++ b/string/test-strstr.c
@@@ -14,12 -14,10 +14,11 @@@
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. */
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
#define TEST_MAIN
+#define TEST_NAME "strstr"
#include "test-string.h"
diff --cc sysdeps/x86_64/multiarch/rawmemchr.S
index 858aec3,c4157ad..ebcc17e
--- a/sysdeps/x86_64/multiarch/rawmemchr.S
+++ b/sysdeps/x86_64/multiarch/rawmemchr.S
@@@ -39,10 -42,8 +42,10 @@@ strong_alias (rawmemchr, __rawmemchr
.section .text.sse4.2,"ax",@progbits
- .align 16
+ .align 16
.type __rawmemchr_sse42, @function
+ .globl __rawmemchr_sse42
+ .hidden __rawmemchr_sse42
__rawmemchr_sse42:
cfi_startproc
CALL_MCOUNT
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4c8c94b62f23164de0ef76a9ff04c62470e91c28
commit 4c8c94b62f23164de0ef76a9ff04c62470e91c28
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Aug 11 11:06:45 2011 -0700
Test 32bit strcat and strncat.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 754584f..d1ccdff 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,16 @@
2011-08-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/i386/i686/multiarch/libc-test.c (strcat_list): New.
+ (find_strcat): Likewise.
+ (strncat_list): Likewise.
+ (find_strncat): Likewise.
+ (__libc_func): Use them.
+
+ * sysdeps/i386/i686/multiarch/strcat.S (STRCAT_IA32): Make it
+ global and hidden.
+
+2011-08-11 H.J. Lu <hongjiu.lu@intel.com>
+
* string/test-strcmp.c (TEST_NAME): Support WIDE.
* string/test-strncat.c (TEST_NAME): New.
diff --git a/sysdeps/i386/i686/multiarch/libc-test.c b/sysdeps/i386/i686/multiarch/libc-test.c
index 128e852..e046fed 100644
--- a/sysdeps/i386/i686/multiarch/libc-test.c
+++ b/sysdeps/i386/i686/multiarch/libc-test.c
@@ -34,6 +34,8 @@
#define find_strcpy() NULL
#define find_strncpy() NULL
#define find_strcasestr() NULL
+#define find_strcat() NULL
+#define find_strncat() NULL
#define find_strcmp() NULL
#define find_strncmp() NULL
#define find_strcspn() NULL
@@ -235,6 +237,46 @@ static const struct libc_func_test strcmp_list[] =
{ 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 *
@@ -482,6 +524,12 @@ __libc_func (const char *name)
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 ();
diff --git a/sysdeps/i386/i686/multiarch/strcat.S b/sysdeps/i386/i686/multiarch/strcat.S
index 14d4f91..a84d297 100644
--- a/sysdeps/i386/i686/multiarch/strcat.S
+++ b/sysdeps/i386/i686/multiarch/strcat.S
@@ -105,6 +105,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
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=00fc83e7e30e79ca3b290afe1a32c261201dae40
commit 00fc83e7e30e79ca3b290afe1a32c261201dae40
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Aug 11 10:50:37 2011 -0700
Correct filename in ChangeLog.test-ifunc.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 0e382ed..754584f 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -15,7 +15,7 @@
2011-06-24 H.J. Lu <hongjiu.lu@intel.com>
- * sysdeps/x86_64/multiarch/libc-test.c (stpcpy_list): New.
+ * sysdeps/i386/i686/multiarch/libc-test.c (stpcpy_list): New.
(find_stpcpy): Likewise.
(stpncpy_list): Likewise.
(find_stpncpy): Likewise.
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8710308e9991150fe9c86ccad56164c68880913f
commit 8710308e9991150fe9c86ccad56164c68880913f
Merge: 6b911d1 2df1f7b
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Aug 11 10:42:27 2011 -0700
Merge remote-tracking branch 'origin/master' into hjl/ifunc/test
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6b911d1a0e70c135bc56318a421f3c5ad67fddfe
commit 6b911d1a0e70c135bc56318a421f3c5ad67fddfe
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Aug 11 10:39:15 2011 -0700
Test 64bit strcat and strncat.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index b715d80..0e382ed 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,3 +1,18 @@
+2011-08-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * string/test-strcmp.c (TEST_NAME): Support WIDE.
+
+ * string/test-strncat.c (TEST_NAME): New.
+
+ * sysdeps/x86_64/multiarch/libc-test.c (strcat_list): New.
+ (find_strcat): Likewise.
+ (strncat_list): Likewise.
+ (find_strncat): Likewise.
+ (__libc_func): Use them.
+
+ * sysdeps/x86_64/multiarch/strcat.S (STRCAT_SSE2): Make it
+ global and hidden.
+
2011-06-24 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/x86_64/multiarch/libc-test.c (stpcpy_list): New.
diff --git a/string/test-strcmp.c b/string/test-strcmp.c
index eab962b..d8a85c9 100644
--- a/string/test-strcmp.c
+++ b/string/test-strcmp.c
@@ -20,7 +20,11 @@
02111-1307 USA. */
#define TEST_MAIN
-#define TEST_NAME "strcmp"
+#ifdef WIDE
+# define TEST_NAME "wstrcmp"
+#else
+# define TEST_NAME "strcmp"
+#endif
#include "test-string.h"
#ifdef WIDE
diff --git a/string/test-strncat.c b/string/test-strncat.c
index f7cf7df..59306a6 100644
--- a/string/test-strncat.c
+++ b/string/test-strncat.c
@@ -18,6 +18,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strncat"
#include "test-string.h"
typedef char *(*proto_t) (char *, const char *, size_t);
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 24f69c0..92db4ae 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -36,6 +36,8 @@
#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
@@ -248,6 +250,46 @@ find_strcasecmp_l (void)
return strcasecmp_l_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
}
+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;
@@ -625,6 +667,9 @@ __libc_func (const char *name)
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 ();
@@ -634,6 +679,9 @@ __libc_func (const char *name)
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 ();
diff --git a/sysdeps/x86_64/multiarch/strcat.S b/sysdeps/x86_64/multiarch/strcat.S
index f3ccc8e..b9b7298 100644
--- a/sysdeps/x86_64/multiarch/strcat.S
+++ b/sysdeps/x86_64/multiarch/strcat.S
@@ -64,6 +64,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
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7cb6b35b5845c23d78468be3218852d1579ccd33
commit 7cb6b35b5845c23d78468be3218852d1579ccd33
Merge: 7e5723c 6761ac0
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Aug 11 09:58:32 2011 -0700
Merge remote-tracking branch 'origin/master' into hjl/ifunc/test
Conflicts:
configure
configure.in
diff --cc configure
index 34ec935,2bea3c0..3f26a9c
--- a/configure
+++ b/configure
@@@ -691,8 -694,6 +694,7 @@@ base_machin
add_on_subdirs
add_ons
libc_cv_nss_crypt
- experimental_malloc
+test_multi_arch
all_warnings
force_install
bindnow
@@@ -791,8 -794,6 +795,7 @@@ enable_force_instal
enable_kernel
enable_all_warnings
enable_multi_arch
+enable_test_multi_arch
- enable_experimental_malloc
enable_nss_crypt
with_cpu
'
@@@ -1452,11 -1453,6 +1455,9 @@@ Optional Features
--enable-all-warnings enable all useful warnings gcc can issue
--enable-multi-arch enable single DSO with optimizations for multiple
architectures
+ --enable-test-multi-arch
+ enable test of optimizations for multiple
+ architectures
- --enable-experimental-malloc
- enable experimental malloc features
--enable-nss-crypt enable libcrypt to use nss
Optional Packages:
@@@ -3771,26 -3778,6 +3783,19 @@@ els
fi
+# Check whether --enable-test-multi-arch was given.
+if test "${enable_test_multi_arch+set}" = set; then :
+ enableval=$enable_test_multi_arch; test_multi_arch=$enableval
+else
+ test_multi_arch=no
+fi
+
+if test x"$test_multi_arch" != xno; then
+ $as_echo "#define TEST_MULTIARCH 1" >>confdefs.h
+
+fi
+
+
- # Check whether --enable-experimental-malloc was given.
- if test "${enable_experimental_malloc+set}" = set; then :
- enableval=$enable_experimental_malloc; experimental_malloc=$enableval
- fi
-
-
-
# Check whether --enable-nss-crypt was given.
if test "${enable_nss_crypt+set}" = set; then :
enableval=$enable_nss_crypt; nss_crypt=$enableval
diff --cc configure.in
index 01942f8,65ace27..6dd7b65
--- a/configure.in
+++ b/configure.in
@@@ -274,23 -281,6 +281,16 @@@ AC_ARG_ENABLE([multi-arch]
[multi_arch=$enableval],
[multi_arch=default])
+AC_ARG_ENABLE([test-multi-arch],
+ AC_HELP_STRING([--enable-test-multi-arch],
+ [enable test of optimizations for multiple architectures]),
+ [test_multi_arch=$enableval],
+ [test_multi_arch=no])
+if test x"$test_multi_arch" != xno; then
+ AC_DEFINE(TEST_MULTIARCH)
+fi
+AC_SUBST(test_multi_arch)
+
- AC_ARG_ENABLE([experimental-malloc],
- AC_HELP_STRING([--enable-experimental-malloc],
- [enable experimental malloc features]),
- [experimental_malloc=$enableval],
- [])
- AC_SUBST(experimental_malloc)
-
AC_ARG_ENABLE([nss-crypt],
AC_HELP_STRING([--enable-nss-crypt],
[enable libcrypt to use nss]),
diff --cc string/test-strcmp.c
index 71242e3,b8d85dc..eab962b
--- a/string/test-strcmp.c
+++ b/string/test-strcmp.c
@@@ -19,19 -20,46 +20,47 @@@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strcmp"
#include "test-string.h"
- typedef int (*proto_t) (const char *, const char *);
- int simple_strcmp (const char *, const char *);
- int stupid_strcmp (const char *, const char *);
-
- IMPL (stupid_strcmp, 0)
- IMPL (simple_strcmp, 0)
- IMPL (strcmp, 1)
+ #ifdef WIDE
+ # include <inttypes.h>
+ # include <wchar.h>
+
+ # define L(str) L##str
+ # define STRCMP wcscmp
+ # define STRCPY wcscpy
+ # define STRLEN wcslen
+ # define MEMCPY wmemcpy
+ # define SIMPLE_STRCMP simple_wcscmp
+ # define STUPID_STRCMP stupid_wcscmp
+ # define CHAR wchar_t
+ # define UCHAR uint32_t
+ # define CHARBYTES 4
+ # define CHARBYTESLOG 2
+ # define CHARALIGN __alignof__ (CHAR)
+ # define MIDCHAR 0x7fffffff
+ # define LARGECHAR 0xfffffffe
+ #else
+ # define L(str) str
+ # define STRCMP strcmp
+ # define STRCPY strcpy
+ # define STRLEN strlen
+ # define MEMCPY memcpy
+ # define SIMPLE_STRCMP simple_strcmp
+ # define STUPID_STRCMP stupid_strcmp
+ # define CHAR char
+ # define UCHAR unsigned char
+ # define CHARBYTES 1
+ # define CHARBYTESLOG 0
+ # define CHARALIGN 1
+ # define MIDCHAR 0x7f
+ # define LARGECHAR 0xfe
+ #endif
+ typedef int (*proto_t) (const CHAR *, const CHAR *);
int
- simple_strcmp (const char *s1, const char *s2)
+ SIMPLE_STRCMP (const CHAR *s1, const CHAR *s2)
{
int ret;
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7e5723c61e2bfcc04a12e41128d88c210d03ede6
commit 7e5723c61e2bfcc04a12e41128d88c210d03ede6
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 24 14:39:22 2011 -0700
Test new 32bit/64bit strcpy functions.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index ef78c11..b715d80 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,3 +1,24 @@
+2011-06-24 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/x86_64/multiarch/libc-test.c (stpcpy_list): New.
+ (find_stpcpy): Likewise.
+ (stpncpy_list): Likewise.
+ (find_stpncpy): Likewise.
+ (strcpy_list): Likewise.
+ (find_strcpy): Likewise.
+ (strncpy_list): Likewise.
+ (find_strncpy): Likewise.
+ (__libc_func): Use them.
+
+ * sysdeps/i386/i686/multiarch/strcpy.S (STRCPY_IA32): Make it
+ global and hidden.
+
+ * sysdeps/x86_64/multiarch/libc-test.c (stpcpy_list): Add
+ __stpcpy_sse2_unaligned.
+ (stpncpy_list): Add __stpncpy_sse2_unaligned.
+ (strcpy_list): Add __strcpy_sse2_unaligned.
+ (strncpy_list): Add __strncpy_sse2_unaligned.
+
2011-03-18 H.J. Lu <hongjiu.lu@intel.com>
* include/libc-test.h: Fix a typo in comments.
diff --git a/sysdeps/i386/i686/multiarch/libc-test.c b/sysdeps/i386/i686/multiarch/libc-test.c
index 094b9a7..128e852 100644
--- a/sysdeps/i386/i686/multiarch/libc-test.c
+++ b/sysdeps/i386/i686/multiarch/libc-test.c
@@ -29,6 +29,10 @@
#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_strcasestr() NULL
#define find_strcmp() NULL
#define find_strncmp() NULL
@@ -121,6 +125,86 @@ 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 (strcasestr) __strcasestr_ia32;
extern __typeof (strcasestr) __strcasestr_sse42;
@@ -383,6 +467,18 @@ __libc_func (const char *name)
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, "strcasestr") == 0)
return find_strcasestr ();
diff --git a/sysdeps/i386/i686/multiarch/strcpy.S b/sysdeps/i386/i686/multiarch/strcpy.S
index d025a4f..9b2d42e 100644
--- a/sysdeps/i386/i686/multiarch/strcpy.S
+++ b/sysdeps/i386/i686/multiarch/strcpy.S
@@ -121,6 +121,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
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 4f7e99b..24f69c0 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -129,12 +129,14 @@ find_rawmemchr (void)
}
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 },
};
@@ -147,12 +149,14 @@ find_stpcpy (void)
}
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 },
};
@@ -165,12 +169,14 @@ find_stpncpy (void)
}
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 },
};
@@ -183,12 +189,14 @@ find_strcpy (void)
}
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 },
};
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=04bf7eef69cb55b6be61bf7fb4a3c9682e068299
commit 04bf7eef69cb55b6be61bf7fb4a3c9682e068299
Merge: 7643265 8912479
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jun 24 14:11:43 2011 -0700
Merge remote-tracking branch 'origin/master' into hjl/test-ifunc
Conflicts:
sysdeps/x86_64/multiarch/strcpy.S
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7643265ad7206f3491a5e25bea7baec9828f33ba
commit 7643265ad7206f3491a5e25bea7baec9828f33ba
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Mar 18 06:50:43 2011 -0700
Fix a typo in comments.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 74cf58d..ef78c11 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,3 +1,7 @@
+2011-03-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ * include/libc-test.h: Fix a typo in comments.
+
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/i386/i686/multiarch/libc-test.c (strcspn_list): Fix
diff --git a/include/libc-test.h b/include/libc-test.h
index a6e2710..d278b2d 100644
--- a/include/libc-test.h
+++ b/include/libc-test.h
@@ -33,4 +33,4 @@ struct libc_func_test
/* Return the NULL terminated array of functions. */
extern const struct libc_func_test *__libc_func (const char *);
-#endif /* libc-symbols.h */
+#endif /* libc-test.h */
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=da92d67720446d707cf17a5ad44a20b0966cecbf
commit da92d67720446d707cf17a5ad44a20b0966cecbf
Merge: f346c34 c6e1302
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Mar 18 06:42:41 2011 -0700
Merge remote-tracking branch 'origin/master' into intel/test-ifunc
Conflicts:
config.h.in
diff --cc config.h.in
index 7501aee,9e797eb..bae5aeb
--- a/config.h.in
+++ b/config.h.in
@@@ -201,9 -201,9 +201,12 @@@
/* Define if multi-arch DSOs should be generated. */
#undef USE_MULTIARCH
+ /* Define if `.ctors' and `.dtors' sections shouldn't be used. */
+ #undef NO_CTORS_DTORS_SECTIONS
+
+/* Define if optimizations for multiple architectures should be tested. */
+#undef TEST_MULTIARCH
+
/*
*/
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f346c3443b3f516b5027deba78bd3af8ee3f615a
commit f346c3443b3f516b5027deba78bd3af8ee3f615a
Merge: a7f0a50 dbb0472
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Dec 11 10:29:03 2010 -0800
Merge remote branch 'origin/master' into intel/test-ifunc
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a7f0a5009884f086b585123f14b4faa3d14e3c5d
commit a7f0a5009884f086b585123f14b4faa3d14e3c5d
Merge: 85e9101 a5b913e
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Sat Dec 4 06:40:45 2010 -0800
Merge remote branch 'origin/master' into intel/test-ifunc
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=85e91017ba076c7fea3a85d43029803f5ae5fb3f
commit 85e91017ba076c7fea3a85d43029803f5ae5fb3f
Merge: 1eda50a 1e24cf6
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Dec 1 10:22:44 2010 -0800
Merge remote branch 'origin/master' into intel/test-ifunc
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1eda50abdca403a6729bd809dcfe295a247c4727
commit 1eda50abdca403a6729bd809dcfe295a247c4727
Merge: f83d320 a769081
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Mon Nov 29 10:04:53 2010 -0800
Merge remote branch 'origin/master' into intel/test-ifunc
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f83d32039ca502bb5ca9564adaa5d34706b99f97
commit f83d32039ca502bb5ca9564adaa5d34706b99f97
Merge: 5fdbcee 3bf8d1b
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 25 10:11:04 2010 -0800
Merge remote branch 'origin/master' into intel/test-ifunc
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=5fdbcee86fb726bdc77812e08c7b1fc93230d40e
commit 5fdbcee86fb726bdc77812e08c7b1fc93230d40e
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 15:54:35 2010 -0800
Fix a typo in strcspn_list.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 6a7a080..74cf58d 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,10 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/i386/i686/multiarch/libc-test.c (strcspn_list): Fix
+ a typo.
+
+2010-11-11 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.
diff --git a/sysdeps/i386/i686/multiarch/libc-test.c b/sysdeps/i386/i686/multiarch/libc-test.c
index 5dfece8..094b9a7 100644
--- a/sysdeps/i386/i686/multiarch/libc-test.c
+++ b/sysdeps/i386/i686/multiarch/libc-test.c
@@ -164,8 +164,8 @@ extern __typeof (strcspn) __strcspn_sse42;
static const struct libc_func_test strcspn_list[] =
{
- LIBC_FUNC_INIT (__strcspn_ia32),
LIBC_FUNC_INIT (__strcspn_sse42),
+ LIBC_FUNC_INIT (__strcspn_ia32),
{ NULL, NULL },
};
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=be3aa2c07d03279908e2730fb50d8a2cb65de0e6
commit be3aa2c07d03279908e2730fb50d8a2cb65de0e6
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 15:40:18 2010 -0800
Test i686 multiarch functions.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 396b45f..6a7a080 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,18 @@
2010-11-11 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/strcmp.S (__STRCMP_IA32): Likewise.
+
+ * sysdeps/i386/i686/multiarch/libc-test.c: New.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (__memmove_chk_list): Moved
out of "#ifdef SHARED" block.
(find___memmove_chk): Likewise.
diff --git a/sysdeps/i386/i686/multiarch/bcopy.S b/sysdeps/i386/i686/multiarch/bcopy.S
index 8671bf6..1da9d5a 100644
--- a/sysdeps/i386/i686/multiarch/bcopy.S
+++ b/sysdeps/i386/i686/multiarch/bcopy.S
@@ -78,6 +78,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 8c740a4..33dfb6c 100644
--- a/sysdeps/i386/i686/multiarch/bzero.S
+++ b/sysdeps/i386/i686/multiarch/bzero.S
@@ -78,6 +78,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-test.c b/sysdeps/i386/i686/multiarch/libc-test.c
new file mode 100644
index 0000000..5dfece8
--- /dev/null
+++ b/sysdeps/i386/i686/multiarch/libc-test.c
@@ -0,0 +1,411 @@
+/* Copyright (C) 2010 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 <libc-test.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_strcasestr() NULL
+#define find_strcmp() NULL
+#define find_strncmp() NULL
+#define find_strcspn() NULL
+#define find_strlen() NULL
+#define find_strpbrk() NULL
+#define find_strspn() NULL
+#define find_strstr() 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 (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 (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 },
+};
+
+# 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 (strcspn) __strcspn_ia32;
+extern __typeof (strcspn) __strcspn_sse42;
+
+static const struct libc_func_test strcspn_list[] =
+{
+ LIBC_FUNC_INIT (__strcspn_ia32),
+ LIBC_FUNC_INIT (__strcspn_sse42),
+ { 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_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);
+}
+
+# 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, "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, "strcasestr") == 0)
+ return find_strcasestr ();
+
+ if (strcmp (name, "strcmp") == 0)
+ return find_strcmp ();
+
+ if (strcmp (name, "strncmp") == 0)
+ return find_strncmp ();
+
+ 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, "strspn") == 0)
+ return find_strspn ();
+
+ if (strcmp (name, "strstr") == 0)
+ return find_strstr ();
+
+ return NULL;
+}
diff --git a/sysdeps/i386/i686/multiarch/memcmp.S b/sysdeps/i386/i686/multiarch/memcmp.S
index cf606a5..f4f4043 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.S
+++ b/sysdeps/i386/i686/multiarch/memcmp.S
@@ -69,6 +69,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 bf1c7cc..2b2b3d1 100644
--- a/sysdeps/i386/i686/multiarch/memcpy.S
+++ b/sysdeps/i386/i686/multiarch/memcpy.S
@@ -62,6 +62,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 e0529c0..8da9e5e 100644
--- a/sysdeps/i386/i686/multiarch/memmove.S
+++ b/sysdeps/i386/i686/multiarch/memmove.S
@@ -61,6 +61,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 df830d2..d238e50 100644
--- a/sysdeps/i386/i686/multiarch/mempcpy.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy.S
@@ -62,6 +62,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/strcmp.S b/sysdeps/i386/i686/multiarch/strcmp.S
index 7136d47..5585690 100644
--- a/sysdeps/i386/i686/multiarch/strcmp.S
+++ b/sysdeps/i386/i686/multiarch/strcmp.S
@@ -94,6 +94,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
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=522dde18d033f49c6fd19093e9eacd91474927f8
commit 522dde18d033f49c6fd19093e9eacd91474927f8
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 15:15:28 2010 -0800
Test x86-64 multiarch strcasestr.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 4ad7511..396b45f 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,14 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (__memmove_chk_list): Moved
+ out of "#ifdef SHARED" block.
+ (find___memmove_chk): Likewise.
+ (strcasestr_list): New.
+ (find_strcasestr): Likewise.
+ (__libc_func): Use it.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (__memcpy_chk_list): New.
(find___memcpy_chk): Likewise.
(__memmove_chk_list): Likewise.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 16b99e6..4f7e99b 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -40,6 +40,7 @@
#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
@@ -80,6 +81,27 @@ static const struct libc_func_test memset_list[] =
{ 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 *
@@ -298,6 +320,24 @@ 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_sse42;
@@ -486,27 +526,6 @@ find___memcpy_chk (void)
return __memcpy_chk_list + (HAS_SSSE3 ? 0 : 2);
}
-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);
-}
-
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;
@@ -610,6 +629,9 @@ __libc_func (const char *name)
if (strcmp (name, "strncmp") == 0)
return find_strncmp ();
+ if (strcmp (name, "strcasestr") == 0)
+ return find_strcasestr ();
+
if (strcmp (name, "strchr") == 0)
return find_strchr ();
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4965eeedb3e658708ea1d0679227cfed4dd37cd7
commit 4965eeedb3e658708ea1d0679227cfed4dd37cd7
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 14:11:37 2010 -0800
Test x86-64 multiarch family of __memcpy_chk functions.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 2f73cf8..4ad7511 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,15 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (__memcpy_chk_list): New.
+ (find___memcpy_chk): Likewise.
+ (__memmove_chk_list): Likewise.
+ (find___memmove_chk): Likewise.
+ (__mempcpy_chk_list): Likewise.
+ (find___mempcpy_chk): Likewise.
+ (__libc_func): Use them.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (strchr_list): New.
(find_strchr): Likewise.
(strrchr_list): Likewise.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 8b02e32..16b99e6 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -25,6 +25,9 @@
#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
@@ -462,6 +465,69 @@ 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 *__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);
+}
+
+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_no_bsf;
extern __typeof (strlen) __strlen_sse42;
@@ -499,6 +565,15 @@ __libc_func (const char *name)
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 ();
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=7d6de954cdfdb43b595227d3b84c2a896a5b4ba1
commit 7d6de954cdfdb43b595227d3b84c2a896a5b4ba1
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 13:54:04 2010 -0800
Test x86-64 multiarch strchr/strrchr.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index d753e48..2f73cf8 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,19 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (strchr_list): New.
+ (find_strchr): Likewise.
+ (strrchr_list): Likewise.
+ (find_strrchr): Likewise.
+ (__libc_func): Use them.
+
+ * sysdeps/x86_64/multiarch/strchr.S (__strchr_sse42): Make it
+ global and hidden.
+ (__strchr_sse2): Likewise.
+ * sysdeps/x86_64/multiarch/strrchr.S (__strrchr_sse42): Likewise.
+ (__strrchr_sse2): Likewise.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (strpbrk_list): New.
(find_strpbrk): Likewise.
(strspn_list): Likewise.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 32811a4..8b02e32 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -37,9 +37,11 @@
#define find_strncasecmp() NULL
#define find_strncasecmp_l() NULL
#define find_strncmp() 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
@@ -293,6 +295,24 @@ find_strncmp (void)
return strncmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
}
+extern __typeof (strchr) __strchr_sse2;
+extern __typeof (strchr) __strchr_sse42;
+
+static const struct libc_func_test strchr_list[] =
+{
+ LIBC_FUNC_INIT (__strchr_sse42),
+ LIBC_FUNC_INIT (__strchr_sse2),
+ { 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;
@@ -329,6 +349,24 @@ find_strpbrk (void)
return strpbrk_list + (HAS_SSE4_2 ? 0 : 1);
}
+extern __typeof (strrchr) __strrchr_sse2;
+extern __typeof (strrchr) __strrchr_sse42;
+
+static const struct libc_func_test strrchr_list[] =
+{
+ LIBC_FUNC_INIT (__strrchr_sse42),
+ LIBC_FUNC_INIT (__strrchr_sse2),
+ { 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;
@@ -497,6 +535,9 @@ __libc_func (const char *name)
if (strcmp (name, "strncmp") == 0)
return find_strncmp ();
+ if (strcmp (name, "strchr") == 0)
+ return find_strchr ();
+
if (strcmp (name, "strcspn") == 0)
return find_strcspn ();
@@ -506,6 +547,9 @@ __libc_func (const char *name)
if (strcmp (name, "strpbrk") == 0)
return find_strpbrk ();
+ if (strcmp (name, "strrchr") == 0)
+ return find_strrchr ();
+
if (strcmp (name, "strspn") == 0)
return find_strspn ();
diff --git a/sysdeps/x86_64/multiarch/strchr.S b/sysdeps/x86_64/multiarch/strchr.S
index 71845a3..6523cee 100644
--- a/sysdeps/x86_64/multiarch/strchr.S
+++ b/sysdeps/x86_64/multiarch/strchr.S
@@ -79,6 +79,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
@@ -161,6 +163,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/strrchr.S b/sysdeps/x86_64/multiarch/strrchr.S
index 0d17fdb..6c15d27 100644
--- a/sysdeps/x86_64/multiarch/strrchr.S
+++ b/sysdeps/x86_64/multiarch/strrchr.S
@@ -84,6 +84,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
@@ -262,6 +264,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
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=08ab544bb5a15286806e570f25bc231a0a62236a
commit 08ab544bb5a15286806e570f25bc231a0a62236a
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 13:40:15 2010 -0800
Test x86-64 multiarch strpbrk/strspn.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index f80e4c3..d753e48 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,13 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (strpbrk_list): New.
+ (find_strpbrk): Likewise.
+ (strspn_list): Likewise.
+ (find_strspn): Likewise.
+ (__libc_func): Use them.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (strcspn_list): New.
(find_strcspn): Likewise.
(__libc_func): Use it.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 5920968..32811a4 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -39,6 +39,8 @@
#define find_strncmp() NULL
#define find_strcspn() NULL
#define find_strlen() NULL
+#define find_strpbrk() NULL
+#define find_strspn() NULL
#define find_strstr() NULL
#ifndef NOT_IN_libc
@@ -309,6 +311,42 @@ 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 (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;
@@ -465,6 +503,12 @@ __libc_func (const char *name)
if (strcmp (name, "strlen") == 0)
return find_strlen ();
+ if (strcmp (name, "strpbrk") == 0)
+ return find_strpbrk ();
+
+ if (strcmp (name, "strspn") == 0)
+ return find_strspn ();
+
if (strcmp (name, "strstr") == 0)
return find_strstr ();
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e42397ceb0a43a2dca7a1a564e56bd017d4575be
commit e42397ceb0a43a2dca7a1a564e56bd017d4575be
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 13:32:55 2010 -0800
Test x86-64 multiarch strcspn.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index afe4c81..f80e4c3 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,11 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (strcspn_list): New.
+ (find_strcspn): Likewise.
+ (__libc_func): Use it.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (strstr_list): New.
(find_strstr): Likewise.
(__libc_func): Use it.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 5f5f2f1..5920968 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -37,6 +37,7 @@
#define find_strncasecmp() NULL
#define find_strncasecmp_l() NULL
#define find_strncmp() NULL
+#define find_strcspn() NULL
#define find_strlen() NULL
#define find_strstr() NULL
@@ -290,6 +291,24 @@ find_strncmp (void)
return strncmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
}
+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 (strstr) __strstr_sse2;
extern __typeof (strstr) __strstr_sse42;
@@ -440,6 +459,9 @@ __libc_func (const char *name)
if (strcmp (name, "strncmp") == 0)
return find_strncmp ();
+ if (strcmp (name, "strcspn") == 0)
+ return find_strcspn ();
+
if (strcmp (name, "strlen") == 0)
return find_strlen ();
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6455f3b17a3144c9f623ba60417460d821fc9db1
commit 6455f3b17a3144c9f623ba60417460d821fc9db1
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 12:52:48 2010 -0800
Test x86-64 multiarch strstr.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 4eec09a..afe4c81 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,11 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (strstr_list): New.
+ (find_strstr): Likewise.
+ (__libc_func): Use it.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (strlen_list): New.
(find_strlen): Likewise.
(__libc_func): Use it.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index d623172..5f5f2f1 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -38,6 +38,7 @@
#define find_strncasecmp_l() NULL
#define find_strncmp() NULL
#define find_strlen() NULL
+#define find_strstr() NULL
#ifndef NOT_IN_libc
@@ -289,6 +290,24 @@ find_strncmp (void)
return strncmp_list + (HAS_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
}
+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);
+}
+
# ifdef SHARED
extern __typeof (memcmp) __memcmp_sse2;
extern __typeof (memcmp) __memcmp_sse4_1;
@@ -424,5 +443,8 @@ __libc_func (const char *name)
if (strcmp (name, "strlen") == 0)
return find_strlen ();
+ if (strcmp (name, "strstr") == 0)
+ return find_strstr ();
+
return NULL;
}
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=2db104c3cbe0528d96bbc61590f9b8ea2366a7a1
commit 2db104c3cbe0528d96bbc61590f9b8ea2366a7a1
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 12:25:49 2010 -0800
Test x86-64 multiarch strlen.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 9a5d2ab..4eec09a 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,14 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (strlen_list): New.
+ (find_strlen): Likewise.
+ (__libc_func): Use it.
+
+ * sysdeps/x86_64/multiarch/strlen.S (__strlen_sse2): Make it
+ global and hidden.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* string/test-string.h (FOR_EACH_IMPL): Skip TEST_NAME if
func_list isn't NULL.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 7885726..d623172 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -37,6 +37,7 @@
#define find_strncasecmp() NULL
#define find_strncasecmp_l() NULL
#define find_strncmp() NULL
+#define find_strlen() NULL
#ifndef NOT_IN_libc
@@ -346,6 +347,26 @@ find_mempcpy (void)
{
return mempcpy_list + (HAS_SSSE3 ? 0 : 2);
}
+
+extern __typeof (strlen) __strlen_sse2;
+extern __typeof (strlen) __strlen_no_bsf;
+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_no_bsf),
+ { NULL, NULL },
+};
+
+# undef find_strlen
+
+static const struct libc_func_test *
+find_strlen (void)
+{
+ return strlen_list + (HAS_SSE4_2 ? 0 : 2);
+}
# endif /* SHARED */
#endif /* NOT_IN_libc */
@@ -400,5 +421,8 @@ __libc_func (const char *name)
if (strcmp (name, "strncmp") == 0)
return find_strncmp ();
+ if (strcmp (name, "strlen") == 0)
+ return find_strlen ();
+
return NULL;
}
diff --git a/sysdeps/x86_64/multiarch/strlen.S b/sysdeps/x86_64/multiarch/strlen.S
index 83a88ec..c18b97a 100644
--- a/sysdeps/x86_64/multiarch/strlen.S
+++ b/sysdeps/x86_64/multiarch/strlen.S
@@ -47,6 +47,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
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b81b2c55fd920af6764a18340dde295ce35a35e0
commit b81b2c55fd920af6764a18340dde295ce35a35e0
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 12:14:16 2010 -0800
FOR_EACH_IMPL: Skip TEST_NAME if func_list isn't NULL.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index aaf3661..9a5d2ab 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,10 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * string/test-string.h (FOR_EACH_IMPL): Skip TEST_NAME if
+ func_list isn't NULL.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (strcasecmp_list): New.
(find_strcasecmp): Likewise.
(strcasecmp_l_list): Likewise.
diff --git a/string/test-string.h b/string/test-string.h
index 93773e3..17ce9de 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -111,11 +111,15 @@ size_t iterations = 100000;
if (impl_count == -1) \
{ \
impl_count = 0; \
- for (impl = __start_impls; impl < __stop_impls; ++impl) \
- impl_count++; \
if (func_list) \
{ \
const struct libc_func_test *p; \
+ impl_t *skip = NULL; \
+ for (impl = __start_impls; impl < __stop_impls; ++impl) \
+ if (strcmp (impl->name, TEST_NAME) == 0) \
+ skip = impl; \
+ else \
+ impl_count++; \
for (p = func_list; p && p->name; ++p) \
impl_count++; \
if (impl_count) \
@@ -123,7 +127,8 @@ size_t iterations = 100000;
impl_t *a; \
a = impl_array = malloc (impl_count * sizeof (impl_t)); \
for (impl = __start_impls; impl < __stop_impls; ++impl) \
- *a++ = *impl; \
+ if (impl != skip) \
+ *a++ = *impl; \
for (p = func_list; p && p->name; ++p) \
{ \
a->name = p->name; \
@@ -134,7 +139,11 @@ size_t iterations = 100000;
} \
} \
else \
- impl_array = __start_impls; \
+ { \
+ for (impl = __start_impls; impl < __stop_impls; ++impl) \
+ impl_count++; \
+ impl_array = __start_impls; \
+ } \
} \
impl = impl_array; \
for (count = 0; count < impl_count; ++count, ++impl) \
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f7cfcb24728e871b7d786de5b3e2ca0198efde5f
commit f7cfcb24728e871b7d786de5b3e2ca0198efde5f
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 12:07:05 2010 -0800
Test x86-64 multiarch family of strcmp functions.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index d3b8337..aaf3661 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,27 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (strcasecmp_list): New.
+ (find_strcasecmp): Likewise.
+ (strcasecmp_l_list): Likewise.
+ (find_strcasecmp_l): Likewise.
+ (strcmp_list): Likewise.
+ (find_strcmp): Likewise.
+ (strncasecmp_list): Likewise.
+ (find_strncasecmp): Likewise.
+ (strncasecmp_l_list): Likewise.
+ (find_strncasecmp_l): Likewise.
+ (strncmp_list): Likewise.
+ (find_strncmp): Likewise.
+ (__libc_func): Use them.
+
+ * sysdeps/x86_64/multiarch/strcmp.S (STRCMP_SSE42): Make it
+ global and hidden.
+ (STRCMP_SSE2): Likewise.
+ (__strcasecmp_sse2): Likewise.
+ (__strncasecmp_sse2): Likewise.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (stpcpy_list): New.
(find_stpcpy): Likewise.
(stpncpy_list): Likewise.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 471809d..7885726 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -31,6 +31,12 @@
#define find_stpncpy() NULL
#define find_strcpy() NULL
#define find_strncpy() NULL
+#define find_strcasecmp() NULL
+#define find_strcasecmp_l() NULL
+#define find_strcmp() NULL
+#define find_strncasecmp() NULL
+#define find_strncasecmp_l() NULL
+#define find_strncmp() NULL
#ifndef NOT_IN_libc
@@ -162,6 +168,126 @@ 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;
+
+static const struct libc_func_test strcasecmp_list[] =
+{
+ 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_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+extern __typeof (strcasecmp_l) __strcasecmp_l_sse2;
+extern __typeof (strcasecmp_l) __strcasecmp_l_ssse3;
+extern __typeof (strcasecmp_l) __strcasecmp_l_sse42;
+
+static const struct libc_func_test strcasecmp_l_list[] =
+{
+ 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_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+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;
+
+static const struct libc_func_test strncasecmp_list[] =
+{
+ 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_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+extern __typeof (strncasecmp_l) __strncasecmp_l_sse2;
+extern __typeof (strncasecmp_l) __strncasecmp_l_ssse3;
+extern __typeof (strncasecmp_l) __strncasecmp_l_sse42;
+
+static const struct libc_func_test strncasecmp_l_list[] =
+{
+ 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_SSE4_2 ? 0 : (HAS_SSSE3 ? 1 : 2));
+}
+
+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));
+}
+
# ifdef SHARED
extern __typeof (memcmp) __memcmp_sse2;
extern __typeof (memcmp) __memcmp_sse4_1;
@@ -256,5 +382,23 @@ __libc_func (const char *name)
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, "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, "strncmp") == 0)
+ return find_strncmp ();
+
return NULL;
}
diff --git a/sysdeps/x86_64/multiarch/strcmp.S b/sysdeps/x86_64/multiarch/strcmp.S
index 1859289..7977147 100644
--- a/sysdeps/x86_64/multiarch/strcmp.S
+++ b/sysdeps/x86_64/multiarch/strcmp.S
@@ -167,6 +167,8 @@ weak_alias (__strncasecmp, strncasecmp)
.section .text.sse4.2,"ax",@progbits
.align 16
.type STRCMP_SSE42, @function
+ .globl STRCMP_SSE42
+ .hidden STRCMP_SSE42
# ifdef USE_AS_STRCASECMP_L
ENTRY (__strcasecmp_sse42)
movq __libc_tsd_LOCALE@gottpoff(%rip),%rax
@@ -1920,6 +1922,8 @@ LABEL(unaligned_table_sse4_2):
# define ENTRY(name) \
.type STRCMP_SSE2, @function; \
.align 16; \
+ .globl STRCMP_SSE2; \
+ .hidden STRCMP_SSE2; \
STRCMP_SSE2: cfi_startproc; \
CALL_MCOUNT
# undef END
@@ -1930,6 +1934,8 @@ LABEL(unaligned_table_sse4_2):
# define ENTRY2(name) \
.type __strcasecmp_sse2, @function; \
.align 16; \
+ .globl __strcasecmp_sse2; \
+ .hidden __strcasecmp_sse2; \
__strcasecmp_sse2: cfi_startproc; \
CALL_MCOUNT
# define END2(name) \
@@ -1940,6 +1946,8 @@ LABEL(unaligned_table_sse4_2):
# define ENTRY2(name) \
.type __strncasecmp_sse2, @function; \
.align 16; \
+ .globl __strncasecmp_sse2; \
+ .hidden __strncasecmp_sse2; \
__strncasecmp_sse2: cfi_startproc; \
CALL_MCOUNT
# define END2(name) \
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=134c2930fa376aa8a49181771103aaa1ccf5fe3c
commit 134c2930fa376aa8a49181771103aaa1ccf5fe3c
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 11:40:33 2010 -0800
Test x86-64 multiarch stpcpy/stpncpy/strcpy/strncpy.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 438b1e6..d3b8337 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,21 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (stpcpy_list): New.
+ (find_stpcpy): Likewise.
+ (stpncpy_list): Likewise.
+ (find_stpncpy): Likewise.
+ (strcpy_list): Likewise.
+ (find_strcpy): Likewise.
+ (strncpy_list): Likewise.
+ (find_strncpy): Likewise.
+ (__libc_func): Use them.
+
+ * sysdeps/x86_64/multiarch/strcpy.S (STRCPY_SSSE3): Make it
+ global and hidden.
+ (STRCPY_SSE2): Likewise.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (rawmemchr_list): New.
(find_rawmemchr): Likewise.
(__libc_func): Use find_rawmemchr.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 540c74a..471809d 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -27,6 +27,10 @@
#define find_mempcpy() 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
#ifndef NOT_IN_libc
@@ -86,6 +90,78 @@ find_rawmemchr (void)
return rawmemchr_list + (HAS_SSE4_2 ? 0 : 1);
}
+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),
+ { 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_ssse3;
+
+static const struct libc_func_test stpncpy_list[] =
+{
+ LIBC_FUNC_INIT (__stpncpy_ssse3),
+ LIBC_FUNC_INIT (__stpncpy_sse2),
+ { 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_ssse3;
+
+static const struct libc_func_test strcpy_list[] =
+{
+ LIBC_FUNC_INIT (__strcpy_ssse3),
+ LIBC_FUNC_INIT (__strcpy_sse2),
+ { 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_ssse3;
+
+static const struct libc_func_test strncpy_list[] =
+{
+ LIBC_FUNC_INIT (__strncpy_ssse3),
+ LIBC_FUNC_INIT (__strncpy_sse2),
+ { NULL, NULL },
+};
+
+# undef find_strncpy
+
+static const struct libc_func_test *
+find_strncpy (void)
+{
+ return strncpy_list + (HAS_SSSE3 ? 0 : 1);
+}
+
# ifdef SHARED
extern __typeof (memcmp) __memcmp_sse2;
extern __typeof (memcmp) __memcmp_sse4_1;
@@ -168,5 +244,17 @@ __libc_func (const char *name)
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 ();
+
return NULL;
}
diff --git a/sysdeps/x86_64/multiarch/strcpy.S b/sysdeps/x86_64/multiarch/strcpy.S
index 02fa8d0..ae4d120 100644
--- a/sysdeps/x86_64/multiarch/strcpy.S
+++ b/sysdeps/x86_64/multiarch/strcpy.S
@@ -70,6 +70,9 @@ ENTRY(STRCPY)
END(STRCPY)
.section .text.ssse3,"ax",@progbits
+ .type STRCPY_SSSE3, @function
+ .globl STRCPY_SSSE3
+ .hidden STRCPY_SSSE3
STRCPY_SSSE3:
cfi_startproc
CALL_MCOUNT
@@ -1890,6 +1893,8 @@ LABEL(unaligned_table):
# define ENTRY(name) \
.type STRCPY_SSE2, @function; \
.align 16; \
+ .globl STRCPY_SSE2; \
+ .hidden STRCPY_SSE2; \
STRCPY_SSE2: cfi_startproc; \
CALL_MCOUNT
# undef END
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0048c93003220fac134286399c8ed8b54d4a70b4
commit 0048c93003220fac134286399c8ed8b54d4a70b4
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 11:26:38 2010 -0800
Test x86-64 multiarch rawmemchr.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index ddca3ca..438b1e6 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,15 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (rawmemchr_list): New.
+ (find_rawmemchr): Likewise.
+ (__libc_func): Use find_rawmemchr.
+
+ * sysdeps/x86_64/multiarch/rawmemchr.S (__rawmemchr_sse42): Make
+ it global and hidden.
+ (__rawmemchr_sse2): Likewise.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (memset_list): New.
(find_memset): Likewise.
(__libc_func): Use find_memset.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 4229157..540c74a 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -21,11 +21,12 @@
#include <libc-test.h>
#include "init-arch.h"
-#define find_memcmp() NULL
-#define find_memcpy() NULL
-#define find_memmove() NULL
-#define find_mempcpy() NULL
-#define find_memset() NULL
+#define find_memcmp() NULL
+#define find_memcpy() NULL
+#define find_memmove() NULL
+#define find_mempcpy() NULL
+#define find_memset() NULL
+#define find_rawmemchr() NULL
#ifndef NOT_IN_libc
@@ -33,7 +34,7 @@ extern __typeof (memmove) __memmove_sse2;
extern __typeof (memmove) __memmove_ssse3;
extern __typeof (memmove) __memmove_ssse3_back;
-static const struct libc_func_test memmove_list [] =
+static const struct libc_func_test memmove_list[] =
{
LIBC_FUNC_INIT (__memmove_ssse3_back),
LIBC_FUNC_INIT (__memmove_ssse3),
@@ -52,7 +53,7 @@ find_memmove (void)
extern __typeof (memset) __memset_x86_64;
extern __typeof (memset) __memset_sse2;
-static const struct libc_func_test memset_list [] =
+static const struct libc_func_test memset_list[] =
{
LIBC_FUNC_INIT (__memset_x86_64),
LIBC_FUNC_INIT (__memset_sse2),
@@ -67,11 +68,29 @@ 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);
+}
+
# ifdef SHARED
extern __typeof (memcmp) __memcmp_sse2;
extern __typeof (memcmp) __memcmp_sse4_1;
-static const struct libc_func_test memcmp_list [] =
+static const struct libc_func_test memcmp_list[] =
{
LIBC_FUNC_INIT (__memcmp_sse4_1),
LIBC_FUNC_INIT (__memcmp_sse2),
@@ -90,7 +109,7 @@ extern __typeof (memcpy) __memcpy_sse2;
extern __typeof (memcpy) __memcpy_ssse3;
extern __typeof (memcpy) __memcpy_ssse3_back;
-static const struct libc_func_test memcpy_list [] =
+static const struct libc_func_test memcpy_list[] =
{
LIBC_FUNC_INIT (__memcpy_ssse3_back),
LIBC_FUNC_INIT (__memcpy_ssse3),
@@ -110,7 +129,7 @@ extern __typeof (mempcpy) __mempcpy_sse2;
extern __typeof (mempcpy) __mempcpy_ssse3;
extern __typeof (mempcpy) __mempcpy_ssse3_back;
-static const struct libc_func_test mempcpy_list [] =
+static const struct libc_func_test mempcpy_list[] =
{
LIBC_FUNC_INIT (__mempcpy_ssse3_back),
LIBC_FUNC_INIT (__mempcpy_ssse3),
@@ -146,5 +165,8 @@ __libc_func (const char *name)
if (strcmp (name, "memset") == 0)
return find_memset ();
+ if (strcmp (name, "rawmemchr") == 0)
+ return find_rawmemchr ();
+
return NULL;
}
diff --git a/sysdeps/x86_64/multiarch/rawmemchr.S b/sysdeps/x86_64/multiarch/rawmemchr.S
index 2a8a690..858aec3 100644
--- a/sysdeps/x86_64/multiarch/rawmemchr.S
+++ b/sysdeps/x86_64/multiarch/rawmemchr.S
@@ -41,6 +41,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
@@ -79,6 +81,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
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=180c894ea2756ff3168b36d291fb8520d9c29f87
commit 180c894ea2756ff3168b36d291fb8520d9c29f87
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 10:53:22 2010 -0800
Test x86-64 multiarch memset.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 01d4d2c..ddca3ca 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,11 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (memset_list): New.
+ (find_memset): Likewise.
+ (__libc_func): Use find_memset.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (mempcpy_list): New.
(find_mempcpy): Likewise.
(__libc_func): Use find_mempcpy.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index b1a2a66..4229157 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -25,6 +25,7 @@
#define find_memcpy() NULL
#define find_memmove() NULL
#define find_mempcpy() NULL
+#define find_memset() NULL
#ifndef NOT_IN_libc
@@ -48,6 +49,24 @@ 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 },
+};
+
+# undef find_memset
+
+static const struct libc_func_test *
+find_memset (void)
+{
+ return memset_list;
+}
+
# ifdef SHARED
extern __typeof (memcmp) __memcmp_sse2;
extern __typeof (memcmp) __memcmp_sse4_1;
@@ -124,5 +143,8 @@ __libc_func (const char *name)
if (strcmp (name, "mempcpy") == 0)
return find_mempcpy ();
+ if (strcmp (name, "memset") == 0)
+ return find_memset ();
+
return NULL;
}
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=47893ca5fe071225862594afd6dfc8fd2e5fc4df
commit 47893ca5fe071225862594afd6dfc8fd2e5fc4df
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 10:46:04 2010 -0800
Test x86-64 multiarch mempcpy.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 11962a0..01d4d2c 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,14 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (mempcpy_list): New.
+ (find_mempcpy): Likewise.
+ (__libc_func): Use find_mempcpy.
+
+ * sysdeps/x86_64/multiarch/mempcpy.S (__mempcpy_sse2): Make it
+ global and hidden.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (memmove_list): New.
(find_memmove): Likewise.
(__libc_func): Use find_memmove.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index f609e49..b1a2a66 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -24,6 +24,7 @@
#define find_memcmp() NULL
#define find_memcpy() NULL
#define find_memmove() NULL
+#define find_mempcpy() NULL
#ifndef NOT_IN_libc
@@ -85,6 +86,26 @@ 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);
+}
# endif /* SHARED */
#endif /* NOT_IN_libc */
@@ -100,5 +121,8 @@ __libc_func (const char *name)
if (strcmp (name, "memmove") == 0)
return find_memmove ();
+ if (strcmp (name, "mempcpy") == 0)
+ return find_mempcpy ();
+
return NULL;
}
diff --git a/sysdeps/x86_64/multiarch/mempcpy.S b/sysdeps/x86_64/multiarch/mempcpy.S
index e8152d6..ecd48a8 100644
--- a/sysdeps/x86_64/multiarch/mempcpy.S
+++ b/sysdeps/x86_64/multiarch/mempcpy.S
@@ -44,6 +44,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
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=742ca846c95759752fbb815479fdd738e915a9e7
commit 742ca846c95759752fbb815479fdd738e915a9e7
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 10:37:34 2010 -0800
Test x86-64 multiarch memmove.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 9237913..11962a0 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,11 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (memmove_list): New.
+ (find_memmove): Likewise.
+ (__libc_func): Use find_memmove.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* include/libc-test.h (LIBC_FUNC_INIT): New.
* sysdeps/x86_64/multiarch/libc-test.c (memcmp_list): Use it.
(memcpy_list): Likewise.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index cb876cf..f609e49 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -21,7 +21,33 @@
#include <libc-test.h>
#include "init-arch.h"
-#if defined SHARED && !defined NOT_IN_libc
+#define find_memcmp() NULL
+#define find_memcpy() NULL
+#define find_memmove() 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);
+}
+
+# ifdef SHARED
extern __typeof (memcmp) __memcmp_sse2;
extern __typeof (memcmp) __memcmp_sse4_1;
@@ -32,6 +58,8 @@ static const struct libc_func_test memcmp_list [] =
{ NULL, NULL },
};
+# undef find_memcmp
+
static const struct libc_func_test *
find_memcmp (void)
{
@@ -50,15 +78,15 @@ static const struct libc_func_test memcpy_list [] =
{ NULL, NULL },
};
+# undef find_memcpy
+
static const struct libc_func_test *
find_memcpy (void)
{
return memcpy_list + (HAS_SSSE3 ? 0 : 2);
}
-#else
-#define find_memcmp() NULL
-#define find_memcpy() NULL
-#endif
+# endif /* SHARED */
+#endif /* NOT_IN_libc */
const struct libc_func_test *
__libc_func (const char *name)
@@ -69,5 +97,8 @@ __libc_func (const char *name)
if (strcmp (name, "memcpy") == 0)
return find_memcpy ();
+ if (strcmp (name, "memmove") == 0)
+ return find_memmove ();
+
return NULL;
}
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4fe825a92258d2f3a5a608aeb3c38db2b0f100bb
commit 4fe825a92258d2f3a5a608aeb3c38db2b0f100bb
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 09:20:43 2010 -0800
Add LIBC_FUNC_INIT.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 1171fa2..9237913 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,11 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * include/libc-test.h (LIBC_FUNC_INIT): New.
+ * sysdeps/x86_64/multiarch/libc-test.c (memcmp_list): Use it.
+ (memcpy_list): Likewise.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c (memcmp_list): New.
(find_memcmp): Likewise.
diff --git a/include/libc-test.h b/include/libc-test.h
index edd814f..a6e2710 100644
--- a/include/libc-test.h
+++ b/include/libc-test.h
@@ -27,6 +27,9 @@ struct libc_func_test
void (*fn) (void);
};
+/* Initializer for struct libc_func_test entry. */
+#define LIBC_FUNC_INIT(fn) { #fn, (void (*) (void)) fn }
+
/* Return the NULL terminated array of functions. */
extern const struct libc_func_test *__libc_func (const char *);
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 703bf5b..cb876cf 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -27,8 +27,8 @@ extern __typeof (memcmp) __memcmp_sse4_1;
static const struct libc_func_test memcmp_list [] =
{
- { "__memcmp_sse4_1", (void (*) (void)) __memcmp_sse4_1 },
- { "__memcmp_sse2", (void (*) (void)) __memcmp_sse2 },
+ LIBC_FUNC_INIT (__memcmp_sse4_1),
+ LIBC_FUNC_INIT (__memcmp_sse2),
{ NULL, NULL },
};
@@ -44,9 +44,9 @@ extern __typeof (memcpy) __memcpy_ssse3_back;
static const struct libc_func_test memcpy_list [] =
{
- { "__memcpy_ssse3_back", (void (*) (void)) __memcpy_ssse3_back },
- { "__memcpy_ssse3", (void (*) (void)) __memcpy_ssse3 },
- { "__memcpy_sse2", (void (*) (void)) __memcpy_sse2 },
+ LIBC_FUNC_INIT (__memcpy_ssse3_back),
+ LIBC_FUNC_INIT (__memcpy_ssse3),
+ LIBC_FUNC_INIT (__memcpy_sse2),
{ NULL, NULL },
};
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d8599e4150b3ce1d4769374d844c46a8f37d9482
commit d8599e4150b3ce1d4769374d844c46a8f37d9482
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 09:10:49 2010 -0800
Test x86-64 multiarch memcmp.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 400a178..1171fa2 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,13 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c (memcmp_list): New.
+ (find_memcmp): Likewise.
+
+ * sysdeps/x86_64/multiarch/memcmp.S (__memcmp_sse2): Make it
+ global and hidden.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* string/Makefile: Include ../Makeconfig.
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
index 5975e0b..703bf5b 100644
--- a/sysdeps/x86_64/multiarch/libc-test.c
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -22,9 +22,25 @@
#include "init-arch.h"
#if defined SHARED && !defined NOT_IN_libc
-extern void *__memcpy_sse2 (void *, const void *, size_t);
-extern void *__memcpy_ssse3 (void *, const void *, size_t);
-extern void *__memcpy_ssse3_back (void *, const void *, size_t);
+extern __typeof (memcmp) __memcmp_sse2;
+extern __typeof (memcmp) __memcmp_sse4_1;
+
+static const struct libc_func_test memcmp_list [] =
+{
+ { "__memcmp_sse4_1", (void (*) (void)) __memcmp_sse4_1 },
+ { "__memcmp_sse2", (void (*) (void)) __memcmp_sse2 },
+ { NULL, NULL },
+};
+
+static const struct libc_func_test *
+find_memcmp (void)
+{
+ return memcmp_list + (HAS_SSE4_1 ? 0 : 1);
+}
+
+extern __typeof (memcpy) __memcpy_sse2;
+extern __typeof (memcpy) __memcpy_ssse3;
+extern __typeof (memcpy) __memcpy_ssse3_back;
static const struct libc_func_test memcpy_list [] =
{
@@ -40,16 +56,16 @@ find_memcpy (void)
return memcpy_list + (HAS_SSSE3 ? 0 : 2);
}
#else
-static const struct libc_func_test *
-find_memcpy (void)
-{
- return NULL;
-}
+#define find_memcmp() NULL
+#define find_memcpy() NULL
#endif
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 ();
diff --git a/sysdeps/x86_64/multiarch/memcmp.S b/sysdeps/x86_64/multiarch/memcmp.S
index 301ab28..beded2b 100644
--- a/sysdeps/x86_64/multiarch/memcmp.S
+++ b/sysdeps/x86_64/multiarch/memcmp.S
@@ -40,6 +40,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
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=f1a009727d49d89967d6a6c2c50ea10866a0b8af
commit f1a009727d49d89967d6a6c2c50ea10866a0b8af
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 06:43:56 2010 -0800
Include ../Makeconfig in string/Makefile.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 0cd52df..400a178 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,9 @@
2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+ * string/Makefile: Include ../Makeconfig.
+
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
* config.h.in (TEST_MULTIARCH): New.
* config.make.in (test-multi-arch): Likewise.
diff --git a/string/Makefile b/string/Makefile
index 2702e82..7439f45 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -42,6 +42,8 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
strcoll_l strxfrm_l string-inlines memrchr \
xpg-strerror strerror_l
+include ../Makeconfig
+
ifeq (yes,$(test-multi-arch))
routines += libc-test
endif
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=9210ca846ef093b6b6ebe347f41fe31b19fc4a54
commit 9210ca846ef093b6b6ebe347f41fe31b19fc4a54
Merge: 8881845 da93d21
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 06:40:10 2010 -0800
Merge remote branch 'origin/master' into intel/test-ifunc
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8881845d98e1538481a29d3227b7ffe9897dcfdf
commit 8881845d98e1538481a29d3227b7ffe9897dcfdf
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 06:16:52 2010 -0800
Re-add --enable-test-multi-arch.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 2809843..0cd52df 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,3 +1,19 @@
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config.h.in (TEST_MULTIARCH): New.
+ * config.make.in (test-multi-arch): Likewise.
+
+ * configure.in: Add --enable-test-multi-arch.
+ * configure: Regenerated.
+
+ * string/Makefile (routines): Add libc-test if $(test-multi-arch)
+ is yes.
+
+ * string/Versions: Add __libc_func if TEST_MULTIARCH is defined.
+
+ * string/test-string.h (FOR_EACH_IMPL): Optimized for NULL
+ func_list.
+
2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
* debug/test-stpcpy_chk.c (TEST_NAME): New.
diff --git a/config.h.in b/config.h.in
index 18bf01a..7501aee 100644
--- a/config.h.in
+++ b/config.h.in
@@ -201,6 +201,9 @@
/* Define if multi-arch DSOs should be generated. */
#undef USE_MULTIARCH
+/* Define if optimizations for multiple architectures should be tested. */
+#undef TEST_MULTIARCH
+
/*
*/
diff --git a/config.make.in b/config.make.in
index efffee4..87aafb8 100644
--- a/config.make.in
+++ b/config.make.in
@@ -76,6 +76,7 @@ oldest-abi = @oldest_abi@
no-whole-archive = @no_whole_archive@
exceptions = @exceptions@
multi-arch = @multi_arch@
+test-multi-arch = @test_multi_arch@
mach-interface-list = @mach_interface_list@
diff --git a/configure b/configure
index eae35ba..ab31c22 100755
--- a/configure
+++ b/configure
@@ -684,6 +684,7 @@ add_on_subdirs
add_ons
libc_cv_nss_crypt
experimental_malloc
+test_multi_arch
all_warnings
force_install
bindnow
@@ -782,6 +783,7 @@ enable_force_install
enable_kernel
enable_all_warnings
enable_multi_arch
+enable_test_multi_arch
enable_experimental_malloc
enable_nss_crypt
with_cpu
@@ -1441,6 +1443,9 @@ Optional Features:
--enable-all-warnings enable all useful warnings gcc can issue
--enable-multi-arch enable single DSO with optimizations for multiple
architectures
+ --enable-test-multi-arch
+ enable test of optimizations for multiple
+ architectures
--enable-experimental-malloc
enable experimental malloc features
--enable-nss-crypt enable libcrypt to use nss
@@ -3750,6 +3755,19 @@ else
fi
+# Check whether --enable-test-multi-arch was given.
+if test "${enable_test_multi_arch+set}" = set; then :
+ enableval=$enable_test_multi_arch; test_multi_arch=$enableval
+else
+ test_multi_arch=no
+fi
+
+if test x"$test_multi_arch" != xno; then
+ $as_echo "#define TEST_MULTIARCH 1" >>confdefs.h
+
+fi
+
+
# Check whether --enable-experimental-malloc was given.
if test "${enable_experimental_malloc+set}" = set; then :
enableval=$enable_experimental_malloc; experimental_malloc=$enableval
diff --git a/configure.in b/configure.in
index d8cd5f1..f8f7602 100644
--- a/configure.in
+++ b/configure.in
@@ -274,6 +274,16 @@ AC_ARG_ENABLE([multi-arch],
[multi_arch=$enableval],
[multi_arch=default])
+AC_ARG_ENABLE([test-multi-arch],
+ AC_HELP_STRING([--enable-test-multi-arch],
+ [enable test of optimizations for multiple architectures]),
+ [test_multi_arch=$enableval],
+ [test_multi_arch=no])
+if test x"$test_multi_arch" != xno; then
+ AC_DEFINE(TEST_MULTIARCH)
+fi
+AC_SUBST(test_multi_arch)
+
AC_ARG_ENABLE([experimental-malloc],
AC_HELP_STRING([--enable-experimental-malloc],
[enable experimental malloc features]),
diff --git a/string/Makefile b/string/Makefile
index d25d23d..2702e82 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -40,7 +40,11 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
addsep replace) \
envz basename \
strcoll_l strxfrm_l string-inlines memrchr \
- xpg-strerror strerror_l libc-test
+ xpg-strerror strerror_l
+
+ifeq (yes,$(test-multi-arch))
+routines += libc-test
+endif
# Gcc internally generates calls to unbounded memcpy and memset
# for -fbounded-pointer compiles. Glibc uses memchr for explicit checks.
diff --git a/string/Versions b/string/Versions
index fe6a418..9cecf29 100644
--- a/string/Versions
+++ b/string/Versions
@@ -80,7 +80,9 @@ libc {
GLIBC_2.6 {
strerror_l;
}
- GLIBC_2.13 {
+%ifdef TEST_MULTIARCH
+ GLIBC_PRIVATE {
__libc_func;
}
+%endif
}
diff --git a/string/test-string.h b/string/test-string.h
index db7d02e..93773e3 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -110,25 +110,31 @@ size_t iterations = 100000;
int count; \
if (impl_count == -1) \
{ \
- const struct libc_func_test *p; \
impl_count = 0; \
for (impl = __start_impls; impl < __stop_impls; ++impl) \
impl_count++; \
- for (p = func_list; p && p->name; ++p) \
- impl_count++; \
- if (impl_count) \
+ if (func_list) \
{ \
- impl_t *a; \
- a = impl_array = malloc (impl_count * sizeof (impl_t)); \
- for (impl = __start_impls; impl < __stop_impls; ++impl, ++a) \
- *a = *impl; \
- for (p = func_list; p && p->name; ++p, a++) \
+ const struct libc_func_test *p; \
+ for (p = func_list; p && p->name; ++p) \
+ impl_count++; \
+ if (impl_count) \
{ \
- a->name = p->name; \
- a->fn = p->fn; \
- a->test = 1; \
+ impl_t *a; \
+ a = impl_array = malloc (impl_count * sizeof (impl_t)); \
+ for (impl = __start_impls; impl < __stop_impls; ++impl) \
+ *a++ = *impl; \
+ for (p = func_list; p && p->name; ++p) \
+ { \
+ a->name = p->name; \
+ a->fn = p->fn; \
+ a->test = 1; \
+ a++; \
+ } \
} \
} \
+ else \
+ impl_array = __start_impls; \
} \
impl = impl_array; \
for (count = 0; count < impl_count; ++count, ++impl) \
@@ -155,7 +161,9 @@ static impl_t *impl_array;
static void
test_init (void)
{
+#ifdef TEST_MULTIARCH
func_list = __libc_func (TEST_NAME);
+#endif
page_size = 2 * getpagesize ();
#ifdef MIN_PAGE_SIZE
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cccc39ac2890148f31377c8855ec32cad742c942
commit cccc39ac2890148f31377c8855ec32cad742c942
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 06:15:56 2010 -0800
Revert "Add --enable-test-multi-arch."
This reverts commit 0e2345ce2df14d8f76aa38c6bcb99fa04e16c226.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 0cd52df..2809843 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,19 +1,3 @@
-2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
-
- * config.h.in (TEST_MULTIARCH): New.
- * config.make.in (test-multi-arch): Likewise.
-
- * configure.in: Add --enable-test-multi-arch.
- * configure: Regenerated.
-
- * string/Makefile (routines): Add libc-test if $(test-multi-arch)
- is yes.
-
- * string/Versions: Add __libc_func if TEST_MULTIARCH is defined.
-
- * string/test-string.h (FOR_EACH_IMPL): Optimized for NULL
- func_list.
-
2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
* debug/test-stpcpy_chk.c (TEST_NAME): New.
diff --git a/config.h.in b/config.h.in
index 7501aee..18bf01a 100644
--- a/config.h.in
+++ b/config.h.in
@@ -201,9 +201,6 @@
/* Define if multi-arch DSOs should be generated. */
#undef USE_MULTIARCH
-/* Define if optimizations for multiple architectures should be tested. */
-#undef TEST_MULTIARCH
-
/*
*/
diff --git a/config.make.in b/config.make.in
index 87aafb8..efffee4 100644
--- a/config.make.in
+++ b/config.make.in
@@ -76,7 +76,6 @@ oldest-abi = @oldest_abi@
no-whole-archive = @no_whole_archive@
exceptions = @exceptions@
multi-arch = @multi_arch@
-test-multi-arch = @test_multi_arch@
mach-interface-list = @mach_interface_list@
diff --git a/configure b/configure
index ab31c22..eae35ba 100755
--- a/configure
+++ b/configure
@@ -684,7 +684,6 @@ add_on_subdirs
add_ons
libc_cv_nss_crypt
experimental_malloc
-test_multi_arch
all_warnings
force_install
bindnow
@@ -783,7 +782,6 @@ enable_force_install
enable_kernel
enable_all_warnings
enable_multi_arch
-enable_test_multi_arch
enable_experimental_malloc
enable_nss_crypt
with_cpu
@@ -1443,9 +1441,6 @@ Optional Features:
--enable-all-warnings enable all useful warnings gcc can issue
--enable-multi-arch enable single DSO with optimizations for multiple
architectures
- --enable-test-multi-arch
- enable test of optimizations for multiple
- architectures
--enable-experimental-malloc
enable experimental malloc features
--enable-nss-crypt enable libcrypt to use nss
@@ -3755,19 +3750,6 @@ else
fi
-# Check whether --enable-test-multi-arch was given.
-if test "${enable_test_multi_arch+set}" = set; then :
- enableval=$enable_test_multi_arch; test_multi_arch=$enableval
-else
- test_multi_arch=no
-fi
-
-if test x"$test_multi_arch" != xno; then
- $as_echo "#define TEST_MULTIARCH 1" >>confdefs.h
-
-fi
-
-
# Check whether --enable-experimental-malloc was given.
if test "${enable_experimental_malloc+set}" = set; then :
enableval=$enable_experimental_malloc; experimental_malloc=$enableval
diff --git a/configure.in b/configure.in
index f8f7602..d8cd5f1 100644
--- a/configure.in
+++ b/configure.in
@@ -274,16 +274,6 @@ AC_ARG_ENABLE([multi-arch],
[multi_arch=$enableval],
[multi_arch=default])
-AC_ARG_ENABLE([test-multi-arch],
- AC_HELP_STRING([--enable-test-multi-arch],
- [enable test of optimizations for multiple architectures]),
- [test_multi_arch=$enableval],
- [test_multi_arch=no])
-if test x"$test_multi_arch" != xno; then
- AC_DEFINE(TEST_MULTIARCH)
-fi
-AC_SUBST(test_multi_arch)
-
AC_ARG_ENABLE([experimental-malloc],
AC_HELP_STRING([--enable-experimental-malloc],
[enable experimental malloc features]),
diff --git a/string/Makefile b/string/Makefile
index 2702e82..d25d23d 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -40,11 +40,7 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
addsep replace) \
envz basename \
strcoll_l strxfrm_l string-inlines memrchr \
- xpg-strerror strerror_l
-
-ifeq (yes,$(test-multi-arch))
-routines += libc-test
-endif
+ xpg-strerror strerror_l libc-test
# Gcc internally generates calls to unbounded memcpy and memset
# for -fbounded-pointer compiles. Glibc uses memchr for explicit checks.
diff --git a/string/Versions b/string/Versions
index 9cecf29..fe6a418 100644
--- a/string/Versions
+++ b/string/Versions
@@ -80,9 +80,7 @@ libc {
GLIBC_2.6 {
strerror_l;
}
-%ifdef TEST_MULTIARCH
- GLIBC_PRIVATE {
+ GLIBC_2.13 {
__libc_func;
}
-%endif
}
diff --git a/string/test-string.h b/string/test-string.h
index 93773e3..db7d02e 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -110,31 +110,25 @@ size_t iterations = 100000;
int count; \
if (impl_count == -1) \
{ \
+ const struct libc_func_test *p; \
impl_count = 0; \
for (impl = __start_impls; impl < __stop_impls; ++impl) \
impl_count++; \
- if (func_list) \
+ for (p = func_list; p && p->name; ++p) \
+ impl_count++; \
+ if (impl_count) \
{ \
- const struct libc_func_test *p; \
- for (p = func_list; p && p->name; ++p) \
- impl_count++; \
- if (impl_count) \
+ impl_t *a; \
+ a = impl_array = malloc (impl_count * sizeof (impl_t)); \
+ for (impl = __start_impls; impl < __stop_impls; ++impl, ++a) \
+ *a = *impl; \
+ for (p = func_list; p && p->name; ++p, a++) \
{ \
- impl_t *a; \
- a = impl_array = malloc (impl_count * sizeof (impl_t)); \
- for (impl = __start_impls; impl < __stop_impls; ++impl) \
- *a++ = *impl; \
- for (p = func_list; p && p->name; ++p) \
- { \
- a->name = p->name; \
- a->fn = p->fn; \
- a->test = 1; \
- a++; \
- } \
+ a->name = p->name; \
+ a->fn = p->fn; \
+ a->test = 1; \
} \
} \
- else \
- impl_array = __start_impls; \
} \
impl = impl_array; \
for (count = 0; count < impl_count; ++count, ++impl) \
@@ -161,9 +155,7 @@ static impl_t *impl_array;
static void
test_init (void)
{
-#ifdef TEST_MULTIARCH
func_list = __libc_func (TEST_NAME);
-#endif
page_size = 2 * getpagesize ();
#ifdef MIN_PAGE_SIZE
diff --git a/sysdeps/generic/libc-test.c b/sysdeps/generic/libc-test.c
new file mode 100644
index 0000000..672e1e4
--- /dev/null
+++ b/sysdeps/generic/libc-test.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2010 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 <libc-test.h>
+
+/* Return the NULL terminated array of functions. */
+
+const struct libc_func_test *
+__libc_func (const char *name __attribute__ ((unused)))
+{
+ return NULL;
+}
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0e2345ce2df14d8f76aa38c6bcb99fa04e16c226
commit 0e2345ce2df14d8f76aa38c6bcb99fa04e16c226
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Thu Nov 11 06:15:00 2010 -0800
Add --enable-test-multi-arch.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 2809843..0cd52df 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,3 +1,19 @@
+2010-11-11 H.J. Lu <hongjiu.lu@intel.com>
+
+ * config.h.in (TEST_MULTIARCH): New.
+ * config.make.in (test-multi-arch): Likewise.
+
+ * configure.in: Add --enable-test-multi-arch.
+ * configure: Regenerated.
+
+ * string/Makefile (routines): Add libc-test if $(test-multi-arch)
+ is yes.
+
+ * string/Versions: Add __libc_func if TEST_MULTIARCH is defined.
+
+ * string/test-string.h (FOR_EACH_IMPL): Optimized for NULL
+ func_list.
+
2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
* debug/test-stpcpy_chk.c (TEST_NAME): New.
diff --git a/config.h.in b/config.h.in
index 18bf01a..7501aee 100644
--- a/config.h.in
+++ b/config.h.in
@@ -201,6 +201,9 @@
/* Define if multi-arch DSOs should be generated. */
#undef USE_MULTIARCH
+/* Define if optimizations for multiple architectures should be tested. */
+#undef TEST_MULTIARCH
+
/*
*/
diff --git a/config.make.in b/config.make.in
index efffee4..87aafb8 100644
--- a/config.make.in
+++ b/config.make.in
@@ -76,6 +76,7 @@ oldest-abi = @oldest_abi@
no-whole-archive = @no_whole_archive@
exceptions = @exceptions@
multi-arch = @multi_arch@
+test-multi-arch = @test_multi_arch@
mach-interface-list = @mach_interface_list@
diff --git a/configure b/configure
index eae35ba..ab31c22 100755
--- a/configure
+++ b/configure
@@ -684,6 +684,7 @@ add_on_subdirs
add_ons
libc_cv_nss_crypt
experimental_malloc
+test_multi_arch
all_warnings
force_install
bindnow
@@ -782,6 +783,7 @@ enable_force_install
enable_kernel
enable_all_warnings
enable_multi_arch
+enable_test_multi_arch
enable_experimental_malloc
enable_nss_crypt
with_cpu
@@ -1441,6 +1443,9 @@ Optional Features:
--enable-all-warnings enable all useful warnings gcc can issue
--enable-multi-arch enable single DSO with optimizations for multiple
architectures
+ --enable-test-multi-arch
+ enable test of optimizations for multiple
+ architectures
--enable-experimental-malloc
enable experimental malloc features
--enable-nss-crypt enable libcrypt to use nss
@@ -3750,6 +3755,19 @@ else
fi
+# Check whether --enable-test-multi-arch was given.
+if test "${enable_test_multi_arch+set}" = set; then :
+ enableval=$enable_test_multi_arch; test_multi_arch=$enableval
+else
+ test_multi_arch=no
+fi
+
+if test x"$test_multi_arch" != xno; then
+ $as_echo "#define TEST_MULTIARCH 1" >>confdefs.h
+
+fi
+
+
# Check whether --enable-experimental-malloc was given.
if test "${enable_experimental_malloc+set}" = set; then :
enableval=$enable_experimental_malloc; experimental_malloc=$enableval
diff --git a/configure.in b/configure.in
index d8cd5f1..f8f7602 100644
--- a/configure.in
+++ b/configure.in
@@ -274,6 +274,16 @@ AC_ARG_ENABLE([multi-arch],
[multi_arch=$enableval],
[multi_arch=default])
+AC_ARG_ENABLE([test-multi-arch],
+ AC_HELP_STRING([--enable-test-multi-arch],
+ [enable test of optimizations for multiple architectures]),
+ [test_multi_arch=$enableval],
+ [test_multi_arch=no])
+if test x"$test_multi_arch" != xno; then
+ AC_DEFINE(TEST_MULTIARCH)
+fi
+AC_SUBST(test_multi_arch)
+
AC_ARG_ENABLE([experimental-malloc],
AC_HELP_STRING([--enable-experimental-malloc],
[enable experimental malloc features]),
diff --git a/string/Makefile b/string/Makefile
index d25d23d..2702e82 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -40,7 +40,11 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
addsep replace) \
envz basename \
strcoll_l strxfrm_l string-inlines memrchr \
- xpg-strerror strerror_l libc-test
+ xpg-strerror strerror_l
+
+ifeq (yes,$(test-multi-arch))
+routines += libc-test
+endif
# Gcc internally generates calls to unbounded memcpy and memset
# for -fbounded-pointer compiles. Glibc uses memchr for explicit checks.
diff --git a/string/Versions b/string/Versions
index fe6a418..9cecf29 100644
--- a/string/Versions
+++ b/string/Versions
@@ -80,7 +80,9 @@ libc {
GLIBC_2.6 {
strerror_l;
}
- GLIBC_2.13 {
+%ifdef TEST_MULTIARCH
+ GLIBC_PRIVATE {
__libc_func;
}
+%endif
}
diff --git a/string/test-string.h b/string/test-string.h
index db7d02e..93773e3 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -110,25 +110,31 @@ size_t iterations = 100000;
int count; \
if (impl_count == -1) \
{ \
- const struct libc_func_test *p; \
impl_count = 0; \
for (impl = __start_impls; impl < __stop_impls; ++impl) \
impl_count++; \
- for (p = func_list; p && p->name; ++p) \
- impl_count++; \
- if (impl_count) \
+ if (func_list) \
{ \
- impl_t *a; \
- a = impl_array = malloc (impl_count * sizeof (impl_t)); \
- for (impl = __start_impls; impl < __stop_impls; ++impl, ++a) \
- *a = *impl; \
- for (p = func_list; p && p->name; ++p, a++) \
+ const struct libc_func_test *p; \
+ for (p = func_list; p && p->name; ++p) \
+ impl_count++; \
+ if (impl_count) \
{ \
- a->name = p->name; \
- a->fn = p->fn; \
- a->test = 1; \
+ impl_t *a; \
+ a = impl_array = malloc (impl_count * sizeof (impl_t)); \
+ for (impl = __start_impls; impl < __stop_impls; ++impl) \
+ *a++ = *impl; \
+ for (p = func_list; p && p->name; ++p) \
+ { \
+ a->name = p->name; \
+ a->fn = p->fn; \
+ a->test = 1; \
+ a++; \
+ } \
} \
} \
+ else \
+ impl_array = __start_impls; \
} \
impl = impl_array; \
for (count = 0; count < impl_count; ++count, ++impl) \
@@ -155,7 +161,9 @@ static impl_t *impl_array;
static void
test_init (void)
{
+#ifdef TEST_MULTIARCH
func_list = __libc_func (TEST_NAME);
+#endif
page_size = 2 * getpagesize ();
#ifdef MIN_PAGE_SIZE
diff --git a/sysdeps/generic/libc-test.c b/sysdeps/generic/libc-test.c
deleted file mode 100644
index 672e1e4..0000000
--- a/sysdeps/generic/libc-test.c
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright (C) 2010 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 <libc-test.h>
-
-/* Return the NULL terminated array of functions. */
-
-const struct libc_func_test *
-__libc_func (const char *name __attribute__ ((unused)))
-{
- return NULL;
-}
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0a7d115b7713e3686439ac2abe25a8c4056ddd37
commit 0a7d115b7713e3686439ac2abe25a8c4056ddd37
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Nov 10 16:25:29 2010 -0800
Remove an extra white space.
diff --git a/debug/test-stpcpy_chk.c b/debug/test-stpcpy_chk.c
index aecc88c..1f8f588 100644
--- a/debug/test-stpcpy_chk.c
+++ b/debug/test-stpcpy_chk.c
@@ -20,7 +20,7 @@
#define STRCPY_RESULT(dst, len) ((dst) + (len))
#define TEST_MAIN
-# define TEST_NAME "stpcpy_chk"
+#define TEST_NAME "stpcpy_chk"
#include "../string/test-string.h"
extern void __attribute__ ((noreturn)) __chk_fail (void);
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=98b7f95434d20667084b7e05bb8876db85ff98c5
commit 98b7f95434d20667084b7e05bb8876db85ff98c5
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Nov 10 16:22:50 2010 -0800
Define TEST_NAME in debug/test-stpcpy_chk.c and debug/test-strcpy_chk.c.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index bbf421a..2809843 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,10 @@
2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
+ * debug/test-stpcpy_chk.c (TEST_NAME): New.
+ * debug/test-strcpy_chk.c (TEST_NAME): Likewise.
+
+2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
+
* string/test-memccpy.c (TEST_NAME): New.
(test_main): Don't pass function to test_init.
* string/test-memchr.c (test_main): Likewise.
diff --git a/debug/test-stpcpy_chk.c b/debug/test-stpcpy_chk.c
index d717ca7..aecc88c 100644
--- a/debug/test-stpcpy_chk.c
+++ b/debug/test-stpcpy_chk.c
@@ -20,6 +20,7 @@
#define STRCPY_RESULT(dst, len) ((dst) + (len))
#define TEST_MAIN
+# define TEST_NAME "stpcpy_chk"
#include "../string/test-string.h"
extern void __attribute__ ((noreturn)) __chk_fail (void);
diff --git a/debug/test-strcpy_chk.c b/debug/test-strcpy_chk.c
index e08141d..05bd0cb 100644
--- a/debug/test-strcpy_chk.c
+++ b/debug/test-strcpy_chk.c
@@ -21,6 +21,7 @@
#ifndef STRCPY_RESULT
# define STRCPY_RESULT(dst, len) dst
# define TEST_MAIN
+# define TEST_NAME "strcpy_chk"
# include "../string/test-string.h"
extern void __attribute__ ((noreturn)) __chk_fail (void);
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=42c649ad67c1dd10aa2e1d2cd6680778796a46d0
commit 42c649ad67c1dd10aa2e1d2cd6680778796a46d0
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Nov 10 16:17:54 2010 -0800
Don't pass function to test_init.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 7f9de1d..bbf421a 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,39 @@
2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
+ * string/test-memccpy.c (TEST_NAME): New.
+ (test_main): Don't pass function to test_init.
+ * string/test-memchr.c (test_main): Likewise.
+ * string/test-memcmp.c (test_main): Likewise.
+ * string/test-memcpy.c (test_main): Likewise.
+ * string/test-memmem.c (test_main): Likewise.
+ * string/test-memmove.c (test_main): Likewise.
+ * string/test-memset.c (test_main): Likewise.
+ * string/test-strcasecmp.c (test_main): Likewise.
+ * string/test-strcasestr.c (test_main): Likewise.
+ * string/test-strcat.c (test_main): Likewise.
+ * string/test-strchr.c (test_main): Likewise.
+ * string/test-strcmp.c(test_main): Likewise.
+ * tring/test-strcpy.c (test_main): Likewise.
+ * string/test-strlen.c (test_main): Likewise.
+ * string/test-strncasecmp.c (test_main): Likewise.
+ * string/test-strncmp.c (test_main): Likewise.
+ * string/test-strncpy.c (test_main): Likewise.
+ * string/test-strnlen.c (test_main): Likewise.
+ * string/test-strpbrk.c (test_main): Likewise.
+ * string/test-strrchr.c (test_main): Likewise.
+ * string/test-strspn.c (test_main): Likewise.
+ * string/test-strstr.c (test_main): Likewise.
+
+ * string/test-mempcpy.c (TEST_NAME): New.
+ * string/test-stpcpy.c (TEST_NAME): Likewise.
+ * string/test-stpncpy.c (TEST_NAME): Likewise.
+ * string/test-strcspn.c (TEST_NAME): Likewise.
+
+ * string/test-string.h (test_init): Remove parameter. Pass
+ TEST_NAME to __libc_func.
+
+2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
+
* sysdeps/x86_64/multiarch/libc-test.c: New.
* sysdeps/x86_64/multiarch/memcpy.S (__memcpy_sse2): Make it
diff --git a/string/test-memccpy.c b/string/test-memccpy.c
index 3790342..c5676cf 100644
--- a/string/test-memccpy.c
+++ b/string/test-memccpy.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "memccpy"
#include "test-string.h"
void *simple_memccpy (void *, const void *, int, size_t);
@@ -259,7 +260,7 @@ test_main (void)
{
size_t i;
- test_init ("memccpy");
+ test_init ();
printf ("%28s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-memchr.c b/string/test-memchr.c
index 3ca522d..ab510ef 100644
--- a/string/test-memchr.c
+++ b/string/test-memchr.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "memchr"
#include "test-string.h"
typedef char *(*proto_t) (const char *, int, size_t);
@@ -170,7 +171,7 @@ test_main (void)
{
size_t i;
- test_init ("memchr");
+ test_init ();
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 755b40b..4fbfa54 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "memcmp"
#include "test-string.h"
typedef int (*proto_t) (const char *, const char *, size_t);
@@ -437,7 +438,7 @@ test_main (void)
{
size_t i;
- test_init ("memcmp");
+ test_init ();
check1 ();
diff --git a/string/test-memcpy.c b/string/test-memcpy.c
index 01ba0a3..5b5c657 100644
--- a/string/test-memcpy.c
+++ b/string/test-memcpy.c
@@ -22,6 +22,7 @@
# define MEMCPY_RESULT(dst, len) dst
# define MIN_PAGE_SIZE 131072
# define TEST_MAIN
+# define TEST_NAME "memcpy"
# include "test-string.h"
char *simple_memcpy (char *, const char *, size_t);
@@ -235,7 +236,7 @@ test_main (void)
{
size_t i;
- test_init ("memcpy");
+ test_init ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-memmem.c b/string/test-memmem.c
index ad8a567..4402623 100644
--- a/string/test-memmem.c
+++ b/string/test-memmem.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "memmem"
#define BUF1PAGES 20
#define ITERATIONS 500
#include "test-string.h"
@@ -160,7 +161,7 @@ test_main (void)
{
size_t i;
- test_init ("memmem");
+ test_init ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-memmove.c b/string/test-memmove.c
index c6c547e..cf3fa1e 100644
--- a/string/test-memmove.c
+++ b/string/test-memmove.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "memmove"
#include "test-string.h"
typedef char *(*proto_t) (char *, const char *, size_t);
@@ -243,7 +244,7 @@ test_main (void)
{
size_t i;
- test_init ("memmove");
+ test_init ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-mempcpy.c b/string/test-mempcpy.c
index f8b0267..9bf2e86 100644
--- a/string/test-mempcpy.c
+++ b/string/test-mempcpy.c
@@ -20,6 +20,7 @@
#define MEMCPY_RESULT(dst, len) (dst) + (len)
#define TEST_MAIN
+#define TEST_NAME "mempcpy"
#include "test-string.h"
char *simple_mempcpy (char *, const char *, size_t);
diff --git a/string/test-memset.c b/string/test-memset.c
index c692af2..cdc51d0 100644
--- a/string/test-memset.c
+++ b/string/test-memset.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "memset"
#define MIN_PAGE_SIZE 131072
#include "test-string.h"
@@ -186,7 +187,7 @@ test_main (void)
size_t i;
int c;
- test_init ("memset");
+ test_init ();
printf ("%24s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-stpcpy.c b/string/test-stpcpy.c
index c8d4cc4..0582aaa 100644
--- a/string/test-stpcpy.c
+++ b/string/test-stpcpy.c
@@ -20,6 +20,7 @@
#define STRCPY_RESULT(dst, len) ((dst) + (len))
#define TEST_MAIN
+#define TEST_NAME "stpcpy"
#include "test-string.h"
char *simple_stpcpy (char *, const char *);
diff --git a/string/test-stpncpy.c b/string/test-stpncpy.c
index 8784588..115cf79 100644
--- a/string/test-stpncpy.c
+++ b/string/test-stpncpy.c
@@ -20,6 +20,7 @@
#define STRNCPY_RESULT(dst, len, n) ((dst) + ((len) > (n) ? (n) : (len)))
#define TEST_MAIN
+#define TEST_NAME "stpncpy"
#include "test-string.h"
char *simple_stpncpy (char *, const char *, size_t);
diff --git a/string/test-strcasecmp.c b/string/test-strcasecmp.c
index 2070262..261af13 100644
--- a/string/test-strcasecmp.c
+++ b/string/test-strcasecmp.c
@@ -20,6 +20,7 @@
#include <ctype.h>
#define TEST_MAIN
+#define TEST_NAME "strcasecmp"
#include "test-string.h"
typedef int (*proto_t) (const char *, const char *);
@@ -235,7 +236,7 @@ test_main (void)
{
size_t i;
- test_init ("strcasecmp");
+ test_init ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcasestr.c b/string/test-strcasestr.c
index eaca6ac..9981c23 100644
--- a/string/test-strcasestr.c
+++ b/string/test-strcasestr.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strcasestr"
#include "test-string.h"
@@ -141,7 +142,7 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2,
static int
test_main (void)
{
- test_init ("strcasestr");
+ test_init ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcat.c b/string/test-strcat.c
index 1c91ae2..83b133a 100644
--- a/string/test-strcat.c
+++ b/string/test-strcat.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strcat"
#include "test-string.h"
typedef char *(*proto_t) (char *, const char *);
@@ -225,7 +226,7 @@ test_main (void)
{
size_t i;
- test_init ("strcat");
+ test_init ();
printf ("%28s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strchr.c b/string/test-strchr.c
index f756b7f..200327c 100644
--- a/string/test-strchr.c
+++ b/string/test-strchr.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strchr"
#include "test-string.h"
typedef char *(*proto_t) (const char *, int);
@@ -188,7 +189,7 @@ test_main (void)
{
size_t i;
- test_init ("strchr");
+ test_init ();
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcmp.c b/string/test-strcmp.c
index 3930d66..71242e3 100644
--- a/string/test-strcmp.c
+++ b/string/test-strcmp.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strcmp"
#include "test-string.h"
typedef int (*proto_t) (const char *, const char *);
@@ -219,7 +220,7 @@ test_main (void)
{
size_t i;
- test_init ("strcmp");
+ test_init ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcpy.c b/string/test-strcpy.c
index d2b1cba..7a4e3be 100644
--- a/string/test-strcpy.c
+++ b/string/test-strcpy.c
@@ -21,6 +21,7 @@
#ifndef STRCPY_RESULT
# define STRCPY_RESULT(dst, len) dst
# define TEST_MAIN
+# define TEST_NAME "strcpy"
# include "test-string.h"
char *simple_strcpy (char *, const char *);
@@ -192,7 +193,7 @@ test_main (void)
{
size_t i;
- test_init ("strcpy");
+ test_init ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcspn.c b/string/test-strcspn.c
index b563179..403a2fd 100644
--- a/string/test-strcspn.c
+++ b/string/test-strcspn.c
@@ -21,6 +21,7 @@
#define STRPBRK_RESULT(s, pos) (pos)
#define RES_TYPE size_t
#define TEST_MAIN
+#define TEST_NAME "strcspn"
#include "test-string.h"
typedef size_t (*proto_t) (const char *, const char *);
diff --git a/string/test-string.h b/string/test-string.h
index 4e28e92..db7d02e 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -153,9 +153,9 @@ static int impl_count = -1;
static impl_t *impl_array;
static void
-test_init (const char *name)
+test_init (void)
{
- func_list = __libc_func (name);
+ func_list = __libc_func (TEST_NAME);
page_size = 2 * getpagesize ();
#ifdef MIN_PAGE_SIZE
diff --git a/string/test-strlen.c b/string/test-strlen.c
index 245c9be..feb1c5d 100644
--- a/string/test-strlen.c
+++ b/string/test-strlen.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strlen"
#include "test-string.h"
typedef size_t (*proto_t) (const char *);
@@ -142,7 +143,7 @@ test_main (void)
{
size_t i;
- test_init ("strlen");
+ test_init ();
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strncasecmp.c b/string/test-strncasecmp.c
index 9b422aa..9ec8955 100644
--- a/string/test-strncasecmp.c
+++ b/string/test-strncasecmp.c
@@ -20,6 +20,7 @@
#include <ctype.h>
#define TEST_MAIN
+#define TEST_NAME "strncasecmp"
#include "test-string.h"
typedef int (*proto_t) (const char *, const char *, size_t);
@@ -276,7 +277,7 @@ test_main (void)
{
size_t i;
- test_init ("strncasecmp");
+ test_init ();
check1 ();
diff --git a/string/test-strncmp.c b/string/test-strncmp.c
index 61c144c..891acb0 100644
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strncmp"
#include "test-string.h"
typedef int (*proto_t) (const char *, const char *, size_t);
@@ -317,7 +318,7 @@ test_main (void)
{
size_t i;
- test_init ("strncmp");
+ test_init ();
check1 ();
diff --git a/string/test-strncpy.c b/string/test-strncpy.c
index 379feb5..f89b27d 100644
--- a/string/test-strncpy.c
+++ b/string/test-strncpy.c
@@ -21,6 +21,7 @@
#ifndef STRNCPY_RESULT
# define STRNCPY_RESULT(dst, len, n) dst
# define TEST_MAIN
+# define TEST_NAME "strncpy"
# include "test-string.h"
char *simple_strncpy (char *, const char *, size_t);
@@ -274,7 +275,7 @@ test_main (void)
{
size_t i;
- test_init ("strncpy");
+ test_init ();
printf ("%28s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strnlen.c b/string/test-strnlen.c
index c7631da..d078729 100644
--- a/string/test-strnlen.c
+++ b/string/test-strnlen.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strnlen"
#include "test-string.h"
typedef size_t (*proto_t) (const char *, size_t);
@@ -151,7 +152,7 @@ test_main (void)
{
size_t i;
- test_init ("strnlen");
+ test_init ();
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strpbrk.c b/string/test-strpbrk.c
index 3142fc6..76ac8c7 100644
--- a/string/test-strpbrk.c
+++ b/string/test-strpbrk.c
@@ -22,6 +22,7 @@
# define STRPBRK_RESULT(s, pos) ((s)[(pos)] ? (s) + (pos) : NULL)
# define RES_TYPE char *
# define TEST_MAIN
+# define TEST_NAME "strpbrk"
# include "test-string.h"
typedef char *(*proto_t) (const char *, const char *);
@@ -227,7 +228,7 @@ test_main (void)
{
size_t i;
- test_init ("strpbrk");
+ test_init ();
printf ("%32s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strrchr.c b/string/test-strrchr.c
index cbe8876..64af621 100644
--- a/string/test-strrchr.c
+++ b/string/test-strrchr.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strrchr"
#include "test-string.h"
typedef char *(*proto_t) (const char *, int);
@@ -187,7 +188,7 @@ test_main (void)
{
size_t i;
- test_init ("strrchr");
+ test_init ();
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strspn.c b/string/test-strspn.c
index 369b9cf..ad7b845 100644
--- a/string/test-strspn.c
+++ b/string/test-strspn.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strspn"
#include "test-string.h"
typedef size_t (*proto_t) (const char *, const char *);
@@ -210,7 +211,7 @@ test_main (void)
{
size_t i;
- test_init ("strspn");
+ test_init ();
printf ("%32s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strstr.c b/string/test-strstr.c
index aaed60c..6116d70 100644
--- a/string/test-strstr.c
+++ b/string/test-strstr.c
@@ -19,6 +19,7 @@
02111-1307 USA. */
#define TEST_MAIN
+#define TEST_NAME "strstr"
#include "test-string.h"
@@ -138,7 +139,7 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2,
static int
test_main (void)
{
- test_init ("strstr");
+ test_init ();
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=a26d445a740e14d16fcfd1ed624b4dfa7302c8d0
commit a26d445a740e14d16fcfd1ed624b4dfa7302c8d0
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Nov 10 15:55:10 2010 -0800
Test multiple versions of memcpy.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
index 3017f3a..7f9de1d 100644
--- a/ChangeLog.test-ifunc
+++ b/ChangeLog.test-ifunc
@@ -1,5 +1,12 @@
2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
+ * sysdeps/x86_64/multiarch/libc-test.c: New.
+
+ * sysdeps/x86_64/multiarch/memcpy.S (__memcpy_sse2): Make it
+ global and hidden.
+
+2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
+
* include/libc-test.h: New.
* sysdeps/generic/libc-test.c: Likewise.
diff --git a/sysdeps/x86_64/multiarch/libc-test.c b/sysdeps/x86_64/multiarch/libc-test.c
new file mode 100644
index 0000000..5975e0b
--- /dev/null
+++ b/sysdeps/x86_64/multiarch/libc-test.c
@@ -0,0 +1,57 @@
+/* Copyright (C) 2010 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 <libc-test.h>
+#include "init-arch.h"
+
+#if defined SHARED && !defined NOT_IN_libc
+extern void *__memcpy_sse2 (void *, const void *, size_t);
+extern void *__memcpy_ssse3 (void *, const void *, size_t);
+extern void *__memcpy_ssse3_back (void *, const void *, size_t);
+
+static const struct libc_func_test memcpy_list [] =
+{
+ { "__memcpy_ssse3_back", (void (*) (void)) __memcpy_ssse3_back },
+ { "__memcpy_ssse3", (void (*) (void)) __memcpy_ssse3 },
+ { "__memcpy_sse2", (void (*) (void)) __memcpy_sse2 },
+ { NULL, NULL },
+};
+
+static const struct libc_func_test *
+find_memcpy (void)
+{
+ return memcpy_list + (HAS_SSSE3 ? 0 : 2);
+}
+#else
+static const struct libc_func_test *
+find_memcpy (void)
+{
+ return NULL;
+}
+#endif
+
+const struct libc_func_test *
+__libc_func (const char *name)
+{
+ if (strcmp (name, "memcpy") == 0)
+ return find_memcpy ();
+
+ return NULL;
+}
diff --git a/sysdeps/x86_64/multiarch/memcpy.S b/sysdeps/x86_64/multiarch/memcpy.S
index 8e9fb19..a45ca9f 100644
--- a/sysdeps/x86_64/multiarch/memcpy.S
+++ b/sysdeps/x86_64/multiarch/memcpy.S
@@ -44,6 +44,8 @@ END(memcpy)
# undef ENTRY
# define ENTRY(name) \
.type __memcpy_sse2, @function; \
+ .globl __memcpy_sse2; \
+ .hidden __memcpy_sse2; \
.p2align 4; \
__memcpy_sse2: cfi_startproc; \
CALL_MCOUNT
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=524db7262907b398e60d353a7f7dac4138b7fcd6
commit 524db7262907b398e60d353a7f7dac4138b7fcd6
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Nov 10 15:26:13 2010 -0800
Add __libc_func.
diff --git a/ChangeLog.test-ifunc b/ChangeLog.test-ifunc
new file mode 100644
index 0000000..3017f3a
--- /dev/null
+++ b/ChangeLog.test-ifunc
@@ -0,0 +1,39 @@
+2010-11-10 H.J. Lu <hongjiu.lu@intel.com>
+
+ * include/libc-test.h: New.
+ * sysdeps/generic/libc-test.c: Likewise.
+
+ * string/Makefile (routines): Add libc-test.
+
+ * string/Versions (GLIBC_2.13): New. Include __libc_func.
+
+ * string/test-string.h: Include <libc-test.h>.
+ (FOR_EACH_IMPL): Support func_list.
+ (func_list): New.
+ (impl_count): Likewise.
+ (impl_array); Likewise.
+ (test_init): Take a parameter for function name. Call
+ __libc_func to initialize func_list.
+
+ * string/test-memccpy.c (test_main): Pass function to test_init.
+ * string/test-memchr.c (test_main): Likewise.
+ * string/test-memcmp.c (test_main): Likewise.
+ * string/test-memcpy.c (test_main): Likewise.
+ * string/test-memmem.c (test_main): Likewise.
+ * string/test-memmove.c (test_main): Likewise.
+ * string/test-memset.c (test_main): Likewise.
+ * string/test-strcasecmp.c (test_main): Likewise.
+ * string/test-strcasestr.c (test_main): Likewise.
+ * string/test-strcat.c (test_main): Likewise.
+ * string/test-strchr.c (test_main): Likewise.
+ * string/test-strcmp.c(test_main): Likewise.
+ * tring/test-strcpy.c (test_main): Likewise.
+ * string/test-strlen.c (test_main): Likewise.
+ * string/test-strncasecmp.c (test_main): Likewise.
+ * string/test-strncmp.c (test_main): Likewise.
+ * string/test-strncpy.c (test_main): Likewise.
+ * string/test-strnlen.c (test_main): Likewise.
+ * string/test-strpbrk.c (test_main): Likewise.
+ * string/test-strrchr.c (test_main): Likewise.
+ * string/test-strspn.c (test_main): Likewise.
+ * string/test-strstr.c (test_main): Likewise.
diff --git a/include/libc-test.h b/include/libc-test.h
new file mode 100644
index 0000000..edd814f
--- /dev/null
+++ b/include/libc-test.h
@@ -0,0 +1,33 @@
+/* Copyright (C) 2010 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. */
+
+#ifndef _LIBC_TEST_H
+#define _LIBC_TEST_H 1
+
+struct libc_func_test
+{
+ /* The name of function to be tested. */
+ const char *name;
+ /* The address of function to be tested. */
+ void (*fn) (void);
+};
+
+/* Return the NULL terminated array of functions. */
+extern const struct libc_func_test *__libc_func (const char *);
+
+#endif /* libc-symbols.h */
diff --git a/string/Makefile b/string/Makefile
index f836f59..d25d23d 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -40,7 +40,7 @@ routines := strcat strchr strcmp strcoll strcpy strcspn \
addsep replace) \
envz basename \
strcoll_l strxfrm_l string-inlines memrchr \
- xpg-strerror strerror_l
+ xpg-strerror strerror_l libc-test
# Gcc internally generates calls to unbounded memcpy and memset
# for -fbounded-pointer compiles. Glibc uses memchr for explicit checks.
diff --git a/string/Versions b/string/Versions
index f145fd3..fe6a418 100644
--- a/string/Versions
+++ b/string/Versions
@@ -80,4 +80,7 @@ libc {
GLIBC_2.6 {
strerror_l;
}
+ GLIBC_2.13 {
+ __libc_func;
+ }
}
diff --git a/string/test-memccpy.c b/string/test-memccpy.c
index 2653263..3790342 100644
--- a/string/test-memccpy.c
+++ b/string/test-memccpy.c
@@ -259,7 +259,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("memccpy");
printf ("%28s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-memchr.c b/string/test-memchr.c
index cd9a01e..3ca522d 100644
--- a/string/test-memchr.c
+++ b/string/test-memchr.c
@@ -170,7 +170,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("memchr");
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-memcmp.c b/string/test-memcmp.c
index 3040e21..755b40b 100644
--- a/string/test-memcmp.c
+++ b/string/test-memcmp.c
@@ -437,7 +437,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("memcmp");
check1 ();
diff --git a/string/test-memcpy.c b/string/test-memcpy.c
index 7b0723a..01ba0a3 100644
--- a/string/test-memcpy.c
+++ b/string/test-memcpy.c
@@ -235,7 +235,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("memcpy");
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-memmem.c b/string/test-memmem.c
index 91b661b..ad8a567 100644
--- a/string/test-memmem.c
+++ b/string/test-memmem.c
@@ -160,7 +160,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("memmem");
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-memmove.c b/string/test-memmove.c
index 2f3a8f7..c6c547e 100644
--- a/string/test-memmove.c
+++ b/string/test-memmove.c
@@ -243,7 +243,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("memmove");
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-memset.c b/string/test-memset.c
index 601ace4..c692af2 100644
--- a/string/test-memset.c
+++ b/string/test-memset.c
@@ -186,7 +186,7 @@ test_main (void)
size_t i;
int c;
- test_init ();
+ test_init ("memset");
printf ("%24s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcasecmp.c b/string/test-strcasecmp.c
index 7d1d110..2070262 100644
--- a/string/test-strcasecmp.c
+++ b/string/test-strcasecmp.c
@@ -235,7 +235,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strcasecmp");
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcasestr.c b/string/test-strcasestr.c
index edc41f3..eaca6ac 100644
--- a/string/test-strcasestr.c
+++ b/string/test-strcasestr.c
@@ -141,7 +141,7 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2,
static int
test_main (void)
{
- test_init ();
+ test_init ("strcasestr");
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcat.c b/string/test-strcat.c
index 4437520..1c91ae2 100644
--- a/string/test-strcat.c
+++ b/string/test-strcat.c
@@ -225,7 +225,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strcat");
printf ("%28s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strchr.c b/string/test-strchr.c
index cf25b44..f756b7f 100644
--- a/string/test-strchr.c
+++ b/string/test-strchr.c
@@ -188,7 +188,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strchr");
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcmp.c b/string/test-strcmp.c
index 769e982..3930d66 100644
--- a/string/test-strcmp.c
+++ b/string/test-strcmp.c
@@ -219,7 +219,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strcmp");
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strcpy.c b/string/test-strcpy.c
index 6a2ea25..d2b1cba 100644
--- a/string/test-strcpy.c
+++ b/string/test-strcpy.c
@@ -192,7 +192,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strcpy");
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-string.h b/string/test-string.h
index 1aea4c9..4e28e92 100644
--- a/string/test-string.h
+++ b/string/test-string.h
@@ -48,6 +48,7 @@ extern impl_t __start_impls[], __stop_impls[];
#include <error.h>
#include <errno.h>
#include <time.h>
+#include <libc-test.h>
#define GL(x) _##x
#define GLRO(x) _##x
#include <hp-timing.h>
@@ -105,7 +106,32 @@ size_t iterations = 100000;
(* (proto_t) (impl)->fn) (__VA_ARGS__)
#define FOR_EACH_IMPL(impl, notall) \
- for (impl_t *impl = __start_impls; impl < __stop_impls; ++impl) \
+ impl_t *impl; \
+ int count; \
+ if (impl_count == -1) \
+ { \
+ const struct libc_func_test *p; \
+ impl_count = 0; \
+ for (impl = __start_impls; impl < __stop_impls; ++impl) \
+ impl_count++; \
+ for (p = func_list; p && p->name; ++p) \
+ impl_count++; \
+ if (impl_count) \
+ { \
+ impl_t *a; \
+ a = impl_array = malloc (impl_count * sizeof (impl_t)); \
+ for (impl = __start_impls; impl < __stop_impls; ++impl, ++a) \
+ *a = *impl; \
+ for (p = func_list; p && p->name; ++p, a++) \
+ { \
+ a->name = p->name; \
+ a->fn = p->fn; \
+ a->test = 1; \
+ } \
+ } \
+ } \
+ impl = impl_array; \
+ for (count = 0; count < impl_count; ++count, ++impl) \
if (!notall || impl->test)
#define HP_TIMING_BEST(best_time, start, end) \
@@ -122,9 +148,15 @@ size_t iterations = 100000;
# define BUF1PAGES 1
#endif
+static const struct libc_func_test *func_list;
+static int impl_count = -1;
+static impl_t *impl_array;
+
static void
-test_init (void)
+test_init (const char *name)
{
+ func_list = __libc_func (name);
+
page_size = 2 * getpagesize ();
#ifdef MIN_PAGE_SIZE
if (page_size < MIN_PAGE_SIZE)
diff --git a/string/test-strlen.c b/string/test-strlen.c
index e01befb..245c9be 100644
--- a/string/test-strlen.c
+++ b/string/test-strlen.c
@@ -142,7 +142,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strlen");
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strncasecmp.c b/string/test-strncasecmp.c
index daff6ed..9b422aa 100644
--- a/string/test-strncasecmp.c
+++ b/string/test-strncasecmp.c
@@ -276,7 +276,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strncasecmp");
check1 ();
diff --git a/string/test-strncmp.c b/string/test-strncmp.c
index 3687879..61c144c 100644
--- a/string/test-strncmp.c
+++ b/string/test-strncmp.c
@@ -317,7 +317,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strncmp");
check1 ();
diff --git a/string/test-strncpy.c b/string/test-strncpy.c
index d7a714c..379feb5 100644
--- a/string/test-strncpy.c
+++ b/string/test-strncpy.c
@@ -274,7 +274,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strncpy");
printf ("%28s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strnlen.c b/string/test-strnlen.c
index cb8c80f..c7631da 100644
--- a/string/test-strnlen.c
+++ b/string/test-strnlen.c
@@ -151,7 +151,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strnlen");
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strpbrk.c b/string/test-strpbrk.c
index f3ed208..3142fc6 100644
--- a/string/test-strpbrk.c
+++ b/string/test-strpbrk.c
@@ -227,7 +227,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strpbrk");
printf ("%32s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strrchr.c b/string/test-strrchr.c
index 92e8ab1..cbe8876 100644
--- a/string/test-strrchr.c
+++ b/string/test-strrchr.c
@@ -187,7 +187,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strrchr");
printf ("%20s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strspn.c b/string/test-strspn.c
index 15cf492..369b9cf 100644
--- a/string/test-strspn.c
+++ b/string/test-strspn.c
@@ -210,7 +210,7 @@ test_main (void)
{
size_t i;
- test_init ();
+ test_init ("strspn");
printf ("%32s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/string/test-strstr.c b/string/test-strstr.c
index c1da686..aaed60c 100644
--- a/string/test-strstr.c
+++ b/string/test-strstr.c
@@ -138,7 +138,7 @@ do_test (size_t align1, size_t align2, size_t len1, size_t len2,
static int
test_main (void)
{
- test_init ();
+ test_init ("strstr");
printf ("%23s", "");
FOR_EACH_IMPL (impl, 0)
diff --git a/sysdeps/generic/libc-test.c b/sysdeps/generic/libc-test.c
new file mode 100644
index 0000000..672e1e4
--- /dev/null
+++ b/sysdeps/generic/libc-test.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 2010 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 <libc-test.h>
+
+/* Return the NULL terminated array of functions. */
+
+const struct libc_func_test *
+__libc_func (const char *name __attribute__ ((unused)))
+{
+ return NULL;
+}
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8d75fe99e95bdd3f342c4a70e2ee7dbe24fa5b6c
commit 8d75fe99e95bdd3f342c4a70e2ee7dbe24fa5b6c
Merge: 8ca52c6 78458b8
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Nov 10 10:41:20 2010 -0800
Merge branch 'intel/i686' into intel/test-ifunc
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=78458b893f88d85476871b6428d9e852071f243b
commit 78458b893f88d85476871b6428d9e852071f243b
Merge: 57ed74c 0e516e0
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Wed Nov 3 16:27:10 2010 -0700
Merge remote branch 'origin/master' into intel/i686
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=57ed74c6ec21c45e691f46cc6a6fdb794d83ce7b
commit 57ed74c6ec21c45e691f46cc6a6fdb794d83ce7b
Merge: 261a93e b9b42ee
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Aug 17 09:46:07 2010 -0700
Merge remote branch 'origin/master' into intel/i686
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=261a93efe8edee8f00a7dc73583d2f1f34b0242a
commit 261a93efe8edee8f00a7dc73583d2f1f34b0242a
Merge: 53f7502 962dba7
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Aug 13 14:48:05 2010 -0700
Merge remote branch 'origin/master' into intel/i686
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=53f75025a469d7fdb955838c072b2a5b75b9cefa
commit 53f75025a469d7fdb955838c072b2a5b75b9cefa
Merge: 4084b67 f15ce4d
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Aug 10 14:53:57 2010 -0700
Merge remote branch 'origin/master' into intel/i686
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=4084b6786194e0632303111ad2794367e59a00f8
commit 4084b6786194e0632303111ad2794367e59a00f8
Merge: edc66a5 b08c89d
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Tue Jul 13 09:36:55 2010 -0700
Merge remote branch 'origin/master' into intel/i686
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=edc66a5f6e938797cf999f4a10c15bb812811e11
commit edc66a5f6e938797cf999f4a10c15bb812811e11
Author: H.J. Lu <hjl.tools@gmail.com>
Date: Fri Jul 9 08:35:07 2010 -0700
Add "-U __i686" to asm-CPPFLAGS.
diff --git a/ChangeLog.i686 b/ChangeLog.i686
new file mode 100644
index 0000000..c6ceca6
--- /dev/null
+++ b/ChangeLog.i686
@@ -0,0 +1,3 @@
+2010-07-09 H.J. Lu <hongjiu.lu@intel.com>
+
+ * sysdeps/i386/Makefile (asm-CPPFLAGS): Add "-U __i686".
diff --git a/sysdeps/i386/Makefile b/sysdeps/i386/Makefile
index ef45ce6..07a970b 100644
--- a/sysdeps/i386/Makefile
+++ b/sysdeps/i386/Makefile
@@ -1,6 +1,7 @@
# The mpn functions need a #define for asm syntax flavor.
-# Every i386 port in use uses gas syntax (I think).
-asm-CPPFLAGS += -DGAS_SYNTAX
+# Every i386 port in use uses gas syntax (I think). Don't replace
+# __i686 in __i686.get_pc_thunk.bx.
+asm-CPPFLAGS += -DGAS_SYNTAX -U __i686
# The i386 `long double' is a distinct type we support.
long-double-fcts = yes
-----------------------------------------------------------------------
hooks/post-receive
--
GNU C Library master sources