memcpy asm for i386 and x86_64
This commit is contained in:
parent
036eaa24cf
commit
aaa9eb5101
2 changed files with 51 additions and 0 deletions
22
src/string/x86_64/memcpy.s
Normal file
22
src/string/x86_64/memcpy.s
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
.global memcpy
|
||||
.type memcpy,@function
|
||||
memcpy:
|
||||
mov %rdi,%rax
|
||||
cmp $8,%rdx
|
||||
jc 1f
|
||||
test $7,%edi
|
||||
jz 1f
|
||||
2: movsb
|
||||
dec %rdx
|
||||
test $7,%edi
|
||||
jnz 2b
|
||||
1: mov %rdx,%rcx
|
||||
shr $3,%rcx
|
||||
rep
|
||||
movsq
|
||||
and $7,%edx
|
||||
jz 1f
|
||||
2: movsb
|
||||
dec %edx
|
||||
jnz 2b
|
||||
1: ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue