blob: 0656627166f38e3070731893beeba2acbad1b571 [file] [log] [blame]
Adrian Bunkb00dc832008-05-19 16:52:27 -07001/*
Linus Torvalds1da177e2005-04-16 15:20:36 -07002 * Sparc64 optimized strncmp code.
3 *
4 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
5 */
6
David S. Miller8695c372012-05-11 20:33:22 -07007#include <linux/linkage.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07008#include <asm/asi.h>
9
10 .text
David S. Miller8695c372012-05-11 20:33:22 -070011ENTRY(strncmp)
Linus Torvalds1da177e2005-04-16 15:20:36 -070012 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
David S. Miller8695c372012-05-11 20:33:22 -070030ENDPROC(strncmp)