aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/lib/memcmp.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/lib/memcmp.S')
-rw-r--r--arch/sparc/lib/memcmp.S27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/sparc/lib/memcmp.S b/arch/sparc/lib/memcmp.S
new file mode 100644
index 000000000000..efa106c41ed0
--- /dev/null
+++ b/arch/sparc/lib/memcmp.S
@@ -0,0 +1,27 @@
1/* Sparc optimized memcmp code.
2 *
3 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
4 * Copyright (C) 2000, 2008 David S. Miller (davem@davemloft.net)
5 */
6
7#include <linux/linkage.h>
8#include <asm/asm.h>
9
10 .text
11ENTRY(memcmp)
12 cmp %o2, 0
131: BRANCH32(be, pn, 2f)
14 nop
15 ldub [%o0], %g7
16 ldub [%o1], %g3
17 sub %o2, 1, %o2
18 add %o0, 1, %o0
19 add %o1, 1, %o1
20 subcc %g7, %g3, %g3
21 BRANCH32(be, pt, 1b)
22 cmp %o2, 0
23 retl
24 mov %g3, %o0
252: retl
26 mov 0, %o0
27ENDPROC(memcmp)