mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-22 01:59:26 +00:00
The `<isc/bit.h>` header is a GNU C11 compatible version of C23's `<stdbit.h>`. It currently uses either `<stdbit.h>` or the equivilent compiler builtins. However, the generic `__builtin_ctzg` and `__builtin_ctlz` builtins are not available in every compiler version and thus falls back to manually selecting from type. Furthermore, the ctz fallback has been removed since `__builtin_ctzll` has been used for a while directly without any compilation issues from users. Thus, we can also require `__builtin_ctz`. Unlike the rest of C23's bit utilities, we avoid the stdc_rotate_* functions since we don't need the rotation modulus precision. This adds a couple (admittedly cheap) unwanted instructions on some architectures.