Fix algorithm to align source pointer correctly.
This commit is contained in:
parent
7ceef50ec9
commit
7288b24f0c
@ -141,11 +141,13 @@ ENTRY (BP_SYM (strcat))
|
|||||||
2:
|
2:
|
||||||
/* Second step: Copy source to destination. */
|
/* Second step: Copy source to destination. */
|
||||||
|
|
||||||
movq %rax, %rcx /* duplicate */
|
movq %rsi, %rcx /* duplicate */
|
||||||
andl $7,%ecx /* mask alignment bits */
|
andl $7,%ecx /* mask alignment bits */
|
||||||
movq %rax, %rdx /* move around */
|
movq %rax, %rdx /* move around */
|
||||||
jz 22f /* aligned => start loop */
|
jz 22f /* aligned => start loop */
|
||||||
|
|
||||||
|
neg %ecx /* align to 8 bytes. */
|
||||||
|
addl $8, %ecx
|
||||||
/* Align the source pointer. */
|
/* Align the source pointer. */
|
||||||
21:
|
21:
|
||||||
movb (%rsi), %al /* Fetch a byte */
|
movb (%rsi), %al /* Fetch a byte */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user