LLVM API Documentation

llvm::APIntOps Namespace Reference


Functions

APInt smin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be signed.
APInt smax (const APInt &A, const APInt &B)
 Determine the larger of two APInts considered to be signed.
APInt umin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be signed.
APInt umax (const APInt &A, const APInt &B)
 Determine the larger of two APInts considered to be unsigned.
bool isIntN (uint32_t N, const APInt &APIVal)
 Check if the specified APInt has a N-bits unsigned integer value.
bool isSignedIntN (uint32_t N, const APInt &APIVal)
 Check if the specified APInt has a N-bits signed integer value.
bool isMask (uint32_t numBits, const APInt &APIVal)
bool isShiftedMask (uint32_t numBits, const APInt &APIVal)
APInt byteSwap (const APInt &APIVal)
uint32_t logBase2 (const APInt &APIVal)
APInt GreatestCommonDivisor (const APInt &Val1, const APInt &Val2)
 Compute GCD of two APInt values.
double RoundAPIntToDouble (const APInt &APIVal)
 Converts the given APInt to a double value.
double RoundSignedAPIntToDouble (const APInt &APIVal)
 Converts the given APInt to a double value.
float RoundAPIntToFloat (const APInt &APIVal)
 Converts the given APInt to a float vlalue.
float RoundSignedAPIntToFloat (const APInt &APIVal)
 Converts the given APInt to a float value.
APInt RoundDoubleToAPInt (double Double, uint32_t width)
 Converts the given double value into a APInt.
APInt RoundFloatToAPInt (float Float, uint32_t width)
 Converts a float value into a APInt.
APInt ashr (const APInt &LHS, uint32_t shiftAmt)
 Arithmetic right-shift function.
APInt lshr (const APInt &LHS, uint32_t shiftAmt)
 Logical right-shift function.
APInt shl (const APInt &LHS, uint32_t shiftAmt)
 Left-shift function.
APInt sdiv (const APInt &LHS, const APInt &RHS)
 Signed division function for APInt.
APInt udiv (const APInt &LHS, const APInt &RHS)
 Unsigned division function for APInt.
APInt srem (const APInt &LHS, const APInt &RHS)
 Function for signed remainder operation.
APInt urem (const APInt &LHS, const APInt &RHS)
 Function for unsigned remainder operation.
APInt mul (const APInt &LHS, const APInt &RHS)
 Function for multiplication operation.
APInt add (const APInt &LHS, const APInt &RHS)
 Function for addition operation.
APInt sub (const APInt &LHS, const APInt &RHS)
 Function for subtraction operation.
APInt And (const APInt &LHS, const APInt &RHS)
 Bitwise AND function for APInt.
APInt Or (const APInt &LHS, const APInt &RHS)
 Bitwise OR function for APInt.
APInt Xor (const APInt &LHS, const APInt &RHS)
 Bitwise XOR function for APInt.
APInt Not (const APInt &APIVal)
 Bitwise complement function.


Function Documentation

APInt llvm::APIntOps::add ( const APInt &  LHS,
const APInt &  RHS 
) [inline]

Function for addition operation.

Performs addition on APInt values.

Definition at line 1536 of file APInt.h.

References LHS, and RHS.

APInt llvm::APIntOps::And ( const APInt &  LHS,
const APInt &  RHS 
) [inline]

Bitwise AND function for APInt.

Performs bitwise AND operation on APInt LHS and APInt RHS.

Definition at line 1549 of file APInt.h.

APInt llvm::APIntOps::ashr ( const APInt &  LHS,
uint32_t  shiftAmt 
) [inline]

Arithmetic right-shift function.

Arithmetic right-shift the APInt by shiftAmt.

Definition at line 1488 of file APInt.h.

References llvm::APInt::ashr().

APInt llvm::APIntOps::byteSwap ( const APInt &  APIVal  )  [inline]

Returns:
a byte-swapped representation of the specified APInt Value.

Definition at line 1438 of file APInt.h.

References llvm::APInt::byteSwap().

