(value: u32)
| 196 | #[inline] |
| 197 | #[must_use] |
| 198 | pub const fn trailing_zeros_u32(value: u32) -> u32 { |
| 199 | #[cfg(any( |
| 200 | target_arch = "aarch64", |
| 201 | target_arch = "x86", |
| 202 | target_arch = "x86_64", |
| 203 | target_feature = "thumb2", |
| 204 | target_feature = "zbb" |
| 205 | ))] |
| 206 | { |
| 207 | value.trailing_zeros() |
| 208 | } |
| 209 | #[cfg(not(any( |
| 210 | target_arch = "aarch64", |
| 211 | target_arch = "x86", |
| 212 | target_arch = "x86_64", |
| 213 | target_feature = "thumb2", |
| 214 | target_feature = "zbb" |
| 215 | )))] |
| 216 | { |
| 217 | // Reversing bits uses fixed shifts and masks when RBIT is unavailable. |
| 218 | leading_zeros_u32_soft(value.reverse_bits()) |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | /// Count leading zero bits, returning 64 if `value` is zero. |
| 223 | #[inline] |
no test coverage detected