LLVM  5.0.0
Functions
llvm::APIntOps Namespace Reference

Functions

const APInt & smin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be signed. More...
 
const APInt & smax (const APInt &A, const APInt &B)
 Determine the larger of two APInts considered to be signed. More...
 
const APInt & umin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be signed. More...
 
const APInt & umax (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

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 A, B, llvm::APInt::countTrailingZeros(), llvm::APInt::lshrInPlace(), and llvm::APInt::ugt().

Referenced by gcd().

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().

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().

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 D, I, and T.

Referenced by llvm::ExecutionEngine::getConstantValue(), and 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 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 2121 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 2133 of file APInt.h.

References llvm::APInt::signedRoundToDouble().

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(), and llvm::ConstantRange::smax().

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 llvm::ConstantRange::smin().

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

Determine the larger of two APInts considered to be unsigned.

Definition at line 2099 of file APInt.h.

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

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

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

Determine the smaller of two APInts considered to be signed.

Definition at line 2094 of file APInt.h.

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

Referenced by llvm::ConstantRange::binaryAnd(), and llvm::ConstantRange::umin().