blob: 92dd80544602053fc245b5112bd55f7184315e2e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* Copyright 2002 Andi Kleen */
2
3 #include <asm/cpufeature.h>
4/*
5 * memcpy - Copy a memory block.
6 *
7 * Input:
8 * rdi destination
9 * rsi source
10 * rdx count
11 *
12 * Output:
13 * rax original destination
Andi Kleena5b250a2005-11-05 17:25:54 +010014 *
15 * TODO: check best memcpy for PSC
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 */
17
18 .globl __memcpy
19 .globl memcpy
20 .p2align 4
21__memcpy:
22memcpy:
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 movq %rdi,%rax
24 movl %edx,%ecx
25 shrl $3,%ecx
26 andl $7,%edx
27 rep
28 movsq
29 movl %edx,%ecx
30 rep
31 movsb
32 ret