xref: /openbmc/linux/arch/sparc/lib/strncmp_64.S (revision 4f6cce39)
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#include <asm/export.h>
10
11	.text
12ENTRY(strncmp)
13	brlez,pn %o2, 3f
14	 lduba	[%o0] (ASI_PNF), %o3
151:
16	add	%o0, 1, %o0
17	ldub	[%o1], %o4
18	brz,pn	%o3, 2f
19	 add	%o1, 1, %o1
20	cmp	%o3, %o4
21	bne,pn	%icc, 2f
22	 subcc	%o2, 1, %o2
23	bne,a,pt %xcc, 1b
24	 ldub	[%o0], %o3
252:
26	retl
27	 sub	%o3, %o4, %o0
283:
29	retl
30	 clr	%o0
31ENDPROC(strncmp)
32EXPORT_SYMBOL(strncmp)
33