APInt llvm::APIntOps::GreatestCommonDivisor ( const APInt Val1,
const APInt Val2 
)

Compute GCD of two APInt values.

GreatestCommonDivisor - This function returns the greatest common divisor of the two APInt values using Euclid's algorithm.

Returns:
the greatest common divisor of Val1 and Val2

Definition at line 757 of file APInt.cpp.

References A, T, and urem().

bool llvm::APIntOps::isIntN ( uint32_t  N,
const APInt &  APIVal 
) [inline]

Check if the specified APInt has a N-bits unsigned integer value.

Definition at line 1415 of file APInt.h.

References llvm::APInt::isIntN().

bool llvm::APIntOps::isMask ( uint32_t  numBits,
const APInt &  APIVal 
) [inline]

Returns:
true if the argument APInt value is a sequence of ones starting at the least significant bit with the remainder zero.

Definition at line 1426 of file APInt.h.

References llvm::APInt::getBitWidth(), and llvm::APInt::getLowBitsSet().

Referenced by isShiftedMask().

bool llvm::APIntOps::isShiftedMask ( uint32_t  numBits,
const APInt &  APIVal 
) [inline]

Returns:
true if the argument APInt value contains a sequence of ones with the remainder zero.

Definition at line 1433 of file APInt.h.

References isMask().

Referenced by isRunOfOnes().

bool llvm::APIntOps::isSignedIntN ( uint32_t  N,
const APInt &  APIVal 
) [inline]

Check if the specified APInt has a N-bits signed integer value.

Definition at line 1420 of file APInt.h.

References llvm::APInt::isSignedIntN().

uint32_t llvm::APIntOps::logBase2 ( const APInt &  APIVal  )  [inline]

Returns:
the floor log base 2 of the specified APInt value.

Definition at line 1443 of file APInt.h.

References llvm::APInt::logBase2().

APInt llvm::APIntOps::lshr ( const APInt &  LHS,
uint32_t  shiftAmt 
) [inline]

Logical right-shift function.

Logical right-shift the APInt by shiftAmt.

Definition at line 1494 of file APInt.h.

References llvm::APInt::lshr().

Referenced by llvm::ComputeMaskedBits(), llvm::APInt::getHiBits(), and llvm::APInt::getLoBits().

APInt llvm::APIntOps::mul ( const APInt &  LHS,
const APInt &  RHS 
) [inline]

Function for multiplication operation.

Performs multiplication on APInt values.

Definition at line 1530 of file APInt.h.

APInt llvm::APIntOps::Not ( const APInt &  APIVal  )  [inline]

Bitwise complement function.

Performs a bitwise complement operation on APInt.

Definition at line 1567 of file APInt.h.

APInt llvm::APIntOps::Or ( const APInt &  LHS,
const APInt &  RHS 
) [inline]

double llvm::APIntOps::RoundAPIntToDouble ( const APInt &  APIVal  )  [inline]

Converts the given APInt to a double value.

Treats the APInt as an unsigned value for conversion purposes.

Definition at line 1455 of file APInt.h.

References llvm::APInt::roundToDouble().

Referenced by RoundAPIntToFloat().

float llvm::APIntOps::RoundAPIntToFloat ( const APInt &  APIVal  )  [inline]

Converts the given APInt to a float vlalue.

Definition at line 1466 of file APInt.h.

References RoundAPIntToDouble().

APInt llvm::APIntOps::RoundDoubleToAPInt ( double  Double,
uint32_t  width 
)

Converts the given double value into a APInt.

RoundDoubleToAPInt - This function convert a double value to an APInt value.

Definition at line 768 of file APInt.cpp.

References I, llvm::APInt::shl(), and T.

Referenced by llvm::ExecutionEngine::getConstantValue(), and RoundFloatToAPInt().

APInt llvm::APIntOps::RoundFloatToAPInt ( float  Float,
uint32_t  width 
) [inline]

Converts a float value into a APInt.

RoundFloatToAPInt - Converts a float value into an APInt value.

