Skip to content

Commit

Permalink
x86_64: Always use builtin memcpy on gcc 4.3
Browse files Browse the repository at this point in the history
Jan asked to always use the builtin memcpy on gcc 4.3 mainline because
it should generate better code than the old macro. Let's try it.

Cc: Jan Hubicka <jh@suse.cz>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Jul 22, 2007
1 parent 5b74e3a commit aac57f8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion include/asm-x86_64/string.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ return (to);
function. */

#define __HAVE_ARCH_MEMCPY 1
#if (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) || __GNUC__ > 4
extern void *memcpy(void *to, const void *from, size_t len);
#else
extern void *__memcpy(void *to, const void *from, size_t len);
#define memcpy(dst,src,len) \
({ size_t __len = (len); \
Expand All @@ -38,7 +41,7 @@ extern void *__memcpy(void *to, const void *from, size_t len);
else \
__ret = __builtin_memcpy((dst),(src),__len); \
__ret; })

#endif

#define __HAVE_ARCH_MEMSET
void *memset(void *s, int c, size_t n);
Expand Down

0 comments on commit aac57f8

Please sign in to comment.