llvm::APInt::getBitsSet

Get a value with a block of bits set.

Synopsis

Declared in <llvm/ADT/APInt.h>

static
APInt
getBitsSet(
    unsigned int numBits,
    unsigned int loBit,
    unsigned int hiBit);

Description

Constructs an APInt value that has a contiguous range of bits set. The bits from loBit (inclusive) to hiBit (exclusive) will be set. All other bits will be zero. For example, with parameters(32, 0, 16) you would get 0x0000FFFF. Please call getBitsSetWithWrap if loBit may be greater than hiBit.

Return Value

An APInt value with the requested bits set.

Parameters

NameDescription
numBitsthe intended bit width of the result
loBitthe index of the lowest bit set.
hiBitthe index of the highest bit set.