003 File Manager
Current Path:
/usr/src/lib/libc/amd64/string
usr
/
src
/
lib
/
libc
/
amd64
/
string
/
📁
..
📄
Makefile.inc
(117 B)
📄
bcmp.S
(2.6 KB)
📄
bcopy.c
(176 B)
📄
bzero.c
(152 B)
📄
memcmp.S
(4.17 KB)
📄
memcpy.S
(114 B)
📄
memmove.S
(5.71 KB)
📄
memset.S
(3.12 KB)
📄
stpcpy.S
(2.15 KB)
📄
strcat.S
(2.62 KB)
📄
strcmp.S
(1.16 KB)
📄
strcpy.c
(1.68 KB)
Editing: strcmp.S
/* * Written by J.T. Conklin <jtc@acorntoolworks.com> * Public domain. */ #include <machine/asm.h> __FBSDID("$FreeBSD$"); #if 0 RCSID("$NetBSD: strcmp.S,v 1.3 2004/07/19 20:04:41 drochner Exp $") #endif ENTRY(strcmp) /* * Align s1 to word boundary. * Consider unrolling loop? */ .Ls1align: testb $7,%dil je .Ls1aligned movb (%rdi),%al incq %rdi movb (%rsi),%dl incq %rsi testb %al,%al je .Ldone cmpb %al,%dl je .Ls1align jmp .Ldone /* * Check whether s2 is aligned to a word boundary. If it is, we * can compare by words. Otherwise we have to compare by bytes. */ .Ls1aligned: testb $7,%sil jne .Lbyte_loop movabsq $0x0101010101010101,%r8 subq $8,%rdi movabsq $0x8080808080808080,%r9 subq $8,%rsi .align 4 .Lword_loop: movq 8(%rdi),%rax addq $8,%rdi movq 8(%rsi),%rdx addq $8,%rsi cmpq %rax,%rdx jne .Lbyte_loop subq %r8,%rdx notq %rax andq %rax,%rdx testq %r9,%rdx je .Lword_loop .align 4 .Lbyte_loop: movb (%rdi),%al incq %rdi movb (%rsi),%dl incq %rsi testb %al,%al je .Ldone cmpb %al,%dl je .Lbyte_loop .Ldone: movzbq %al,%rax movzbq %dl,%rdx subq %rdx,%rax ret END(strcmp) .section .note.GNU-stack,"",%progbits
Upload File
Create Folder