aboutsummaryrefslogtreecommitdiff
path: root/arch/cris/arch-v32/lib
diff options
context:
space:
mode:
authorJesper Nilsson <jesper.nilsson@axis.com>2009-06-10 15:06:55 +0200
committerJesper Nilsson <jesper.nilsson@axis.com>2009-06-10 15:21:03 +0200
commit7f2ff23db1de53ea8695bb4a7c1cfab88886e3fd (patch)
tree3e3b4d823322052d83fc2e80b755cafdc50219dd /arch/cris/arch-v32/lib
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/arch-v32/lib')
-rw-r--r--arch/cris/arch-v32/lib/Makefile2
-rw-r--r--arch/cris/arch-v32/lib/strcmp.S21
2 files changed, 22 insertions, 1 deletions
diff --git a/arch/cris/arch-v32/lib/Makefile b/arch/cris/arch-v32/lib/Makefile
index eb4aad1f115..dd296b9db03 100644
--- a/arch/cris/arch-v32/lib/Makefile
+++ b/arch/cris/arch-v32/lib/Makefile
@@ -3,5 +3,5 @@
#
lib-y = checksum.o checksumcopy.o string.o usercopy.o memset.o \
- csumcpfruser.o spinlock.o delay.o
+ csumcpfruser.o spinlock.o delay.o strcmp.o
diff --git a/arch/cris/arch-v32/lib/strcmp.S b/arch/cris/arch-v32/lib/strcmp.S
new file mode 100644
index 00000000000..8f7a1ee6259
--- /dev/null
+++ b/arch/cris/arch-v32/lib/strcmp.S
@@ -0,0 +1,21 @@
+; strcmp.S -- CRISv32 version.
+; Copyright (C) 2008 AXIS Communications AB
+; Written by Edgar E. Iglesias
+;
+; This source code is licensed under the GNU General Public License,
+; Version 2. See the file COPYING for more details.
+
+ .global strcmp
+ .type strcmp,@function
+strcmp:
+1:
+ move.b [$r10+], $r12
+ seq $r13
+ sub.b [$r11+], $r12
+ or.b $r12, $r13
+ beq 1b
+ nop
+
+ ret
+ movs.b $r12, $r10
+ .size strcmp, . - strcmp