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

Function rte_fls_u64

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

* Return the last (most-significant) bit set. * * @note The last (most significant) bit is at position 64. * @note rte_fls_u64(0) = 0, rte_fls_u64(1) = 1, * rte_fls_u64(0x8000000000000000) = 64 * * @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

584 * The last (most-significant) bit set, or 0 if the input is 0.
585 */
586static inline uint32_t
587rte_fls_u64(uint64_t x)
588{
589 return (x == 0) ? 0 : 64 - rte_clz64(x);
590}
591
592/*********** Macros to work with powers of 2 ********/
593

Callers 2

emit_mov_immFunction · 0.50
test_flsFunction · 0.50

Calls 1

rte_clz64Function · 0.85

Tested by 1

test_flsFunction · 0.40