implement _cu_memmove in AArch64

This commit is contained in:
mykola2312 2022-05-19 01:04:20 +03:00
parent a80088be55
commit 219bfa538d

View file

@ -47,6 +47,29 @@ _cu_memcpy:
ret ret
_cu_memmove: _cu_memmove:
// x0 - dst, x1 - src, x2 - size
cmp x0, x1
beq .move0
blt .less1
add x0, x0, x2
add x1, x1, x2
sub x0, x0, #1
sub x1, x1, #1
.greater1:
ldrb w3, [x1]
strb w3, [x0]
sub x0, x0, #1
sub x1, x1, #1
subs x2, x2, #1
bne .greater1
b .move0
.less1:
ldrb w3, [x1], #1
strb w3, [x0], #1
subs x2, x2, #1
bne .less1
.move0:
ret ret
_cu_memcmp: _cu_memcmp: