* [PATCH] Benchtests: Remove simple_strcpy_chk
@ 2023-03-08 10:53 Wilco Dijkstra
2023-03-08 15:19 ` Adhemerval Zanella Netto
0 siblings, 1 reply; 2+ messages in thread
From: Wilco Dijkstra @ 2023-03-08 10:53 UTC (permalink / raw)
To: 'GNU C Library'
Remove the slow byte oriented simple_strcpy_chk and simple_stpcpy_chk.
Adjust iteration count to increase benchmark time.
---
diff --git a/benchtests/bench-stpcpy_chk.c b/benchtests/bench-stpcpy_chk.c
index aaacd336bad6e5f5f4f420773480749ed05ee9ac..85d5a5e9240110533ca7b25103c2e5e64bc0e948 100644
--- a/benchtests/bench-stpcpy_chk.c
+++ b/benchtests/bench-stpcpy_chk.c
@@ -22,24 +22,11 @@
#include "bench-string.h"
extern void __attribute__ ((noreturn)) __chk_fail (void);
-char *simple_stpcpy_chk (char *, const char *, size_t);
extern char *normal_stpcpy (char *, const char *, size_t)
__asm ("stpcpy");
extern char *__stpcpy_chk (char *, const char *, size_t);
-IMPL (simple_stpcpy_chk, 0)
IMPL (normal_stpcpy, 1)
IMPL (__stpcpy_chk, 2)
-char *
-simple_stpcpy_chk (char *dst, const char *src, size_t len)
-{
- if (! len)
- __chk_fail ();
- while ((*dst++ = *src++) != '\0')
- if (--len == 0)
- __chk_fail ();
- return dst - 1;
-}
-
#include "bench-strcpy_chk.c"
diff --git a/benchtests/bench-strcpy_chk.c b/benchtests/bench-strcpy_chk.c
index 6fce90cc9879d7b9bdc5b13a84eaaaadbde97a5b..48ecaaf392201cbce41a6f1520c630d68b59aacb 100644
--- a/benchtests/bench-strcpy_chk.c
+++ b/benchtests/bench-strcpy_chk.c
@@ -26,26 +26,13 @@
symbol, which is part of the public ABI and may be used
externally. */
extern void __attribute__ ((noreturn)) __chk_fail (void);
-char *simple_strcpy_chk (char *, const char *, size_t);
extern char *normal_strcpy (char *, const char *, size_t)
__asm ("strcpy");
extern char *__strcpy_chk (char *, const char *, size_t);
-IMPL (simple_strcpy_chk, 0)
IMPL (normal_strcpy, 1)
IMPL (__strcpy_chk, 2)
-char *
-simple_strcpy_chk (char *dst, const char *src, size_t len)
-{
- char *ret = dst;
- if (! len)
- __chk_fail ();
- while ((*dst++ = *src++) != '\0')
- if (--len == 0)
- __chk_fail ();
- return ret;
-}
#endif
#include <fcntl.h>
@@ -77,7 +64,7 @@ do_one_test (impl_t *impl, char *dst, const char *src,
size_t len, size_t dlen)
{
char *res;
- size_t i, iters = INNER_LOOP_ITERS8;
+ size_t i, iters = INNER_LOOP_ITERS_LARGE;
timing_t start, stop, cur;
if (dlen <= len)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Benchtests: Remove simple_strcpy_chk
2023-03-08 10:53 [PATCH] Benchtests: Remove simple_strcpy_chk Wilco Dijkstra
@ 2023-03-08 15:19 ` Adhemerval Zanella Netto
0 siblings, 0 replies; 2+ messages in thread
From: Adhemerval Zanella Netto @ 2023-03-08 15:19 UTC (permalink / raw)
To: Wilco Dijkstra, 'GNU C Library'
On 08/03/23 07:53, Wilco Dijkstra via Libc-alpha wrote:
>
> Remove the slow byte oriented simple_strcpy_chk and simple_stpcpy_chk.
> Adjust iteration count to increase benchmark time.
LGTM, thanks.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
>
> ---
>
> diff --git a/benchtests/bench-stpcpy_chk.c b/benchtests/bench-stpcpy_chk.c
> index aaacd336bad6e5f5f4f420773480749ed05ee9ac..85d5a5e9240110533ca7b25103c2e5e64bc0e948 100644
> --- a/benchtests/bench-stpcpy_chk.c
> +++ b/benchtests/bench-stpcpy_chk.c
> @@ -22,24 +22,11 @@
> #include "bench-string.h"
>
> extern void __attribute__ ((noreturn)) __chk_fail (void);
> -char *simple_stpcpy_chk (char *, const char *, size_t);
> extern char *normal_stpcpy (char *, const char *, size_t)
> __asm ("stpcpy");
> extern char *__stpcpy_chk (char *, const char *, size_t);
>
> -IMPL (simple_stpcpy_chk, 0)
> IMPL (normal_stpcpy, 1)
> IMPL (__stpcpy_chk, 2)
>
> -char *
> -simple_stpcpy_chk (char *dst, const char *src, size_t len)
> -{
> - if (! len)
> - __chk_fail ();
> - while ((*dst++ = *src++) != '\0')
> - if (--len == 0)
> - __chk_fail ();
> - return dst - 1;
> -}
> -
> #include "bench-strcpy_chk.c"
> diff --git a/benchtests/bench-strcpy_chk.c b/benchtests/bench-strcpy_chk.c
> index 6fce90cc9879d7b9bdc5b13a84eaaaadbde97a5b..48ecaaf392201cbce41a6f1520c630d68b59aacb 100644
> --- a/benchtests/bench-strcpy_chk.c
> +++ b/benchtests/bench-strcpy_chk.c
> @@ -26,26 +26,13 @@
> symbol, which is part of the public ABI and may be used
> externally. */
> extern void __attribute__ ((noreturn)) __chk_fail (void);
> -char *simple_strcpy_chk (char *, const char *, size_t);
> extern char *normal_strcpy (char *, const char *, size_t)
> __asm ("strcpy");
> extern char *__strcpy_chk (char *, const char *, size_t);
>
> -IMPL (simple_strcpy_chk, 0)
> IMPL (normal_strcpy, 1)
> IMPL (__strcpy_chk, 2)
>
> -char *
> -simple_strcpy_chk (char *dst, const char *src, size_t len)
> -{
> - char *ret = dst;
> - if (! len)
> - __chk_fail ();
> - while ((*dst++ = *src++) != '\0')
> - if (--len == 0)
> - __chk_fail ();
> - return ret;
> -}
> #endif
>
> #include <fcntl.h>
> @@ -77,7 +64,7 @@ do_one_test (impl_t *impl, char *dst, const char *src,
> size_t len, size_t dlen)
> {
> char *res;
> - size_t i, iters = INNER_LOOP_ITERS8;
> + size_t i, iters = INNER_LOOP_ITERS_LARGE;
> timing_t start, stop, cur;
>
> if (dlen <= len)
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-03-08 15:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08 10:53 [PATCH] Benchtests: Remove simple_strcpy_chk Wilco Dijkstra
2023-03-08 15:19 ` Adhemerval Zanella Netto
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).