glibc/sysdeps/i386
H.J. Lu c5cc45148c i586: Use conditional branches in strcpy.S [BZ #22353]
i586 strcpy.S used a clever trick with LEA to implement jump table:

/* ECX has the last 2 bits of the address of source - 1.  */
	andl	$3, %ecx

        call    2f
2:      popl    %edx
	/* 0xb is the distance between 2: and 1:.  */
        leal    0xb(%edx,%ecx,8), %ecx
        jmp     *%ecx

        .align 8
1:  /* ECX == 0 */
        orb     (%esi), %al
        jz      L(end)
        stosb
        xorl    %eax, %eax
        incl    %esi
    /* ECX == 1 */
        orb     (%esi), %al
        jz      L(end)
        stosb
        xorl    %eax, %eax
        incl    %esi
    /* ECX == 2 */
        orb     (%esi), %al
        jz      L(end)
        stosb
        xorl    %eax, %eax
        incl    %esi
    /* ECX == 3 */
L(1):   movl    (%esi), %ecx
        leal    4(%esi),%esi

This fails if there are instruction length changes before L(1):.  This
patch replaces it with conditional branches:

	cmpb	$2, %cl
	je	L(Src2)
	ja	L(Src3)
	cmpb	$1, %cl
	je	L(Src1)

L(Src0):

which have similar performance and work with any instruction lengths.

Tested on i586 and i686 with and without --disable-multi-arch.

	[BZ #22353]
	* sysdeps/i386/i586/strcpy.S (STRCPY): Use conditional branches.
	(1): Renamed to ...
	(L(Src0)): This.
	(L(Src1)): New.
	(L(Src2)): Likewise.
	(L(1)): Renamed to ...
	(L(Src3)): This.
2017-10-30 10:02:30 -07:00
..
fpu i386: Regenerate libm-test-ulps for for gcc 7 2017-10-27 14:09:14 -07:00
i586 i586: Use conditional branches in strcpy.S [BZ #22353] 2017-10-30 10:02:30 -07:00
i686 i386: Replace assembly versions of e_powf with generic e_powf.c 2017-10-22 08:12:41 -07:00
i786
nptl Remove CALL_THREAD_FCT macro 2017-04-04 18:03:35 -03:00
sys Fix mcontext_t sigcontext namespace (bug 21457). 2017-08-30 22:02:04 +00:00
Implies Add float128 support for x86_64, x86. 2017-06-26 22:02:24 +00:00
Makefile Enable unwind info in libc-start.c and backtrace.c 2017-09-19 15:07:58 +01:00
Versions
____longjmp_chk.S
__longjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
abort-instr.h
add_n.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
addmul_1.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
asm-syntax.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
atomic-machine.h Optimize generic spinlock code and use C11 like atomic macros. 2017-06-06 09:41:56 +02:00
backtrace.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
bcopy.S Add i386 memset and memcpy assembly functions 2015-08-27 09:04:54 -07:00
bsd-_setjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
bsd-setjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
bzero.S Add i386 memset and memcpy assembly functions 2015-08-27 09:04:54 -07:00
cacheinfo.c Move sysdeps/x86_64/cacheinfo.c to sysdeps/x86 2016-05-08 08:49:18 -07:00
configure Don't use hidden visibility in libc.a with PIE on i386 2017-10-04 17:18:42 -07:00
configure.ac Don't use hidden visibility in libc.a with PIE on i386 2017-10-04 17:18:42 -07:00
crti.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
crtn.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-irel.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-lookupcfg.h elf: Remove internal_function attribute 2017-08-31 16:59:37 +02:00
dl-machine.h Revert x86: Allow undefined _DYNAMIC in static executable 2017-10-03 17:49:09 -07:00
dl-procinfo.c x86: Set dl_platform and dl_hwcap from CPU features [BZ #21391] 2017-05-03 13:44:35 -07:00
dl-tls.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-tlsdesc.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
dl-tlsdesc.h elf: Remove internal_function attribute 2017-08-31 16:59:37 +02:00
dl-trampoline.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ffs.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gccframe.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
gmp-mparam.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
htonl.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
htons.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
i386-mcount.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
init-arch.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
jmpbuf-offsets.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
jmpbuf-unwind.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ldbl2mpn.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
ldsodefs.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
link-defines.sym Preserve bound registers for pointer pass/return 2015-07-09 06:50:12 -07:00
lshift.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
machine-gmon.h Mark internal functions with attribute_hidden [BZ #18822] 2017-10-01 15:07:23 -07:00
malloc-alignment.h i386: Increase MALLOC_ALIGNMENT to 16 [BZ #21120] 2017-06-30 09:11:24 -07:00
memchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcopy.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcpy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memcpy_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memmove.S Add i386 memset and memcpy assembly functions 2015-08-27 09:04:54 -07:00
memmove_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mempcpy.S Add i386 memset and memcpy assembly functions 2015-08-27 09:04:54 -07:00
mempcpy_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memset.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memset_chk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
memusage.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
mp_clz_tab.c
mul_1.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
preconfigure Move base_machine and machine settings from configure.ac to sysdeps preconfigure fragments. 2014-06-25 17:52:56 +00:00
pthread_spin_trylock.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
rawmemchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
rshift.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
setfpucw.c Check if SSE is available with HAS_CPU_FEATURE 2017-04-07 07:44:59 -07:00
setjmp.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stackguard-macros.h BZ #15754: CVE-2013-4788 2013-09-23 00:52:09 -04:00
stackinfo.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
start.S i386: Use "movl main@GOT(%ebx), %eax" in start.S 2017-10-03 17:54:30 -07:00
stpcpy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
stpncpy.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcat.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strchrnul.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strcspn.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
string-inlines.c Remove bits/string.h. 2017-06-20 08:21:24 -04:00
strlen.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strlen.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strpbrk.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strrchr.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
strspn.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
sub_n.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
submul_1.S Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
symbol-hacks.h Build divdi3 only for architecture that required it 2017-04-06 15:14:34 -03:00
sysdep.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tls-macros.h i386: Fix build by GCC 5.0 2014-12-30 11:37:41 -08:00
tlsdesc.c elf: Remove internal_function attribute 2017-08-31 16:59:37 +02:00
tlsdesc.sym
tst-audit.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-audit3.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-audit3.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-auditmod3a.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-auditmod3b.c Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-ld-sse-use.sh Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00
tst-stack-align.h Update copyright dates with scripts/update-copyrights. 2017-01-01 00:14:16 +00:00