* Get the count of leading 0-bits in v. * * @param v * The value. * @return * The count of leading zero bits. */
| 266 | * The count of leading zero bits. |
| 267 | */ |
| 268 | static inline unsigned int |
| 269 | rte_clz64(uint64_t v) |
| 270 | { |
| 271 | unsigned long rv; |
| 272 | |
| 273 | (void)_BitScanReverse64(&rv, v); |
| 274 | |
| 275 | return (unsigned int)(sizeof(v) * CHAR_BIT - 1 - rv); |
| 276 | } |
| 277 | |
| 278 | /** |
| 279 | * Get the count of trailing 0-bits in v. |
no outgoing calls