X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstring%2Fi386%2Fmemcpy.s;fp=src%2Fstring%2Fi386%2Fmemcpy.s;h=b2977c89286628ad51afc1733d79e6ae5bd0415d;hp=0000000000000000000000000000000000000000;hb=aaa9eb5101e3a748218fb9373dd9655b50582da2;hpb=036eaa24cf573c69982ba18dd427de68f6eeba2a diff --git a/src/string/i386/memcpy.s b/src/string/i386/memcpy.s new file mode 100644 index 00000000..b2977c89 --- /dev/null +++ b/src/string/i386/memcpy.s @@ -0,0 +1,29 @@ +.global memcpy +.type memcpy,@function +memcpy: + push %esi + push %edi + mov 12(%esp),%edi + mov 16(%esp),%esi + mov 20(%esp),%ecx + mov %edi,%eax + cmp $4,%ecx + jc 1f + test $3,%edi + jz 1f +2: movsb + dec %ecx + test $3,%edi + jnz 2b +1: mov %ecx,%edx + shr $2,%ecx + rep + movsl + and $3,%edx + jz 1f +2: movsb + dec %edx + jnz 2b +1: pop %edi + pop %esi + ret