# HG changeset patch # User Mychaela Falconia # Date 1477952078 0 # Node ID 3670e7768ab627dbc98448deaaea0e5109ea3918 # Parent cbc6bc05d4940f479f19efa307f945b160500925 target-utils/libc: strlen optimized assembly implementation added diff -r cbc6bc05d494 -r 3670e7768ab6 target-utils/libc/Makefile --- a/target-utils/libc/Makefile Mon Oct 31 21:33:05 2016 +0000 +++ b/target-utils/libc/Makefile Mon Oct 31 22:14:38 2016 +0000 @@ -5,8 +5,8 @@ RANLIB= arm-elf-ranlib OBJS= atoi.o bzero.o ctype_.o index.o memcmp.o memcpy.o memcpy16.o memcpy32.o\ - memset.o rindex.o strcasecmp.o strcat.o strcmp.o strcpy.o strncat.o \ - strncmp.o strncpy.o + memset.o rindex.o strcasecmp.o strcat.o strcmp.o strcpy.o strlen.o \ + strncat.o strncmp.o strncpy.o all: libc.a diff -r cbc6bc05d494 -r 3670e7768ab6 target-utils/libc/strlen.S --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/target-utils/libc/strlen.S Mon Oct 31 22:14:38 2016 +0000 @@ -0,0 +1,10 @@ + .text + .code 32 + .globl strlen +strlen: + mov r1, r0 +1: ldrb r2, [r0], #1 + cmn r2, #0 + bne 1b + sbc r0, r0, r1 + bx lr