aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2009-06-10 09:06:55 -0400
committerJesper Nilsson <jesper.nilsson@axis.com>2009-06-10 09:21:03 -0400
commit7f2ff23db1de53ea8695bb4a7c1cfab88886e3fd (patch)
tree3e3b4d823322052d83fc2e80b755cafdc50219dd /arch/cris
parentb0903ee8e4853eea35cb24cfb4dda1b60c7948dc (diff)
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>
Diffstat (limited to 'arch/cris')
-rw-r--r--arch/cris/arch-v32/lib/Makefile2
-rw-r--r--arch/cris/arch-v32/lib/strcmp.S21
-rw-r--r--arch/cris/include/asm/string.h6
3 files changed, 28 insertions, 1 deletions
diff --git a/arch/cris/arch-v32/lib/Makefile b/arch/cris/arch-v32/lib/Makefile
index eb4aad1f1158..dd296b9db034 100644
--- a/arch/cris/arch-v32/lib/Makefile
+++ b/arch/cris/arch-v32/lib/Makefile
@@ -3,5 +3,5 @@
3# 3#
4 4
5lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o \ 5lib-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
diff --git a/arch/cris/arch-v32/lib/strcmp.S b/arch/cris/arch-v32/lib/strcmp.S
new file mode 100644
index 000000000000..8f7a1ee62591
--- /dev/null
+++ b/arch/cris/arch-v32/lib/strcmp.S
@@ -0,0 +1,21 @@
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
10strcmp:
111:
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
diff --git a/arch/cris/include/asm/string.h b/arch/cris/include/asm/string.h
index 691190e99a27..d5db39f9eea1 100644
--- a/arch/cris/include/asm/string.h
+++ b/arch/cris/include/asm/string.h
@@ -11,4 +11,10 @@ extern void *memcpy(void *, const void *, size_t);
11#define __HAVE_ARCH_MEMSET 11#define __HAVE_ARCH_MEMSET
12extern void *memset(void *, int, size_t); 12extern 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
17extern int strcmp(const char *s1, const char *s2);
18#endif
19
14#endif 20#endif