From 1dc9e472e19acfe6dc7f41e429236e7eef7ceda1 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Tue, 3 Mar 2009 19:28:35 -0800 Subject: auto import from //depot/cupcake/@135843 --- libc/arch-x86/string/fss.S | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 libc/arch-x86/string/fss.S (limited to 'libc/arch-x86/string/fss.S') diff --git a/libc/arch-x86/string/fss.S b/libc/arch-x86/string/fss.S new file mode 100644 index 0000000..96affab --- /dev/null +++ b/libc/arch-x86/string/fss.S @@ -0,0 +1,17 @@ +/* $OpenBSD: ffs.S,v 1.3 2005/08/07 11:30:38 espie Exp $ */ +/* + * Written by J.T. Conklin . + * Public domain. + */ + +#include + +ENTRY(ffs) + bsfl 4(%esp),%eax + jz L1 /* ZF is set if all bits are 0 */ + incl %eax /* bits numbered from 1, not 0 */ + ret + + .align 2 +L1: xorl %eax,%eax /* clear result */ + ret -- cgit v1.1