mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Merge pull request #241 from gwilymk/update-to-use-agbabis-fix
Use agbabi's official fix for small copies / sets
This commit is contained in:
commit
e0e6686ac3
|
@ -29,11 +29,11 @@ __aeabi_memcpy:
|
|||
bmi .Lcopy1
|
||||
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:
|
||||
// Handle <= 2 byte copies byte-by-byte
|
||||
cmp r2, #2
|
||||
ble .Lcopy1
|
||||
|
||||
// Copy half and byte head
|
||||
rsb r3, r0, #4
|
||||
movs r3, r3, lsl #31
|
||||
|
|
|
@ -34,6 +34,17 @@ __aeabi_memset:
|
|||
// Fallthrough
|
||||
|
||||
.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
|
||||
rsb r3, r0, #4
|
||||
movs r3, r3, lsl #31
|
||||
|
|
Loading…
Reference in a new issue