aboutsummaryrefslogtreecommitdiff
path: root/S/byte_copy.S
diff options
context:
space:
mode:
Diffstat (limited to 'S/byte_copy.S')
-rw-r--r--S/byte_copy.S23
1 files changed, 23 insertions, 0 deletions
diff --git a/S/byte_copy.S b/S/byte_copy.S
new file mode 100644
index 0000000..44ff449
--- /dev/null
+++ b/S/byte_copy.S
@@ -0,0 +1,23 @@
+.globl byte_copy
+.type byte_copy, @function
+byte_copy:
+ pushl %edi
+ pushl %esi
+ movl 12(%esp), %edi
+ movl 16(%esp), %ecx
+ movl 20(%esp), %esi
+ cld
+
+#ifdef BYTE_COPY_FAST
+ movl %ecx, %eax
+ shrl $2, %ecx
+ andl $3, %eax
+
+ rep movsl
+ movl %eax, %ecx
+#endif
+ rep movsb
+
+ popl %esi
+ popl %edi
+ ret