From 3af48cbdfaeb8bc389de1caeb33bc29811da80e8 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Tue, 12 Jan 2010 11:22:03 -0800 Subject: Optimize 32bit memset/memcpy with SSE2/SSSE3. --- sysdeps/i386/i686/memmove.S | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'sysdeps/i386/i686/memmove.S') diff --git a/sysdeps/i386/i686/memmove.S b/sysdeps/i386/i686/memmove.S index b93b5c729f..981f14f4e0 100644 --- a/sysdeps/i386/i686/memmove.S +++ b/sysdeps/i386/i686/memmove.S @@ -26,18 +26,27 @@ #define PARMS LINKAGE+4 /* one spilled register */ #define RTN PARMS -#define DEST RTN+RTN_SIZE -#define SRC DEST+PTR_SIZE -#define LEN SRC+PTR_SIZE .text -#if defined PIC && !defined NOT_IN_libc -ENTRY (__memmove_chk) + +#ifdef USE_AS_BCOPY +# define SRC RTN+RTN_SIZE +# define DEST SRC+PTR_SIZE +# define LEN DEST+PTR_SIZE +#else +# define DEST RTN+RTN_SIZE +# define SRC DEST+PTR_SIZE +# define LEN SRC+PTR_SIZE + +# if defined PIC && !defined NOT_IN_libc +ENTRY_CHK (__memmove_chk) movl 12(%esp), %eax cmpl %eax, 16(%esp) jb HIDDEN_JUMPTARGET (__chk_fail) -END (__memmove_chk) +END_CHK (__memmove_chk) +# endif #endif + ENTRY (BP_SYM (memmove)) ENTER @@ -69,8 +78,10 @@ ENTRY (BP_SYM (memmove)) movsl movl %edx, %esi cfi_restore (esi) +#ifndef USE_AS_BCOPY movl DEST(%esp), %eax RETURN_BOUNDED_POINTER (DEST(%esp)) +#endif popl %edi cfi_adjust_cfa_offset (-4) @@ -101,8 +112,10 @@ ENTRY (BP_SYM (memmove)) movsl movl %edx, %esi cfi_restore (esi) +#ifndef USE_AS_BCOPY movl DEST(%esp), %eax RETURN_BOUNDED_POINTER (DEST(%esp)) +#endif cld popl %edi @@ -112,4 +125,6 @@ ENTRY (BP_SYM (memmove)) LEAVE RET_PTR END (BP_SYM (memmove)) +#ifndef USE_AS_BCOPY libc_hidden_builtin_def (memmove) +#endif -- cgit 1.4.1