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

Function leading_zeroes

Source/external/fast_float.h:329–348  ·  view source on GitHub ↗

result might be undefined when input_num is zero */

Source from the content-addressed store, hash-verified

327
328/* result might be undefined when input_num is zero */
329fastfloat_really_inline FASTFLOAT_CONSTEXPR20
330int leading_zeroes(uint64_t input_num) {
331 assert(input_num > 0);
332 if (cpp20_and_in_constexpr()) {
333 return leading_zeroes_generic(input_num);
334 }
335#ifdef FASTFLOAT_VISUAL_STUDIO
336 #if defined(_M_X64) || defined(_M_ARM64)
337 unsigned long leading_zero = 0;
338 // Search the mask data from most significant bit (MSB)
339 // to least significant bit (LSB) for a set bit (1).
340 _BitScanReverse64(&leading_zero, input_num);
341 return (int)(63 - leading_zero);
342 #else
343 return leading_zeroes_generic(input_num);
344 #endif
345#else
346 return __builtin_clzll(input_num);
347#endif
348}
349
350// slow emulation routine for 32-bit
351fastfloat_really_inline constexpr uint64_t emulu(uint32_t x, uint32_t y) {

Callers 4

compute_errorFunction · 0.85
compute_floatFunction · 0.85
uint64_hi64Function · 0.85
ctlzMethod · 0.85

Calls 2

cpp20_and_in_constexprFunction · 0.85
leading_zeroes_genericFunction · 0.85

Tested by

no test coverage detected