···3535 if (val == 0)
3636 return 32;
37373838- /* __builtin_ffs(l(l)): Returns one plus the index of the least significant
3939- 1-bit of x, or if x is zero, returns zero. */
4040- return __builtin_ffs(val) - 1;
3838+ /* __builtin_ctz[l[l]]: Returns the number of trailing 0-bits in x,
3939+ * starting at the least significant bit position. If x is 0, the result
4040+ * is undefined. */
4141+ return __builtin_ctz(val);
4142}