LLVM: llvm::DynamicAPInt Class Reference (original) (raw)
This class provides support for dynamic arbitrary-precision arithmetic. More...
#include "[llvm/ADT/DynamicAPInt.h](DynamicAPInt%5F8h%5Fsource.html)"
This class provides support for dynamic arbitrary-precision arithmetic.
Unlike APInt, this extends the precision as necessary to prevent overflows and supports operations between objects with differing internal precisions.
This is optimized for small-values by providing fast-paths for the cases when the value stored fits in 64-bits. We annotate all fastpaths by using the LLVM_LIKELY/LLVM_UNLIKELY annotations. Removing these would result in a 1.2x performance slowdown.
We always_inline all operations; removing these results in a 1.5x performance slowdown.
When isLarge returns true, a SlowMPInt is held in the union. If isSmall returns true, the int64_t is held. We don't have a separate field for indicating this, and instead "steal" memory from ValLarge when it is not in use because we know that the memory layout of APInt is such that BitWidth doesn't overlap with ValSmall (see static_assert_layout). Using std::variant instead would lead to significantly worse performance.
Definition at line 48 of file DynamicAPInt.h.
◆ DynamicAPInt() [2/4]
◆ DynamicAPInt() [3/4]
Definition at line 128 of file DynamicAPInt.h.
References LLVM_ATTRIBUTE_ALWAYS_INLINE.
Referenced by divByPositive(), divByPositiveInPlace(), operator%(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), and operator/=().
◆ ~DynamicAPInt()
◆ DynamicAPInt() [4/4]
◆ divByPositive()
◆ divByPositiveInPlace()
◆ dump()
◆ operator int64_t()
◆ operator!=()
◆ operator%()
◆ operator%=()
◆ operator*()
◆ operator*=()
◆ operator+()
◆ operator++()
◆ operator+=()
◆ operator-() [1/2]
◆ operator-() [2/2]
◆ operator--()
◆ operator-=()
◆ operator/()
◆ operator/=()
◆ operator<()
◆ operator<=()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
We define the operations here in the header to facilitate inlining.
Comparison operators.
Definition at line 265 of file DynamicAPInt.h.
References LLVM_LIKELY.
◆ operator>()
◆ operator>=()
◆ print()
◆ static_assert_layout()
| void DynamicAPInt::static_assert_layout | ( | ) |
|---|
◆ abs
◆ ceilDiv
◆ floorDiv
◆ gcd
◆ hash_value
Redeclarations of friend declaration above to make it discoverable by lookups.
References LLVM_ABI, and LLVM_DUMP_METHOD.
◆ lcm
◆ mod
◆ operator!= [1/2]
◆ operator!= [2/2]
◆ operator% [1/2]
◆ operator% [2/2]
◆ operator%=
◆ operator* [1/2]
◆ operator* [2/2]
◆ operator*=
◆ operator+ [1/2]
◆ operator+ [2/2]
◆ operator+=
◆ operator- [1/2]
◆ operator- [2/2]
◆ operator-=
◆ operator/ [1/2]
◆ operator/ [2/2]
◆ operator/=
◆ operator< [1/2]
◆ operator< [2/2]
◆ operator<= [1/2]
◆ operator<= [2/2]
◆ operator== [1/2]
◆ operator== [2/2]
◆ operator> [1/2]
◆ operator> [2/2]
◆ operator>= [1/2]
◆ operator>= [2/2]
◆ ValLarge
◆ ValSmall
int64_t llvm::DynamicAPInt::ValSmall
The documentation for this class was generated from the following files:
- include/llvm/ADT/DynamicAPInt.h
- lib/Support/DynamicAPInt.cpp