Ah, I see the bug. I was looking at ffz (which is correct),
not ffs (which isn't).
> __asm__("bsfl %1,%0\n\t"
> "jnz 1f\n\t"
> "movl $-1,%0\n"
> "1:" : "=r" (r) : "g" (x));
The problem is ^^^
That sez any of register, memory, or immediate is ok.
It should be "r" instead, just like in ffz.
That said, we should probably be using __builtin_ffs
instead. The compiler knows how to do bsfl plus the
adjustment. Plus, it knows how to evaluate it at
compile-time for constants.
r~
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/