public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] Benchtests: Remove simple_memcmp
@ 2023-03-08 18:46 Wilco Dijkstra
  0 siblings, 0 replies; only message in thread
From: Wilco Dijkstra @ 2023-03-08 18:46 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=183b425a05f421db0f21a9a81553816525fe93b9

commit 183b425a05f421db0f21a9a81553816525fe93b9
Author: Wilco Dijkstra <wilco.dijkstra@arm.com>
Date:   Fri Mar 3 13:04:00 2023 +0000

    Benchtests: Remove simple_memcmp
    
    Remove the slow byte oriented simple_memcmp.
    
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Diff:
---
 benchtests/bench-memcmp.c | 32 +-------------------------------
 1 file changed, 1 insertion(+), 31 deletions(-)

diff --git a/benchtests/bench-memcmp.c b/benchtests/bench-memcmp.c
index a937953065..4d2b8cbb30 100644
--- a/benchtests/bench-memcmp.c
+++ b/benchtests/bench-memcmp.c
@@ -19,46 +19,16 @@
 #define TEST_MAIN
 #ifdef TEST_MEMCMPEQ
 # define TEST_NAME "__memcmpeq"
-# define SIMPLE_MEMCMP simple_memcmpeq
 #elif defined WIDE
 # define TEST_NAME "wmemcmp"
-# define SIMPLE_MEMCMP simple_wmemcmp
 #else
 # define TEST_NAME "memcmp"
-# define SIMPLE_MEMCMP simple_memcmp
 #endif
 #include "bench-string.h"
-#ifdef WIDE
-
-int
-SIMPLE_MEMCMP (const wchar_t *s1, const wchar_t *s2, size_t n)
-{
-  int ret = 0;
-  /* Warning!
-	wmemcmp has to use SIGNED comparison for elements.
-	memcmp has to use UNSIGNED comparison for elemnts.
-  */
-  while (n-- && (ret = *s1 < *s2 ? -1 : *s1 == *s2 ? 0 : 1) == 0) {s1++; s2++;}
-  return ret;
-}
-#else
-# include <limits.h>
-
-int
-SIMPLE_MEMCMP (const char *s1, const char *s2, size_t n)
-{
-  int ret = 0;
-
-  while (n-- && (ret = *(unsigned char *) s1++ - *(unsigned char *) s2++) == 0);
-  return ret;
-}
-#endif
-
-# include "json-lib.h"
+#include "json-lib.h"
 
 typedef int (*proto_t) (const CHAR *, const CHAR *, size_t);
 
-IMPL (SIMPLE_MEMCMP, 0)
 IMPL (MEMCMP, 1)
 
 static void

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-08 18:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08 18:46 [glibc] Benchtests: Remove simple_memcmp Wilco Dijkstra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).