LLVM  6.0.0svn
Functions
llvm::APIntOps Namespace Reference

Functions

const APIntsmin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be signed. More...
 
const APIntsmax (const APInt &A, const APInt &B)
 Determine the larger of two APInts considered to be signed. More...
 
const APIntumin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be signed. More...
 
const APIntumax (const APInt &A, const APInt &B)
 Determine the larger of two APInts considered to be unsigned. More...
 
APInt GreatestCommonDivisor (APInt A, APInt B)
 Compute GCD of two unsigned APInt values. More...
 
double RoundAPIntToDouble (const APInt &APIVal)
 Converts the given APInt to a double value. More...
 
double RoundSignedAPIntToDouble (const APInt &APIVal)
 Converts the given APInt to a double value. More...
 
float RoundAPIntToFloat (const APInt &APIVal)
 Converts the given APInt to a float vlalue. More...
 
float RoundSignedAPIntToFloat (const APInt &APIVal)
 Converts the given APInt to a float value. More...
 
APInt RoundDoubleToAPInt (double Double, unsigned width)
 Converts the given double value into a APInt. More...
 
APInt RoundFloatToAPInt (float Float, unsigned width)
 Converts a float value into a APInt. More...
 

Function Documentation

◆ GreatestCommonDivisor()

APInt llvm::APIntOps::GreatestCommonDivisor ( APInt  A,
APInt  B 
)

Compute GCD of two unsigned APInt values.

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

Returns
the greatest common divisor of A and B.

Definition at line 671 of file APInt.cpp.

References B, llvm::APInt::countTrailingZeros(), llvm::APInt::lshrInPlace(), and llvm::APInt::ugt().

Referenced by gcd(), getConstantPart(), and umax().

◆ RoundAPIntToDouble()

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 2114 of file APInt.h.

References llvm::APInt::roundToDouble().

Referenced by RoundAPIntToFloat(), and llvm::Interpreter::visitAShr().

◆ RoundAPIntToFloat()

float llvm::APIntOps::RoundAPIntToFloat ( const APInt APIVal)
inline

Converts the given APInt to a float vlalue.

Definition at line 2126 of file APInt.h.

References RoundAPIntToDouble().

Referenced by llvm::Interpreter::visitAShr().

◆ RoundDoubleToAPInt()

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

Converts the given double value into a APInt.

This function convert a double value to an APInt value.

Definition at line 714 of file APInt.cpp.

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

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

◆ RoundFloatToAPInt()

APInt llvm::APIntOps::RoundFloatToAPInt ( float  Float,
unsigned  width 
)
inline

Converts a float value into a APInt.

Converts a float value into an APInt value.

Definition at line 2145 of file APInt.h.

References Arg, llvm::hash_value(), and RoundDoubleToAPInt().

Referenced by llvm::ExecutionEngine::getConstantValue(), and llvm::Interpreter::visitAShr().

◆ RoundSignedAPIntToDouble()

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 2121 of file APInt.h.

References llvm::APInt::signedRoundToDouble().

Referenced by llvm::Interpreter::visitAShr().

◆ RoundSignedAPIntToFloat()

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 2133 of file APInt.h.

References RoundDoubleToAPInt(), and llvm::APInt::signedRoundToDouble().

Referenced by llvm::Interpreter::visitAShr().

◆ smax()

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

Determine the larger of two APInts considered to be signed.

Definition at line 2089 of file APInt.h.

References B, and llvm::APInt::sgt().

Referenced by llvm::ScalarEvolution::getSMaxExpr(), IsKnownPredicateViaMinOrMax(), llvm::ConstantRange::operator!=(), and llvm::ConstantRange::smax().

◆ smin()

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

Determine the smaller of two APInts considered to be signed.

Definition at line 2084 of file APInt.h.

References B, and llvm::APInt::slt().

Referenced by IsKnownPredicateViaMinOrMax(), llvm::ConstantRange::operator!=(), and llvm::ConstantRange::smin().

◆ umax()

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

◆ umin()

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