projects
/
linux-2.4.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
more debug output
[linux-2.4.git]
/
arch
/
x86_64
/
lib
/
memcpy.S
1
/* Copyright 2002 Andi Kleen */
2
3
/*
4
* memcpy - Copy a memory block.
5
*
6
* Input:
7
* rdi destination
8
* rsi source
9
* rdx count
10
*
11
* Output:
12
* rax original destination
13
*/
14
15
.globl __memcpy
16
.globl memcpy
17
.p2align 4
18
__memcpy:
19
memcpy:
20
pushq %rbx
21
movq %rdi,%rax
22
23
movl %edx,%ecx
24
shrl $6,%ecx
25
jz .Lhandle_tail
26
27
.p2align 4
28
.Lloop_64:
29
decl %ecx
30
31
movq (%rsi),%r11
32
movq 8(%rsi),%r8
33
34
movq %r11,(%rdi)
35
movq %r8,1*8(%rdi)
36
37
movq 2*8(%rsi),%r9
38
movq 3*8(%rsi),%r10
39
40
movq %r9,2*8(%rdi)
41
movq %r10,3*8(%rdi)
42
43
movq 4*8(%rsi),%r11
44
movq 5*8(%rsi),%r8
45
46
movq %r11,4*8(%rdi)
47
movq %r8,5*8(%rdi)
48
49
movq 6*8(%rsi),%r9
50
movq 7*8(%rsi),%r10
51
52
movq %r9,6*8(%rdi)
53
movq %r10,7*8(%rdi)
54
55
leaq 64(%rsi),%rsi
56
leaq 64(%rdi),%rdi
57
jnz .Lloop_64
58
59
.Lhandle_tail:
60
movl %edx,%ecx
61
andl $63,%ecx
62
shrl $3,%ecx
63
jz .Lhandle_7
64
.p2align 4
65
.Lloop_8:
66
decl %ecx
67
movq (%rsi),%r8
68
movq %r8,(%rdi)
69
leaq 8(%rdi),%rdi
70
leaq 8(%rsi),%rsi
71
jnz .Lloop_8
72
73
.Lhandle_7:
74
movl %edx,%ecx
75
andl $7,%ecx
76
jz .Lende
77
.p2align 4
78
.Lloop_1:
79
movb (%rsi),%r8b
80
movb %r8b,(%rdi)
81
incq %rdi
82
incq %rsi
83
decl %ecx
84
jnz .Lloop_1
85
86
.Lende:
87
popq %rbx
88
ret
89