xref: /minix/common/lib/libc/arch/x86_64/string/bcmp.S (revision 0a6a1f1d)
1#include <machine/asm.h>
2
3#if defined(LIBC_SCCS)
4	RCSID("$NetBSD: bcmp.S,v 1.3 2014/03/22 19:16:34 jakllsch Exp $")
5#endif
6
7ENTRY(bcmp)
8	xorl	%eax,%eax		/* clear return value */
9
10	movq	%rdx,%rcx		/* compare by words */
11	shrq	$3,%rcx
12	repe
13	cmpsq
14	jne	L1
15
16	movq	%rdx,%rcx		/* compare remainder by bytes */
17	andq	$7,%rcx
18	repe
19	cmpsb
20	je	L2
21
22L1:	incl	%eax
23L2:	ret
24END(bcmp)
25