LLVM 20.0.0git
|
A simple class providing dynamic arbitrary-precision arithmetic. More...
#include "llvm/ADT/SlowDynamicAPInt.h"
Public Attributes | |
friend | DynamicAPInt |
Friends | |
SlowDynamicAPInt | abs (const SlowDynamicAPInt &X) |
Redeclarations of friend declarations above to make it discoverable by lookups. | |
SlowDynamicAPInt | ceilDiv (const SlowDynamicAPInt &LHS, const SlowDynamicAPInt &RHS) |
SlowDynamicAPInt | floorDiv (const SlowDynamicAPInt &LHS, const SlowDynamicAPInt &RHS) |
SlowDynamicAPInt | gcd (const SlowDynamicAPInt &A, const SlowDynamicAPInt &B) |
The operands must be non-negative for gcd. | |
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 34 of file SlowDynamicAPInt.h.
|
explicit |
Definition at line 17 of file SlowDynamicAPInt.cpp.
SlowDynamicAPInt::SlowDynamicAPInt | ( | ) |
Definition at line 19 of file SlowDynamicAPInt.cpp.
Referenced by operator%(), operator*(), operator+(), operator-(), operator/(), and operator=().
Definition at line 20 of file SlowDynamicAPInt.cpp.
void SlowDynamicAPInt::dump | ( | ) | const |
Definition at line 286 of file SlowDynamicAPInt.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 79 of file SlowDynamicAPInt.h.
References llvm::APInt::getBitWidth().
|
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 llvm::APInt::sext().
SlowDynamicAPInt SlowDynamicAPInt::operator% | ( | const SlowDynamicAPInt & | O | ) | const |
This operation cannot overflow.
Definition at line 234 of file SlowDynamicAPInt.cpp.
References llvm::APInt::getBitWidth(), llvm::APInt::sext(), SlowDynamicAPInt(), and llvm::APInt::srem().
SlowDynamicAPInt & SlowDynamicAPInt::operator%= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 267 of file SlowDynamicAPInt.cpp.
SlowDynamicAPInt SlowDynamicAPInt::operator* | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 182 of file SlowDynamicAPInt.cpp.
References runOpWithExpandOnOverflow(), SlowDynamicAPInt(), and llvm::APInt::smul_ov().
SlowDynamicAPInt & SlowDynamicAPInt::operator*= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 259 of file SlowDynamicAPInt.cpp.
SlowDynamicAPInt SlowDynamicAPInt::operator+ | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 174 of file SlowDynamicAPInt.cpp.
References runOpWithExpandOnOverflow(), llvm::APInt::sadd_ov(), and SlowDynamicAPInt().
SlowDynamicAPInt & SlowDynamicAPInt::operator++ | ( | ) |
Definition at line 271 of file SlowDynamicAPInt.cpp.
SlowDynamicAPInt & SlowDynamicAPInt::operator+= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 251 of file SlowDynamicAPInt.cpp.
SlowDynamicAPInt SlowDynamicAPInt::operator- | ( | ) | const |
Overflow only occurs when the value is the minimum possible value.
Definition at line 239 of file SlowDynamicAPInt.cpp.
References llvm::APInt::getBitWidth(), llvm::APInt::isMinSignedValue(), llvm::APInt::sext(), and SlowDynamicAPInt().
SlowDynamicAPInt SlowDynamicAPInt::operator- | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 178 of file SlowDynamicAPInt.cpp.
References runOpWithExpandOnOverflow(), SlowDynamicAPInt(), and llvm::APInt::ssub_ov().
SlowDynamicAPInt & SlowDynamicAPInt::operator-- | ( | ) |
Definition at line 276 of file SlowDynamicAPInt.cpp.
SlowDynamicAPInt & SlowDynamicAPInt::operator-= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 255 of file SlowDynamicAPInt.cpp.
SlowDynamicAPInt SlowDynamicAPInt::operator/ | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 186 of file SlowDynamicAPInt.cpp.
References runOpWithExpandOnOverflow(), llvm::APInt::sdiv_ov(), and SlowDynamicAPInt().
SlowDynamicAPInt & SlowDynamicAPInt::operator/= | ( | const SlowDynamicAPInt & | O | ) |
Definition at line 263 of file SlowDynamicAPInt.cpp.
bool SlowDynamicAPInt::operator< | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 138 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), llvm::APInt::sext(), and llvm::APInt::slt().
bool SlowDynamicAPInt::operator<= | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 142 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), llvm::APInt::sext(), and llvm::APInt::sle().
SlowDynamicAPInt & SlowDynamicAPInt::operator= | ( | int64_t | Val | ) |
Definition at line 21 of file SlowDynamicAPInt.cpp.
References SlowDynamicAPInt().
bool SlowDynamicAPInt::operator== | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 126 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), and llvm::APInt::sext().
bool SlowDynamicAPInt::operator> | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 134 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), llvm::APInt::sext(), and llvm::APInt::sgt().
bool SlowDynamicAPInt::operator>= | ( | const SlowDynamicAPInt & | O | ) | const |
Definition at line 146 of file SlowDynamicAPInt.cpp.
References getMaxWidth(), llvm::APInt::sext(), and llvm::APInt::sge().
void SlowDynamicAPInt::print | ( | raw_ostream & | OS | ) | const |
|
friend |
Redeclarations of friend declarations above to make it discoverable by lookups.
|
friend |
|
friend |
|
friend |
The operands must be non-negative for gcd.
|
friend |
Overload to compute a hash_code for a SlowDynamicAPInt value.
friend llvm::detail::SlowDynamicAPInt::DynamicAPInt |
Definition at line 77 of file SlowDynamicAPInt.h.