]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - lib/libc/amd64/string/bcmp.S
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / lib / libc / amd64 / string / bcmp.S
1 #include <machine/asm.h>
2 __FBSDID("$FreeBSD$");
3
4 #if 0
5         RCSID("$NetBSD: bcmp.S,v 1.1 2001/06/19 00:25:04 fvdl Exp $")
6 #endif
7
8 ENTRY(bcmp)
9         cld                             /* set compare direction forward */
10
11         movq    %rdx,%rcx               /* compare by words */
12         shrq    $3,%rcx
13         repe
14         cmpsq
15         jne     L1
16
17         movq    %rdx,%rcx               /* compare remainder by bytes */
18         andq    $7,%rcx
19         repe
20         cmpsb
21 L1:
22         setne   %al
23         movsbl  %al,%eax
24         ret
25 END(bcmp)
26
27         .section .note.GNU-stack,"",%progbits