summaryrefslogtreecommitdiffstats
path: root/libc-top-half/musl/src/string/x86_64/memcpy.s
diff options
context:
space:
mode:
Diffstat (limited to 'libc-top-half/musl/src/string/x86_64/memcpy.s')
-rw-r--r--libc-top-half/musl/src/string/x86_64/memcpy.s25
1 files changed, 25 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/string/x86_64/memcpy.s b/libc-top-half/musl/src/string/x86_64/memcpy.s
new file mode 100644
index 0000000..3d960ef
--- /dev/null
+++ b/libc-top-half/musl/src/string/x86_64/memcpy.s
@@ -0,0 +1,25 @@
+.global memcpy
+.global __memcpy_fwd
+.hidden __memcpy_fwd
+.type memcpy,@function
+memcpy:
+__memcpy_fwd:
+ 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