summaryrefslogtreecommitdiff
path: root/benchtests/bench-memset-large.c
diff options
context:
space:
mode:
authorWilco Dijkstra <wdijkstr@arm.com>2019-08-29 15:45:49 +0100
committerWilco Dijkstra <wdijkstr@arm.com>2019-08-30 17:21:35 +0100
commit3c05dd79d04da765b1ec93ea97474b3b8d9e0af3 (patch)
tree7765a34bee154154bcd8e48d934ec661cfbab7a9 /benchtests/bench-memset-large.c
parent9743c6272df3d4f4c37cc98e68fab83bf3f57efb (diff)
downloadglibc-3c05dd79d04da765b1ec93ea97474b3b8d9e0af3.tar.gz
Use generic memset/memcpy/memmove in benchtests
Use the generic C memset/memcpy/memmove in benchtests since comparing against a slow byte-oriented implementation makes no sense. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> 2019-08-29 Wilco Dijkstra <wdijkstr@arm.com> * benchtests/bench-memcpy.c (simple_memcpy): Remove. (generic_memcpy): Include generic C memcpy. * benchtests/bench-memmove.c (simple_memmove): Remove. (generic_memmove): Include generic C memmove. * benchtests/bench-memset.c (simple_memset): Remove. (generic_memset): Include generic C memset. * benchtests/bench-memset-large.c (simple_memset): Remove. (generic_memset): Include generic C memset. * benchtests/bench-memset-walk.c (simple_memset): Remove. (generic_memset): Include generic C memset. * string/memcpy.c (MEMCPY): Add defines to enable redirection. * string/memset.c (MEMSET): Likewise. * sysdeps/x86_64/memcopy.h: Remove empty file.
Diffstat (limited to 'benchtests/bench-memset-large.c')
-rw-r--r--benchtests/bench-memset-large.c36
1 files changed, 13 insertions, 23 deletions
diff --git a/benchtests/bench-memset-large.c b/benchtests/bench-memset-large.c
index d99f0a24aa..97ba30f122 100644
--- a/benchtests/bench-memset-large.c
+++ b/benchtests/bench-memset-large.c
@@ -17,38 +17,20 @@
<http://www.gnu.org/licenses/>. */
#define TEST_MAIN
-#ifndef WIDE
-# define TEST_NAME "memset"
-#else
-# define TEST_NAME "wmemset"
-#endif /* WIDE */
+#define TEST_NAME "memset"
#define START_SIZE (128 * 1024)
#define MIN_PAGE_SIZE (getpagesize () + 64 * 1024 * 1024)
#define TIMEOUT (20 * 60)
#include "bench-string.h"
-#ifndef WIDE
-# define SIMPLE_MEMSET simple_memset
-#else
-# define SIMPLE_MEMSET simple_wmemset
-#endif /* WIDE */
-
#include <assert.h>
#include "json-lib.h"
-IMPL (MEMSET, 1)
-
-typedef CHAR *(*proto_t) (CHAR *, int, size_t);
+void *generic_memset (void *, int, size_t);
+typedef void *(*proto_t) (void *, int, size_t);
-CHAR *
-inhibit_loop_to_libcall
-SIMPLE_MEMSET (CHAR *s, int c, size_t n)
-{
- CHAR *r = s, *end = s + n;
- while (r < end)
- *r++ = c;
- return s;
-}
+IMPL (MEMSET, 1)
+IMPL (generic_memset, 0)
static void
do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s,
@@ -133,3 +115,11 @@ test_main (void)
}
#include <support/test-driver.c>
+
+#define libc_hidden_builtin_def(X)
+#define libc_hidden_def(X)
+#define libc_hidden_weak(X)
+#define weak_alias(X,Y)
+#undef MEMSET
+#define MEMSET generic_memset
+#include <string/memset.c>