summaryrefslogtreecommitdiff
path: root/sys/lib/libkern/arch/powerpc64/ffs.S
blob: 13fe17fb4f8fe3f32d2eb3e8470abd2964eda376 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*	$OpenBSD: ffs.S,v 1.1 2020/06/10 20:19:29 naddy Exp $ */
/*
 * Written by Christian Weisgerber <naddy@openbsd.org>.
 * Public domain.
 */
 
#include <machine/asm.h>

ENTRY(ffs)
	neg	%r4, %r3
	and	%r3, %r3, %r4
	cntlzw	%r3, %r3
	subfic	%r3, %r3, 32
	blr
END(ffs)