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

Function MinAlign

MathExtras.h:357–364  ·  view source on GitHub ↗

MinAlign - A and B are either alignments or offsets. Return the minimum alignment that may be assumed after adding the two together.

Source from the content-addressed store, hash-verified

355/// MinAlign - A and B are either alignments or offsets. Return the minimum
356/// alignment that may be assumed after adding the two together.
357static inline uint64_t MinAlign(uint64_t A, uint64_t B) {
358 // The largest power of 2 that divides both A and B.
359 //
360 // Replace "-Value" by "1+~Value" in the following commented code to avoid
361 // MSVC warning C4146
362 // return (A | B) & -(A | B);
363 return (A | B) & (1 + ~(A | B));
364}
365
366/// NextPowerOf2 - Returns the next power of two (in 64-bits)
367/// that is strictly greater than A. Returns zero on overflow.

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…