diff options
Diffstat (limited to 'arch/sparc64/lib/memcmp.S')
-rw-r--r-- | arch/sparc64/lib/memcmp.S | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/sparc64/lib/memcmp.S b/arch/sparc64/lib/memcmp.S new file mode 100644 index 000000000000..c90ad96c51b9 --- /dev/null +++ b/arch/sparc64/lib/memcmp.S | |||
@@ -0,0 +1,28 @@ | |||
1 | /* $Id: memcmp.S,v 1.3 2000/03/23 07:51:08 davem Exp $ | ||
2 | * Sparc64 optimized memcmp code. | ||
3 | * | ||
4 | * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | ||
5 | * Copyright (C) 2000 David S. Miller (davem@redhat.com) | ||
6 | */ | ||
7 | |||
8 | .text | ||
9 | .align 32 | ||
10 | .globl __memcmp, memcmp | ||
11 | __memcmp: | ||
12 | memcmp: | ||
13 | cmp %o2, 0 ! IEU1 Group | ||
14 | loop: be,pn %icc, ret_0 ! CTI | ||
15 | nop ! IEU0 | ||
16 | ldub [%o0], %g7 ! LSU Group | ||
17 | ldub [%o1], %g3 ! LSU Group | ||
18 | sub %o2, 1, %o2 ! IEU0 | ||
19 | add %o0, 1, %o0 ! IEU1 | ||
20 | add %o1, 1, %o1 ! IEU0 Group | ||
21 | subcc %g7, %g3, %g3 ! IEU1 Group | ||
22 | be,pt %icc, loop ! CTI | ||
23 | cmp %o2, 0 ! IEU1 Group | ||
24 | |||
25 | ret_n0: retl | ||
26 | mov %g3, %o0 | ||
27 | ret_0: retl | ||
28 | mov 0, %o0 | ||