File: memcmp.S

package info (click to toggle)
linux 3.2.73-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 692,996 kB
  • sloc: ansic: 9,719,677; asm: 244,034; xml: 40,377; makefile: 23,845; perl: 16,079; python: 4,929; sh: 4,425; cpp: 3,598; yacc: 2,979; lex: 1,726; awk: 708; pascal: 231; lisp: 218; sed: 30
file content (27 lines) | stat: -rw-r--r-- 478 bytes parent folder | download | duplicates (25)
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
/* Sparc optimized memcmp code.
 *
 * Copyright (C) 1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
 * Copyright (C) 2000, 2008 David S. Miller (davem@davemloft.net)
 */

#include <linux/linkage.h>
#include <asm/asm.h>

	.text
ENTRY(memcmp)
	cmp	%o2, 0
1:	BRANCH32(be, pn, 2f)
	 nop
	ldub	[%o0], %g7
	ldub	[%o1], %g3
	sub	%o2, 1, %o2
	add	%o0, 1, %o0
	add	%o1, 1, %o1
	subcc	%g7, %g3, %g3
	BRANCH32(be, pt, 1b)
	 cmp	%o2, 0
	retl
	 mov	%g3, %o0
2:	retl
	 mov	0, %o0
ENDPROC(memcmp)