What is the reason to use implementation-specific builtins? The type-generic macro stdc_leading_zeros from stdbit.h (section 7.18.3 of the ISO C23 standard) looks like it would be fine here. Philipp