diff options
author | Hale Wang <hale.wang@arm.com> | 2015-06-01 12:49:37 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-06-01 12:49:37 +0200 |
commit | 24e054c8c8ed59b4b1009f81dc2760b914ad5b00 (patch) | |
tree | 6a6adc6280e2ca5e7f486e12e1cbedf3618681b3 /newlib/libc/machine/arm/aeabi_memmove-thumb.S | |
parent | b27c7d1d9a21496b0584a6f1252f66539151b42a (diff) | |
download | cygnal-24e054c8c8ed59b4b1009f81dc2760b914ad5b00.tar.gz cygnal-24e054c8c8ed59b4b1009f81dc2760b914ad5b00.tar.bz2 cygnal-24e054c8c8ed59b4b1009f81dc2760b914ad5b00.zip |
Update the assembler code to support old ARM architectures.
* libc/machine/arm/aeabi_memmove-arm.S (__aeabi_memmove): Update the
assembler implementation.
* libc/machine/arm/aeabi_memmove-thumb.S (__aeabi_memmove): Ditto.
* libc/machine/arm/aeabi_memmove-thumb2.S (__aeabi_memmove): Ditto.
* libc/machine/arm/aeabi_memset-arm.S (__aeabi_memset): Ditto.
* libc/machine/arm/aeabi_memset-thumb.S (__aeabi_memset): Ditto.
* libc/machine/arm/aeabi_memset-thumb2.S (__aeabi_memset): Ditto.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc/machine/arm/aeabi_memmove-thumb.S')
-rw-r--r-- | newlib/libc/machine/arm/aeabi_memmove-thumb.S | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/newlib/libc/machine/arm/aeabi_memmove-thumb.S b/newlib/libc/machine/arm/aeabi_memmove-thumb.S index 52e9e07b6..61a72581c 100644 --- a/newlib/libc/machine/arm/aeabi_memmove-thumb.S +++ b/newlib/libc/machine/arm/aeabi_memmove-thumb.S @@ -33,32 +33,34 @@ ASM_ALIAS __aeabi_memmove4 __aeabi_memmove ASM_ALIAS __aeabi_memmove8 __aeabi_memmove __aeabi_memmove: - .cfi_startproc push {r4, lr} cmp r0, r1 - bls .L9 - adds r3, r1, r2 - cmp r0, r3 - bcc .L3 -.L9: + bls 3f + adds r4, r1, r2 + cmp r0, r4 + bcs 3f + subs r3, r2, #1 + cmp r2, #0 + beq 2f + subs r2, r4, r2 +1: + ldrb r1, [r2, r3] + strb r1, [r0, r3] + subs r3, r3, #1 + bcs 1b +2: + pop {r4} + pop {r1} + bx r1 +3: movs r3, #0 - b .L4 -.L3: - subs r3, r3, r2 -.L5: - subs r2, r2, #1 - bcc .L10 - ldrb r1, [r3, r2] - strb r1, [r0, r2] - b .L5 -.L4: - cmp r3, r2 - beq .L10 + cmp r2, #0 + beq 2b +4: ldrb r4, [r1, r3] strb r4, [r0, r3] adds r3, r3, #1 - b .L4 -.L10: - pop {r4, pc} - .cfi_endproc + cmp r2, r3 + bne 4b + b 2b .size __aeabi_memmove, . - __aeabi_memmove |