Definition at line 1482 of file APInt.h.

References RoundDoubleToAPInt().

Referenced by llvm::ExecutionEngine::getConstantValue().

double llvm::APIntOps::RoundSignedAPIntToDouble ( const APInt &  APIVal  )  [inline]

Converts the given APInt to a double value.

Treats the APInt as a signed value for conversion purposes.

Definition at line 1461 of file APInt.h.

References llvm::APInt::signedRoundToDouble().

float llvm::APIntOps::RoundSignedAPIntToFloat ( const APInt &  APIVal  )  [inline]

Converts the given APInt to a float value.

Treast the APInt as a signed value for conversion purposes.

Definition at line 1472 of file APInt.h.

References llvm::APInt::signedRoundToDouble().

APInt llvm::APIntOps::sdiv ( const APInt &  LHS,
const APInt &  RHS 
) [inline]

Signed division function for APInt.

Signed divide APInt LHS by APInt RHS.

Definition at line 1506 of file APInt.h.

References llvm::APInt::sdiv().

Referenced by SolveQuadraticEquation().

APInt llvm::APIntOps::shl ( const APInt &  LHS,
uint32_t  shiftAmt 
) [inline]

Left-shift function.

Left-shift the APInt by shiftAmt.

Definition at line 1500 of file APInt.h.

References llvm::APInt::shl().

Referenced by dyn_castFoldableMul(), llvm::APInt::getLoBits(), and llvm::ConstantRange::zeroExtend().

APInt llvm::APIntOps::smax ( const APInt &  A,
const APInt &  B 
) [inline]

Determine the larger of two APInts considered to be signed.

Definition at line 1400 of file APInt.h.

References llvm::APInt::sgt().

Referenced by llvm::ScalarEvolution::getSMaxExpr().

APInt llvm::APIntOps::smin ( const APInt &  A,
const APInt &  B 
) [inline]

Determine the smaller of two APInts considered to be signed.

Definition at line 1395 of file APInt.h.

References llvm::APInt::slt().

APInt llvm::APIntOps::srem ( const APInt &  LHS,
const APInt &  RHS 
) [inline]

Function for signed remainder operation.

Signed remainder operation on APInt.

Definition at line 1518 of file APInt.h.

References llvm::APInt::srem().

APInt llvm::APIntOps::sub ( const APInt &  LHS,
const APInt &  RHS 
) [inline]

Function for subtraction operation.

Performs subtraction on APInt values.

Definition at line 1542 of file APInt.h.

APInt llvm::APIntOps::udiv ( const APInt &  LHS,
const APInt &  RHS 
) [inline]

Unsigned division function for APInt.

Unsigned divide APInt LHS by APInt RHS.

Definition at line 1512 of file APInt.h.

References llvm::APInt::udiv().

Referenced by llvm::SCEVAddRecExpr::getNumIterationsInRange().

APInt llvm::APIntOps::umax ( const APInt &  A,
const APInt &  B 
) [inline]

Determine the larger of two APInts considered to be unsigned.

Definition at line 1410 of file APInt.h.

References llvm::APInt::ugt().

Referenced by llvm::ScalarEvolution::getUMaxExpr(), and llvm::ConstantRange::intersectWith().

APInt llvm::APIntOps::umin ( const APInt &  A,
const APInt &  B 
) [inline]

Determine the smaller of two APInts considered to be signed.

Definition at line 1405 of file APInt.h.

References llvm::APInt::ult().

Referenced by llvm::ConstantRange::intersectWith().

APInt llvm::APIntOps::urem ( const APInt &  LHS,
const APInt &  RHS 
) [inline]

Function for unsigned remainder operation.

Unsigned remainder operation on APInt.

Definition at line 1524 of file APInt.h.

References llvm::APInt::urem().

Referenced by GreatestCommonDivisor(), and SolveLinEquationWithOverflow().

APInt llvm::APIntOps::Xor ( const APInt &  LHS,
const APInt &  RHS 
) [inline]




This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.