* Get the count of leading 0-bits in v. * * @param v * The value. * @return * The count of leading zero bits. */
| 248 | * The count of leading zero bits. |
| 249 | */ |
| 250 | static inline unsigned int |
| 251 | rte_clz32(uint32_t v) |
| 252 | { |
| 253 | unsigned long rv; |
| 254 | |
| 255 | (void)_BitScanReverse(&rv, v); |
| 256 | |
| 257 | return (unsigned int)(sizeof(v) * CHAR_BIT - 1 - rv); |
| 258 | } |
| 259 | |
| 260 | /** |
| 261 | * Get the count of leading 0-bits in v. |
no outgoing calls