implement _cu_memmove in AArch64
This commit is contained in:
parent
a80088be55
commit
219bfa538d
1 changed files with 23 additions and 0 deletions
|
|
@ -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:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue