diff options
author | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2022-04-06 20:53:24 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2022-04-06 20:53:24 +0530 |
commit | 67e3b0c63c35769c1ba28fa2a32446332bb4fcef (patch) | |
tree | 30222f7961103558c51c99871cead59139e65fd5 /string/test-memset.c | |
parent | dfc7bf8a24f63532da167cc7131227c1c4027ffb (diff) | |
download | glibc-67e3b0c63c35769c1ba28fa2a32446332bb4fcef.tar.gz glibc-67e3b0c63c35769c1ba28fa2a32446332bb4fcef.tar.xz glibc-67e3b0c63c35769c1ba28fa2a32446332bb4fcef.zip |
tests/string: Drop simple/stupid/builtin tests
In most cases the simple/stupid/builtin functions were in there to benchmark optimized implementations against. Only in some cases the functions are used to check expected results. Remove these tests from IMPL() and only keep them in wherever they're used for a specific purpose, e.g. to generate expected results. This improves timing of `make subdirs=string` by over a minute and a half (over 15%) on a Whiskey Lake laptop. Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Reviewed-by: Noah Goldstein <libc-alpha@sourceware.org>
Diffstat (limited to 'string/test-memset.c')
-rw-r--r-- | string/test-memset.c | 42 |
1 files changed, 5 insertions, 37 deletions
diff --git a/string/test-memset.c b/string/test-memset.c index ee548f6924..00582c881c 100644 --- a/string/test-memset.c +++ b/string/test-memset.c @@ -50,51 +50,19 @@ # define BIG_CHAR WCHAR_MAX #endif /* WIDE */ -CHAR *SIMPLE_MEMSET (CHAR *, int, size_t); - #ifdef TEST_BZERO typedef void (*proto_t) (char *, size_t); -void simple_bzero (char *, size_t); -void builtin_bzero (char *, size_t); - -IMPL (simple_bzero, 0) -IMPL (builtin_bzero, 0) -#ifdef TEST_EXPLICIT_BZERO +# ifdef TEST_EXPLICIT_BZERO IMPL (explicit_bzero, 1) -#else +# else IMPL (bzero, 1) -#endif - -void -simple_bzero (char *s, size_t n) -{ - SIMPLE_MEMSET (s, 0, n); -} - -void -builtin_bzero (char *s, size_t n) -{ - __builtin_bzero (s, n); -} +# endif #else typedef CHAR *(*proto_t) (CHAR *, int, size_t); - -IMPL (SIMPLE_MEMSET, 0) -# ifndef WIDE -char *builtin_memset (char *, int, size_t); -IMPL (builtin_memset, 0) -# endif /* !WIDE */ IMPL (MEMSET, 1) - -# ifndef WIDE -char * -builtin_memset (char *s, int c, size_t n) -{ - return __builtin_memset (s, c, n); -} -# endif /* !WIDE */ #endif /* !TEST_BZERO */ +/* Naive implementation to verify results. */ CHAR * inhibit_loop_to_libcall SIMPLE_MEMSET (CHAR *s, int c, size_t n) @@ -116,7 +84,7 @@ do_one_test (impl_t *impl, CHAR *s, int c __attribute ((unused)), size_t n, int s[n] = sentinel; SIMPLE_MEMSET(s, ~c, n); #ifdef TEST_BZERO - simple_bzero (buf, n); + SIMPLE_MEMSET (buf, 0, n); CALL (impl, s, n); if (memcmp (s, buf, n) != 0 || (space_below && s[-1] != sentinel) |