mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
SSSE3 strcpy/stpcpy for x86-64
This patch adds SSSE3 strcpy/stpcpy. I got up to 4X speed up on Core 2 and Core i7. I disabled it on Atom since SSSE3 version is slower for shorter (<64byte) data.
This commit is contained in:
@ -28,17 +28,19 @@
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#ifndef weak_alias
|
||||
# define __stpncpy stpncpy
|
||||
#ifndef STPNCPY
|
||||
# ifdef weak_alias
|
||||
# define STPNCPY __stpncpy
|
||||
weak_alias (__stpncpy, stpncpy)
|
||||
# else
|
||||
# define STPNCPY stpncpy
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/* Copy no more than N characters of SRC to DEST, returning the address of
|
||||
the terminating '\0' in DEST, if any, or else DEST + N. */
|
||||
char *
|
||||
__stpncpy (dest, src, n)
|
||||
char *dest;
|
||||
const char *src;
|
||||
size_t n;
|
||||
STPNCPY (char *dest, const char *src, size_t n)
|
||||
{
|
||||
char c;
|
||||
char *s = dest;
|
||||
@ -96,5 +98,4 @@ __stpncpy (dest, src, n)
|
||||
}
|
||||
#ifdef weak_alias
|
||||
libc_hidden_def (__stpncpy)
|
||||
weak_alias (__stpncpy, stpncpy)
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user