llvm::APIntOps::GetMostSignificantDifferentBit

Return the index of the most significant bit that differs between two values.

Synopsis

Declared in <llvm/ADT/APInt.h>

std::optional<unsigned int>
GetMostSignificantDifferentBit(
    APInt const& A,
    APInt const& B);

Return Value

Bit index of the highest differing bit, or std::nullopt if equal

Parameters

NameDescription
AFirst value
BSecond value