LLVM 22.0.0git
|
A simple class providing dynamic arbitrary-precision arithmetic. More...
#include "llvm/ADT/SlowDynamicAPInt.h"
Public Attributes | |
friend | DynamicAPInt |
Friends | |
LLVM_ABI friend SlowDynamicAPInt | abs (const SlowDynamicAPInt &X) |
Redeclarations of friend declarations above to make it discoverable by lookups. | |
LLVM_ABI friend SlowDynamicAPInt | ceilDiv (const SlowDynamicAPInt &LHS, const SlowDynamicAPInt &RHS) |
LLVM_ABI friend SlowDynamicAPInt | floorDiv (const SlowDynamicAPInt &LHS, const SlowDynamicAPInt &RHS) |
LLVM_ABI friend SlowDynamicAPInt | gcd (const SlowDynamicAPInt &A, const SlowDynamicAPInt &B) |
The operands must be non-negative for gcd. | |
LLVM_ABI friend hash_code | hash_value (const SlowDynamicAPInt &X) |
Overload to compute a hash_code for a SlowDynamicAPInt value. |
A simple class providing dynamic arbitrary-precision arithmetic.
Internally, it stores an APInt, whose width is doubled whenever an overflow occurs at a certain width. The default constructor sets the initial width to 64. SlowDynamicAPInt is primarily intended to be used as a slow fallback path for the upcoming DynamicAPInt class.
Definition at line 35 of file SlowDynamicAPInt.h.
|
explicit |
Definition at line 17 of file SlowDynamicAPInt.cpp.
Referenced by abs, ceilDiv, floorDiv, gcd, hash_value, operator!=(), operator%(), operator%=(), operator*(), operator*=(), operator+(), operator++(), operator+=(), operator-(), operator-(), operator--(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), and SlowDynamicAPInt().
SlowDynamicAPInt::SlowDynamicAPInt | ( | ) |
Definition at line 19 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt().
Referenced by operator%(), operator*(), operator+(), operator-(), operator-(), operator/(), and operator=().
Definition at line 20 of file SlowDynamicAPInt.cpp.
LLVM_DUMP_METHOD void SlowDynamicAPInt::dump | ( | ) | const |
Definition at line 287 of file SlowDynamicAPInt.cpp.
References llvm::dbgs(), LLVM_DUMP_METHOD, and print().
|
inline |
Definition at line 80 of file SlowDynamicAPInt.h.
|
explicit |
Definition at line 24 of file SlowDynamicAPInt.cpp.
bool SlowDynamicAPInt::operator!= | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 130 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), and SlowDynamicAPInt().
SlowDynamicAPInt SlowDynamicAPInt::operator% | ( | const SlowDynamicAPInt & | O | ) | const |
This operation cannot overflow.
Definition at line 234 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt(), and SlowDynamicAPInt().
SlowDynamicAPInt & SlowDynamicAPInt::operator%= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 267 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt().
SlowDynamicAPInt SlowDynamicAPInt::operator* | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 182 of file SlowDynamicAPInt.cpp.
References runOpWithExpandOnOverflow(), SlowDynamicAPInt(), SlowDynamicAPInt(), and llvm::APInt::smul_ov().
SlowDynamicAPInt & SlowDynamicAPInt::operator*= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 259 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt().
SlowDynamicAPInt SlowDynamicAPInt::operator+ | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 174 of file SlowDynamicAPInt.cpp.
References runOpWithExpandOnOverflow(), llvm::APInt::sadd_ov(), SlowDynamicAPInt(), and SlowDynamicAPInt().
SlowDynamicAPInt & SlowDynamicAPInt::operator++ | ( | ) |
Definition at line 271 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt().
SlowDynamicAPInt & SlowDynamicAPInt::operator+= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 251 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt().
SlowDynamicAPInt SlowDynamicAPInt::operator- | ( | ) | const |
Overflow only occurs when the value is the minimum possible value.
Definition at line 239 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt(), and SlowDynamicAPInt().
SlowDynamicAPInt SlowDynamicAPInt::operator- | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 178 of file SlowDynamicAPInt.cpp.
References runOpWithExpandOnOverflow(), SlowDynamicAPInt(), SlowDynamicAPInt(), and llvm::APInt::ssub_ov().
SlowDynamicAPInt & SlowDynamicAPInt::operator-- | ( | ) |
Definition at line 276 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt().
SlowDynamicAPInt & SlowDynamicAPInt::operator-= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 255 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt().
SlowDynamicAPInt SlowDynamicAPInt::operator/ | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 186 of file SlowDynamicAPInt.cpp.
References runOpWithExpandOnOverflow(), llvm::APInt::sdiv_ov(), SlowDynamicAPInt(), and SlowDynamicAPInt().
SlowDynamicAPInt & SlowDynamicAPInt::operator/= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 263 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt().
bool SlowDynamicAPInt::operator< | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 138 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), and SlowDynamicAPInt().
bool SlowDynamicAPInt::operator<= | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 142 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), and SlowDynamicAPInt().
SlowDynamicAPInt & SlowDynamicAPInt::operator= | ( | int64_t | Val | ) |
Definition at line 21 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt(), and SlowDynamicAPInt().
bool SlowDynamicAPInt::operator== | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 126 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), and SlowDynamicAPInt().
bool SlowDynamicAPInt::operator> | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 134 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), and SlowDynamicAPInt().
bool SlowDynamicAPInt::operator>= | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 146 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), and SlowDynamicAPInt().
void SlowDynamicAPInt::print | ( | raw_ostream & | OS | ) | const |
|
friend |
Redeclarations of friend declarations above to make it discoverable by lookups.
References LLVM_ABI, SlowDynamicAPInt(), and X.
|
friend |
References LHS, LLVM_ABI, RHS, and SlowDynamicAPInt().
|
friend |
References LHS, LLVM_ABI, RHS, and SlowDynamicAPInt().
|
friend |
The operands must be non-negative for gcd.
References A(), B(), LLVM_ABI, and SlowDynamicAPInt().
|
friend |
Overload to compute a hash_code for a SlowDynamicAPInt value.
References LLVM_ABI, SlowDynamicAPInt(), and X.
friend llvm::detail::SlowDynamicAPInt::DynamicAPInt |
Definition at line 78 of file SlowDynamicAPInt.h.