about summary refs log tree commit diff
path: root/src/string/x86_64/memmove.s
blob: 247f0ac387973ce0c39c507f96e590552c74a77d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
.global memmove
.type memmove,@function
memmove:
	mov %rdi,%rax
	sub %rsi,%rax
	cmp %rdx,%rax
	jae memcpy
	mov %rdx,%rcx
	lea -1(%rdi,%rdx),%rdi
	lea -1(%rsi,%rdx),%rsi
	std
	rep movsb
	cld
	lea 1(%rdi),%rax
	ret