Searched refs:ConstexprLog2 (Results 1 – 2 of 2) sorted by relevance
57 static_assert(ConstexprLog2(1u) == 0u, ""); in TEST()58 static_assert(ConstexprLog2(0xFFFFFFFFu) == 31u, ""); in TEST()59 static_assert(ConstexprLog2(static_cast<uint64_t>(0xFFFFFFFFFFFFFFFF)) == 63u, ""); in TEST()67 static_assert(ConstexprLog2(0x80000000u) == 31u, ""); in TEST()68 static_assert(ConstexprLog2(0x7FFFFFFFu) == 30u, ""); in TEST()69 static_assert(ConstexprLog2(static_cast<uint64_t>(0x8000000000000000)) == 63u, ""); in TEST()70 static_assert(ConstexprLog2(static_cast<uint64_t>(0x7FFFFFFFFFFFFFFF)) == 62u, ""); in TEST()75 static_assert(ConstexprLog2(16u) == 4u, ""); in TEST()76 static_assert(ConstexprLog2(15u) == 3u, ""); in TEST()
34 constexpr uint32_t ConstexprLog2(uint64_t v) { in ConstexprLog2() function35 return v <= 1 ? 0 : 1 + ConstexprLog2(v / 2); in ConstexprLog2()39 return v <= 1 ? 0 : ConstexprLog2(v - 1) + 1; in ConstexprLog2Ceil()