LLVM 20.0.0git
Classes | Namespaces | Functions
APInt.h File Reference

This file implements a class to represent arbitrary precision integral constant values and operations on them. More...

#include "llvm/Support/Compiler.h"
#include "llvm/Support/MathExtras.h"
#include "llvm/Support/float128.h"
#include <cassert>
#include <climits>
#include <cstring>
#include <optional>
#include <utility>

Go to the source code of this file.

Classes

class  llvm::APInt
 Class for arbitrary precision integers. More...
 
struct  llvm::DenseMapInfo< APInt, void >
 Provide DenseMapInfo for APInt. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 
namespace  llvm::APIntOps
 

Functions

APInt llvm::operator- (APInt)
 
bool llvm::operator== (uint64_t V1, const APInt &V2)
 
bool llvm::operator!= (uint64_t V1, const APInt &V2)
 
APInt llvm::operator~ (APInt v)
 Unary bitwise complement operator.
 
APInt llvm::operator& (APInt a, const APInt &b)
 
APInt llvm::operator& (const APInt &a, APInt &&b)
 
APInt llvm::operator& (APInt a, uint64_t RHS)
 
APInt llvm::operator& (uint64_t LHS, APInt b)
 
APInt llvm::operator| (APInt a, const APInt &b)
 
APInt llvm::operator| (const APInt &a, APInt &&b)
 
APInt llvm::operator| (APInt a, uint64_t RHS)
 
APInt llvm::operator| (uint64_t LHS, APInt b)
 
APInt llvm::operator^ (APInt a, const APInt &b)
 
APInt llvm::operator^ (const APInt &a, APInt &&b)
 
APInt llvm::operator^ (APInt a, uint64_t RHS)
 
APInt llvm::operator^ (uint64_t LHS, APInt b)
 
raw_ostream & llvm::operator<< (raw_ostream &OS, const APInt &I)
 
APInt llvm::operator+ (APInt a, const APInt &b)
 
APInt llvm::operator+ (const APInt &a, APInt &&b)
 
APInt llvm::operator+ (APInt a, uint64_t RHS)
 
APInt llvm::operator+ (uint64_t LHS, APInt b)
 
APInt llvm::operator- (APInt a, const APInt &b)
 
APInt llvm::operator- (const APInt &a, APInt &&b)
 
APInt llvm::operator- (APInt a, uint64_t RHS)
 
APInt llvm::operator- (uint64_t LHS, APInt b)
 
APInt llvm::operator* (APInt a, uint64_t RHS)
 
APInt llvm::operator* (uint64_t LHS, APInt b)
 
const APInt & llvm::APIntOps::smin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be signed.
 
const APInt & llvm::APIntOps::smax (const APInt &A, const APInt &B)
 Determine the larger of two APInts considered to be signed.
 
const APInt & llvm::APIntOps::umin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be unsigned.
 
const APInt & llvm::APIntOps::umax (const APInt &A, const APInt &B)
 Determine the larger of two APInts considered to be unsigned.
 
const APInt llvm::APIntOps::abds (const APInt &A, const APInt &B)
 Determine the absolute difference of two APInts considered to be signed.
 
const APInt llvm::APIntOps::abdu (const APInt &A, const APInt &B)
 Determine the absolute difference of two APInts considered to be unsigned.
 
APInt llvm::APIntOps::avgFloorS (const APInt &C1, const APInt &C2)
 Compute the floor of the signed average of C1 and C2.
 
APInt llvm::APIntOps::avgFloorU (const APInt &C1, const APInt &C2)
 Compute the floor of the unsigned average of C1 and C2.
 
APInt llvm::APIntOps::avgCeilS (const APInt &C1, const APInt &C2)
 Compute the ceil of the signed average of C1 and C2.
 
APInt llvm::APIntOps::avgCeilU (const APInt &C1, const APInt &C2)
 Compute the ceil of the unsigned average of C1 and C2.
 
APInt llvm::APIntOps::mulhs (const APInt &C1, const APInt &C2)
 Performs (2*N)-bit multiplication on sign-extended operands.
 
APInt llvm::APIntOps::mulhu (const APInt &C1, const APInt &C2)
 Performs (2*N)-bit multiplication on zero-extended operands.
 
APInt llvm::APIntOps::GreatestCommonDivisor (APInt A, APInt B)
 Compute GCD of two unsigned APInt values.
 
double llvm::APIntOps::RoundAPIntToDouble (const APInt &APIVal)
 Converts the given APInt to a double value.
 
double llvm::APIntOps::RoundSignedAPIntToDouble (const APInt &APIVal)
 Converts the given APInt to a double value.
 
float llvm::APIntOps::RoundAPIntToFloat (const APInt &APIVal)
 Converts the given APInt to a float value.
 
float llvm::APIntOps::RoundSignedAPIntToFloat (const APInt &APIVal)
 Converts the given APInt to a float value.
 
APInt llvm::APIntOps::RoundDoubleToAPInt (double Double, unsigned width)
 Converts the given double value into a APInt.
 
APInt llvm::APIntOps::RoundFloatToAPInt (float Float, unsigned width)
 Converts a float value into a APInt.
 
APInt llvm::APIntOps::RoundingUDiv (const APInt &A, const APInt &B, APInt::Rounding RM)
 Return A unsign-divided by B, rounded by the given rounding mode.
 
APInt llvm::APIntOps::RoundingSDiv (const APInt &A, const APInt &B, APInt::Rounding RM)
 Return A sign-divided by B, rounded by the given rounding mode.
 
std::optional< APIntllvm::APIntOps::SolveQuadraticEquationWrap (APInt A, APInt B, APInt C, unsigned RangeWidth)
 Let q(n) = An^2 + Bn + C, and BW = bit width of the value range (e.g.
 
std::optional< unsignedllvm::APIntOps::GetMostSignificantDifferentBit (const APInt &A, const APInt &B)
 Compare two values, and if they are different, return the position of the most significant bit that is different in the values.
 
APInt llvm::APIntOps::ScaleBitMask (const APInt &A, unsigned NewBitWidth, bool MatchAllBits=false)
 Splat/Merge neighboring bits to widen/narrow the bitmask represented by.
 
hash_code llvm::hash_value (const APInt &Arg)
 
void llvm::StoreIntToMemory (const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes)
 StoreIntToMemory - Fills the StoreBytes bytes of memory starting from Dst with the integer held in IntVal.
 
void llvm::LoadIntFromMemory (APInt &IntVal, const uint8_t *Src, unsigned LoadBytes)
 LoadIntFromMemory - Loads the integer stored in the LoadBytes bytes starting from Src into IntVal, which is assumed to be wide enough and to hold zero.
 

Detailed Description

This file implements a class to represent arbitrary precision integral constant values and operations on them.

Definition in file APInt.h.