Fix mtl_rmemcpy32 incorrectly calculating the number of bytes and words

This commit is contained in:
Madeline Busig 2024-03-07 15:53:10 -07:00
parent c9091951f8
commit 236b5661ad

View File

@ -117,7 +117,7 @@ add r1, r2
sub r0, #1 sub r0, #1
sub r1, #1 sub r1, #1
// r12 = num residual bytes // r12 = num residual bytes
and r12, r2, #3 and r12, r2, #2
.Lrbyte_copy: .Lrbyte_copy:
subs r12, #1 subs r12, #1
ldrcsb r3, [r1], #-1 ldrcsb r3, [r1], #-1
@ -125,6 +125,7 @@ and r12, r2, #3
bhi .Lrbyte_copy bhi .Lrbyte_copy
// r12 = num residual words // r12 = num residual words
lsr r12, r2, #2 lsr r12, r2, #2
and r12, #3
// Move to the beginning of the current word // Move to the beginning of the current word
sub r0, #3 sub r0, #3
sub r1, #3 sub r1, #3