diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-09-14 20:38:01 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-09-14 20:38:01 +0000 |
commit | b6cfea1299f5d86b17508fd7a52e3fb5bc40bb63 (patch) | |
tree | e9332999951fc4997669b733fd868f3936bdd558 /sysdeps/arm/memset.S | |
parent | 9b995718ae13f142edbeb9fcda7dbc48106486da (diff) | |
download | glibc-b6cfea1299f5d86b17508fd7a52e3fb5bc40bb63.tar.gz glibc-b6cfea1299f5d86b17508fd7a52e3fb5bc40bb63.tar.xz glibc-b6cfea1299f5d86b17508fd7a52e3fb5bc40bb63.zip |
Update.
2003-09-14 Ulrich Drepper <drepper@redhat.com> * dirent/dirent.h: Remove __THROW from scandir. 2003-09-14 Philip Blundell <philb@gnu.org> * sysdeps/unix/sysv/linux/arm/mmap.S: Use sys_mmap2 if it's known to be available. * sysdeps/unix/sysv/linux/arm/mmap64.S: Optimise code a little. * sysdeps/arm/memset.S: Rewrite.
Diffstat (limited to 'sysdeps/arm/memset.S')
-rw-r--r-- | sysdeps/arm/memset.S | 75 |
1 files changed, 37 insertions, 38 deletions
diff --git a/sysdeps/arm/memset.S b/sysdeps/arm/memset.S index 0b624139eb..1e2699d077 100644 --- a/sysdeps/arm/memset.S +++ b/sysdeps/arm/memset.S @@ -22,47 +22,46 @@ /* void *memset (dstpp, c, len) */ ENTRY(memset) - mov a4, a1 - cmp a3, $8 @ at least 8 bytes to do? - blt 2f - orr a2, a2, a2, lsl $8 - orr a2, a2, a2, lsl $16 + mov r3, r0 + cmp r2, #8 + bcc 2f @ less than 8 bytes to move + 1: - tst a4, $3 @ aligned yet? - strneb a2, [a4], $1 - subne a3, a3, $1 + tst r3, #3 @ aligned yet? + strneb r1, [r3], #1 + subne r2, r2, #1 bne 1b - mov ip, a2 + + orr r1, r1, r1, lsl $8 + orr r1, r1, r1, lsl $16 + 1: - cmp a3, $8 @ 8 bytes still to do? - blt 2f - stmia a4!, {a2, ip} - sub a3, a3, $8 - cmp a3, $8 @ 8 bytes still to do? - blt 2f - stmia a4!, {a2, ip} - sub a3, a3, $8 - cmp a3, $8 @ 8 bytes still to do? - blt 2f - stmia a4!, {a2, ip} - sub a3, a3, $8 - cmp a3, $8 @ 8 bytes still to do? - stmgeia a4!, {a2, ip} - subge a3, a3, $8 - bge 1b + subs r2, r2, #8 + strcs r1, [r3], #4 @ store up to 32 bytes per loop iteration + strcs r1, [r3], #4 + subcss r2, r2, #8 + strcs r1, [r3], #4 + strcs r1, [r3], #4 + subcss r2, r2, #8 + strcs r1, [r3], #4 + strcs r1, [r3], #4 + subcss r2, r2, #8 + strcs r1, [r3], #4 + strcs r1, [r3], #4 + bcs 1b + + and r2, r2, #7 2: - movs a3, a3 @ anything left? - RETINSTR(moveq,pc,lr) @ nope - rsb a3, a3, $7 - add pc, pc, a3, lsl $2 - mov r0, r0 - strb a2, [a4], $1 - strb a2, [a4], $1 - strb a2, [a4], $1 - strb a2, [a4], $1 - strb a2, [a4], $1 - strb a2, [a4], $1 - strb a2, [a4], $1 - RETINSTR(mov,pc,lr) + 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 + bcs 2b + + DO_RET(lr) END(memset) libc_hidden_builtin_def (memset) |