bcmp.S revision 144782
1#include <machine/asm.h> 2__FBSDID("$FreeBSD: head/lib/libc/amd64/string/bcmp.S 144782 2005-04-08 05:15:55Z alc $"); 3 4#if 0 5 RCSID("$NetBSD: bcmp.S,v 1.1 2001/06/19 00:25:04 fvdl Exp $") 6#endif 7 8ENTRY(bcmp) 9 xorl %eax,%eax /* clear return value */ 10 cld /* set compare direction forward */ 11 12 movq %rdx,%rcx /* compare by words */ 13 shrq $3,%rcx 14 repe 15 cmpsq 16 jne L1 17 18 movq %rdx,%rcx /* compare remainder by bytes */ 19 andq $7,%rcx 20 repe 21 cmpsb 22 je L2 23 24L1: incl %eax 25L2: ret 26