~linaro-toolchain-dev/cortex-strings/trunk

« back to all changes in this revision

Viewing changes to src/reference/glibc/strlen.S

  • Committer: Michael Hope
  • Date: 2010-08-26 22:34:40 UTC
  • Revision ID: michael.hope@linaro.org-20100826223440-ddib3epkpb63yfct
Made the different routines compile.  Expanded the tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18
18
   02111-1307 USA.  */
19
19
 
20
 
#include <sysdep.h>
21
 
 
22
20
/* size_t strlen(const char *S)
23
21
 * entry: r0 -> string
24
22
 * exit: r0 = len
25
23
 */
26
24
 
27
 
ENTRY(strlen)
 
25
strlen: 
28
26
        bic     r1, r0, $3              @ addr of word containing first byte
29
27
        ldr     r2, [r1], $4            @ get the first word
30
28
        ands    r3, r0, $3              @ how many bytes are duff?
68
66
        tstne   r2, $0x00ff0000         @ (if first three all non-zero, 4th
69
67
        addne   r0, r0, $1              @  must be zero)
70
68
#endif
71
 
        DO_RET(lr)
72
 
END(strlen)
73
 
libc_hidden_builtin_def (strlen)
 
69
        bx lr
 
70