diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-08-11 21:33:13 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-08-11 21:33:13 -0400 |
commit | aaa9eb5101e3a748218fb9373dd9655b50582da2 (patch) | |
tree | 3b756d667add7460ff46739c965b380c00471166 /src/string/x86_64 | |
parent | 036eaa24cf573c69982ba18dd427de68f6eeba2a (diff) | |
download | musl-aaa9eb5101e3a748218fb9373dd9655b50582da2.tar.gz |
memcpy asm for i386 and x86_64
Diffstat (limited to 'src/string/x86_64')
-rw-r--r-- | src/string/x86_64/memcpy.s | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/string/x86_64/memcpy.s b/src/string/x86_64/memcpy.s new file mode 100644 index 00000000..1282dc3b --- /dev/null +++ b/src/string/x86_64/memcpy.s @@ -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 |