diff options
Diffstat (limited to 'lib/libc/arch/powerpc64/string/ffs.S')
-rw-r--r-- | lib/libc/arch/powerpc64/string/ffs.S | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libc/arch/powerpc64/string/ffs.S b/lib/libc/arch/powerpc64/string/ffs.S new file mode 100644 index 00000000000..8e656698ec9 --- /dev/null +++ b/lib/libc/arch/powerpc64/string/ffs.S @@ -0,0 +1,15 @@ +/* $OpenBSD: ffs.S,v 1.1 2020/06/26 20:16:21 naddy Exp $ */ +/* + * Written by Christian Weisgerber <naddy@openbsd.org>. + * Public domain. + */ + +#include "DEFS.h" + +ENTRY(ffs) + neg %r4, %r3 + and %r3, %r3, %r4 + cntlzw %r3, %r3 + subfic %r3, %r3, 32 + blr +END_BUILTIN(ffs) |