Annotation of sys/lib/libkern/arch/amd64/ffs.S, Revision 1.1
1.1 ! nbrk 1: /*
! 2: * Written by J.T. Conklin <jtc@netbsd.org>.
! 3: * Public domain.
! 4: * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
! 5: */
! 6:
! 7: #include <machine/asm.h>
! 8:
! 9: #if defined(LIBC_SCCS)
! 10: RCSID("$NetBSD: ffs.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $")
! 11: #endif
! 12:
! 13: ENTRY(ffs)
! 14: bsfl %edi,%eax
! 15: jz L1 /* ZF is set if all bits are 0 */
! 16: incl %eax /* bits numbered from 1, not 0 */
! 17: ret
! 18:
! 19: _ALIGN_TEXT
! 20: L1: xorl %eax,%eax /* clear result */
! 21: ret
CVSweb