LLVM 23.0.0git
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_ostreamllvm::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 APIntllvm::APIntOps::smin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be signed.
const APIntllvm::APIntOps::smax (const APInt &A, const APInt &B)
 Determine the larger of two APInts considered to be signed.
const APIntllvm::APIntOps::umin (const APInt &A, const APInt &B)
 Determine the smaller of two APInts considered to be unsigned.
const APIntllvm::APIntOps::umax (const APInt &A, const APInt &B)
 Determine the larger of two APInts considered to be unsigned.
APInt llvm::APIntOps::abds (const APInt &A, const APInt &B)
 Determine the absolute difference of two APInts considered to be signed.
APInt llvm::APIntOps::abdu (const APInt &A, const APInt &B)
 Determine the absolute difference of two APInts considered to be unsigned.
LLVM_ABI APInt llvm::APIntOps::avgFloorS (const APInt &C1, const APInt &C2)
 Compute the floor of the signed average of C1 and C2.
LLVM_ABI APInt llvm::APIntOps::avgFloorU (const APInt &C1, const APInt &C2)
 Compute the floor of the unsigned average of C1 and C2.
LLVM_ABI APInt llvm::APIntOps::avgCeilS (const APInt &C1, const APInt &C2)
 Compute the ceil of the signed average of C1 and C2.
LLVM_ABI APInt llvm::APIntOps::avgCeilU (const APInt &C1, const APInt &C2)
 Compute the ceil of the unsigned average of C1 and C2.
LLVM_ABI APInt llvm::APIntOps::mulhs (const APInt &C1, const APInt &C2)
 Performs (2*N)-bit multiplication on sign-extended operands.
LLVM_ABI APInt llvm::APIntOps::mulhu (const APInt &C1, const APInt &C2)
 Performs (2*N)-bit multiplication on zero-extended operands.
LLVM_ABI APInt llvm::APIntOps::mulsExtended (const APInt &C1, const APInt &C2)
 Performs (2*N)-bit multiplication on sign-extended operands.
LLVM_ABI APInt llvm::APIntOps::muluExtended (const APInt &C1, const APInt &C2)
 Performs (2*N)-bit multiplication on zero-extended operands.
LLVM_ABI APInt llvm::APIntOps::pow (const APInt &X, int64_t N)
 Compute X^N for N>=0.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI 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.
LLVM_ABI APInt llvm::APIntOps::ScaleBitMask (const APInt &A, unsigned NewBitWidth, bool MatchAllBits=false)
 Splat/Merge neighboring bits to widen/narrow the bitmask represented by.
LLVM_ABI APInt llvm::APIntOps::fshl (const APInt &Hi, const APInt &Lo, const APInt &Shift)
 Perform a funnel shift left.
LLVM_ABI APInt llvm::APIntOps::fshr (const APInt &Hi, const APInt &Lo, const APInt &Shift)
 Perform a funnel shift right.
LLVM_ABI APInt llvm::APIntOps::clmul (const APInt &LHS, const APInt &RHS)
 Perform a carry-less multiply, also known as XOR multiplication, and return low-bits.
LLVM_ABI APInt llvm::APIntOps::clmulr (const APInt &LHS, const APInt &RHS)
 Perform a reversed carry-less multiply.
LLVM_ABI APInt llvm::APIntOps::clmulh (const APInt &LHS, const APInt &RHS)
 Perform a carry-less multiply, and return high-bits.
LLVM_ABI hash_code llvm::hash_value (const APInt &Arg)
LLVM_ABI void llvm::StoreIntToMemory (const APInt &IntVal, uint8_t *Dst, unsigned StoreBytes)
 Fills the StoreBytes bytes of memory starting from Dst with the integer held in IntVal.
LLVM_ABI void llvm::LoadIntFromMemory (APInt &IntVal, const uint8_t *Src, unsigned LoadBytes)
 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.