summary refs log tree commit diff
path: root/benchtests/bench-memset.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2019-02-12 17:19:51 +0000
committerWilco Dijkstra <wdijkstr@arm.com>2019-02-12 17:19:51 +0000
commit16f87cfd630522afe745a0cf665287b8fe206cf4 (patch)
tree9f33bc5ad9ad0bbf3f1975ce25019e6acdd1f183 /benchtests/bench-memset.c
parent0c6d82e979d562147c9cfe0e6f65b42a904288bc (diff)
downloadglibc-16f87cfd630522afe745a0cf665287b8fe206cf4.tar.gz
glibc-16f87cfd630522afe745a0cf665287b8fe206cf4.tar.xz
glibc-16f87cfd630522afe745a0cf665287b8fe206cf4.zip
String benchtest cleanup
Continue cleanup of the string benchtests.  Remove simplistic
byte-oriented versions with faster generic implementations.
Remove bcopy/bzero benchmarks (bcopy/bzero are obsolete and never
emitted by compilers).  Remove builtin versions of memcpy, memset
and strlen.  Remove all remaining "stupid" implementations given
they are always slower than the "simple" variants and thus don't
add anything useful.

	* benchtests/bench-strcasecmp.c (stupid_strcasecmp): Remove.
	* benchtests/bench-strcasestr.c (stupid_strcasestr): Remove.
	* benchtests/bench-strchr.c (stupid_strchr): Remove.
	* benchtests/bench-strcmp.c (stupid_strcmp): Remove.
	* benchtests/bench-strcspn.c (stupid_strcspn): Remove.
	* benchtests/bench-strlen.c (builtin_strlen): Remove.
	* benchtests/bench-strncasecmp.c (stupid_strncasecmp): Remove.
	* benchtests/bench-strncmp.c (stupid_strncmp): Remove.
	* benchtests/bench-strpbrk.c (stupid_strpbrk): Remove.
	* benchtests/bench-strspn.c (stupid_strspn): Remove.
	* benchtests/Makefile: Remove bench-bcopy.c and bench-bzero.c.
	* benchtests/bench-bcopy.c: Delete file.
	* benchtests/bench-bzero.c: Likewise.
	* benchtests/bench-memccpy.c (stupid_memccpy): Remove.
	(simple_memccpy): Remove.
	(generic_memccpy): Add function.
	* benchtests/bench-memcpy.c: (builtin_memcpy): Remove.
	* benchtests/bench-memmove.c (simple_bcopy): Remove.
	* benchtests/bench-mempcpy.c (simple_mempcpy): Remove.
	(generic_mempcpy): Add new function.
	* benchtests/bench-memset.c (simple_bzero): Remove.
	(builtin_bzero): Remove.
	(builtin_memset): Remove.
	* benchtests/bench-rawmemchr.c (simple_rawmemchr): Remove.
	(generic_rawmemchr): Add new function.
Diffstat (limited to 'benchtests/bench-memset.c')
-rw-r--r--benchtests/bench-memset.c60
1 files changed, 5 insertions, 55 deletions
diff --git a/benchtests/bench-memset.c b/benchtests/bench-memset.c
index c2679a6ac1..0df55d1263 100644
--- a/benchtests/bench-memset.c
+++ b/benchtests/bench-memset.c
@@ -17,66 +17,22 @@
    <http://www.gnu.org/licenses/>.  */
 
 #define TEST_MAIN
-#ifdef TEST_BZERO
-# define TEST_NAME "bzero"
-#else
-# ifndef WIDE
-#  define TEST_NAME "memset"
-# else
-#  define TEST_NAME "wmemset"
-# endif /* WIDE */
-#endif /* !TEST_BZERO */
-#define MIN_PAGE_SIZE 131072
-#include "bench-string.h"
-
 #ifndef WIDE
-# define SIMPLE_MEMSET simple_memset
+# define TEST_NAME "memset"
 #else
-# define SIMPLE_MEMSET simple_wmemset
+# define TEST_NAME "wmemset"
 #endif /* WIDE */
+#define MIN_PAGE_SIZE 131072
+#include "bench-string.h"
 
 #include "json-lib.h"
 
 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)
-IMPL (bzero, 1)
-
-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);
-}
-#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 */
+IMPL (SIMPLE_MEMSET, 0)
 
 CHAR *
 inhibit_loop_to_libcall
@@ -98,11 +54,7 @@ do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s,
   TIMING_NOW (start);
   for (i = 0; i < iters; ++i)
     {
-#ifdef TEST_BZERO
-      CALL (impl, s, n);
-#else
       CALL (impl, s, c, n);
-#endif /* !TEST_BZERO */
     }
   TIMING_NOW (stop);
 
@@ -159,9 +111,7 @@ test_main (void)
 
   json_array_begin (&json_ctx, "results");
 
-#ifndef TEST_BZERO
   for (c = -65; c <= 130; c += 65)
-#endif
     {
       for (i = 0; i < 18; ++i)
 	do_test (&json_ctx, 0, c, 1 << i);