MCPcopy Create free account
hub / github.com/capstone-engine/capstone / NextPowerOf2

Function NextPowerOf2

MathExtras.h:368–376  ·  view source on GitHub ↗

NextPowerOf2 - Returns the next power of two (in 64-bits) that is strictly greater than A. Returns zero on overflow.

Source from the content-addressed store, hash-verified

366/// NextPowerOf2 - Returns the next power of two (in 64-bits)
367/// that is strictly greater than A. Returns zero on overflow.
368static inline uint64_t NextPowerOf2(uint64_t A) {
369 A |= (A >> 1);
370 A |= (A >> 2);
371 A |= (A >> 4);
372 A |= (A >> 8);
373 A |= (A >> 16);
374 A |= (A >> 32);
375 return A + 1;
376}
377
378/// Returns the next integer (mod 2**64) that is greater than or equal to
379/// \p Value and is a multiple of \p Align. \p Align must be non-zero.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…