Changeset View
Changeset View
Standalone View
Standalone View
head/lib/libc/amd64/string/memmove.S
Show First 20 Lines • Show All 133 Lines • ▼ Show 20 Lines | 100001: | ||||
movb (%rsi),%dl | movb (%rsi),%dl | ||||
movb %dl,(%rdi) | movb %dl,(%rdi) | ||||
100000: | 100000: | ||||
\end | \end | ||||
ret | ret | ||||
ALIGN_TEXT | ALIGN_TEXT | ||||
1256: | 1256: | ||||
testb $15,%dil | |||||
jnz 100f | |||||
.if \erms == 1 | .if \erms == 1 | ||||
rep | rep | ||||
movsb | movsb | ||||
.else | .else | ||||
shrq $3,%rcx /* copy by 64-bit words */ | shrq $3,%rcx /* copy by 64-bit words */ | ||||
rep | rep | ||||
movsq | movsq | ||||
movq %rdx,%rcx | |||||
andl $7,%ecx /* any bytes left? */ | |||||
jne 100408b | |||||
.endif | |||||
\end | |||||
ret | |||||
100: | |||||
movq (%rsi),%r8 | |||||
movq 8(%rsi),%r9 | |||||
movq %rdi,%r10 | |||||
movq %rdi,%rcx | |||||
andq $15,%rcx | |||||
leaq -16(%rdx,%rcx),%rdx | |||||
neg %rcx | |||||
leaq 16(%rdi,%rcx),%rdi | |||||
leaq 16(%rsi,%rcx),%rsi | |||||
movq %rdx,%rcx | |||||
.if \erms == 1 | |||||
rep | |||||
movsb | |||||
movq %r8,(%r10) | |||||
movq %r9,8(%r10) | |||||
.else | |||||
shrq $3,%rcx /* copy by 64-bit words */ | |||||
rep | |||||
movsq | |||||
movq %r8,(%r10) | |||||
movq %r9,8(%r10) | |||||
movq %rdx,%rcx | movq %rdx,%rcx | ||||
andl $7,%ecx /* any bytes left? */ | andl $7,%ecx /* any bytes left? */ | ||||
jne 100408b | jne 100408b | ||||
.endif | .endif | ||||
\end | \end | ||||
ret | ret | ||||
.if \overlap == 1 | .if \overlap == 1 | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |