|
LLVM
4.0.0
|
Class for arbitrary precision integers. More...
#include <APInt.h>
Classes | |
| struct | ms |
| Magic data for optimising signed division by a constant. More... | |
| struct | mu |
| Magic data for optimising unsigned division by a constant. More... | |
Public Member Functions | |
Constructors | |
| APInt (unsigned numBits, uint64_t val, bool isSigned=false) | |
| Create a new APInt of numBits width, initialized as val. More... | |
| APInt (unsigned numBits, ArrayRef< uint64_t > bigVal) | |
| Construct an APInt of numBits width, initialized as bigVal[]. More... | |
| APInt (unsigned numBits, unsigned numWords, const uint64_t bigVal[]) | |
| Equivalent to APInt(numBits, ArrayRef<uint64_t>(bigVal, numWords)), but deprecated because this constructor is prone to ambiguity with the APInt(unsigned, uint64_t, bool) constructor. More... | |
| APInt (unsigned numBits, StringRef str, uint8_t radix) | |
| Construct an APInt from a string representation. More... | |
| APInt (const APInt &that) | |
| Simply makes *this a copy of that. More... | |
| APInt (APInt &&that) | |
| Move Constructor. More... | |
| ~APInt () | |
| Destructor. More... | |
| APInt () | |
| Default constructor that creates an uninteresting APInt representing a 1-bit zero value. More... | |
| bool | needsCleanup () const |
| Returns whether this instance allocated memory. More... | |
| void | Profile (FoldingSetNodeID &id) const |
| Used to insert APInt objects, or objects that contain APInt objects, into FoldingSets. More... | |
Value Tests | |
| bool | isNegative () const |
| Determine sign of this APInt. More... | |
| bool | isNonNegative () const |
| Determine if this APInt Value is non-negative (>= 0) More... | |
| bool | isStrictlyPositive () const |
| Determine if this APInt Value is positive. More... | |
| bool | isAllOnesValue () const |
| Determine if all bits are set. More... | |
| bool | isMaxValue () const |
| Determine if this is the largest unsigned value. More... | |
| bool | isMaxSignedValue () const |
| Determine if this is the largest signed value. More... | |
| bool | isMinValue () const |
| Determine if this is the smallest unsigned value. More... | |
| bool | isMinSignedValue () const |
| Determine if this is the smallest signed value. More... | |
| bool | isIntN (unsigned N) const |
| Check if this APInt has an N-bits unsigned integer value. More... | |
| bool | isSignedIntN (unsigned N) const |
| Check if this APInt has an N-bits signed integer value. More... | |
| bool | isPowerOf2 () const |
| Check if this APInt's value is a power of two greater than zero. More... | |
| bool | isSignBit () const |
| Check if the APInt's value is returned by getSignBit. More... | |
| bool | getBoolValue () const |
| Convert APInt to a boolean value. More... | |
| uint64_t | getLimitedValue (uint64_t Limit=~0ULL) const |
| If this value is smaller than the specified limit, return it, otherwise return the limit value. More... | |
| bool | isSplat (unsigned SplatSizeInBits) const |
| Check if the APInt consists of a repeated bit pattern. More... | |
Unary Operators | |
| const APInt | operator++ (int) |
| Postfix increment operator. More... | |
| APInt & | operator++ () |
| Prefix increment operator. More... | |
| const APInt | operator-- (int) |
| Postfix decrement operator. More... | |
| APInt & | operator-- () |
| Prefix decrement operator. More... | |
| APInt | operator~ () const |
| Unary bitwise complement operator. More... | |
| bool | operator! () const |
| Logical negation operator. More... | |
Assignment Operators | |
| APInt & | operator= (const APInt &RHS) |
| Copy assignment operator. More... | |
| APInt & | operator= (APInt &&that) |
| Move assignment operator. More... | |
| APInt & | operator= (uint64_t RHS) |
| Assignment operator. More... | |
| APInt & | operator&= (const APInt &RHS) |
| Bitwise AND assignment operator. More... | |
| APInt & | operator|= (const APInt &RHS) |
| Bitwise OR assignment operator. More... | |
| APInt & | operator|= (uint64_t RHS) |
| Bitwise OR assignment operator. More... | |
| APInt & | operator^= (const APInt &RHS) |
| Bitwise XOR assignment operator. More... | |
| APInt & | operator*= (const APInt &RHS) |
| Multiplication assignment operator. More... | |
| APInt & | operator+= (const APInt &RHS) |
| Addition assignment operator. More... | |
| APInt & | operator+= (uint64_t RHS) |
| APInt & | operator-= (const APInt &RHS) |
| Subtraction assignment operator. More... | |
| APInt & | operator-= (uint64_t RHS) |
| APInt & | operator<<= (unsigned shiftAmt) |
| Left-shift assignment function. More... | |
Comparison Operators | |
| bool | operator== (const APInt &RHS) const |
| Equality operator. More... | |
| bool | operator== (uint64_t Val) const |
| Equality operator. More... | |
| bool | eq (const APInt &RHS) const |
| Equality comparison. More... | |
| bool | operator!= (const APInt &RHS) const |
| Inequality operator. More... | |
| bool | operator!= (uint64_t Val) const |
| Inequality operator. More... | |
| bool | ne (const APInt &RHS) const |
| Inequality comparison. More... | |
| bool | ult (const APInt &RHS) const |
| Unsigned less than comparison. More... | |
| bool | ult (uint64_t RHS) const |
| Unsigned less than comparison. More... | |
| bool | slt (const APInt &RHS) const |
| Signed less than comparison. More... | |
| bool | slt (int64_t RHS) const |
| Signed less than comparison. More... | |
| bool | ule (const APInt &RHS) const |
| Unsigned less or equal comparison. More... | |
| bool | ule (uint64_t RHS) const |
| Unsigned less or equal comparison. More... | |
| bool | sle (const APInt &RHS) const |
| Signed less or equal comparison. More... | |
| bool | sle (uint64_t RHS) const |
| Signed less or equal comparison. More... | |
| bool | ugt (const APInt &RHS) const |
| Unsigned greather than comparison. More... | |
| bool | ugt (uint64_t RHS) const |
| Unsigned greater than comparison. More... | |
| bool | sgt (const APInt &RHS) const |
| Signed greather than comparison. More... | |
| bool | sgt (int64_t RHS) const |
| Signed greater than comparison. More... | |
| bool | uge (const APInt &RHS) const |
| Unsigned greater or equal comparison. More... | |
| bool | uge (uint64_t RHS) const |
| Unsigned greater or equal comparison. More... | |
| bool | sge (const APInt &RHS) const |
| Signed greather or equal comparison. More... | |
| bool | sge (int64_t RHS) const |
| Signed greater or equal comparison. More... | |
| bool | intersects (const APInt &RHS) const |
| This operation tests if there are any pairs of corresponding bits between this APInt and RHS that are both set. More... | |
Resizing Operators | |
| APInt | trunc (unsigned width) const |
| Truncate to new width. More... | |
| APInt | sext (unsigned width) const |
| Sign extend to a new width. More... | |
| APInt | zext (unsigned width) const |
| Zero extend to a new width. More... | |
| APInt | sextOrTrunc (unsigned width) const |
| Sign extend or truncate to width. More... | |
| APInt | zextOrTrunc (unsigned width) const |
| Zero extend or truncate to width. More... | |
| APInt | sextOrSelf (unsigned width) const |
| Sign extend or truncate to width. More... | |
| APInt | zextOrSelf (unsigned width) const |
| Zero extend or truncate to width. More... | |
Bit Manipulation Operators | |
| void | setAllBits () |
| Set every bit to 1. More... | |
| void | setBit (unsigned bitPosition) |
| Set a given bit to 1. More... | |
| void | clearAllBits () |
| Set every bit to 0. More... | |
| void | clearBit (unsigned bitPosition) |
| Set a given bit to 0. More... | |
| void | flipAllBits () |
| Toggle every bit to its opposite value. More... | |
| void | flipBit (unsigned bitPosition) |
| Toggles a given bit to its opposite value. More... | |
Mathematics Operations | |
| unsigned | logBase2 () const |
| unsigned | ceilLogBase2 () const |
| unsigned | nearestLogBase2 () const |
| int32_t | exactLogBase2 () const |
| APInt | sqrt () const |
| Compute the square root. More... | |
| APInt | abs () const |
| Get the absolute value;. More... | |
| APInt | multiplicativeInverse (const APInt &modulo) const |
| Computes the multiplicative inverse of this APInt for a given modulo. More... | |
Support for division by constant | |
| ms | magic () const |
| Calculate the magic numbers required to implement a signed integer division by a constant as a sequence of multiplies, adds and shifts. More... | |
| mu | magicu (unsigned LeadingZeros=0) const |
| Calculate the magic numbers required to implement an unsigned integer division by a constant as a sequence of multiplies, adds and shifts. More... | |
Friends | |
| struct | DenseMapAPIntKeyInfo |
Value Generators | |
| hash_code | hash_value (const APInt &Arg) |
| Overload to compute a hash_code for an APInt value. More... | |
| APInt | getHiBits (unsigned numBits) const |
| Compute an APInt containing numBits highbits from this APInt. More... | |
| APInt | getLoBits (unsigned numBits) const |
| Compute an APInt containing numBits lowbits from this APInt. More... | |
| const uint64_t * | getRawData () const |
| This function returns a pointer to the internal storage of the APInt. More... | |
| static APInt | getMaxValue (unsigned numBits) |
| Gets maximum unsigned value of APInt for specific bit width. More... | |
| static APInt | getSignedMaxValue (unsigned numBits) |
| Gets maximum signed value of APInt for a specific bit width. More... | |
| static APInt | getMinValue (unsigned numBits) |
| Gets minimum unsigned value of APInt for a specific bit width. More... | |
| static APInt | getSignedMinValue (unsigned numBits) |
| Gets minimum signed value of APInt for a specific bit width. More... | |
| static APInt | getSignBit (unsigned BitWidth) |
| Get the SignBit for a specific bit width. More... | |
| static APInt | getAllOnesValue (unsigned numBits) |
| Get the all-ones value. More... | |
| static APInt | getNullValue (unsigned numBits) |
| Get the '0' value. More... | |
| static APInt | getOneBitSet (unsigned numBits, unsigned BitNo) |
| Return an APInt with exactly one bit set in the result. More... | |
| static APInt | getBitsSet (unsigned numBits, unsigned loBit, unsigned hiBit) |
| Get a value with a block of bits set. More... | |
| static APInt | getHighBitsSet (unsigned numBits, unsigned hiBitsSet) |
| Get a value with high bits set. More... | |
| static APInt | getLowBitsSet (unsigned numBits, unsigned loBitsSet) |
| Get a value with low bits set. More... | |
| static APInt | getSplat (unsigned NewLen, const APInt &V) |
| Return a value containing V broadcasted over NewLen bits. More... | |
| static bool | isSameValue (const APInt &I1, const APInt &I2) |
| Determine if two APInts have the same value, after zero-extending one of them (if needed!) to ensure that the bit-widths match. More... | |
Binary Operators | |
| APInt | operator& (const APInt &RHS) const |
| Bitwise AND operator. More... | |
| APInt | And (const APInt &RHS) const |
| APInt | operator| (const APInt &RHS) const |
| Bitwise OR operator. More... | |
| APInt | Or (const APInt &RHS) const |
| Bitwise OR function. More... | |
| APInt | operator^ (const APInt &RHS) const |
| Bitwise XOR operator. More... | |
| APInt | Xor (const APInt &RHS) const |
| Bitwise XOR function. More... | |
| APInt | operator* (const APInt &RHS) const |
| Multiplication operator. More... | |
| APInt | operator<< (unsigned Bits) const |
| Left logical shift operator. More... | |
| APInt | operator<< (const APInt &Bits) const |
| Left logical shift operator. More... | |
| APInt | ashr (unsigned shiftAmt) const |
| Arithmetic right-shift function. More... | |
| APInt | lshr (unsigned shiftAmt) const |
| Logical right-shift function. More... | |
| APInt | shl (unsigned shiftAmt) const |
| Left-shift function. More... | |
| APInt | rotl (unsigned rotateAmt) const |
| Rotate left by rotateAmt. More... | |
| APInt | rotr (unsigned rotateAmt) const |
| Rotate right by rotateAmt. More... | |
| APInt | ashr (const APInt &shiftAmt) const |
| Arithmetic right-shift function. More... | |
| APInt | lshr (const APInt &shiftAmt) const |
| Logical right-shift function. More... | |
| APInt | shl (const APInt &shiftAmt) const |
| Left-shift function. More... | |
| APInt | rotl (const APInt &rotateAmt) const |
| Rotate left by rotateAmt. More... | |
| APInt | rotr (const APInt &rotateAmt) const |
| Rotate right by rotateAmt. More... | |
| APInt | udiv (const APInt &RHS) const |
| Unsigned division operation. More... | |
| APInt | sdiv (const APInt &RHS) const |
| Signed division function for APInt. More... | |
| APInt | urem (const APInt &RHS) const |
| Unsigned remainder operation. More... | |
| APInt | srem (const APInt &RHS) const |
| Function for signed remainder operation. More... | |
| APInt | sadd_ov (const APInt &RHS, bool &Overflow) const |
| APInt | uadd_ov (const APInt &RHS, bool &Overflow) const |
| APInt | ssub_ov (const APInt &RHS, bool &Overflow) const |
| APInt | usub_ov (const APInt &RHS, bool &Overflow) const |
| APInt | sdiv_ov (const APInt &RHS, bool &Overflow) const |
| APInt | smul_ov (const APInt &RHS, bool &Overflow) const |
| APInt | umul_ov (const APInt &RHS, bool &Overflow) const |
| APInt | sshl_ov (const APInt &Amt, bool &Overflow) const |
| APInt | ushl_ov (const APInt &Amt, bool &Overflow) const |
| bool | operator[] (unsigned bitPosition) const |
| Array-indexing support. More... | |
| static void | udivrem (const APInt &LHS, const APInt &RHS, APInt &Quotient, APInt &Remainder) |
| Dual division/remainder interface. More... | |
| static void | sdivrem (const APInt &LHS, const APInt &RHS, APInt &Quotient, APInt &Remainder) |
Value Characterization Functions | |
| unsigned | getBitWidth () const |
| Return the number of bits in the APInt. More... | |
| unsigned | getNumWords () const |
| Get the number of words. More... | |
| unsigned | getActiveBits () const |
| Compute the number of active bits in the value. More... | |
| unsigned | getActiveWords () const |
| Compute the number of active words in the value of this APInt. More... | |
| unsigned | getMinSignedBits () const |
| Get the minimum bit size for this signed APInt. More... | |
| uint64_t | getZExtValue () const |
| Get zero extended value. More... | |
| int64_t | getSExtValue () const |
| Get sign extended value. More... | |
| unsigned | countLeadingZeros () const |
| The APInt version of the countLeadingZeros functions in MathExtras.h. More... | |
| unsigned | countLeadingOnes () const |
| Count the number of leading one bits. More... | |
| unsigned | getNumSignBits () const |
| Computes the number of leading bits of this APInt that are equal to its sign bit. More... | |
| unsigned | countTrailingZeros () const |
| Count the number of trailing zero bits. More... | |
| unsigned | countTrailingOnes () const |
| Count the number of trailing one bits. More... | |
| unsigned | countPopulation () const |
| Count the number of bits set. More... | |
| static unsigned | getNumWords (unsigned BitWidth) |
| Get the number of words. More... | |
| static unsigned | getBitsNeeded (StringRef str, uint8_t radix) |
| Get bits required for string value. More... | |
Conversion Functions | |
| void | print (raw_ostream &OS, bool isSigned) const |
| void | toString (SmallVectorImpl< char > &Str, unsigned Radix, bool Signed, bool formatAsCLiteral=false) const |
| Converts an APInt to a string and append it to Str. More... | |
| void | toStringUnsigned (SmallVectorImpl< char > &Str, unsigned Radix=10) const |
| Considers the APInt to be unsigned and converts it into a string in the radix given. More... | |
| void | toStringSigned (SmallVectorImpl< char > &Str, unsigned Radix=10) const |
| Considers the APInt to be signed and converts it into a string in the radix given. More... | |
| std::string | toString (unsigned Radix, bool Signed) const |
| Return the APInt as a std::string. More... | |
| APInt | byteSwap () const |
| APInt | reverseBits () const |
| double | roundToDouble (bool isSigned) const |
| Converts this APInt to a double value. More... | |
| double | roundToDouble () const |
| Converts this unsigned APInt to a double value. More... | |
| double | signedRoundToDouble () const |
| Converts this signed APInt to a double value. More... | |
| double | bitsToDouble () const |
| Converts APInt bits to a double. More... | |
| float | bitsToFloat () const |
| Converts APInt bits to a double. More... | |
| static APInt | doubleToBits (double V) |
| Converts a double to APInt bits. More... | |
| static APInt | floatToBits (float V) |
| Converts a float to APInt bits. More... | |
Building-block Operations for APInt and APFloat | |
| void | dump () const |
| debug method More... | |
| static void | tcSet (integerPart *, integerPart, unsigned int) |
| Sets the least significant part of a bignum to the input value, and zeroes out higher parts. More... | |
| static void | tcAssign (integerPart *, const integerPart *, unsigned int) |
| Assign one bignum to another. More... | |
| static bool | tcIsZero (const integerPart *, unsigned int) |
| Returns true if a bignum is zero, false otherwise. More... | |
| static int | tcExtractBit (const integerPart *, unsigned int bit) |
| Extract the given bit of a bignum; returns 0 or 1. Zero-based. More... | |
| static void | tcExtract (integerPart *, unsigned int dstCount, const integerPart *, unsigned int srcBits, unsigned int srcLSB) |
| Copy the bit vector of width srcBITS from SRC, starting at bit srcLSB, to DST, of dstCOUNT parts, such that the bit srcLSB becomes the least significant bit of DST. More... | |
| static void | tcSetBit (integerPart *, unsigned int bit) |
| Set the given bit of a bignum. Zero-based. More... | |
| static void | tcClearBit (integerPart *, unsigned int bit) |
| Clear the given bit of a bignum. Zero-based. More... | |
| static unsigned int | tcLSB (const integerPart *, unsigned int) |
| Returns the bit number of the least or most significant set bit of a number. More... | |
| static unsigned int | tcMSB (const integerPart *parts, unsigned int n) |
| static void | tcNegate (integerPart *, unsigned int) |
| Negate a bignum in-place. More... | |
| static integerPart | tcAdd (integerPart *, const integerPart *, integerPart carry, unsigned) |
| DST += RHS + CARRY where CARRY is zero or one. Returns the carry flag. More... | |
| static integerPart | tcSubtract (integerPart *, const integerPart *, integerPart carry, unsigned) |
| DST -= RHS + CARRY where CARRY is zero or one. Returns the carry flag. More... | |
| static int | tcMultiplyPart (integerPart *dst, const integerPart *src, integerPart multiplier, integerPart carry, unsigned int srcParts, unsigned int dstParts, bool add) |
| DST += SRC * MULTIPLIER + PART if add is true DST = SRC * MULTIPLIER + PART if add is false. More... | |
| static int | tcMultiply (integerPart *, const integerPart *, const integerPart *, unsigned) |
| DST = LHS * RHS, where DST has the same width as the operands and is filled with the least significant parts of the result. More... | |
| static unsigned int | tcFullMultiply (integerPart *, const integerPart *, const integerPart *, unsigned, unsigned) |
| DST = LHS * RHS, where DST has width the sum of the widths of the operands. More... | |
| static int | tcDivide (integerPart *lhs, const integerPart *rhs, integerPart *remainder, integerPart *scratch, unsigned int parts) |
| If RHS is zero LHS and REMAINDER are left unchanged, return one. More... | |
| static void | tcShiftLeft (integerPart *, unsigned int parts, unsigned int count) |
| Shift a bignum left COUNT bits. More... | |
| static void | tcShiftRight (integerPart *, unsigned int parts, unsigned int count) |
| Shift a bignum right COUNT bits. More... | |
| static void | tcAnd (integerPart *, const integerPart *, unsigned int) |
| The obvious AND, OR and XOR and complement operations. More... | |
| static void | tcOr (integerPart *, const integerPart *, unsigned int) |
| static void | tcXor (integerPart *, const integerPart *, unsigned int) |
| static void | tcComplement (integerPart *, unsigned int) |
| static int | tcCompare (const integerPart *, const integerPart *, unsigned int) |
| Comparison (unsigned) of two bignums. More... | |
| static integerPart | tcIncrement (integerPart *, unsigned int) |
| Increment a bignum in-place. Return the carry flag. More... | |
| static integerPart | tcDecrement (integerPart *, unsigned int) |
| Decrement a bignum in-place. Return the borrow flag. More... | |
| static void | tcSetLeastSignificantBits (integerPart *, unsigned int, unsigned int bits) |
| Set the least significant BITS and clear the rest. More... | |
Class for arbitrary precision integers.
APInt is a functional replacement for common case unsigned integer type like "unsigned", "unsigned long" or "uint64_t", but also allows non-byte-width integer sizes and large integer value types such as 3-bits, 15-bits, or more than 64-bits of precision. APInt provides a variety of arithmetic operators and methods to manipulate integer values of any bit-width. It supports both the typical integer arithmetic and comparison operations as well as bitwise manipulation.
The class has several invariants worth noting:
Create a new APInt of numBits width, initialized as val.
If isSigned is true then val is treated as if it were a signed value (i.e. as an int64_t) and the appropriate sign extension to the bit width will be done. Otherwise, no sign extension occurs (high order bits beyond the range of val are zero filled).
| numBits | the bit width of the constructed APInt |
| val | the initial value of the APInt |
| isSigned | how to treat signedness of val |
Definition at line 240 of file APInt.h.
References assert().
Construct an APInt of numBits width, initialized as bigVal[].
Note that bigVal.size() can be smaller or larger than the corresponding bit width but any extraneous bits will be dropped.
Equivalent to APInt(numBits, ArrayRef<uint64_t>(bigVal, numWords)), but deprecated because this constructor is prone to ambiguity with the APInt(unsigned, uint64_t, bool) constructor.
If this overload is ever deleted, care should be taken to prevent calls from being incorrectly captured by the APInt(unsigned, uint64_t, bool) constructor.
Definition at line 113 of file APInt.cpp.
References llvm::makeArrayRef().
Construct an APInt from a string representation.
This constructor interprets the string str in the given radix. The interpretation stops when the first character that is not suitable for the radix is encountered, or the end of the string. Acceptable radix values are 2, 8, 10, 16, and 36. It is an error for the value implied by the string to require more bits than numBits.
| numBits | the bit width of the constructed APInt |
| str | the string to be interpreted |
| radix | the radix to use for the conversion |
Definition at line 118 of file APInt.cpp.
References assert().
|
inline |
|
inlineexplicit |
Default constructor that creates an uninteresting APInt representing a 1-bit zero value.
This is useful for object deserialization (pair this with the static method Read).
Definition at line 306 of file APInt.h.
Referenced by ashr(), byteSwap(), lshr(), multiplicativeInverse(), operator*(), reverseBits(), sext(), sqrt(), sshl_ov(), trunc(), udiv(), udivrem(), urem(), ushl_ov(), and zext().
|
inline |
Get the absolute value;.
If *this is < 0 then return -(*this), otherwise *this;
Definition at line 1559 of file APInt.h.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), findGCD(), gcd(), magic(), simplifyICmpWithConstant(), and llvm::InstCombiner::visitMul().
Definition at line 780 of file APInt.h.
References llvm::operator&().
Arithmetic right-shift function.
Arithmetic right-shift this APInt by shiftAmt.
Arithmetic right-shift function.
Definition at line 1035 of file APInt.cpp.
References APInt(), assert(), getNumWords(), i, isNegative(), and llvm::SignExtend64().
Referenced by ashr(), llvm::APIntOps::ashr(), BuildExactSDIV(), llvm::ConstantFoldBinaryInstruction(), FoldValue(), llvm::AArch64TTIImpl::getIntImmCost(), llvm::X86TTIImpl::getIntImmCost(), performMulCombine(), simplifyICmpWithConstant(), and llvm::Interpreter::visitAShr().
Arithmetic right-shift function.
Arithmetic right-shift this APInt by shiftAmt.
Arithmetic right-shift function.
Definition at line 1029 of file APInt.cpp.
References ashr(), and getLimitedValue().
|
inline |
Converts APInt bits to a double.
The conversion does not do a translation from integer to double, it just re-interprets the bits as a double. Note that it is valid to do this on any bit width. Exactly 64 bits will be translated.
Definition at line 1453 of file APInt.h.
Referenced by llvm::detail::IEEEFloat::convertToDouble(), llvm::ExecutionEngine::getConstantValue(), getConstantVector(), and LowerVectorBroadcast().
|
inline |
Converts APInt bits to a double.
The conversion does not do a translation from integer to float, it just re-interprets the bits as a float. Note that it is valid to do this on any bit width. Exactly 32 bits will be translated.
Definition at line 1467 of file APInt.h.
Referenced by llvm::detail::IEEEFloat::convertToFloat(), llvm::ExecutionEngine::getConstantValue(), getConstantVector(), and LowerVectorBroadcast().
| APInt APInt::byteSwap | ( | ) | const |
Definition at line 744 of file APInt.cpp.
References APInt(), assert(), llvm::ByteSwap_16(), llvm::ByteSwap_32(), llvm::ByteSwap_64(), getNumWords(), I, lshrNear(), N, and pVal.
Referenced by llvm::APIntOps::byteSwap(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), and llvm::SelectionDAG::getNode().
|
inline |
Definition at line 1510 of file APInt.h.
References countLeadingZeros().
Referenced by ComputeNumSignBits().
|
inline |
Set every bit to 0.
Definition at line 1221 of file APInt.h.
Referenced by computeKnownBits(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromAssume(), computeKnownBitsFromOperator(), computeKnownBitsFromShiftOperator(), computeKnownBitsMul(), getUsefulBitsFromOrWithShiftedReg(), and operator*=().
| void APInt::clearBit | ( | unsigned | bitPosition | ) |
Set a given bit to 0.
Set the given bit to 0 whose position is given as "bitPosition".
Set a given bit to 0.
Definition at line 562 of file APInt.cpp.
References pVal.
Referenced by checkRippleForAdd(), computeSignedMinMaxValuesFromKnownBits(), flipBit(), and getSignedMaxValue().
| unsigned APInt::countLeadingOnes | ( | ) | const |
Count the number of leading one bits.
This function is an APInt version of the countLeadingOnes functions in MathExtras.h. It counts the number of ones from the most significant bit to the first zero bit.
Definition at line 676 of file APInt.cpp.
References llvm::countLeadingOnes(), getNumWords(), i, and pVal.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), computeKnownBitsMul(), ComputeNumSignBits(), llvm::computeOverflowForUnsignedMul(), llvm::RegsForValue::getCopyFromRegs(), isU24(), LowerAndToBT(), simplifyICmpWithConstant(), sshl_ov(), and llvm::InstCombiner::visitSwitchInst().
|
inline |
The APInt version of the countLeadingZeros functions in MathExtras.h.
It counts the number of zeros from the most significant bit to the first one bit.
Definition at line 1343 of file APInt.h.
References llvm::countLeadingZeros().
Referenced by areUsedBitsDense(), BitsProperlyConcatenate(), ceilLogBase2(), checkRippleForAdd(), computeKnownBitsFromOperator(), llvm::SelectionDAG::ComputeNumSignBits(), computeNumSignBitsVectorConstant(), foldCttzCtlz(), getContiguousRangeOfSetBits(), llvm::SelectionDAG::getNode(), isKnownNonZero(), processUMulZExtIdiom(), llvm::TargetLowering::TargetLoweringOpt::ShrinkDemandedOp(), simplifyICmpWithConstant(), sshl_ov(), tryBitfieldInsertOpFromOr(), ushl_ov(), and llvm::InstCombiner::visitAnd().
|
inline |
Count the number of bits set.
This function is an APInt version of the countPopulation functions in MathExtras.h. It counts the number of 1 bits in the APInt value.
Definition at line 1397 of file APInt.h.
References llvm::countPopulation().
Referenced by checkRippleForAdd(), computeKnownBitsFromOperator(), getContiguousRangeOfSetBits(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::isKnownToBeAPowerOfTwo(), ParseBFI(), llvm::ARMTargetLowering::PerformCMOVToBFICombine(), tryBitfieldInsertOpFromOr(), and tryBitfieldInsertOpFromOrAndImm().
|
inline |
Count the number of trailing one bits.
This function is an APInt version of the countTrailingOnes functions in MathExtras.h. It counts the number of ones from the least significant bit to the first zero bit.
Definition at line 1385 of file APInt.h.
References llvm::countTrailingOnes().
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), computeKnownBitsMul(), llvm::AlignmentFromAssumptionsPass::extractAlignmentInfo(), getDemandedBitsLHSMask(), isKnownNonZero(), and isWordAligned().
| unsigned APInt::countTrailingZeros | ( | ) | const |
Count the number of trailing zero bits.
This function is an APInt version of the countTrailingZeros functions in MathExtras.h. It counts the number of zeros from the least significant bit to the first set bit.
Definition at line 703 of file APInt.cpp.
References llvm::countTrailingZeros(), getNumWords(), i, fuzzer::min(), and pVal.
Referenced by areUsedBitsDense(), BinomialCoefficient(), BitsProperlyConcatenate(), BuildExactSDIV(), llvm::TargetLowering::BuildUDIV(), checkForNegativeOperand(), foldCttzCtlz(), getContiguousRangeOfSetBits(), getDemandedBitsLHSMask(), llvm::SelectionDAG::getNode(), getPowerOf2Factor(), PerformBFICombine(), processUGT_ADDCST_ADD(), simplifyICmpWithConstant(), llvm::TargetLowering::SimplifySetCC(), SolveLinEquationWithOverflow(), llvm::detail::IEEEFloat::toString(), and tryBitfieldInsertOpFromOr().
|
inlinestatic |
Converts a double to APInt bits.
The conversion does not do a translation from double to integer, it just re-interprets the bits of the double.
Definition at line 1480 of file APInt.h.
Referenced by llvm::ExecutionEngine::getConstantValue(), and llvm::detail::IEEEFloat::IEEEFloat().
| LLVM_DUMP_METHOD void APInt::dump | ( | ) | const |
debug method
Definition at line 2249 of file APInt.cpp.
References llvm::dbgs(), toStringSigned(), and toStringUnsigned().
Equality comparison.
Compares this APInt with RHS for the validity of the equality relationship.
Definition at line 983 of file APInt.h.
Referenced by llvm::APSInt::compareValues(), and processUMulZExtIdiom().
|
inline |
Definition at line 1547 of file APInt.h.
References llvm::APIntOps::logBase2().
Referenced by llvm::BuildVectorSDNode::getConstantFPSplatPow2ToLog2Int(), and llvm::InstCombiner::visitSDiv().
|
inline |
Toggle every bit to its opposite value.
Definition at line 1234 of file APInt.h.
References i.
Referenced by getUsefulBits(), getUsefulBitsFromBFM(), getUsefulBitsFromOrWithShiftedReg(), llvm::operator-(), operator~(), and toString().
| void APInt::flipBit | ( | unsigned | bitPosition | ) |
Toggles a given bit to its opposite value.
Toggle every bit to its opposite value.
Toggle a given bit to its opposite value whose position is given as "bitPosition".
Toggle a given bit to its opposite value whose position is given as "bitPosition". Toggles a given bit to its opposite value.
Definition at line 574 of file APInt.cpp.
References assert(), clearBit(), and setBit().
|
inlinestatic |
Converts a float to APInt bits.
The conversion does not do a translation from float to integer, it just re-interprets the bits of the float.
Definition at line 1493 of file APInt.h.
Referenced by llvm::ExecutionEngine::getConstantValue(), and llvm::detail::IEEEFloat::IEEEFloat().
|
inline |
Compute the number of active bits in the value.
This function returns the number of active bits which is defined as the bit width minus the number of leading zeros. This is used in several computations to see how "wide" the value is.
Definition at line 1279 of file APInt.h.
References llvm::countLeadingZeros().
Referenced by llvm::APSInt::APSInt(), areUsedBitsDense(), getConstantTripCount(), llvm::ARMTTIImpl::getIntImmCost(), llvm::ScalarEvolution::getSmallConstantTripMultiple(), isIndexInRangeOfArrayType(), isRunOfOnes(), llvm::SelectionDAGBuilder::lowerRangeToAssertZExt(), operator*=(), llvm::ARMTargetLowering::PerformCMOVToBFICombine(), roundToDouble(), sqrt(), udiv(), udivrem(), llvm::ConstantInt::uge(), ult(), and urem().
|
inline |
Get the all-ones value.
Definition at line 458 of file APInt.h.
Referenced by combineSext(), combineVSelectWithAllOnesOrZeros(), combineX86ShuffleChain(), computeKnownBits(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), computeKnownBitsFromShiftOperator(), llvm::Constant::getAllOnesValue(), llvm::APFloat::getAllOnesValue(), llvm::TargetLowering::getConstTrueVal(), llvm::DemandedBits::getDemandedBits(), getDemandedBitsLHSMask(), llvm::SelectionDAG::getLogicalNOT(), llvm::IntegerType::getMask(), llvm::SelectionDAG::getNode(), llvm::SelectionDAG::getNOT(), getOnesVector(), isConditionalZeroOrAllOnes(), lowerVectorShuffleAsBitBlend(), lowerVectorShuffleAsBitMask(), magicu(), llvm::PPCTargetLowering::PerformDAGCombine(), llvm::TargetLowering::SimplifyDemandedBits(), simplifyICmpWithConstant(), llvm::TargetLowering::SimplifySetCC(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitInsertElementInst(), llvm::InstCombiner::visitShuffleVectorInst(), and WidenMaskArithmetic().
Get bits required for string value.
This method determines how many bits are required to hold the APInt equivalent of the string given by str.
Definition at line 580 of file APInt.cpp.
References assert(), llvm::StringRef::begin(), llvm::StringRef::empty(), isNegative(), logBase2(), and llvm::StringRef::size().
|
inlinestatic |
Get a value with a block of bits set.
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. If hiBit is less than loBit then the set bits "wrap". For example, with parameters (32, 28, 4), you would get 0xF000000F.
| numBits | the intended bit width of the result |
| loBit | the index of the lowest bit set. |
| hiBit | the index of the highest bit set. |
Definition at line 503 of file APInt.h.
References assert().
Referenced by llvm::SelectionDAG::computeKnownBits(), llvm::BuildVectorSDNode::isConstantSplat(), llvm::AMDGPUTargetLowering::PerformDAGCombine(), llvm::TargetLowering::SimplifyDemandedBits(), tryBitfieldInsertOpFromOr(), and llvm::RegisterBankInfo::ValueMapping::verify().
|
inline |
Return the number of bits in the APInt.
Definition at line 1255 of file APInt.h.
Referenced by llvm::GEPOperator::accumulateConstantOffset(), llvm::DwarfUnit::addConstantFPValue(), llvm::DwarfUnit::addConstantValue(), llvm::DwarfExpression::AddUnsignedConstant(), APIntToHexString(), BitsProperlyConcatenate(), BuildExactSDIV(), llvm::TargetLowering::BuildUDIV(), calculateOffsetDiff(), checkRippleForAdd(), llvm::FunctionComparator::cmpAPInts(), CombineVMOVDRRCandidateWithVecOp(), llvm::InstCombiner::commonIDivTransforms(), llvm::APSInt::compareValues(), llvm::SelectionDAG::computeKnownBits(), computeKnownBits(), computeKnownBitsAddSub(), llvm::SparcTargetLowering::computeKnownBitsForTargetNode(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::PPCTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), llvm::TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromAssume(), computeKnownBitsFromOperator(), llvm::computeKnownBitsFromRangeMetadata(), computeKnownBitsFromShiftOperator(), computeKnownBitsMul(), llvm::computeMinimumValueSizes(), llvm::ComputeMultiple(), llvm::SelectionDAG::ComputeNumSignBits(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), computeSignedMinMaxValuesFromKnownBits(), computeUnsignedMinMaxValuesFromKnownBits(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantRange::ConstantRange(), llvm::MDBuilder::createRange(), llvm::BitTracker::MachineEvaluator::eIMM(), emitGlobalConstantFP(), foldICmpShlOne(), gcd(), llvm::ConstantInt::get(), getAdjustedPtr(), llvm::StringRef::getAsInteger(), llvm::ConstantRange::getBitWidth(), llvm::ConstantInt::getBitWidth(), llvm::ExecutionEngine::getConstantValue(), getConstVector(), getContiguousRangeOfSetBits(), llvm::SystemZTTIImpl::getIntImmCost(), llvm::PPCTTIImpl::getIntImmCost(), llvm::AArch64TTIImpl::getIntImmCost(), llvm::X86TTIImpl::getIntImmCost(), llvm::FunctionLoweringInfo::GetLiveOutRegInfo(), getNaturalGEPRecursively(), getNaturalGEPWithOffset(), llvm::getPtrStride(), getShiftAmount(), getSplat(), llvm::getStrideFromPointer(), getUsefulBits(), getUsefulBitsForUse(), getUsefulBitsFromAndWithImmediate(), getUsefulBitsFromBFM(), getUsefulBitsFromBitfieldMoveOpd(), IncorporateWeight(), isAligned(), isConstantOrConstantVector(), llvm::TargetTransformInfoImplBase::isConstantStridedAccessLessThan(), isDereferenceableAndAlignedPointer(), llvm::DenseMapAPIntKeyInfo::isEqual(), llvm::SIInstrInfo::isInlineConstant(), llvm::APIntOps::isMask(), IsMultiple(), isSameValue(), isSplat(), LoadIntFromMemory(), magic(), magicu(), MaskedValueIsZero(), ParseBFI(), performORCombine(), PerformORCombine(), processUMulZExtIdiom(), ShrinkDemandedConstant(), llvm::TargetLowering::SimplifyDemandedBits(), SimplifyICmpInst(), simplifyICmpWithConstant(), llvm::TargetLowering::SimplifySetCC(), SolveLinEquationWithOverflow(), sshl_ov(), StoreIntToMemory(), llvm::Value::stripAndAccumulateInBoundsConstantOffsets(), llvm::ConstantRange::subtract(), toString(), llvm::detail::IEEEFloat::toString(), toString(), tryBitfieldInsertOpFromOr(), udivrem(), unifyBitWidth(), ushl_ov(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitAnd(), llvm::TBAAVerifier::visitTBAAMetadata(), and zeroExtendToMatch().
|
inline |
Convert APInt to a boolean value.
This converts the APInt to a boolean value as a test against zero.
Definition at line 405 of file APInt.h.
Referenced by bitTrackingDCE(), llvm::SelectionDAG::computeKnownBits(), getPowerOf2Factor(), isKnownToBeAPowerOfTwo(), and llvm::PPCTargetLowering::SelectAddressRegReg().
Compute an APInt containing numBits highbits from this APInt.
This function returns the high "numBits" bits of this APInt.
Get an APInt with the same BitWidth as this APInt, just zero mask the low bits and right shift to the least significant bit.
Definition at line 649 of file APInt.cpp.
References llvm::APIntOps::lshr().
Referenced by llvm::TargetLowering::SimplifyDemandedBits(), and WriteConstantInternal().
Get a value with high bits set.
Constructs an APInt value that has the top hiBitsSet bits set.
| numBits | the bitwidth of the result |
| hiBitsSet | the number of high-order bits set in the result. |
Definition at line 518 of file APInt.h.
References assert().
Referenced by CanEvaluateShifted(), canEvaluateTruncated(), canEvaluateZExtd(), combineSelect(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsAddSub(), llvm::AMDGPUTargetLowering::computeKnownBitsForTargetNode(), llvm::AArch64TargetLowering::computeKnownBitsForTargetNode(), llvm::ARMTargetLowering::computeKnownBitsForTargetNode(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromAssume(), computeKnownBitsFromOperator(), llvm::computeKnownBitsFromRangeMetadata(), computeKnownBitsMul(), llvm::TargetLowering::expandMUL_LOHI(), foldCttzCtlz(), foldMaskAndShiftToScale(), llvm::InstCombiner::FoldShiftByConstant(), GetShiftedValue(), LowerMUL(), llvm::AMDGPUTargetLowering::LowerUDIVREM64(), PerformShiftCombine(), performSRLCombine(), llvm::ConstantRange::signExtend(), llvm::TargetLowering::SimplifyDemandedBits(), llvm::TargetLowering::SimplifySetCC(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitShl(), and llvm::InstCombiner::visitZExt().
|
inline |
If this value is smaller than the specified limit, return it, otherwise return the limit value.
This causes the value to saturate to the limit.
Definition at line 409 of file APInt.h.
Referenced by APIntToHexString(), ashr(), calculateOffsetDiff(), llvm::InstCombiner::commonIDivTransforms(), llvm::ComputeMultiple(), llvm::codeview::consume_numeric(), llvm::Evaluator::EvaluateBlock(), llvm::ARMTTIImpl::getIntImmCodeSizeCost(), llvm::ConstantInt::getLimitedValue(), lshr(), ParseBFI(), rotl(), rotr(), shl(), SimplifyShift(), and SwitchToLookupTable().
Compute an APInt containing numBits lowbits from this APInt.
This function returns the low "numBits" bits of this APInt.
Get an APInt with the same BitWidth as this APInt, just zero mask the high bits.
Definition at line 654 of file APInt.cpp.
References llvm::APIntOps::lshr(), and llvm::APIntOps::shl().
Referenced by computeZeroableShuffleElements(), getTargetShuffleMaskIndices(), matchRotateSub(), llvm::TargetLowering::SimplifyDemandedBits(), simplifyX86vpermilvar(), and WriteConstantInternal().
Get a value with low bits set.
Constructs an APInt value that has the bottom loBitsSet bits set.
| numBits | the bitwidth of the result |
| loBitsSet | the number of low-order bits set in the result. |
Definition at line 536 of file APInt.h.
References assert().
Referenced by canEvaluateShiftedShift(), clampDynamicVectorIndex(), combineBT(), combineVectorTruncationWithPACKUS(), computeKnownBits(), llvm::SelectionDAG::computeKnownBits(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), computeKnownBitsMul(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastOperand(), llvm::extractConstantMask(), llvm::InstCombiner::FoldAndOfICmps(), foldCttzCtlz(), llvm::InstCombiner::FoldShiftByConstant(), foldShiftByConstOfShiftByConst(), getDemandedBitsLHSMask(), GetShiftedValue(), getTargetConstantBitsFromNode(), llvm::SelectionDAG::getZeroExtendInReg(), llvm::APIntOps::isMask(), LowerMUL(), ParseBFI(), performTBISimplification(), processUGT_ADDCST_ADD(), llvm::ConstantRange::signExtend(), llvm::TargetLowering::SimplifyDemandedBits(), simplifyI24(), llvm::TargetLowering::SimplifySetCC(), SimplifyShift(), simplifyX86insertq(), llvm::InstCombiner::visitAnd(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitLShr(), and llvm::InstCombiner::visitZExt().
Gets maximum unsigned value of APInt for specific bit width.
Definition at line 426 of file APInt.h.
Referenced by llvm::ConstantRange::castOp(), llvm::ConstantRange::ConstantRange(), llvm::TargetLowering::expandMUL_LOHI(), llvm::SCEVExpander::generateOverflowCheck(), llvm::APSInt::getMaxValue(), llvm::ConstantRange::getUnsignedMax(), llvm::ScalarEvolution::getZeroExtendExpr(), processUMulZExtIdiom(), llvm::TargetLowering::SimplifySetCC(), and llvm::ConstantRange::truncate().
|
inline |
Get the minimum bit size for this signed APInt.
Computes the minimum bit width for this APInt while considering it to be a signed (and probably negative) value. If the value is not negative, this function returns the same value as getActiveBits()+1. Otherwise, it returns the smallest bit width that will retain the negative value. For example, -1 can be written as 0b1 or 0xFFFFFFFFFF. 0b1 is shorter and so for -1, this function will always return 1.
Definition at line 1298 of file APInt.h.
References llvm::countLeadingOnes().
Referenced by llvm::APSInt::APSInt(), canFoldIVIncExpr(), EliminateDeadSwitchCases(), llvm::TargetLowering::SimplifySetCC(), and llvm::InstCombiner::visitSDiv().
Gets minimum unsigned value of APInt for a specific bit width.
Definition at line 438 of file APInt.h.
Referenced by llvm::ConstantRange::castOp(), llvm::ConstantRange::ConstantRange(), llvm::APSInt::getMinValue(), llvm::ConstantRange::getUnsignedMin(), getUnsignedOverflowLimitForStep(), llvm::ScalarEvolution::getZeroExtendExpr(), llvm::ConstantRange::makeAllowedICmpRegion(), and llvm::TargetLowering::SimplifySetCC().
Get the '0' value.
Definition at line 465 of file APInt.h.
Referenced by llvm::ConstantRange::binaryAnd(), llvm::ConstantRange::binaryOr(), combineX86ShuffleChain(), combineX86ShufflesConstants(), llvm::ObjectSizeOffsetVisitor::compute(), llvm::ConstantFoldCastInstruction(), llvm::SCEVExpander::generateOverflowCheck(), llvm::SelectionDAG::getNode(), llvm::Constant::getNullValue(), getTargetConstantBitsFromNode(), LowerZERO_EXTEND_AVX512(), llvm::ConstantRange::makeAllowedICmpRegion(), llvm::ConstantRange::makeGuaranteedNoWrapRegion(), scalarConstantToHexString(), stripAndComputeConstantOffsets(), and llvm::reassociate::XorOpnd::XorOpnd().
|
inline |
Computes the number of leading bits of this APInt that are equal to its sign bit.
Definition at line 1363 of file APInt.h.
References llvm::countLeadingOnes(), and llvm::countLeadingZeros().
Referenced by canReduceVMulWidth(), llvm::SelectionDAG::ComputeNumSignBits(), and llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo().
|
inline |
Get the number of words.
Here one word's bitwidth equals to that of uint64_t.
Definition at line 1262 of file APInt.h.
References getNumWords().
Referenced by ashr(), byteSwap(), llvm::detail::IEEEFloat::convertFromAPInt(), countLeadingOnes(), countTrailingZeros(), emitGlobalConstantFP(), getNumWords(), llvm::hash_value(), lshr(), llvm::detail::IEEEFloat::makeNaN(), operator&=(), operator*=(), operator++(), operator+=(), operator--(), operator-=(), operator=(), operator^=(), operator|=(), Profile(), sext(), toString(), trunc(), and zext().
Return an APInt with exactly one bit set in the result.
Definition at line 484 of file APInt.h.
References setBit().
Referenced by llvm::InstCombiner::commonIDivTransforms(), llvm::SelectionDAG::computeKnownBits(), IncorporateWeight(), MatchBinaryOp(), processUMulZExtIdiom(), and llvm::ConstantRange::zeroExtend().
|
inline |
This function returns a pointer to the internal storage of the APInt.
This is useful for writing out the APInt in binary form without any conversions.
Definition at line 578 of file APInt.h.
Referenced by llvm::DwarfUnit::addConstantFPValue(), llvm::DwarfUnit::addConstantValue(), llvm::DwarfExpression::AddUnsignedConstant(), llvm::detail::IEEEFloat::convertFromAPInt(), llvm::detail::IEEEFloat::convertFromZeroExtendedInteger(), llvm::detail::DoubleAPFloat::DoubleAPFloat(), emitGlobalConstantFP(), llvm::HexagonLowerToMC(), LoadIntFromMemory(), llvm::detail::IEEEFloat::makeNaN(), sext(), StoreIntToMemory(), llvm::ExecutionEngine::StoreValueToMemory(), toString(), trunc(), and zext().
|
inline |
Get sign extended value.
This method attempts to return the value of this APInt as a sign extended int64_t. The bit width must be <= 64 or the value must fit within an int64_t. Otherwise an assertion will result.
Definition at line 1321 of file APInt.h.
References assert().
Referenced by llvm::DwarfUnit::addConstantValue(), llvm::AArch64_AM::getFP16Imm(), llvm::ARM_AM::getFP16Imm(), llvm::AArch64_AM::getFP32Imm(), llvm::ARM_AM::getFP32Imm(), llvm::AArch64_AM::getFP64Imm(), llvm::ARM_AM::getFP64Imm(), llvm::SystemZTTIImpl::getIntImmCost(), llvm::PPCTTIImpl::getIntImmCost(), llvm::AArch64TTIImpl::getIntImmCost(), llvm::ARMTTIImpl::getIntImmCost(), llvm::X86TTIImpl::getIntImmCost(), llvm::GetPointerBaseWithConstantOffset(), llvm::getPtrStride(), llvm::ConstantInt::getSExtValue(), llvm::getStrideFromPointer(), getVShiftImm(), llvm::TargetTransformInfoImplBase::isConstantStridedAccessLessThan(), llvm::SIInstrInfo::isInlineConstant(), LLVMGenericValueToInt(), llvm::TargetLowering::LowerAsmOperandForConstraint(), llvm::AsmPrinter::lowerConstant(), llvm::codeview::CodeViewRecordIO::mapEncodedInteger(), false::next_type(), ReduceSwitchRange(), llvm::AArch64TargetLowering::shouldConvertConstantLoadToIntImm(), llvm::TargetLowering::SimplifySetCC(), toString(), tryCombineShiftImm(), and llvm::InstCombiner::visitGetElementPtrInst().
Get the SignBit for a specific bit width.
This is just a wrapper function of getSignedMinValue(), and it helps code readability when we want to get a SignBit.
Definition at line 451 of file APInt.h.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsAddSub(), computeKnownBitsFromAssume(), llvm::decomposeBitTestICmp(), llvm::TargetLowering::expandFP_TO_SINT(), foldBitcastedFPLogic(), getDemandedBitsLHSMask(), isFNEG(), LowerFABSorFNEG(), LowerFCOPYSIGN(), LowerShift(), LowerVSETCC(), llvm::SelectionDAG::SignBitIsZero(), llvm::TargetLowering::SimplifyDemandedBits(), SimplifySubInst(), llvm::InstCombiner::visitAShr(), llvm::InstCombiner::visitSDiv(), and llvm::InstCombiner::visitSRem().
Gets maximum signed value of APInt for a specific bit width.
Definition at line 431 of file APInt.h.
References clearBit().
Referenced by CanBeSMax(), llvm::ConstantRange::castOp(), llvm::APSInt::getMaxValue(), llvm::ConstantRange::getSignedMax(), getSignedOverflowLimitForStep(), isKnownNonZero(), llvm::ConstantRange::isSignWrappedSet(), LowerFABSorFNEG(), magicu(), simplifyICmpWithConstant(), and llvm::TargetLowering::SimplifySetCC().
Gets minimum signed value of APInt for a specific bit width.
Definition at line 441 of file APInt.h.
References setBit().
Referenced by CanBeSMin(), llvm::ConstantRange::castOp(), llvm::APSInt::getMinValue(), llvm::ConstantRange::getSignedMin(), getSignedOverflowLimitForStep(), llvm::ConstantRange::isSignWrappedSet(), magic(), magicu(), llvm::ConstantRange::makeAllowedICmpRegion(), llvm::ConstantRange::makeGuaranteedNoWrapRegion(), simplifyICmpWithConstant(), simplifySelectWithFakeICmpEq(), and llvm::TargetLowering::SimplifySetCC().
Return a value containing V broadcasted over NewLen bits.
Definition at line 550 of file APInt.h.
References assert(), getBitWidth(), I, and zextOrSelf().
Referenced by getMemsetValue(), and LowerVectorCTPOPBitmath().
|
inline |
Get zero extended value.
This method attempts to return the value of this APInt as a zero extended uint64_t. The bitwidth must be <= 64 or the value must fit within a uint64_t. Otherwise an assertion will result.
Definition at line 1309 of file APInt.h.
References assert().
Referenced by llvm::DwarfUnit::addConstantValue(), combineVectorShift(), llvm::ProfileSummaryBuilder::computeDetailedSummary(), computeKnownBitsFromShiftOperator(), llvm::computeMinimumValueSizes(), ComputeNumSignBits(), llvm::SelectionDAG::ComputeNumSignBits(), llvm::ConstantFoldTerminator(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::Interpreter::exitCalled(), llvm::extractConstantMask(), GetBranchWeights(), llvm::ExecutionEngine::getConstantValue(), llvm::Function::getEntryCount(), llvm::AArch64_AM::getFP16Imm(), llvm::ARM_AM::getFP16Imm(), llvm::AArch64_AM::getFP32Imm(), llvm::ARM_AM::getFP32Imm(), llvm::AArch64_AM::getFP64Imm(), llvm::ARM_AM::getFP64Imm(), llvm::SystemZTTIImpl::getIntImmCost(), llvm::PPCTTIImpl::getIntImmCost(), llvm::ARMTTIImpl::getIntImmCost(), llvm::X86TTIImpl::getIntImmCost(), llvm::AsmToken::getIntVal(), getNaturalGEPRecursively(), llvm::SelectionDAG::getNode(), llvm::getObjectSize(), getTargetConstantBitsFromNode(), getTargetShuffleMaskIndices(), llvm::ConstantInt::getZExtValue(), IncorporateWeight(), isEXTMask(), isRepeatedByteSequence(), LLVMGenericValueToInt(), llvm::HexagonTargetLowering::LowerBUILD_VECTOR(), LowerShift(), llvm::codeview::CodeViewRecordIO::mapEncodedInteger(), PerformANDCombine(), llvm::AMDGPUTargetLowering::PerformDAGCombine(), performDSPShiftCombine(), PerformORCombine(), llvm::NVPTXFloatMCExpr::printImpl(), llvm::ExecutionEngine::runFunctionAsMain(), llvm::AArch64InstructionSelector::select(), llvm::PPCTargetLowering::SelectAddressRegImm(), llvm::AVRDAGToDAGISel::SelectInlineAsmMemoryOperand(), simplifyX86extrq(), simplifyX86insertq(), simplifyX86varShift(), toString(), llvm::detail::IEEEFloat::toString(), toString(), tryBitfieldInsertOpFromOrAndImm(), llvm::ConstantInt::uge(), llvm::Interpreter::visitAShr(), llvm::Interpreter::visitLShr(), llvm::Interpreter::visitShl(), and WriteConstantInternal().
This operation tests if there are any pairs of corresponding bits between this APInt and RHS that are both set.
Definition at line 1147 of file APInt.h.
Referenced by llvm::SelectionDAGISel::CheckAndMask(), llvm::SelectionDAGISel::CheckOrMask(), llvm::TargetLowering::TargetLoweringOpt::ShrinkDemandedConstant(), and llvm::TargetLowering::SimplifyDemandedBits().
|
inline |
Determine if all bits are set.
This checks to see if the value has all bits of the APInt are set or not.
Definition at line 342 of file APInt.h.
Referenced by areUsedBitsDense(), llvm::ConstantRange::binaryAnd(), computeKnownBitsFromAssume(), llvm::ConstantFoldBinaryInstruction(), createAndInstr(), llvm::extractConstantMask(), llvm::InstCombiner::FoldAndOfICmps(), foldICmpShlOne(), llvm::InstCombiner::FoldOrWithConstants(), llvm::InstCombiner::FoldXorWithConstants(), getExactSDiv(), getTargetConstantBitsFromNode(), llvm::ConstantInt::isMinusOne(), IsMultiple(), isSignBitCheck(), isSignTest(), llvm::PatternMatch::is_all_ones::isValue(), isVectorAllOnes(), matchMinMax(), matchSelectPattern(), performORCombine(), sdiv_ov(), llvm::TargetLowering::SimplifyDemandedBits(), simplifyICmpWithConstant(), llvm::RegisterBankInfo::ValueMapping::verify(), llvm::InstCombiner::visitCallInst(), and llvm::InstCombiner::visitSDiv().
Check if this APInt has an N-bits unsigned integer value.
Definition at line 377 of file APInt.h.
Referenced by AreMulWideOperandsDemotable(), combineShiftLeft(), llvm::codeview::consume_numeric(), llvm::ScalarEvolution::getUDivExactExpr(), intToken(), llvm::APIntOps::isIntN(), and mustBeFiniteCountedLoop().
|
inline |
Determine if this is the largest signed value.
This checks to see if the value of this APInt is the maximum signed value for the APInt's bit width.
Definition at line 358 of file APInt.h.
References llvm::countPopulation().
Referenced by llvm::ConstantInt::isMaxValue(), isSignBitCheck(), llvm::PatternMatch::is_maxsignedvalue::isValue(), matchMinMax(), llvm::ScalarEvolution::SimplifyICmpOperands(), simplifySelectWithICmpCond(), and llvm::InstCombiner::visitICmpInst().
|
inline |
Determine if this is the largest unsigned value.
This checks to see if the value of this APInt is the maximum unsigned value for the APInt's bit width.
Definition at line 352 of file APInt.h.
Referenced by canonicalizeCmpWithConstant(), llvm::ConstantRange::ConstantRange(), llvm::ConstantRange::isFullSet(), llvm::ConstantInt::isMaxValue(), llvm::ScalarEvolution::SimplifyICmpOperands(), and simplifySelectWithICmpCond().
|
inline |
Determine if this is the smallest signed value.
This checks to see if the value of this APInt is the minimum signed value for the APInt's bit width.
Definition at line 372 of file APInt.h.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ConstantRange::getEquivalentICmp(), llvm::ScalarEvolution::getMinusSCEV(), llvm::ConstantInt::isMinValue(), IsMultiple(), llvm::isSafeToSpeculativelyExecute(), matchMinMax(), sdiv_ov(), llvm::ConstantRange::signExtend(), llvm::ScalarEvolution::SimplifyICmpOperands(), simplifyICmpWithConstant(), simplifySelectWithICmpCond(), tryFactorization(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitICmpInst(), and llvm::InstCombiner::visitSRem().
|
inline |
Determine if this is the smallest unsigned value.
This checks to see if the value of this APInt is the minimum unsigned value for the APInt's bit width.
Definition at line 366 of file APInt.h.
Referenced by llvm::ConstantRange::binaryOr(), canonicalizeCmpWithConstant(), llvm::ConstantRange::ConstantRange(), IncorporateWeight(), isDereferenceableAndAlignedPointer(), llvm::ConstantRange::isEmptySet(), llvm::ConstantInt::isMinValue(), IsMultiple(), LinearizeExprTree(), llvm::SelectionDAGBuilder::lowerRangeToAssertZExt(), llvm::ScalarEvolution::SimplifyICmpOperands(), simplifySelectWithICmpCond(), and SolveQuadraticEquation().
|
inline |
Determine sign of this APInt.
This tests the high bit of this APInt to determine if it is set.
Definition at line 324 of file APInt.h.
Referenced by ashr(), llvm::TargetLowering::BuildSDIV(), canReduceVMulWidth(), combineShiftRightAlgebraic(), llvm::APSInt::compareValues(), computeKnownBitsAddSub(), computeKnownBitsFromAssume(), computeKnownBitsFromOperator(), computeKnownBitsMul(), ComputeNumSignBits(), llvm::SelectionDAG::ComputeNumSignBits(), computeNumSignBitsVectorConstant(), computePointerICmp(), llvm::detail::IEEEFloat::convertFromAPInt(), getBitsNeeded(), llvm::ARMTTIImpl::getIntImmCost(), isDereferenceableAndAlignedPointer(), llvm::ScalarEvolution::isKnownNegative(), llvm::ScalarEvolution::isKnownNonNegative(), llvm::ConstantInt::isNegative(), llvm::SCEV::isNonConstantNegative(), isTruePredicate(), llvm::HexagonTargetLowering::LowerSETCC(), magic(), llvm::ConstantRange::makeGuaranteedNoWrapRegion(), multiplicativeInverse(), sdiv(), sdivrem(), simplifyICmpWithConstant(), slt(), srem(), toString(), toString(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitMul(), llvm::InstCombiner::visitSRem(), and llvm::InstCombiner::visitURem().
|
inline |
Determine if this APInt Value is non-negative (>= 0)
This tests the high bit of the APInt to determine if it is unset.
Definition at line 329 of file APInt.h.
Referenced by computeKnownBitsFromOperator(), llvm::ARMTTIImpl::getIntImmCodeSizeCost(), llvm::ConstantRange::multiply(), sadd_ov(), sshl_ov(), ssub_ov(), llvm::InstCombiner::visitGetElementPtrInst(), and llvm::InstCombiner::visitSDiv().
|
inline |
Check if this APInt's value is a power of two greater than zero.
Definition at line 391 of file APInt.h.
References llvm::isPowerOf2_64().
Referenced by llvm::PPCTargetLowering::BuildSDIVPow2(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), llvm::decomposeBitTestICmp(), llvm::InstCombiner::FoldAndOfICmps(), foldICmpShlOne(), llvm::InstCombiner::FoldOrOfICmps(), getLogBase2Vector(), llvm::ScalarEvolution::getSignExtendExpr(), getTypeOfMaskedICmp(), isKnownToBeAPowerOfTwo(), llvm::PatternMatch::is_power2::isValue(), llvm::ARMTargetLowering::PerformCMOVToBFICombine(), performMulCombine(), processUGT_ADDCST_ADD(), processUMulZExtIdiom(), simplifyICmpWithBinOp(), simplifySelectBitTest(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitMul(), and llvm::InstCombiner::visitSDiv().
Determine if two APInts have the same value, after zero-extending one of them (if needed!) to ensure that the bit-widths match.
Definition at line 562 of file APInt.h.
References getBitWidth(), and zext().
|
inline |
Check if the APInt's value is returned by getSignBit.
Definition at line 400 of file APInt.h.
Referenced by isSignBitCheck(), llvm::PatternMatch::is_sign_bit::isValue(), simplifyICmpWithBinOp(), and llvm::InstCombiner::visitAdd().
Check if this APInt has an N-bits signed integer value.
Definition at line 383 of file APInt.h.
Referenced by AreMulWideOperandsDemotable(), and llvm::APIntOps::isSignedIntN().
Check if the APInt consists of a repeated bit pattern.
e.g. 0x01010101 satisfies isSplat(8).
| SplatSizeInBits | The size of the pattern in bits. Must divide bit width without remainder. |
Definition at line 640 of file APInt.cpp.
References assert(), getBitWidth(), and rotl().
Referenced by isRepeatedByteSequence().
|
inline |
Determine if this APInt Value is positive.
This tests if the value of this APInt is positive (> 0). Note that 0 is not a positive value.
Definition at line 337 of file APInt.h.
Referenced by llvm::TargetLowering::BuildSDIV(), ComputeNumSignBits(), llvm::ScalarEvolution::getSignExtendExpr(), llvm::ScalarEvolution::isKnownNonPositive(), llvm::ScalarEvolution::isKnownPositive(), and llvm::ConstantRange::makeGuaranteedNoWrapRegion().
|
inline |
Definition at line 1507 of file APInt.h.
References llvm::countLeadingZeros().
Referenced by ComputeNumSignBits(), foldICmpShlOne(), foldSelectICmpAndOr(), foldUDivPow2Cst(), foldUDivShl(), getBitsNeeded(), getLogBase2Vector(), isEXTMask(), llvm::APIntOps::logBase2(), llvm::ARMTargetLowering::PerformCMOVToBFICombine(), performMulCombine(), processUMulZExtIdiom(), tryMatchAcrossLaneShuffleForReduction(), llvm::InstCombiner::visitAdd(), and llvm::InstCombiner::visitMul().
Logical right-shift function.
Logical right-shift this APInt by shiftAmt.
Logical right-shift function.
Definition at line 1122 of file APInt.cpp.
References APInt(), getNumWords(), i, and lshrNear().
Referenced by areUsedBitsDense(), BinomialCoefficient(), llvm::TargetLowering::BuildUDIV(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromAssume(), computeZeroableShuffleElements(), llvm::ConstantFoldBinaryInstruction(), ExtractConstantBytes(), llvm::extractConstantMask(), llvm::InstCombiner::FoldShiftByConstant(), FoldValue(), llvm::SelectionDAG::getConstant(), getConstantVector(), getConstVector(), llvm::AArch64_AM::getFP16Imm(), llvm::ARM_AM::getFP16Imm(), llvm::AArch64_AM::getFP32Imm(), llvm::ARM_AM::getFP32Imm(), llvm::AArch64_AM::getFP64Imm(), llvm::ARM_AM::getFP64Imm(), llvm::SelectionDAG::getNode(), getTargetConstantBitsFromNode(), getTargetShuffleMaskIndices(), getUsefulBitsFromBitfieldMoveOpd(), getUsefulBitsFromOrWithShiftedReg(), llvm::BuildVectorSDNode::isConstantSplat(), lowerMSABinaryBitImmIntr(), llvm::ConstantRange::lshr(), lshr(), llvm::APIntOps::lshr(), magic(), magicu(), reverseBits(), rotl(), rotr(), llvm::TargetLowering::SimplifyDemandedBits(), simplifyICmpWithConstant(), llvm::TargetLowering::SimplifySetCC(), simplifyX86extrq(), simplifyX86vpermilvar(), SolveLinEquationWithOverflow(), llvm::detail::IEEEFloat::toString(), toString(), llvm::InstCombiner::visitCallInst(), llvm::Interpreter::visitLShr(), and llvm::InstCombiner::visitXor().
Logical right-shift function.
Logical right-shift this APInt by shiftAmt.
Logical right-shift function.
Definition at line 1116 of file APInt.cpp.
References getLimitedValue(), and lshr().
| APInt::ms APInt::magic | ( | ) | const |
Calculate the magic numbers required to implement a signed integer division by a constant as a sequence of multiplies, adds and shifts.
Requires that the divisor not be 0, 1, or -1. Taken from "Hacker's Delight", Henry S. Warren, Jr., chapter 10.
Definition at line 1397 of file APInt.cpp.
References abs(), getBitWidth(), getSignedMinValue(), isNegative(), lshr(), llvm::APInt::ms::m, r1(), r2(), llvm::APInt::ms::s, t, udiv(), uge(), ult(), and urem().
Referenced by llvm::TargetLowering::BuildSDIV().
Calculate the magic numbers required to implement an unsigned integer division by a constant as a sequence of multiplies, adds and shifts.
Requires that the divisor not be 0. Taken from "Hacker's Delight", Henry S. Warren, Jr., chapter 10. LeadingZeros can be used to simplify the calculation if the upper bits of the divided value are known zero.
Definition at line 1441 of file APInt.cpp.
References llvm::APInt::mu::a, allOnes(), getAllOnesValue(), getBitWidth(), getSignedMaxValue(), getSignedMinValue(), lshr(), llvm::APInt::mu::m, r1(), r2(), llvm::APInt::mu::s, udiv(), uge(), ult(), and urem().
Referenced by llvm::TargetLowering::BuildUDIV().
Computes the multiplicative inverse of this APInt for a given modulo.
The iterative extended Euclidean algorithm is used to solve for this value, however we simplify it to speed up calculating only the inverse, and take advantage of div+rem calculations. We also use some tricks to avoid copying (potentially large) APInts around.
Definition at line 1354 of file APInt.cpp.
References APInt(), assert(), i, isNegative(), t, udivrem(), and ult().
Referenced by BinomialCoefficient(), and SolveLinEquationWithOverflow().
|
inline |
NOTE: When we have a BitWidth of 1, we define:
log2(0) = UINT32_MAX log2(1) = 0
to get around any mathematical concerns resulting from referencing 2 in a space where 2 does no exist.
Definition at line 1525 of file APInt.h.
References llvm::APIntOps::logBase2().
|
inline |
|
inline |
|
inline |
|
inline |
Multiplication assignment operator.
Multiplies this APInt by RHS and assigns the result to *this.
Definition at line 373 of file APInt.cpp.
References assert(), clearAllBits(), getActiveBits(), getMemory(), getNumWords(), mul(), pVal, and VAL.
| APInt & APInt::operator++ | ( | ) |
| APInt & APInt::operator+= | ( | uint64_t | RHS | ) |
Definition at line 263 of file APInt.cpp.
References add_1(), getNumWords(), and pVal.
| APInt & APInt::operator-- | ( | ) |
Subtraction assignment operator.
Subtracts the RHS APInt from this APInt.
Subtracts RHS from *this and assigns the result to *this.
Definition at line 288 of file APInt.cpp.
References assert(), getNumWords(), pVal, sub(), and VAL.
| APInt & APInt::operator-= | ( | uint64_t | RHS | ) |
Definition at line 297 of file APInt.cpp.
References getNumWords(), pVal, and sub_1().
Left logical shift operator.
Shifts this APInt left by Bits and returns the result.
Definition at line 830 of file APInt.h.
References llvm::APIntOps::shl().
Left logical shift operator.
Shifts this APInt left by Bits and returns the result.
Definition at line 835 of file APInt.h.
References llvm::APIntOps::shl().
Left-shift assignment function.
Shifts *this left by shiftAmt and assigns the result to *this.
Definition at line 760 of file APInt.h.
References llvm::APIntOps::shl().
Copy assignment operator.
Definition at line 649 of file APInt.h.
References VAL.
Referenced by llvm::APSInt::operator=().
| APInt & APInt::operator= | ( | uint64_t | RHS | ) |
Assignment operator.
The RHS value is assigned to *this. If the significant bits in RHS exceed the bit width, the excess bits are truncated. If the bit width is larger than 64, the value is zero filled in the unspecified high order bits.
Definition at line 156 of file APInt.cpp.
References getNumWords(), and pVal.
|
inline |
Array-indexing support.
Definition at line 943 of file APInt.h.
References assert(), and getBitWidth().
|
inline |
|
inline |
Unary bitwise complement operator.
Performs a bitwise complement operation on this APInt.
Definition at line 621 of file APInt.h.
References flipAllBits().
Bitwise OR function.
Performs a bitwise or on *this and RHS. This is implemented by simply calling operator|.
Definition at line 800 of file APInt.h.
References llvm::operator|().
| void APInt::print | ( | raw_ostream & | OS, |
| bool | isSigned | ||
| ) | const |
Definition at line 2257 of file APInt.cpp.
References toString().
Referenced by emitDebugValueComment(), and llvm::operator<<().
| void APInt::Profile | ( | FoldingSetNodeID & | id | ) | const |
Used to insert APInt objects, or objects that contain APInt objects, into FoldingSets.
This method 'profiles' an APInt for use with FoldingSet.
Definition at line 167 of file APInt.cpp.
References llvm::FoldingSetNodeID::AddInteger(), getNumWords(), i, and pVal.
Referenced by llvm::APSInt::Profile().
| APInt APInt::reverseBits | ( | ) | const |
Rotate left by rotateAmt.
Definition at line 1247 of file APInt.cpp.
References getLimitedValue(), and rotl().
Rotate right by rotateAmt.
Definition at line 1258 of file APInt.cpp.
References getLimitedValue(), and rotr().
| double APInt::roundToDouble | ( | bool | isSigned | ) | const |
Converts this APInt to a double value.
This function converts this APInt to a double.
| Sign Exponent Fraction Bias |
|---|
| 1[63] 11[62-52] 52[51-00] 1023 |
Definition at line 855 of file APInt.cpp.
References assert(), D, getActiveBits(), I, pVal, sext(), llvm::SignExtend64(), and T.
Referenced by llvm::ExecutionEngine::getConstantValue(), and llvm::APIntOps::RoundAPIntToDouble().
|
inline |
Converts this unsigned APInt to a double value.
Definition at line 1443 of file APInt.h.
References roundToDouble().
Referenced by roundToDouble().
Definition at line 1983 of file APInt.cpp.
References isNonNegative().
Referenced by MaintainNoSignedWrap().
Signed division function for APInt.
Signed divide this APInt by APInt RHS.
Definition at line 1854 of file APInt.cpp.
References isNegative(), and udiv().
Referenced by llvm::ProfileSummaryBuilder::computeDetailedSummary(), llvm::ConstantFoldBinaryInstruction(), findGCD(), FoldValue(), llvm::ExecutionEngine::getConstantValue(), getExactSDiv(), getNaturalGEPRecursively(), getNaturalGEPWithOffset(), llvm::APIntOps::sdiv(), sdiv_ov(), simplifyICmpWithConstant(), smul_ov(), SolveQuadraticEquation(), and llvm::Interpreter::visitBinaryOperator().
Definition at line 2009 of file APInt.cpp.
References isAllOnesValue(), isMinSignedValue(), and sdiv().
|
static |
Definition at line 1965 of file APInt.cpp.
References isNegative(), and udivrem().
Referenced by ceilingOfQuotient(), findGCD(), floorOfQuotient(), and IsMultiple().
|
inline |
Set every bit to 1.
Definition at line 1203 of file APInt.h.
References i.
Referenced by computeKnownBits(), computeKnownBitsFromAssume(), and llvm::computeKnownBitsFromRangeMetadata().
| void APInt::setBit | ( | unsigned | bitPosition | ) |
Set a given bit to 1.
Set the given bit to 1 whose position is given as "bitPosition".
Definition at line 553 of file APInt.cpp.
References pVal.
Referenced by llvm::SelectionDAG::computeKnownBits(), computeKnownBitsAddSub(), computeKnownBitsFromOperator(), computeKnownBitsMul(), llvm::ComputeMultiple(), computeSignedMinMaxValuesFromKnownBits(), flipBit(), getOneBitSet(), llvm::ConstantRange::getSetSize(), getSignedMinValue(), SolveLinEquationWithOverflow(), llvm::ConstantRange::truncate(), and llvm::InstCombiner::visitExtractElementInst().
Sign extend to a new width.
This operation sign extends the APInt to a new width. If the high order bit is set, the fill on the left will be done with 1 bits, otherwise zero. It is an error to specify a width that is less than or equal to the current width.
Definition at line 939 of file APInt.cpp.
References APInt(), assert(), bits, getMemory(), getNumWords(), getRawData(), i, and pVal.
Referenced by decodeSoppBrTarget(), llvm::ExecutionEngine::getConstantValue(), llvm::AArch64TTIImpl::getIntImmCost(), llvm::X86TTIImpl::getIntImmCost(), llvm::ConstantRange::multiply(), roundToDouble(), sextOrSelf(), sextOrTrunc(), llvm::ConstantRange::signExtend(), tryToFoldExtendOfConstant(), unifyBitWidth(), and llvm::InstCombiner::visitAdd().
Sign extend or truncate to width.
Make this APInt have the bit width given by width. The value is sign extended, or left alone to make it that width.
Definition at line 1021 of file APInt.cpp.
References sext().
Referenced by llvm::ConstantRange::castOp().
Sign extend or truncate to width.
Make this APInt have the bit width given by width. The value is sign extended, truncated, or left alone to make it that width.
Definition at line 1007 of file APInt.cpp.
References sext(), and trunc().
Referenced by llvm::GEPOperator::accumulateConstantOffset(), llvm::MachineIRBuilder::buildConstant(), combineVSZext(), llvm::AArch64TTIImpl::getIntImmCost(), llvm::X86TTIImpl::getIntImmCost(), llvm::SelectionDAG::getNode(), and isDereferenceableAndAlignedPointer().
Signed greather or equal comparison.
Regards both *this and RHS as signed quantities and compares them for validity of the greater-or-equal relationship.
Definition at line 1135 of file APInt.h.
Referenced by llvm::ConstantFoldCompareInstruction(), llvm::SelectionDAG::FoldSetCC(), FoldValue(), llvm::SCEVAddRecExpr::getNumIterationsInRange(), performIntMed3ImmCombine(), TryMULWIDECombine(), and llvm::InstCombiner::visitAdd().
|
inline |
Signed greather than comparison.
Regards both *this and RHS as signed quantities and compares them for the validity of the greater-than relationship.
Definition at line 1101 of file APInt.h.
Referenced by ceilingOfQuotient(), llvm::ConstantFoldCompareInstruction(), floorOfQuotient(), llvm::InstCombiner::FoldAndOfICmps(), llvm::InstCombiner::FoldOrOfICmps(), llvm::SelectionDAG::FoldSetCC(), hasAddOverflow(), hasSubOverflow(), maxAPInt(), simplifyICmpWithConstant(), llvm::APIntOps::smax(), SwitchToLookupTable(), and llvm::ObjectSizeOffsetVisitor::visitSelectInst().
|
inline |
Left-shift function.
Left-shift this APInt by shiftAmt.
Definition at line 850 of file APInt.h.
References assert().
Referenced by combineShiftLeft(), llvm::SelectionDAG::computeKnownBits(), llvm::ConstantFoldBinaryInstruction(), llvm::extractConstantMask(), getTargetConstantBitsFromNode(), getUsefulBitsFromBFM(), getUsefulBitsFromBitfieldMoveOpd(), getUsefulBitsFromOrWithShiftedReg(), LowerShift(), rotl(), rotr(), llvm::APIntOps::RoundDoubleToAPInt(), llvm::ConstantRange::shl(), shl(), llvm::APIntOps::shl(), llvm::TargetLowering::SimplifyDemandedBits(), simplifyICmpWithConstant(), simplifyX86immShift(), simplifyX86insertq(), sqrt(), and llvm::Interpreter::visitShl().
Left-shift function.
Left-shift this APInt by shiftAmt.
Left-shift function.
Definition at line 1186 of file APInt.cpp.
References getLimitedValue(), and shl().
|
inline |
Converts this signed APInt to a double value.
Definition at line 1446 of file APInt.h.
Referenced by llvm::ExecutionEngine::getConstantValue(), llvm::APIntOps::RoundSignedAPIntToDouble(), and llvm::APIntOps::RoundSignedAPIntToFloat().
Signed less or equal comparison.
Regards both *this and RHS as signed quantities and compares them for validity of the less-or-equal relationship.
Definition at line 1067 of file APInt.h.
Referenced by llvm::ConstantFoldCompareInstruction(), llvm::SelectionDAG::FoldSetCC(), and FoldValue().
|
inline |
Signed less than comparison.
Regards both *this and RHS as signed quantities and compares them for validity of the less-than relationship.
Definition at line 533 of file APInt.cpp.
References assert(), isNegative(), llvm::SignExtend64(), ult(), and VAL.
Referenced by ceilingOfQuotient(), llvm::ConstantFoldCompareInstruction(), findGCD(), floorOfQuotient(), llvm::SelectionDAG::FoldSetCC(), llvm::MDNode::getMostGenericRange(), hasAddOverflow(), hasSubOverflow(), minAPInt(), llvm::ConstantRange::multiply(), llvm::APIntOps::smin(), SwitchToLookupTable(), TryMULWIDECombine(), and llvm::ObjectSizeOffsetVisitor::visitSelectInst().
|
inline |
| APInt APInt::sqrt | ( | ) | const |
Function for signed remainder operation.
Signed remainder operation on APInt.
Definition at line 1902 of file APInt.cpp.
References isNegative(), and urem().
Referenced by llvm::ConstantFoldBinaryInstruction(), findGCD(), FoldValue(), llvm::ExecutionEngine::getConstantValue(), getExactSDiv(), isRemainderZero(), llvm::APIntOps::srem(), and llvm::Interpreter::visitBinaryOperator().
Definition at line 2035 of file APInt.cpp.
References APInt(), countLeadingOnes(), countLeadingZeros(), getBitWidth(), isNonNegative(), and uge().
Definition at line 1996 of file APInt.cpp.
References isNonNegative().
Referenced by MaintainNoSignedWrap().
|
static |
|
static |
|
static |
Assign one bignum to another.
Definition at line 2330 of file APInt.cpp.
References i.
Referenced by llvm::detail::IEEEFloat::convert(), llvm::detail::IEEEFloat::convertFromSignExtendedInteger(), llvm::detail::IEEEFloat::makeNaN(), llvm::powerOf5(), tcDivide(), and tcExtract().
|
static |
Clear the given bit of a bignum. Zero-based.
Definition at line 2368 of file APInt.cpp.
References llvm::integerPartWidth.
Referenced by llvm::detail::IEEEFloat::makeNaN().
|
static |
Comparison (unsigned) of two bignums.
Definition at line 2824 of file APInt.cpp.
Referenced by llvm::detail::IEEEFloat::compareAbsoluteValue(), and tcDivide().
|
static |
|
static |
Decrement a bignum in-place. Return the borrow flag.
Definition at line 2856 of file APInt.cpp.
Referenced by llvm::detail::IEEEFloat::next().
|
static |
If RHS is zero LHS and REMAINDER are left unchanged, return one.
Otherwise set LHS to LHS / RHS with the fractional part discarded, set REMAINDER to the remainder, return zero. i.e.
OLD_LHS = RHS * LHS + REMAINDER
SCRATCH is a bignum of the same size as the operands and result for use by the routine; its contents need not be initialized and are destroyed. LHS, REMAINDER and SCRATCH must be distinct.
Definition at line 2669 of file APInt.cpp.
References assert(), llvm::ScaledNumbers::compare(), llvm::integerPartWidth, tcAssign(), tcCompare(), tcMSB(), tcSet(), tcShiftLeft(), tcShiftRight(), and tcSubtract().
|
static |
Copy the bit vector of width srcBITS from SRC, starting at bit srcLSB, to DST, of dstCOUNT parts, such that the bit srcLSB becomes the least significant bit of DST.
All high bits above srcBITS in DST are zero-filled.
Definition at line 2417 of file APInt.cpp.
References assert(), llvm::integerPartWidth, tcAssign(), and tcShiftRight().
|
static |
Extract the given bit of a bignum; returns 0 or 1. Zero-based.
Definition at line 2353 of file APInt.cpp.
References llvm::integerPartWidth.
Referenced by llvm::detail::IEEEFloat::convertFromSignExtendedInteger(), llvm::detail::IEEEFloat::convertFromZeroExtendedInteger(), llvm::detail::IEEEFloat::isDenormal(), llvm::detail::IEEEFloat::isSignaling(), and llvm::lostFractionThroughTruncation().
|
static |
DST = LHS * RHS, where DST has width the sum of the widths of the operands.
No overflow occurs. DST must be disjoint from both operands. Returns the number of parts required to hold the result.
Definition at line 2635 of file APInt.cpp.
References assert(), tcMultiplyPart(), and tcSet().
Referenced by llvm::powerOf5().
|
static |
Increment a bignum in-place. Return the carry flag.
Definition at line 2843 of file APInt.cpp.
References i.
Referenced by tcNegate().
|
static |
Returns true if a bignum is zero, false otherwise.
Definition at line 2340 of file APInt.cpp.
References i.
Referenced by llvm::detail::IEEEFloat::makeNaN().
|
static |
Returns the bit number of the least or most significant set bit of a number.
If the input number has no bits set -1U is returned.
Definition at line 2377 of file APInt.cpp.
References i, and llvm::integerPartWidth.
Referenced by llvm::lostFractionThroughTruncation().
|
static |
Definition at line 2395 of file APInt.cpp.
References llvm::integerPartWidth.
Referenced by tcDivide().
|
static |
DST = LHS * RHS, where DST has the same width as the operands and is filled with the least significant parts of the result.
Returns one if overflow occurred, otherwise zero. DST must be disjoint from both operands.
Definition at line 2612 of file APInt.cpp.
References assert(), i, tcMultiplyPart(), and tcSet().
|
static |
DST += SRC * MULTIPLIER + PART if add is true DST = SRC * MULTIPLIER + PART if add is false.
Requires 0 <= DSTPARTS <= SRCPARTS + 1. If DST overlaps SRC they must start at the same point, i.e. DST == SRC.
If DSTPARTS == SRC_PARTS + 1 no overflow occurs and zero is returned. Otherwise DST is filled with the least significant DSTPARTS parts of the result, and if all of the omitted higher parts were zero return zero, otherwise overflow occurred and return one.
Definition at line 2519 of file APInt.cpp.
References assert(), i, and llvm::integerPartWidth.
Referenced by tcFullMultiply(), and tcMultiply().
|
static |
Negate a bignum in-place.
Definition at line 2501 of file APInt.cpp.
References tcComplement(), and tcIncrement().
Referenced by llvm::detail::IEEEFloat::convertFromSignExtendedInteger().
|
static |
|
static |
Sets the least significant part of a bignum to the input value, and zeroes out higher parts.
Definition at line 2317 of file APInt.cpp.
Referenced by llvm::detail::IEEEFloat::convert(), llvm::detail::IEEEFloat::makeInf(), llvm::detail::IEEEFloat::makeNaN(), llvm::detail::IEEEFloat::makeSmallest(), llvm::detail::IEEEFloat::makeZero(), llvm::detail::IEEEFloat::next(), tcDivide(), tcFullMultiply(), and tcMultiply().
|
static |
Set the given bit of a bignum. Zero-based.
Definition at line 2361 of file APInt.cpp.
References llvm::integerPartWidth.
Referenced by llvm::detail::IEEEFloat::convert(), llvm::detail::IEEEFloat::makeNaN(), llvm::detail::IEEEFloat::makeQuiet(), and llvm::detail::IEEEFloat::next().
|
static |
Set the least significant BITS and clear the rest.
Definition at line 2871 of file APInt.cpp.
References i, and llvm::integerPartWidth.
|
static |
Shift a bignum left COUNT bits.
Shifted in bits are zero. There are no restrictions on COUNT.
Definition at line 2718 of file APInt.cpp.
References llvm::integerPartWidth.
Referenced by llvm::detail::IEEEFloat::convert(), and tcDivide().
|
static |
Shift a bignum right COUNT bits.
Shifted in bits are zero. There are no restrictions on COUNT.
Definition at line 2752 of file APInt.cpp.
References i, and llvm::integerPartWidth.
Referenced by llvm::shiftRight(), tcDivide(), and tcExtract().
|
static |
DST -= RHS + CARRY where CARRY is zero or one. Returns the carry flag.
Definition at line 2476 of file APInt.cpp.
Referenced by tcDivide().
|
static |
| void APInt::toString | ( | SmallVectorImpl< char > & | Str, |
| unsigned | Radix, | ||
| bool | Signed, | ||
| bool | formatAsCLiteral = false |
||
| ) | const |
Converts an APInt to a string and append it to Str.
Str is commonly a SmallString.
Definition at line 2121 of file APInt.cpp.
References llvm::SmallVectorImpl< T >::append(), assert(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), flipAllBits(), getBitWidth(), getNumWords(), getRawData(), getSExtValue(), getZExtValue(), I, isNegative(), llvm_unreachable, lshr(), N, llvm::cl::Prefix, llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::reverse(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
Referenced by print(), llvm::APSInt::toString(), and toString().
Return the APInt as a std::string.
Returns the APInt as a std::string.
Note that this is an inefficient method. It is better to pass in a SmallVector/SmallString to the methods above to avoid thrashing the heap for the string.
Note that this is an inefficient method. It is better to pass in a SmallVector/SmallString to the methods above.
Definition at line 2242 of file APInt.cpp.
References Signed, llvm::SmallString< InternalLen >::str(), and toString().
|
inline |
Considers the APInt to be signed and converts it into a string in the radix given.
The radix can be 2, 8, 10, 16, or 36.
Definition at line 1421 of file APInt.h.
References llvm::toString().
Referenced by dump().
|
inline |
Considers the APInt to be unsigned and converts it into a string in the radix given.
The radix can be 2, 8, 10 16, or 36.
Definition at line 1415 of file APInt.h.
References llvm::toString().
Referenced by dump().
Truncate to new width.
Truncate the APInt to a specified width. It is an error to specify a width that is greater than or equal to the current width.
Definition at line 916 of file APInt.cpp.
References APInt(), assert(), bits, getMemory(), getNumWords(), getRawData(), i, and pVal.
Referenced by llvm::APSInt::APSInt(), areUsedBitsDense(), BinomialCoefficient(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), ExtractConstantBytes(), llvm::ExecutionEngine::getConstantValue(), getConstantVector(), getConstVector(), llvm::SelectionDAG::getNode(), llvm::BuildVectorSDNode::isConstantSplat(), lowerMSABinaryBitImmIntr(), performShiftToAllZeros(), processUMulZExtIdiom(), sextOrTrunc(), llvm::TargetLowering::SimplifyDemandedBits(), SolveLinEquationWithOverflow(), llvm::APSInt::trunc(), llvm::ConstantRange::truncate(), llvm::InstCombiner::visitAdd(), llvm::InstCombiner::visitSwitchInst(), llvm::InstCombiner::visitTrunc(), and zextOrTrunc().
Unsigned division operation.
Perform an unsigned divide operation on this APInt by RHS. Both this and RHS are treated as unsigned quantities for purposes of this division.
Definition at line 1817 of file APInt.cpp.
References APInt(), assert(), getActiveBits(), pVal, ult(), and VAL.
Referenced by llvm::ConstantFoldBinaryInstruction(), FoldValue(), llvm::ExecutionEngine::getConstantValue(), magic(), magicu(), sdiv(), simplifyICmpWithConstant(), sqrt(), llvm::ConstantRange::udiv(), llvm::APIntOps::udiv(), umul_ov(), and llvm::Interpreter::visitBinaryOperator().
|
static |
Dual division/remainder interface.
Sometimes it is convenient to divide two APInt values and obtain both the quotient and remainder. This function does both operations in the same computation making it a little more efficient. The pair of input arguments may overlap with the pair of output arguments. It is safe to call udivrem(X, Y, X, Y), for example.
Definition at line 1913 of file APInt.cpp.
References APInt(), assert(), getActiveBits(), getBitWidth(), pVal, ult(), and VAL.
Referenced by IsMultiple(), multiplicativeInverse(), sdivrem(), llvm::detail::IEEEFloat::toString(), and llvm::ConstantRange::truncate().
Unsigned greater or equal comparison.
Regards both *this and RHS as unsigned quantities and compares them for validity of the greater-or-equal relationship.
Definition at line 1119 of file APInt.h.
Referenced by combineVectorShift(), llvm::SelectionDAG::ComputeNumSignBits(), llvm::ConstantFoldCompareInstruction(), llvm::SelectionDAG::FoldSetCC(), FoldValue(), getNaturalGEPRecursively(), magic(), magicu(), performIntMed3ImmCombine(), performShiftToAllZeros(), simplifyX86immShift(), simplifyX86varShift(), sshl_ov(), llvm::ConstantRange::truncate(), llvm::ConstantRange::unionWith(), and ushl_ov().
|
inline |
Unsigned greather than comparison.
Regards both *this and RHS as unsigned quantities and compares them for the validity of the greater-than relationship.
Definition at line 1083 of file APInt.h.
Referenced by llvm::FunctionComparator::cmpAPInts(), llvm::APSInt::compareValues(), llvm::ConstantFoldCompareInstruction(), llvm::InstCombiner::FoldAndOfICmps(), llvm::InstCombiner::FoldOrOfICmps(), llvm::SelectionDAG::FoldSetCC(), llvm::ScalarEvolution::getSignExtendExpr(), hasSubOverflow(), llvm::ConstantRange::isWrappedSet(), llvm::ConstantRange::shl(), llvm::APIntOps::umax(), llvm::ConstantRange::unionWith(), ushl_ov(), usub_ov(), and llvm::ObjectSizeOffsetVisitor::visitCallSite().
|
inline |
Unsigned less or equal comparison.
Regards both *this and RHS as unsigned quantities and compares them for validity of the less-or-equal relationship.
Definition at line 1051 of file APInt.h.
Referenced by llvm::SCEVAAResult::alias(), llvm::SelectionDAG::computeKnownBits(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantRange::contains(), llvm::InstCombiner::FoldOrOfICmps(), llvm::SelectionDAG::FoldSetCC(), FoldValue(), llvm::ConstantRange::intersectWith(), isTruePredicate(), sqrt(), llvm::ConstantRange::truncate(), llvm::ConstantRange::unionWith(), and llvm::InstCombiner::visitGetElementPtrInst().
|
inline |
Unsigned less than comparison.
Regards both *this and RHS as unsigned quantities and compares them for the validity of the less-than relationship.
Definition at line 501 of file APInt.cpp.
References assert(), getActiveBits(), i, pVal, and VAL.
Referenced by llvm::ConstantRange::add(), llvm::SelectionDAG::computeKnownBits(), computePointerICmp(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCompareInstruction(), ConstantIntSortPredicate(), llvm::ConstantRange::contains(), llvm::InstCombiner::FoldOrOfICmps(), llvm::SelectionDAG::FoldSetCC(), llvm::ScalarEvolution::getAddExpr(), getValidShiftAmountConstant(), hasAddOverflow(), IncorporateWeight(), llvm::ConstantRange::intersectWith(), magic(), magicu(), multiplicativeInverse(), llvm::ConstantRange::multiply(), simplifyICmpWithConstant(), slt(), sqrt(), llvm::ConstantRange::sub(), llvm::ConstantRange::truncate(), uadd_ov(), udiv(), udivrem(), llvm::APIntOps::umin(), llvm::ConstantRange::unionWith(), urem(), and llvm::InstCombiner::visitTrunc().
|
inline |
Definition at line 2025 of file APInt.cpp.
References udiv().
Referenced by llvm::computeOverflowForUnsignedMul(), MultiplyOverflows(), SimplifyDiv(), and llvm::ObjectSizeOffsetVisitor::visitCallSite().
Unsigned remainder operation.
Perform an unsigned remainder operation on this APInt with RHS being the divisor. Both this and RHS are treated as unsigned quantities for purposes of this operation. Note that this is a true remainder operation and not a modulo operation because the sign follows the sign of the dividend which is *this.
Definition at line 1865 of file APInt.cpp.
References APInt(), assert(), getActiveBits(), pVal, ult(), and VAL.
Referenced by llvm::ConstantFoldBinaryInstruction(), FoldValue(), llvm::ExecutionEngine::getConstantValue(), llvm::ScalarEvolution::getUDivExpr(), isDereferenceableAndAlignedPointer(), magic(), magicu(), srem(), llvm::APIntOps::urem(), and llvm::Interpreter::visitBinaryOperator().
Definition at line 2048 of file APInt.cpp.
References APInt(), countLeadingZeros(), getBitWidth(), uge(), and ugt().
Referenced by llvm::InstCombiner::visitUDiv().
Bitwise XOR function.
Performs a bitwise XOR operation on *this and RHS. This is implemented through the usage of operator^.
Definition at line 820 of file APInt.h.
References llvm::operator^().
Zero extend to a new width.
This operation zero extends the APInt to a new width. The high order bits are filled with 0 bits. It is an error to specify a width that is less than or equal to the current width.
Definition at line 980 of file APInt.cpp.
References APInt(), assert(), getMemory(), getNumWords(), getRawData(), i, and pVal.
Referenced by BinomialCoefficient(), llvm::SelectionDAG::computeKnownBits(), llvm::X86TargetLowering::computeKnownBitsForTargetNode(), computeKnownBitsFromOperator(), llvm::InstCombiner::FoldAndOfICmps(), gcd(), llvm::SCEVExpander::generateOverflowCheck(), llvm::StringRef::getAsInteger(), llvm::ExecutionEngine::getConstantValue(), llvm::ConstantRange::getSetSize(), isSameValue(), llvm::ConstantRange::multiply(), llvm::PPCTargetLowering::PerformDAGCombine(), processUMulZExtIdiom(), llvm::ConstantRange::signExtend(), llvm::TargetLowering::SimplifyDemandedBits(), simplifySelectWithFakeICmpEq(), SolveLinEquationWithOverflow(), llvm::detail::IEEEFloat::toString(), llvm::ConstantRange::truncate(), tryToFoldExtendOfConstant(), WidenMaskArithmetic(), llvm::ConstantRange::zeroExtend(), zextOrSelf(), and zextOrTrunc().
Zero extend or truncate to width.
Make this APInt have the bit width given by width. The value is zero extended, or left alone to make it that width.
Definition at line 1015 of file APInt.cpp.
References zext().
Referenced by llvm::ConstantRange::castOp(), getSplat(), isObjectSizeLessThanOrEq(), isRepeatedByteSequence(), llvm::ObjectSizeOffsetVisitor::visitCallSite(), and zeroExtendToMatch().
Zero extend or truncate to width.
Make this APInt have the bit width given by width. The value is zero extended, truncated, or left alone to make it that width.
Definition at line 999 of file APInt.cpp.
References trunc(), and zext().
Referenced by combineVectorShift(), combineVSZext(), llvm::SelectionDAG::computeKnownBits(), computeKnownBitsFromOperator(), computeKnownBitsFromShiftOperator(), llvm::FunctionLoweringInfo::ComputePHILiveOutRegInfo(), llvm::Interpreter::exitCalled(), llvm::extractConstantMask(), llvm::SelectionDAG::getConstant(), llvm::ExecutionEngine::getConstantValue(), llvm::FunctionLoweringInfo::GetLiveOutRegInfo(), llvm::SelectionDAG::getNode(), getTargetConstantBitsFromNode(), isBitfieldDstMask(), llvm::BuildVectorSDNode::isConstantSplat(), isRepeatedByteSequence(), resolveBuildVector(), ShrinkDemandedConstant(), simplifyX86extrq(), simplifyX86immShift(), simplifyX86insertq(), simplifyX86vpermilvar(), and llvm::InstCombiner::visitCallInst().
|
friend |
| uint64_t* llvm::APInt::pVal |
Used to store the >64 bits integer value.
Definition at line 84 of file APInt.h.
Referenced by byteSwap(), clearBit(), countLeadingOnes(), countTrailingZeros(), llvm::hash_value(), operator&=(), operator*=(), operator++(), operator+=(), operator--(), operator-=(), operator=(), operator^=(), operator|=(), Profile(), roundToDouble(), setBit(), sext(), trunc(), udiv(), udivrem(), ult(), urem(), and zext().
| uint64_t llvm::APInt::VAL |
Used to store the <= 64 bits integer value.
Definition at line 83 of file APInt.h.
Referenced by APInt(), llvm::DenseMapAPIntKeyInfo::getEmptyKey(), llvm::DenseMapAPIntKeyInfo::getTombstoneKey(), llvm::hash_value(), operator&(), operator&=(), operator*(), operator*=(), operator++(), operator+=(), operator--(), operator-=(), operator=(), operator==(), operator^(), operator^=(), operator|(), operator|=(), slt(), udiv(), udivrem(), ult(), and urem().
1.8.6