2013-03-11 Roland McGrath <roland@hack.frob.com>
+ * sysdeps/arm/memcpy.S: Convert to unified assembly syntax.
+ * sysdeps/arm/memmove.S: Likewise.
+ * sysdeps/arm/memset.S: Likewise.
+ * sysdeps/arm/strlen.S: Likewise.
+
* sysdeps/arm/memcpy.S: Use r10 instead of r9.
* sysdeps/arm/memmove.S: Likewise.
#endif
.text
+ .syntax unified
/* Prototype: void *memcpy(void *dest, const void *src, size_t n); */
CALGN( ands ip, r1, #31 )
CALGN( rsb r3, ip, #32 )
- CALGN( sbcnes r4, r3, r2 ) @ C is always set here
+ CALGN( sbcsne r4, r3, r2 ) @ C is always set here
CALGN( bcs 2f )
CALGN( adr r4, 6f )
CALGN( subs r2, r2, r3 ) @ C gets set
cfi_restore (r8)
8: movs r2, r2, lsl #31
- ldrneb r3, [r1], #1
- ldrcsb r4, [r1], #1
- ldrcsb ip, [r1]
- strneb r3, [r0], #1
- strcsb r4, [r0], #1
- strcsb ip, [r0]
+ ldrbne r3, [r1], #1
+ ldrbcs r4, [r1], #1
+ ldrbcs ip, [r1]
+ strbne r3, [r0], #1
+ strbcs r4, [r0], #1
+ strbcs ip, [r0]
#if defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
pop {r0, r4, lr}
9: rsb ip, ip, #4
cmp ip, #2
- ldrgtb r3, [r1], #1
- ldrgeb r4, [r1], #1
+ ldrbgt r3, [r1], #1
+ ldrbge r4, [r1], #1
ldrb lr, [r1], #1
- strgtb r3, [r0], #1
- strgeb r4, [r0], #1
+ strbgt r3, [r0], #1
+ strbge r4, [r0], #1
subs r2, r2, ip
strb lr, [r0], #1
blt 8b
CALGN( ands ip, r1, #31 )
CALGN( rsb ip, ip, #32 )
- CALGN( sbcnes r4, ip, r2 ) @ C is always set here
+ CALGN( sbcsne r4, ip, r2 ) @ C is always set here
CALGN( subcc r2, r2, ip )
CALGN( bcc 15f )
#endif
.text
+ .syntax unified
/*
* Prototype: void *memmove(void *dest, const void *src, size_t n);
blt 5f
CALGN( ands ip, r1, #31 )
- CALGN( sbcnes r4, ip, r2 ) @ C is always set here
+ CALGN( sbcsne r4, ip, r2 ) @ C is always set here
CALGN( bcs 2f )
CALGN( adr r4, 6f )
CALGN( subs r2, r2, ip ) @ C is set here
cfi_restore (r8)
8: movs r2, r2, lsl #31
- ldrneb r3, [r1, #-1]!
- ldrcsb r4, [r1, #-1]!
- ldrcsb ip, [r1, #-1]
- strneb r3, [r0, #-1]!
- strcsb r4, [r0, #-1]!
- strcsb ip, [r0, #-1]
+ ldrbne r3, [r1, #-1]!
+ ldrbcs r4, [r1, #-1]!
+ ldrbcs ip, [r1, #-1]
+ strbne r3, [r0, #-1]!
+ strbcs r4, [r0, #-1]!
+ strbcs ip, [r0, #-1]
#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
pop {r0, r4, lr}
cfi_restore_state
9: cmp ip, #2
- ldrgtb r3, [r1, #-1]!
- ldrgeb r4, [r1, #-1]!
+ ldrbgt r3, [r1, #-1]!
+ ldrbge r4, [r1, #-1]!
ldrb lr, [r1, #-1]!
- strgtb r3, [r0, #-1]!
- strgeb r4, [r0, #-1]!
+ strbgt r3, [r0, #-1]!
+ strbge r4, [r0, #-1]!
subs r2, r2, ip
strb lr, [r0, #-1]!
blt 8b
CALGN( ands ip, r1, #31 )
CALGN( rsb ip, ip, #32 )
- CALGN( sbcnes r4, ip, r2 ) @ C is always set here
+ CALGN( sbcsne r4, ip, r2 ) @ C is always set here
CALGN( subcc r2, r2, ip )
CALGN( bcc 15f )
#define NO_THUMB
#include <sysdep.h>
+ .text
+ .syntax unified
+
/* void *memset (dstpp, c, len) */
ENTRY(memset)
1:
tst r3, #3 @ aligned yet?
- strneb r1, [r3], #1
+ strbne r1, [r3], #1
subne r2, r2, #1
bne 1b
1:
subs r2, r2, #8
- stmcsia r3!, {r1, ip} @ store up to 32 bytes per loop iteration
- subcss r2, r2, #8
- stmcsia r3!, {r1, ip}
- subcss r2, r2, #8
- stmcsia r3!, {r1, ip}
- subcss r2, r2, #8
- stmcsia r3!, {r1, ip}
+ stmiacs r3!, {r1, ip} @ store up to 32 bytes per loop iteration
+ subscs r2, r2, #8
+ stmiacs r3!, {r1, ip}
+ subscs r2, r2, #8
+ stmiacs r3!, {r1, ip}
+ subscs r2, r2, #8
+ stmiacs r3!, {r1, ip}
bcs 1b
and r2, r2, #7
2:
subs r2, r2, #1 @ store up to 4 bytes per loop iteration
- strcsb r1, [r3], #1
- subcss r2, r2, #1
- strcsb r1, [r3], #1
- subcss r2, r2, #1
- strcsb r1, [r3], #1
- subcss r2, r2, #1
- strcsb r1, [r3], #1
+ strbcs r1, [r3], #1
+ subscs r2, r2, #1
+ strbcs r1, [r3], #1
+ subscs r2, r2, #1
+ strbcs r1, [r3], #1
+ subscs r2, r2, #1
+ strbcs r1, [r3], #1
bcs 2b
-
+
DO_RET(lr)
END(memset)
libc_hidden_builtin_def (memset)
* exit: r0 = len
*/
+ .syntax unified
+ .text
+
ENTRY(strlen)
bic r1, r0, $3 @ addr of word containing first byte
ldr r2, [r1], $4 @ get the first word