1#include <machine/asm.h> 2 3ENTRY(bcmp) 4 RETGUARD_SETUP(bcmp, r11) 5 xorl %eax,%eax /* clear return value */ 6 7 movq %rdx,%rcx /* compare by words */ 8 shrq $3,%rcx 9 repe 10 cmpsq 11 jne 1f 12 13 movq %rdx,%rcx /* compare remainder by bytes */ 14 andq $7,%rcx 15 repe 16 cmpsb 17 je 2f 18 191: incl %eax 202: RETGUARD_CHECK(bcmp, r11) 21 ret 22 lfence 23END(bcmp) 24