about summary refs log tree commit diff
path: root/sysdeps/i386/i486
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/i486')
-rw-r--r--sysdeps/i386/i486/strcat.S23
-rw-r--r--sysdeps/i386/i486/strlen.S16
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)