MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_fls_u32

Function rte_fls_u32

dpdk/lib/eal/include/rte_bitops.h:568–572  ·  view source on GitHub ↗

* Return the last (most-significant) bit set. * * @note The last (most significant) bit is at position 32. * @note rte_fls_u32(0) = 0, rte_fls_u32(1) = 1, rte_fls_u32(0x80000000) = 32 * * @param x * The input parameter. * @return * The last (most-significant) bit set, or 0 if the input is 0. */

Source from the content-addressed store, hash-verified

566 * The last (most-significant) bit set, or 0 if the input is 0.
567 */
568static inline uint32_t
569rte_fls_u32(uint32_t x)
570{
571 return (x == 0) ? 0 : 32 - rte_clz32(x);
572}
573
574/**
575 * Return the last (most-significant) bit set.

Callers 7

rte_reciprocal_valueFunction · 0.50
test_flsFunction · 0.50

Calls 1

rte_clz32Function · 0.85

Tested by 1

test_flsFunction · 0.40