2 * Written by J.T. Conklin <jtc@NetBSD.org>.
4 * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
7 #include <machine/asm.h>
10 RCSID("$NetBSD: memcmp.S,v 1.2 2007/11/12 18:41:59 ad Exp $")
14 movq %rdx,%rcx /* compare by longs */
18 jne L5 /* do we match so far? */
20 movq %rdx,%rcx /* compare remainder by bytes */
24 jne L6 /* do we match? */
26 xorl %eax,%eax /* we match, return zero */
29 L5: movl $8,%ecx /* We know that one of the next */
30 subq %rcx,%rdi /* eight pairs of bytes do not */
31 subq %rcx,%rsi /* match. */
34 L6: xorl %eax,%eax /* Perform unsigned comparison */