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

Function log2

freebsd/amd64/vmm/x86.c:82–87  ·  view source on GitHub ↗

* Round up to the next power of two, if necessary, and then take log2. * Returns -1 if argument is zero. */

Source from the content-addressed store, hash-verified

80 * Returns -1 if argument is zero.
81 */
82static __inline int
83log2(u_int x)
84{
85
86 return (fls(x << (1 - powerof2(x))) - 1);
87}
88
89int
90x86_emulate_cpuid(struct vm *vm, int vcpu_id, uint64_t *rax, uint64_t *rbx,

Callers 6

x86_emulate_cpuidFunction · 0.85
__rte_red_init_tablesFunction · 0.85
test_log2Function · 0.85
fmt_memsizeFunction · 0.85

Calls 1

flsFunction · 0.50

Tested by 1

test_log2Function · 0.68