summary refs log tree commit diff
path: root/sysdeps/i386/memcmp.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/i386/memcmp.S')
-rw-r--r--sysdeps/i386/memcmp.S22
1 files changed, 12 insertions, 10 deletions
diff --git a/sysdeps/i386/memcmp.S b/sysdeps/i386/memcmp.S
index 723b5025ff..a1cbadb621 100644
--- a/sysdeps/i386/memcmp.S
+++ b/sysdeps/i386/memcmp.S
@@ -1,5 +1,5 @@
 /* Compare two memory blocks for differences in the first COUNT bytes.
-   Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
+   Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -19,23 +19,24 @@
 
 #include <sysdep.h>
 #include "asm-syntax.h"
+#include "bp-asm.h"
 
-/*
-   INPUT PARAMETERS:
-   block1	(sp + 4)
-   block2	(sp + 8)
-   len		(sp + 12)
-*/
+#define PARMS	LINKAGE+4	/* space for 1 saved reg */
+#define BLK1	PARMS
+#define BLK2	BLK1+PTR_SIZE
+#define LEN	BLK2+PTR_SIZE
 
 	.text
 ENTRY (memcmp)
+	ENTER
+
 	pushl %esi		/* Save callee-safe registers.  */
 	movl %edi, %edx		/* Note that %edx is not used and can
 				   so be used to save %edi.  It's faster.  */
 
-	movl 8(%esp), %esi	/* Load address of block #1.  */
-	movl 12(%esp), %edi	/* Load address of block #2.  */
-	movl 16(%esp), %ecx	/* Load maximal length of compare area.  */
+	movl BLK1(%esp), %esi
+	movl BLK2(%esp), %edi
+	movl LEN(%esp), %ecx
 
 	cld			/* Set direction of comparison.  */
 
@@ -61,6 +62,7 @@ ENTRY (memcmp)
 L(1):	popl %esi		/* Restore registers.  */
 	movl %edx, %edi
 
+	LEAVE
 	ret
 END (memcmp)