am 2317275f
: Merge "libc: delete x86 memchr.S"
* commit '2317275f859a685386889139855f2f3314337d53': libc: delete x86 memchr.S
This commit is contained in:
commit
080d2aa8dc
@ -1,27 +0,0 @@
|
||||
/* $OpenBSD: memchr.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */
|
||||
/*
|
||||
* Written by J.T. Conklin <jtc@netbsd.org>.
|
||||
* Public domain.
|
||||
*/
|
||||
|
||||
#include <machine/asm.h>
|
||||
|
||||
ENTRY(memchr)
|
||||
pushl %edi
|
||||
movl 8(%esp),%edi /* string address */
|
||||
movl 12(%esp),%eax /* set character to search for */
|
||||
movl 16(%esp),%ecx /* set length of search */
|
||||
testl %ecx,%ecx /* test for len == 0 */
|
||||
jz L1
|
||||
cld /* set search forward */
|
||||
repne /* search! */
|
||||
scasb
|
||||
jne L1 /* scan failed, return null */
|
||||
leal -1(%edi),%eax /* adjust result of scan */
|
||||
popl %edi
|
||||
ret
|
||||
.align 2,0x90
|
||||
L1: xorl %eax,%eax
|
||||
popl %edi
|
||||
ret
|
||||
END(memchr)
|
Loading…
Reference in New Issue
Block a user