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