aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc/lib/memcmp_32.S
blob: 9e21f0282659203d3e556fecc17a3171653620e2 (plain)
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
	.text
	.align 4
	.global __memcmp, memcmp
__memcmp:
memcmp:
	cmp	%o2, 0
	ble	L3
	 mov	0, %g3
L5:
	ldub	[%o0], %g2
	ldub	[%o1], %g3
	sub	%g2, %g3, %g2
	mov	%g2, %g3
	sll	%g2, 24, %g2

	cmp	%g2, 0
	bne	L3
	 add	%o0, 1, %o0

	add	%o2, -1, %o2

	cmp	%o2, 0
	bg	L5
	 add	%o1, 1, %o1
L3:
	sll	%g3, 24, %o0
	sra	%o0, 24, %o0

	retl
	 nop