bcmp.S revision 1.2
1#include <machine/asm.h>
2
3ENTRY(bcmp)
4	xorl	%eax,%eax		/* clear return value */
5	cld				/* set compare direction forward */
6
7	movq	%rdx,%rcx		/* compare by words */
8	shrq	$3,%rcx
9	repe
10	cmpsq
11	jne	L1
12
13	movq	%rdx,%rcx		/* compare remainder by bytes */
14	andq	$7,%rcx
15	repe
16	cmpsb
17	je	L2
18
19L1:	incl	%eax
20L2:	ret
21