MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Log2Floor64

Function Log2Floor64

tensorflow/core/lib/core/bits.h:42–44  ·  view source on GitHub ↗

Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0.

Source from the content-addressed store, hash-verified

40
41// Return floor(log2(n)) for positive integer n. Returns -1 iff n == 0.
42inline int Log2Floor64(uint64 n) {
43 return n == 0 ? -1 : 63 ^ __builtin_clzll(n);
44}
45
46#else
47

Callers 4

Log2Ceiling64Function · 0.70
TryDivideToShiftFunction · 0.50
HandleClzMethod · 0.50
IndexMethod · 0.50

Calls 1

Log2FloorFunction · 0.70

Tested by

no test coverage detected