diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2019-02-12 17:19:51 +0000 |
---|---|---|
committer | Wilco Dijkstra <wdijkstr@arm.com> | 2019-02-12 17:19:51 +0000 |
commit | 16f87cfd630522afe745a0cf665287b8fe206cf4 (patch) | |
tree | 9f33bc5ad9ad0bbf3f1975ce25019e6acdd1f183 /benchtests/bench-strspn.c | |
parent | 0c6d82e979d562147c9cfe0e6f65b42a904288bc (diff) | |
download | glibc-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-strspn.c')
-rw-r--r-- | benchtests/bench-strspn.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/benchtests/bench-strspn.c b/benchtests/bench-strspn.c index 04507cdd61..ac874fe234 100644 --- a/benchtests/bench-strspn.c +++ b/benchtests/bench-strspn.c @@ -28,19 +28,15 @@ #ifndef WIDE # define SIMPLE_STRSPN simple_strspn -# define STUPID_STRSPN stupid_strspn # define SMALL_CHAR 127 #else # define SIMPLE_STRSPN simple_wcsspn -# define STUPID_STRSPN stupid_wcsspn # define SMALL_CHAR 1273 #endif /* WIDE */ typedef size_t (*proto_t) (const CHAR *, const CHAR *); size_t SIMPLE_STRSPN (const CHAR *, const CHAR *); -size_t STUPID_STRSPN (const CHAR *, const CHAR *); -IMPL (STUPID_STRSPN, 0) IMPL (SIMPLE_STRSPN, 0) IMPL (STRSPN, 1) @@ -61,23 +57,6 @@ SIMPLE_STRSPN (const CHAR *s, const CHAR *acc) return s - str - 1; } -size_t -STUPID_STRSPN (const CHAR *s, const CHAR *acc) -{ - size_t ns = STRLEN (s), nacc = STRLEN (acc); - size_t i, j; - - for (i = 0; i < ns; ++i) - { - for (j = 0; j < nacc; ++j) - if (s[i] == acc[j]) - break; - if (j == nacc) - return i; - } - return i; -} - static void do_one_test (impl_t *impl, const CHAR *s, const CHAR *acc, size_t exp_res) { |