mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
Benchtests: Remove simple_strcpy_chk
Remove the slow byte oriented simple_strcpy_chk and simple_stpcpy_chk. Adjust iteration count to increase benchmark time. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
d1c3c0e4fe
commit
73a284f618
2 changed files with 1 additions and 27 deletions
|
@ -22,24 +22,11 @@
|
||||||
#include "bench-string.h"
|
#include "bench-string.h"
|
||||||
|
|
||||||
extern void __attribute__ ((noreturn)) __chk_fail (void);
|
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)
|
extern char *normal_stpcpy (char *, const char *, size_t)
|
||||||
__asm ("stpcpy");
|
__asm ("stpcpy");
|
||||||
extern char *__stpcpy_chk (char *, const char *, size_t);
|
extern char *__stpcpy_chk (char *, const char *, size_t);
|
||||||
|
|
||||||
IMPL (simple_stpcpy_chk, 0)
|
|
||||||
IMPL (normal_stpcpy, 1)
|
IMPL (normal_stpcpy, 1)
|
||||||
IMPL (__stpcpy_chk, 2)
|
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"
|
#include "bench-strcpy_chk.c"
|
||||||
|
|
|
@ -26,26 +26,13 @@
|
||||||
symbol, which is part of the public ABI and may be used
|
symbol, which is part of the public ABI and may be used
|
||||||
externally. */
|
externally. */
|
||||||
extern void __attribute__ ((noreturn)) __chk_fail (void);
|
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)
|
extern char *normal_strcpy (char *, const char *, size_t)
|
||||||
__asm ("strcpy");
|
__asm ("strcpy");
|
||||||
extern char *__strcpy_chk (char *, const char *, size_t);
|
extern char *__strcpy_chk (char *, const char *, size_t);
|
||||||
|
|
||||||
IMPL (simple_strcpy_chk, 0)
|
|
||||||
IMPL (normal_strcpy, 1)
|
IMPL (normal_strcpy, 1)
|
||||||
IMPL (__strcpy_chk, 2)
|
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
|
#endif
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -77,7 +64,7 @@ do_one_test (impl_t *impl, char *dst, const char *src,
|
||||||
size_t len, size_t dlen)
|
size_t len, size_t dlen)
|
||||||
{
|
{
|
||||||
char *res;
|
char *res;
|
||||||
size_t i, iters = INNER_LOOP_ITERS8;
|
size_t i, iters = INNER_LOOP_ITERS_LARGE;
|
||||||
timing_t start, stop, cur;
|
timing_t start, stop, cur;
|
||||||
|
|
||||||
if (dlen <= len)
|
if (dlen <= len)
|
||||||
|
|
Loading…
Add table
Reference in a new issue