Idiomatic count-leading zeros, generates native instruction on modern compilers. */
| 35 | |
| 36 | /* Idiomatic count-leading zeros, generates native instruction on modern compilers. */ |
| 37 | static uint32_t clz32(uint32_t inp) |
| 38 | { |
| 39 | uint32_t count = 32; |
| 40 | while (inp) |
| 41 | { |
| 42 | inp >>= 1; |
| 43 | count--; |
| 44 | } |
| 45 | return count; |
| 46 | } |
| 47 | |
| 48 | /* the five rounding modes that IEEE-754r defines */ |
| 49 | typedef enum |