LibC: Cleanup memmove and memcpy for x86_64
This commit is contained in:
parent
b6793cc6f2
commit
ceca93c8b1
|
@ -27,22 +27,20 @@ memcmp:
|
||||||
memcpy:
|
memcpy:
|
||||||
movq %rdi, %rax
|
movq %rdi, %rax
|
||||||
movq %rdx, %rcx
|
movq %rdx, %rcx
|
||||||
movq %rdi, %rdx
|
|
||||||
rep movsb
|
rep movsb
|
||||||
movq %rdx, %rax
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.global memmove
|
.global memmove
|
||||||
memmove:
|
memmove:
|
||||||
cmpq %rdi, %rsi
|
cmpq %rdi, %rsi
|
||||||
jae memcpy
|
jae memcpy
|
||||||
|
movq %rdi, %rax
|
||||||
leaq -1(%rdi, %rdx), %rdi
|
leaq -1(%rdi, %rdx), %rdi
|
||||||
leaq -1(%rsi, %rdx), %rsi
|
leaq -1(%rsi, %rdx), %rsi
|
||||||
movq %rdx, %rcx
|
movq %rdx, %rcx
|
||||||
std
|
std
|
||||||
rep movsb
|
rep movsb
|
||||||
cld
|
cld
|
||||||
leaq 1(%rdi), %rax
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.global memset
|
.global memset
|
||||||
|
|
Loading…
Reference in New Issue