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

Function rte_log2_u64

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

* Return the rounded-up log2 of a 64-bit integer. * * @note Contrary to the logarithm mathematical operation, * rte_log2_u64(0) == 0 and not -inf. * * @param v * The input parameter. * @return * The rounded-up log2 of the input, or 0 if the input is 0. */

Source from the content-addressed store, hash-verified

710 * The rounded-up log2 of the input, or 0 if the input is 0.
711 */
712static inline uint32_t
713rte_log2_u64(uint64_t v)
714{
715 if (v == 0)
716 return 0;
717 v = rte_align64pow2(v);
718 /* we checked for v being 0 already, so no undefined behavior */
719 return rte_bsf64(v);
720}
721
722#ifdef __cplusplus
723}

Callers 5

pagesz_flagsFunction · 0.50
intel_ntb_mw_set_transFunction · 0.50
test_log2Function · 0.50
pagesz_flagsFunction · 0.50

Calls 2

rte_align64pow2Function · 0.70
rte_bsf64Function · 0.70

Tested by 2

test_log2Function · 0.40
pagesz_flagsFunction · 0.40