Fix algorithm to align source pointer correctly.

This commit is contained in:
Andreas Jaeger 2002-11-12 17:57:51 +00:00
parent 7ceef50ec9
commit 7288b24f0c

View file

@ -141,11 +141,13 @@ ENTRY (BP_SYM (strcat))
2:
/* Second step: Copy source to destination. */
movq %rax, %rcx /* duplicate */
movq %rsi, %rcx /* duplicate */
andl $7,%ecx /* mask alignment bits */
movq %rax, %rdx /* move around */
jz 22f /* aligned => start loop */
neg %ecx /* align to 8 bytes. */
addl $8, %ecx
/* Align the source pointer. */
21:
movb (%rsi), %al /* Fetch a byte */