repo.or.cz
/
linux
/
fpc-iii.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
x86/boot: Rename overlapping memcpy() to memmove()
[linux/fpc-iii.git]
/
arch
/
sparc
/
lib
/
strncmp_32.S
blob
c0d1b568c1c561f443356678d06ae6b7d4831053
1
/*
2
* strncmp.S: Hand optimized Sparc assembly of GCC output from GNU libc
3
* generic strncmp routine.
4
*/
5
6
#include <linux/linkage.h>
7
8
.text
9
ENTRY(strncmp)
10
mov %o0, %g3
11
mov 0, %o3
12
13
cmp %o2, 3
14
ble 7f
15
mov 0, %g2
16
17
sra %o2, 2, %o4
18
ldub [%g3], %o3
19
20
0:
21
ldub [%o1], %g2
22
add %g3, 1, %g3
23
and %o3, 0xff, %o0
24
25
cmp %o0, 0
26
be 8f
27
add %o1, 1, %o1
28
29
cmp %o0, %g2
30
be,a 1f
31
ldub [%g3], %o3
32
33
retl
34
sub %o0, %g2, %o0
35
36
1:
37
ldub [%o1], %g2
38
add %g3,1, %g3
39
and %o3, 0xff, %o0
40
41
cmp %o0, 0
42
be 8f
43
add %o1, 1, %o1
44
45
cmp %o0, %g2
46
be,a 1f
47
ldub [%g3], %o3
48
49
retl
50
sub %o0, %g2, %o0
51
52
1:
53
ldub [%o1], %g2
54
add %g3, 1, %g3
55
and %o3, 0xff, %o0
56
57
cmp %o0, 0
58
be 8f
59
add %o1, 1, %o1
60
61
cmp %o0, %g2
62
be,a 1f
63
ldub [%g3], %o3
64
65
retl
66
sub %o0, %g2, %o0
67
68
1:
69
ldub [%o1], %g2
70
add %g3, 1, %g3
71
and %o3, 0xff, %o0
72
73
cmp %o0, 0
74
be 8f
75
add %o1, 1, %o1
76
77
cmp %o0, %g2
78
be 1f
79
add %o4, -1, %o4
80
81
retl
82
sub %o0, %g2, %o0
83
84
1:
85
86
cmp %o4, 0
87
bg,a 0b
88
ldub [%g3], %o3
89
90
b 7f
91
and %o2, 3, %o2
92
93
9:
94
ldub [%o1], %g2
95
add %g3, 1, %g3
96
and %o3, 0xff, %o0
97
98
cmp %o0, 0
99
be 8f
100
add %o1, 1, %o1
101
102
cmp %o0, %g2
103
be 7f
104
add %o2, -1, %o2
105
106
8:
107
retl
108
sub %o0, %g2, %o0
109
110
7:
111
cmp %o2, 0
112
bg,a 9b
113
ldub [%g3], %o3
114
115
and %g2, 0xff, %o0
116
retl
117
sub %o3, %o0, %o0
118
ENDPROC(strncmp)