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>
11 RCSID("$NetBSD: memcmp.S,v 1.2 2003/07/26 19:24:39 salo Exp $")
15 cld /* set compare direction forward */
16 movq %rdx,%rcx /* compare by longs */
20 jne L5 /* do we match so far? */
22 movq %rdx,%rcx /* compare remainder by bytes */
26 jne L6 /* do we match? */
28 xorl %eax,%eax /* we match, return zero */
31 L5: movl $8,%ecx /* We know that one of the next */
32 subq %rcx,%rdi /* eight pairs of bytes do not */
33 subq %rcx,%rsi /* match. */
36 L6: xorl %eax,%eax /* Perform unsigned comparison */
44 .section .note.GNU-stack,"",%progbits