Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* Sparc optimized memcmp code.
0003  *
0004  * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
0005  * Copyright (C) 2000, 2008 David S. Miller (davem@davemloft.net)
0006  */
0007 
0008 #include <linux/linkage.h>
0009 #include <asm/asm.h>
0010 #include <asm/export.h>
0011 
0012     .text
0013 ENTRY(memcmp)
0014     cmp %o2, 0
0015 1:  BRANCH32(be, pn, 2f)
0016      nop
0017     ldub    [%o0], %g7
0018     ldub    [%o1], %g3
0019     sub %o2, 1, %o2
0020     add %o0, 1, %o0
0021     add %o1, 1, %o1
0022     subcc   %g7, %g3, %g3
0023     BRANCH32(be, pt, 1b)
0024      cmp    %o2, 0
0025     retl
0026      mov    %g3, %o0
0027 2:  retl
0028      mov    0, %o0
0029 ENDPROC(memcmp)
0030 EXPORT_SYMBOL(memcmp)