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/speculation/mds: Fix documentation typo
[linux/fpc-iii.git]
/
arch
/
sparc
/
lib
/
strncmp_32.S
blob
794733f036b6c66653b582b120e5e2f615aa89e9
1
/* SPDX-License-Identifier: GPL-2.0 */
2
/*
3
* strncmp.S: Hand optimized Sparc assembly of GCC output from GNU libc
4
* generic strncmp routine.
5
*/
6
7
#include <linux/linkage.h>
8
#include <asm/export.h>
9
10
.text
11
ENTRY(strncmp)
12
mov %o0, %g3
13
mov 0, %o3
14
15
cmp %o2, 3
16
ble 7f
17
mov 0, %g2
18
19
sra %o2, 2, %o4
20
ldub [%g3], %o3
21
22
0:
23
ldub [%o1], %g2
24
add %g3, 1, %g3
25
and %o3, 0xff, %o0
26
27
cmp %o0, 0
28
be 8f
29
add %o1, 1, %o1
30
31
cmp %o0, %g2
32
be,a 1f
33
ldub [%g3], %o3
34
35
retl
36
sub %o0, %g2, %o0
37
38
1:
39
ldub [%o1], %g2
40
add %g3,1, %g3
41
and %o3, 0xff, %o0
42
43
cmp %o0, 0
44
be 8f
45
add %o1, 1, %o1
46
47
cmp %o0, %g2
48
be,a 1f
49
ldub [%g3], %o3
50
51
retl
52
sub %o0, %g2, %o0
53
54
1:
55
ldub [%o1], %g2
56
add %g3, 1, %g3
57
and %o3, 0xff, %o0
58
59
cmp %o0, 0
60
be 8f
61
add %o1, 1, %o1
62
63
cmp %o0, %g2
64
be,a 1f
65
ldub [%g3], %o3
66
67
retl
68
sub %o0, %g2, %o0
69
70
1:
71
ldub [%o1], %g2
72
add %g3, 1, %g3
73
and %o3, 0xff, %o0
74
75
cmp %o0, 0
76
be 8f
77
add %o1, 1, %o1
78
79
cmp %o0, %g2
80
be 1f
81
add %o4, -1, %o4
82
83
retl
84
sub %o0, %g2, %o0
85
86
1:
87
88
cmp %o4, 0
89
bg,a 0b
90
ldub [%g3], %o3
91
92
b 7f
93
and %o2, 3, %o2
94
95
9:
96
ldub [%o1], %g2
97
add %g3, 1, %g3
98
and %o3, 0xff, %o0
99
100
cmp %o0, 0
101
be 8f
102
add %o1, 1, %o1
103
104
cmp %o0, %g2
105
be 7f
106
add %o2, -1, %o2
107
108
8:
109
retl
110
sub %o0, %g2, %o0
111
112
7:
113
cmp %o2, 0
114
bg,a 9b
115
ldub [%g3], %o3
116
117
and %g2, 0xff, %o0
118
retl
119
sub %o3, %o0, %o0
120
ENDPROC(strncmp)
121
EXPORT_SYMBOL(strncmp)