LibC: Cleanup memmove and memcpy for x86_64

This commit is contained in:
Bananymous 2025-08-16 14:05:21 +03:00
parent b6793cc6f2
commit ceca93c8b1
1 changed files with 1 additions and 3 deletions

View File

@ -27,22 +27,20 @@ memcmp:
memcpy:
movq %rdi, %rax
movq %rdx, %rcx
movq %rdi, %rdx
rep movsb
movq %rdx, %rax
ret
.global memmove
memmove:
cmpq %rdi, %rsi
jae memcpy
movq %rdi, %rax
leaq -1(%rdi, %rdx), %rdi
leaq -1(%rsi, %rdx), %rsi
movq %rdx, %rcx
std
rep movsb
cld
leaq 1(%rdi), %rax
ret
.global memset