diff options
author | Greg McGary <greg@mcgary.org> | 2000-06-09 06:14:39 +0000 |
---|---|---|
committer | Greg McGary <greg@mcgary.org> | 2000-06-09 06:14:39 +0000 |
commit | 3f02f778cdbec7d95e0a9d6f9368ce9cda0a6d03 (patch) | |
tree | a193d5f40640e64b7b6555e831772c1934e2a8d0 /sysdeps/i386/i486 | |
parent | a40fb915f89d0e225058c0865de4504f83f90173 (diff) | |
download | glibc-3f02f778cdbec7d95e0a9d6f9368ce9cda0a6d03.tar.gz glibc-3f02f778cdbec7d95e0a9d6f9368ce9cda0a6d03.tar.xz glibc-3f02f778cdbec7d95e0a9d6f9368ce9cda0a6d03.zip |
* sysdeps/i386/bp-asm.h: New file.
* sysdeps/i386/__longjmp.S: Define & use symbolic argument stack offsets. Add ENTER/LEAVE macros for optionally maintaining frame-pointer chain when debugging. * sysdeps/i386/add_n.S: Likewise. * sysdeps/i386/addmul_1.S: Likewise. * sysdeps/i386/lshift.S: Likewise. * sysdeps/i386/memchr.S: Likewise. * sysdeps/i386/memcmp.S: Likewise. * sysdeps/i386/mul_1.S: Likewise. * sysdeps/i386/rawmemchr.S: Likewise. * sysdeps/i386/rshift.S: Likewise. * sysdeps/i386/stpcpy.S: Likewise. * sysdeps/i386/stpncpy.S: Likewise. * sysdeps/i386/strchr.S: Likewise. * sysdeps/i386/strchrnul.S: Likewise. * sysdeps/i386/strcspn.S: Likewise. * sysdeps/i386/strpbrk.S: Likewise. * sysdeps/i386/strrchr.S: Likewise. * sysdeps/i386/strspn.S: Likewise. * sysdeps/i386/strtok.S: Likewise. * sysdeps/i386/sub_n.S: Likewise. * sysdeps/i386/submul_1.S: Likewise. * sysdeps/i386/elf/setjmp.S: Likewise. * sysdeps/i386/i486/strcat.S: Likewise. * sysdeps/i386/i486/strlen.S: Likewise. * sysdeps/i386/i586/add_n.S: Likewise. * sysdeps/i386/i586/lshift.S: Likewise. * sysdeps/i386/i586/memcpy.S: Likewise. * sysdeps/i386/i586/memset.S: Likewise. * sysdeps/i386/i586/rshift.S: Likewise. * sysdeps/i386/i586/strchr.S: Likewise. * sysdeps/i386/i586/strcpy.S: Likewise. * sysdeps/i386/i586/strlen.S: Likewise. * sysdeps/i386/i586/sub_n.S: Likewise. * sysdeps/i386/i686/add_n.S: Likewise. * sysdeps/i386/i686/memcpy.S: Likewise. * sysdeps/i386/i686/mempcpy.S: Likewise. * sysdeps/i386/i686/memset.S: Likewise. * sysdeps/i386/i686/strcmp.S: Likewise. 2000-06-08 Greg McGary <greg@mcgary.org> * sysdeps/i386/bp-asm.h: New file. * sysdeps/i386/__longjmp.S: Define & use symbolic argument stack offsets. Add ENTER/LEAVE macros for optionally maintaining frame-pointer chain when debugging. * sysdeps/i386/add_n.S: Likewise. * sysdeps/i386/addmul_1.S: Likewise. * sysdeps/i386/lshift.S: Likewise. * sysdeps/i386/memchr.S: Likewise. * sysdeps/i386/memcmp.S: Likewise. * sysdeps/i386/mul_1.S: Likewise. * sysdeps/i386/rawmemchr.S: Likewise. * sysdeps/i386/rshift.S: Likewise. * sysdeps/i386/stpcpy.S: Likewise. * sysdeps/i386/stpncpy.S: Likewise. * sysdeps/i386/strchr.S: Likewise. * sysdeps/i386/strchrnul.S: Likewise. * sysdeps/i386/strcspn.S: Likewise. * sysdeps/i386/strpbrk.S: Likewise. * sysdeps/i386/strrchr.S: Likewise. * sysdeps/i386/strspn.S: Likewise. * sysdeps/i386/strtok.S: Likewise. * sysdeps/i386/sub_n.S: Likewise. * sysdeps/i386/submul_1.S: Likewise. * sysdeps/i386/elf/setjmp.S: Likewise. * sysdeps/i386/i486/strcat.S: Likewise. * sysdeps/i386/i486/strlen.S: Likewise. * sysdeps/i386/i586/add_n.S: Likewise. * sysdeps/i386/i586/lshift.S: Likewise. * sysdeps/i386/i586/memcpy.S: Likewise. * sysdeps/i386/i586/memset.S: Likewise. * sysdeps/i386/i586/rshift.S: Likewise. * sysdeps/i386/i586/strchr.S: Likewise. * sysdeps/i386/i586/strcpy.S: Likewise. * sysdeps/i386/i586/strlen.S: Likewise. * sysdeps/i386/i586/sub_n.S: Likewise. * sysdeps/i386/i686/add_n.S: Likewise. * sysdeps/i386/i686/memcpy.S: Likewise. * sysdeps/i386/i686/mempcpy.S: Likewise. * sysdeps/i386/i686/memset.S: Likewise. * sysdeps/i386/i686/strcmp.S: Likewise.
Diffstat (limited to 'sysdeps/i386/i486')
-rw-r--r-- | sysdeps/i386/i486/strcat.S | 23 | ||||
-rw-r--r-- | sysdeps/i386/i486/strlen.S | 16 |
2 files changed, 22 insertions, 17 deletions
diff --git a/sysdeps/i386/i486/strcat.S b/sysdeps/i386/i486/strcat.S index c3893315e7..c4ab170389 100644 --- a/sysdeps/i386/i486/strcat.S +++ b/sysdeps/i386/i486/strcat.S @@ -1,6 +1,6 @@ /* strcat(dest, src) -- Append SRC on the end of DEST. For Intel 80x86, x>=4. - Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper <drepper@ipd.info.uni-karlsruhe.de>. Optimised a little by Alan Modra <Alan@SPRI.Levels.UniSA.Edu.Au> @@ -22,19 +22,21 @@ #include <sysdep.h> #include "asm-syntax.h" +#include "bp-asm.h" -/* - INPUT PARAMETERS: - dest (sp + 4) - src (sp + 8) -*/ +#define PARMS LINKAGE+4 /* space for 1 saved reg */ +#define RTN PARMS +#define DEST RTN+RTN_SIZE +#define SRC DEST+PTR_SIZE .text ENTRY (strcat) + ENTER + pushl %edi /* Save callee-safe register. */ - movl 12(%esp), %ecx /* load source pointer */ - movl 8(%esp), %edx /* load destination pointer */ + movl DEST(%esp), %edx + movl SRC(%esp), %ecx testb $0xff, (%ecx) /* Is source string empty? */ jz L(8) /* yes => return */ @@ -254,8 +256,9 @@ L(9): movb %al, (%ecx,%edx) /* store first byte of last word */ movb %ah, 3(%ecx,%edx) /* store fourth byte of last word */ -L(8): movl 8(%esp), %eax /* start address of destination is result */ +L(8): movl DEST(%esp), %eax /* start address of destination is result */ popl %edi /* restore saved register */ - ret + LEAVE + RET_PTR END (strcat) diff --git a/sysdeps/i386/i486/strlen.S b/sysdeps/i386/i486/strlen.S index 4a25011016..d19a3457cf 100644 --- a/sysdeps/i386/i486/strlen.S +++ b/sysdeps/i386/i486/strlen.S @@ -1,6 +1,6 @@ /* strlen(str) -- determine the length of the string STR. Optimized for Intel 80x86, x>=4. - Copyright (C) 1991, 92, 93, 94, 95, 96, 97 Free Software Foundation, Inc. + Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 2000 Free Software Foundation, Inc. Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>. This file is part of the GNU C Library. @@ -21,15 +21,16 @@ #include <sysdep.h> #include "asm-syntax.h" +#include "bp-asm.h" -/* - INPUT PARAMETERS: - str (sp + 4) -*/ +#define PARMS LINKAGE /* no space for saved regs */ +#define STR PARMS .text ENTRY (strlen) - movl 4(%esp), %ecx /* get string pointer */ + ENTER + + movl STR(%esp), %ecx movl %ecx, %eax /* duplicate it */ andl $3, %ecx /* mask alignment bits */ @@ -127,7 +128,8 @@ L(3): testb %cl, %cl /* is first byte NUL? */ jz L(2) /* yes => return pointer */ incl %eax /* increment pointer */ -L(2): subl 4(%esp), %eax /* compute difference to string start */ +L(2): subl STR(%esp), %eax /* compute difference to string start */ + LEAVE ret END (strlen) |