Update to the latest agbabi memcpy

This commit is contained in:
Gwilym Kuiper 2022-06-24 21:12:14 +01:00
parent 65727d1c93
commit fcbaacac1b

View file

@ -15,17 +15,13 @@
*/
.arm
.align 4
.align 2
.section .iwram.__aeabi_memcpy, "ax", %progbits
.global __agbabi_memcpy
__agbabi_memcpy:
.global __aeabi_memcpy
__aeabi_memcpy:
// Handle <= 2 byte copies byte-by-byte
cmp r2, #2
ble .Lcopy1
// Check pointer alignment
eor r3, r1, r0
// JoaoBapt carry & sign bit test
@ -34,9 +30,13 @@ __aeabi_memcpy:
bcs .Lcopy2
.Lcopy4:
// Handle <= 2 byte copies byte-by-byte
cmp r2, #2
ble .Lcopy1
// Copy half and byte head
rsb r3, r0, #4
// JoaoBapt carry & sign bit test
movs r3, r3, lsl #31
ldrmib r3, [r1], #1
strmib r3, [r0], #1
@ -73,6 +73,7 @@ __aeabi_memcpy4:
bhs .LcopyWords
// Copy half and byte tail
// JoaoBapt carry & sign bit test
movs r3, r2, lsl #31
ldrcsh r3, [r1], #2
strcsh r3, [r0], #2
@ -83,6 +84,7 @@ __aeabi_memcpy4:
.Lcopy2:
// Copy byte head
tst r0, #1
cmpne r2, #0
ldrneb r3, [r1], #1
strneb r3, [r0], #1
subne r2, r2, #1