MCPcopy Create free account
hub / github.com/RustCrypto/utils / leading_zeros_u32

Function leading_zeros_u32

ctutils/src/primitives.rs:172–193  ·  view source on GitHub ↗
(value: u32)

Source from the content-addressed store, hash-verified

170#[inline]
171#[must_use]
172pub const fn leading_zeros_u32(value: u32) -> u32 {
173 #[cfg(any(
174 target_arch = "aarch64",
175 target_arch = "x86",
176 target_arch = "x86_64",
177 target_feature = "thumb2",
178 target_feature = "zbb"
179 ))]
180 {
181 value.leading_zeros()
182 }
183 #[cfg(not(any(
184 target_arch = "aarch64",
185 target_arch = "x86",
186 target_arch = "x86_64",
187 target_feature = "thumb2",
188 target_feature = "zbb"
189 )))]
190 {
191 leading_zeros_u32_soft(value)
192 }
193}
194
195/// Count trailing zero bits, returning 32 if `value` is zero.
196#[inline]

Callers 1

leading_zeros_u64Function · 0.85

Calls 1

leading_zeros_u32_softFunction · 0.85

Tested by

no test coverage detected