xref: /openbmc/linux/arch/sparc/lib/strncmp_64.S (revision 4f3db074)
1/*
2 * Sparc64 optimized strncmp code.
3 *
4 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 */
6
7#include <linux/linkage.h>
8#include <asm/asi.h>
9
10	.text
11ENTRY(strncmp)
12	brlez,pn %o2, 3f
13	 lduba	[%o0] (ASI_PNF), %o3
141:
15	add	%o0, 1, %o0
16	ldub	[%o1], %o4
17	brz,pn	%o3, 2f
18	 add	%o1, 1, %o1
19	cmp	%o3, %o4
20	bne,pn	%icc, 2f
21	 subcc	%o2, 1, %o2
22	bne,a,pt %xcc, 1b
23	 ldub	[%o0], %o3
242:
25	retl
26	 sub	%o3, %o4, %o0
273:
28	retl
29	 clr	%o0
30ENDPROC(strncmp)
31