result might be undefined when input_num is zero */
| 327 | |
| 328 | /* result might be undefined when input_num is zero */ |
| 329 | fastfloat_really_inline FASTFLOAT_CONSTEXPR20 |
| 330 | int 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 |
| 351 | fastfloat_really_inline constexpr uint64_t emulu(uint32_t x, uint32_t y) { |
no test coverage detected