Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

CRISv32: Add arch optimized strcmp.

Add an optimized strcmp for CRISv32. This improves strcmp performance
with about 25% when comparing a 55 character string with itself.

Signed-off-by: Edgar Iglesias <edgar@axis.com>
Acked-by: Jesper Nilsson <jesper.nilsson@axis.com>

+28 -1
+1 -1
arch/cris/arch-v32/lib/Makefile
··· 3 3 # 4 4 5 5 lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o \ 6 - csumcpfruser.o spinlock.o delay.o 6 + csumcpfruser.o spinlock.o delay.o strcmp.o 7 7
+21
arch/cris/arch-v32/lib/strcmp.S
··· 1 + ; strcmp.S -- CRISv32 version. 2 + ; Copyright (C) 2008 AXIS Communications AB 3 + ; Written by Edgar E. Iglesias 4 + ; 5 + ; This source code is licensed under the GNU General Public License, 6 + ; Version 2. See the file COPYING for more details. 7 + 8 + .global strcmp 9 + .type strcmp,@function 10 + strcmp: 11 + 1: 12 + move.b [$r10+], $r12 13 + seq $r13 14 + sub.b [$r11+], $r12 15 + or.b $r12, $r13 16 + beq 1b 17 + nop 18 + 19 + ret 20 + movs.b $r12, $r10 21 + .size strcmp, . - strcmp
+6
arch/cris/include/asm/string.h
··· 11 11 #define __HAVE_ARCH_MEMSET 12 12 extern void *memset(void *, int, size_t); 13 13 14 + #ifdef CONFIG_ETRAX_ARCH_V32 15 + /* For v32 we provide strcmp. */ 16 + #define __HAVE_ARCH_STRCMP 17 + extern int strcmp(const char *s1, const char *s2); 18 + #endif 19 + 14 20 #endif