mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Use agbabi's fix for small copies / sets
This commit is contained in:
parent
e5d35e50c8
commit
5ca8cb8bf7
|
@ -29,11 +29,11 @@ __aeabi_memcpy:
|
||||||
bmi .Lcopy1
|
bmi .Lcopy1
|
||||||
bcs .Lcopy2
|
bcs .Lcopy2
|
||||||
|
|
||||||
// If the number of bytes to copy is less than 4, we should just copy one byte at a time
|
|
||||||
cmp r2, #4
|
|
||||||
bmi .Lcopy1
|
|
||||||
|
|
||||||
.Lcopy4:
|
.Lcopy4:
|
||||||
|
// Handle <= 2 byte copies byte-by-byte
|
||||||
|
cmp r2, #2
|
||||||
|
ble .Lcopy1
|
||||||
|
|
||||||
// Copy half and byte head
|
// Copy half and byte head
|
||||||
rsb r3, r0, #4
|
rsb r3, r0, #4
|
||||||
movs r3, r3, lsl #31
|
movs r3, r3, lsl #31
|
||||||
|
|
|
@ -34,6 +34,17 @@ __aeabi_memset:
|
||||||
// Fallthrough
|
// Fallthrough
|
||||||
|
|
||||||
.LskipShifts:
|
.LskipShifts:
|
||||||
|
// Handle <= 2 byte set byte-by-byte
|
||||||
|
cmp r1, #2
|
||||||
|
bgt .LskipShortHead
|
||||||
|
movs r1, r1, lsl #31
|
||||||
|
// Set byte and half
|
||||||
|
strmib r2, [r0], #1
|
||||||
|
strcsb r2, [r0], #1
|
||||||
|
strcsb r2, [r0]
|
||||||
|
bx lr
|
||||||
|
|
||||||
|
.LskipShortHead:
|
||||||
// JoaoBapt carry & sign bit test
|
// JoaoBapt carry & sign bit test
|
||||||
rsb r3, r0, #4
|
rsb r3, r0, #4
|
||||||
movs r3, r3, lsl #31
|
movs r3, r3, lsl #31
|
||||||
|
|
Loading…
Reference in a new issue