2005-04-17 06:20:36 +08:00
|
|
|
/* Copyright 2002 Andi Kleen */
|
|
|
|
|
|
|
|
#include <asm/cpufeature.h>
|
|
|
|
/*
|
|
|
|
* memcpy - Copy a memory block.
|
|
|
|
*
|
|
|
|
* Input:
|
|
|
|
* rdi destination
|
|
|
|
* rsi source
|
|
|
|
* rdx count
|
|
|
|
*
|
|
|
|
* Output:
|
|
|
|
* rax original destination
|
2005-11-06 00:25:54 +08:00
|
|
|
*
|
|
|
|
* TODO: check best memcpy for PSC
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
.globl __memcpy
|
|
|
|
.globl memcpy
|
|
|
|
.p2align 4
|
|
|
|
__memcpy:
|
|
|
|
memcpy:
|
|
|
|
movq %rdi,%rax
|
|
|
|
movl %edx,%ecx
|
|
|
|
shrl $3,%ecx
|
|
|
|
andl $7,%edx
|
|
|
|
rep
|
|
|
|
movsq
|
|
|
|
movl %edx,%ecx
|
|
|
|
rep
|
|
|
|
movsb
|
|
|
|
ret
|