On Mon, Jun 08, 2020 at 11:16:59PM +0200, Christian Weisgerber wrote: > I blame dlg@ for making me scrutinize the POWER7 instruction set, > which led me to the clz instruction, which led me to ffs(). I > wanted to add this to libc, but then realized the futility because > the compiler already inlines its optimized copy of ffs(). However, > this optimization is disabled for the kernel with -ffreestanding.
int ffs(int x) {
return __builtin_ffs(x);
}
doesn't work?
Joerg
