public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* PATCH: memcpy doubles as mempcy, not bcopy
@ 2000-06-25 17:18 Greg McGary
  2000-06-25 17:38 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Greg McGary @ 2000-06-25 17:18 UTC (permalink / raw)
  To: libc-hacker

This was a pretty stupid, but had no impact non-BP code, and still
doesn't...

Here's where the file is included from:
i586/mempcpy.S:#include <sysdeps/i386/i586/memcpy.S>

OK?

2000-06-25  Greg McGary  <greg@mcgary.org>

	* sysdeps/i386/i586/memcpy.S: redefine memcpy as mempcpy,
	not as bcopy.

Index: memcpy.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/i386/i586/memcpy.S,v
retrieving revision 1.2
diff -u -p -r1.2 memcpy.S
--- memcpy.S	2000/06/09 06:14:39	1.2
+++ memcpy.S	2000/06/26 00:11:55
@@ -22,16 +22,14 @@
 #include "asm-syntax.h"
 #include "bp-asm.h"
 
-/* BEWARE: `#ifdef memset' means that memset is redefined as `bzero' */
-#define BCOPY_P (defined memcpy)
+/* BEWARE: `#ifdef memcpy' means that memcpy is redefined as `mempcpy',
+   and the return value is the byte after the last one copied in
+   the destination. */
+#define MEMPCPY_P (defined memcpy)
 
 #define PARMS	LINKAGE+8	/* space for 2 saved regs */
-#if BCOPY_P
-# define DEST	PARMS
-#else
-# define RTN	PARMS
-# define DEST	RTN+RTN_SIZE
-#endif
+#define RTN	PARMS
+#define DEST	RTN+RTN_SIZE
 #define SRC	DEST+PTR_SIZE
 #define LEN	SRC+PTR_SIZE
 
@@ -99,13 +97,13 @@ L(3):	movl	28(%edi), %edx
 
 	/* Correct extra loop counter modification.  */
 L(2):	addl	$32, %ecx
-#if !BCOPY_P
+#if !MEMPCPY_P
 	movl	DEST(%esp), %eax
 #endif
 
 L(1):	rep; movsb
 
-#if BCOPY_P
+#if MEMPCPY_P
 	movl	%edi, %eax
 #endif
 
@@ -113,9 +111,5 @@ L(1):	rep; movsb
 	popl	%edi
 
 	LEAVE
-#if BCOPY_P
-	ret
-#else
 	RET_PTR
-#endif
 END (memcpy)

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: PATCH: memcpy doubles as mempcy, not bcopy
  2000-06-25 17:18 PATCH: memcpy doubles as mempcy, not bcopy Greg McGary
@ 2000-06-25 17:38 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2000-06-25 17:38 UTC (permalink / raw)
  To: Greg McGary; +Cc: libc-hacker

Greg McGary <greg@kayak.mcgary.org> writes:

> 2000-06-25  Greg McGary  <greg@mcgary.org>
> 
> 	* sysdeps/i386/i586/memcpy.S: redefine memcpy as mempcpy,
> 	not as bcopy.

I've applied the patch.  Thanks,

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-06-25 17:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-25 17:18 PATCH: memcpy doubles as mempcy, not bcopy Greg McGary
2000-06-25 17:38 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).