File: strncmp_32.S

package info (click to toggle)
linux 4.19.20-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 954,852 kB
  • sloc: ansic: 16,749,828; asm: 271,286; makefile: 38,257; sh: 32,808; perl: 27,671; python: 21,022; cpp: 5,063; yacc: 4,648; lex: 2,585; awk: 1,385; ruby: 25; sed: 5
file content (121 lines) | stat: -rw-r--r-- 1,351 bytes parent folder | download | duplicates (18)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* SPDX-License-Identifier: GPL-2.0 */
/*
 * strncmp.S: Hand optimized Sparc assembly of GCC output from GNU libc
 *            generic strncmp routine.
 */

#include <linux/linkage.h>
#include <asm/export.h>

	.text
ENTRY(strncmp)
	mov	%o0, %g3
	mov	0, %o3

	cmp	%o2, 3
	ble	7f
	 mov	0, %g2

	sra	%o2, 2, %o4
	ldub	[%g3], %o3

0:
	ldub	[%o1], %g2
	add	%g3, 1, %g3
	and	%o3, 0xff, %o0

	cmp	%o0, 0
	be	8f
	 add	%o1, 1, %o1

	cmp	%o0, %g2
	be,a	1f
	 ldub	[%g3], %o3

	retl
	 sub	%o0, %g2, %o0

1:
	ldub	[%o1], %g2
	add	%g3,1, %g3
	and	%o3, 0xff, %o0

	cmp	%o0, 0
	be	8f
	 add	%o1, 1, %o1

	cmp	%o0, %g2
	be,a	1f
	 ldub	[%g3], %o3

	retl
	 sub	%o0, %g2, %o0

1:
	ldub	[%o1], %g2
	add	%g3, 1, %g3
	and	%o3, 0xff, %o0

	cmp	%o0, 0
	be	8f
	 add	%o1, 1, %o1

	cmp	%o0, %g2
	be,a	1f
	 ldub	[%g3], %o3

	retl
	 sub	%o0, %g2, %o0

1:
	ldub	[%o1], %g2
	add	%g3, 1, %g3
	and	%o3, 0xff, %o0

	cmp	%o0, 0
	be	8f
	 add	%o1, 1, %o1

	cmp	%o0, %g2
	be	1f
	 add	%o4, -1, %o4

	retl
	 sub	%o0, %g2, %o0

1:

	cmp	%o4, 0
	bg,a	0b
	 ldub	[%g3], %o3

	b	7f
	 and	%o2, 3, %o2

9:
	ldub	[%o1], %g2
	add	%g3, 1, %g3
	and	%o3, 0xff, %o0

	cmp	%o0, 0
	be	8f
	 add	%o1, 1, %o1

	cmp	%o0, %g2
	be	7f
	 add	%o2, -1, %o2

8:
	retl
	 sub	%o0, %g2, %o0

7:
	cmp	%o2, 0
	bg,a	9b
	 ldub	[%g3], %o3

	and	%g2, 0xff, %o0
	retl
	 sub	%o3, %o0, %o0
ENDPROC(strncmp)
EXPORT_SYMBOL(strncmp)