MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / leading_zeroes_generic

Function leading_zeroes_generic

Source/external/fast_float.h:315–326  ·  view source on GitHub ↗

Helper C++11 constexpr generic implementation of leading_zeroes */

Source from the content-addressed store, hash-verified

313
314/* Helper C++11 constexpr generic implementation of leading_zeroes */
315fastfloat_really_inline constexpr
316int leading_zeroes_generic(uint64_t input_num, int last_bit = 0) {
317 return (
318 ((input_num & uint64_t(0xffffffff00000000)) && (input_num >>= 32, last_bit |= 32)),
319 ((input_num & uint64_t( 0xffff0000)) && (input_num >>= 16, last_bit |= 16)),
320 ((input_num & uint64_t( 0xff00)) && (input_num >>= 8, last_bit |= 8)),
321 ((input_num & uint64_t( 0xf0)) && (input_num >>= 4, last_bit |= 4)),
322 ((input_num & uint64_t( 0xc)) && (input_num >>= 2, last_bit |= 2)),
323 ((input_num & uint64_t( 0x2)) && (input_num >>= 1, last_bit |= 1)),
324 63 - last_bit
325 );
326}
327
328/* result might be undefined when input_num is zero */
329fastfloat_really_inline FASTFLOAT_CONSTEXPR20

Callers 1

leading_zeroesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected