diff options
Diffstat (limited to 'benchtests/bench-memset.c')
-rw-r--r-- | benchtests/bench-memset.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/benchtests/bench-memset.c b/benchtests/bench-memset.c index 0df55d1..69e8d36 100644 --- a/benchtests/bench-memset.c +++ b/benchtests/bench-memset.c @@ -21,28 +21,23 @@ # define TEST_NAME "memset" #else # define TEST_NAME "wmemset" +# define generic_memset generic_wmemset #endif /* WIDE */ #define MIN_PAGE_SIZE 131072 #include "bench-string.h" #include "json-lib.h" -CHAR *SIMPLE_MEMSET (CHAR *, int, size_t); +#ifdef WIDE +CHAR *generic_wmemset (CHAR *, CHAR, size_t); +#else +void *generic_memset (void *, int, size_t); +#endif -typedef CHAR *(*proto_t) (CHAR *, int, size_t); +typedef void *(*proto_t) (void *, int, size_t); IMPL (MEMSET, 1) -IMPL (SIMPLE_MEMSET, 0) - -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 (generic_memset, 0) static void do_one_test (json_ctx_t *json_ctx, impl_t *impl, CHAR *s, @@ -146,3 +141,16 @@ 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) +#ifndef WIDE +# undef MEMSET +# define MEMSET generic_memset +# include <string/memset.c> +#else +# define WMEMSET generic_wmemset +# include <wcsmbs/wmemset.c> +#endif |