Lines Matching refs:APFloat
1 //===-- APFloat.cpp - Implement APFloat class -----------------------------===//
15 #include "llvm/ADT/APFloat.h"
54 const fltSemantics APFloat::IEEEhalf = { 15, -14, 11, true };
55 const fltSemantics APFloat::IEEEsingle = { 127, -126, 24, true };
56 const fltSemantics APFloat::IEEEdouble = { 1023, -1022, 53, true };
57 const fltSemantics APFloat::IEEEquad = { 16383, -16382, 113, true };
58 const fltSemantics APFloat::x87DoubleExtended = { 16383, -16382, 64, true };
59 const fltSemantics APFloat::Bogus = { 0, 0, 0, true };
64 const fltSemantics APFloat::PPCDoubleDouble = { 1023, -1022, 106, false };
588 APFloat::initialize(const fltSemantics *ourSemantics)
599 APFloat::freeSignificand()
606 APFloat::assign(const APFloat &rhs)
620 APFloat::copySignificand(const APFloat &rhs)
632 void APFloat::makeNaN(bool SNaN, bool Negative, const APInt *fill)
675 if (semantics == &APFloat::x87DoubleExtended)
679 APFloat APFloat::makeNaN(const fltSemantics &Sem, bool SNaN, bool Negative,
681 APFloat value(Sem, uninitialized);
686 APFloat &
687 APFloat::operator=(const APFloat &rhs)
701 APFloat::bitwiseIsEqual(const APFloat &rhs) const {
730 APFloat::APFloat(const fltSemantics &ourSemantics, integerPart value)
741 APFloat::APFloat(const fltSemantics &ourSemantics) : exponent2(0), sign2(0) {
748 APFloat::APFloat(const fltSemantics &ourSemantics, uninitializedTag tag)
755 APFloat::APFloat(const fltSemantics &ourSemantics,
768 APFloat::APFloat(const fltSemantics &ourSemantics, StringRef text)
775 APFloat::APFloat(const APFloat &rhs) : exponent2(0), sign2(0) {
780 APFloat::~APFloat()
785 // Profile - This method 'profiles' an APFloat for use with FoldingSet.
786 void APFloat::Profile(FoldingSetNodeID& ID) const {
791 APFloat::partCount() const
797 APFloat::semanticsPrecision(const fltSemantics &semantics)
803 APFloat::significandParts() const
805 return const_cast<APFloat *>(this)->significandParts();
809 APFloat::significandParts()
820 APFloat::zeroSignificand()
828 APFloat::incrementSignificand()
841 APFloat::addSignificand(const APFloat &rhs)
856 APFloat::subtractSignificand(const APFloat &rhs, integerPart borrow)
873 APFloat::multiplySignificand(const APFloat &rhs, const APFloat *addend)
928 APFloat extendedAddend(*addend);
966 APFloat::divideSignificand(const APFloat &rhs)
1050 APFloat::significandMSB() const
1056 APFloat::significandLSB() const
1063 APFloat::shiftSignificandRight(unsigned int bits)
1075 APFloat::shiftSignificandLeft(unsigned int bits)
1089 APFloat::cmpResult
1090 APFloat::compareAbsoluteValue(const APFloat &rhs) const
1116 APFloat::opStatus
1117 APFloat::handleOverflow(roundingMode rounding_mode)
1143 APFloat::roundAwayFromZero(roundingMode rounding_mode,
1179 APFloat::opStatus
1180 APFloat::normalize(roundingMode rounding_mode,
1287 APFloat::opStatus
1288 APFloat::addOrSubtractSpecials(const APFloat &rhs, bool subtract)
1342 APFloat::addOrSubtractSignificand(const APFloat &rhs, bool subtract)
1357 APFloat temp_rhs(rhs);
1396 APFloat temp_rhs(rhs);
1413 APFloat::opStatus
1414 APFloat::multiplySpecials(const APFloat &rhs)
1455 APFloat::opStatus
1456 APFloat::divideSpecials(const APFloat &rhs)
1497 APFloat::opStatus
1498 APFloat::modSpecials(const APFloat &rhs)
1535 APFloat::changeSign()
1542 APFloat::clearSign()
1549 APFloat::copySign(const APFloat &rhs)
1556 APFloat::opStatus
1557 APFloat::addOrSubtract(const APFloat &rhs, roundingMode rounding_mode,
1589 APFloat::opStatus
1590 APFloat::add(const APFloat &rhs, roundingMode rounding_mode)
1596 APFloat::opStatus
1597 APFloat::subtract(const APFloat &rhs, roundingMode rounding_mode)
1603 APFloat::opStatus
1604 APFloat::multiply(const APFloat &rhs, roundingMode rounding_mode)
1623 APFloat::opStatus
1624 APFloat::divide(const APFloat &rhs, roundingMode rounding_mode)
1643 APFloat::opStatus
1644 APFloat::remainder(const APFloat &rhs)
1647 APFloat V = *this;
1681 APFloat::opStatus
1682 APFloat::mod(const APFloat &rhs, roundingMode rounding_mode)
1689 APFloat V = *this;
1722 APFloat::opStatus
1723 APFloat::fusedMultiplyAdd(const APFloat &multiplicand,
1724 const APFloat &addend,
1769 APFloat::cmpResult
1770 APFloat::compare(const APFloat &rhs) const
1842 /// APFloat::convert - convert a value of one floating point type to another.
1849 APFloat::opStatus
1850 APFloat
1867 if (&fromSemantics == &APFloat::x87DoubleExtended &&
1868 &toSemantics != &APFloat::x87DoubleExtended && category == fcNaN &&
1935 APFloat::opStatus
1936 APFloat::convertToSignExtendedInteger(integerPart *parts, unsigned int width,
2049 APFloat::opStatus
2050 APFloat::convertToInteger(integerPart *parts, unsigned int width,
2083 APFloat::opStatus
2084 APFloat::convertToInteger(APSInt &result,
2099 APFloat::opStatus
2100 APFloat::convertFromUnsignedParts(const integerPart *src,
2131 APFloat::opStatus
2132 APFloat::convertFromAPInt(const APInt &Val,
2151 APFloat::opStatus
2152 APFloat::convertFromSignExtendedInteger(const integerPart *src,
2180 APFloat::opStatus
2181 APFloat::convertFromZeroExtendedInteger(const integerPart *parts,
2197 APFloat::opStatus
2198 APFloat::convertFromHexadecimalString(StringRef s, roundingMode rounding_mode)
2287 APFloat::opStatus
2288 APFloat::roundSignificandWithExponent(const integerPart *decSigParts,
2313 APFloat decSig(calcSemantics, fcZero, sign);
2314 APFloat pow5(calcSemantics, fcZero, false);
2372 APFloat::opStatus
2373 APFloat::convertFromDecimalString(StringRef str, roundingMode rounding_mode)
2482 APFloat::opStatus
2483 APFloat::convertFromString(StringRef str, roundingMode rounding_mode)
2532 APFloat::convertToHexString(char *dst, unsigned int hexDigits,
2582 APFloat::convertNormalToHexString(char *dst, unsigned int hexDigits,
2685 hash_code llvm::hash_value(const APFloat &Arg) {
2686 if (Arg.category != APFloat::fcNormal)
2700 // Conversion from APFloat to/from host float/double. It may eventually be
2706 // Denormals have exponent minExponent in APFloat, but minExponent-1 in
2710 APFloat::convertF80LongDoubleAPFloatToAPInt() const
2742 APFloat::convertPPCDoubleDoubleAPFloatToAPInt() const
2787 APFloat::convertQuadrupleAPFloatToAPInt() const
2823 APFloat::convertDoubleAPFloatToAPInt() const
2853 APFloat::convertFloatAPFloatToAPInt() const
2882 APFloat::convertHalfAPFloatToAPInt() const
2915 APFloat::bitcastToAPInt() const
2938 APFloat::convertToFloat() const
2947 APFloat::convertToDouble() const
2963 APFloat::initFromF80LongDoubleAPInt(const APInt &api)
2971 initialize(&APFloat::x87DoubleExtended);
2997 APFloat::initFromPPCDoubleDoubleAPInt(const APInt &api)
3007 initialize(&APFloat::PPCDoubleDouble);
3047 APFloat::initFromQuadrupleAPInt(const APInt &api)
3056 initialize(&APFloat::IEEEquad);
3087 APFloat::initFromDoubleAPInt(const APInt &api)
3094 initialize(&APFloat::IEEEdouble);
3120 APFloat::initFromFloatAPInt(const APInt & api)
3127 initialize(&APFloat::IEEEsingle);
3153 APFloat::initFromHalfAPInt(const APInt & api)
3160 initialize(&APFloat::IEEEhalf);
3190 APFloat::initFromAPInt(const APInt& api, bool isIEEE)
3207 APFloat
3208 APFloat::getAllOnesValue(unsigned BitWidth, bool isIEEE)
3210 return APFloat(APInt::getAllOnesValue(BitWidth), isIEEE);
3213 APFloat APFloat::getLargest(const fltSemantics &Sem, bool Negative) {
3214 APFloat Val(Sem, fcNormal, Negative);
3238 APFloat APFloat::getSmallest(const fltSemantics &Sem, bool Negative) {
3239 APFloat Val(Sem, fcNormal, Negative);
3252 APFloat APFloat::getSmallestNormalized(const fltSemantics &Sem, bool Negative) {
3253 APFloat Val(Sem, fcNormal, Negative);
3268 APFloat::APFloat(const APInt& api, bool isIEEE) : exponent2(0), sign2(0) {
3272 APFloat::APFloat(float f) : exponent2(0), sign2(0) {
3276 APFloat::APFloat(double d) : exponent2(0), sign2(0) {
3374 void APFloat::toString(SmallVectorImpl<char> &Str,
3574 bool APFloat::getExactInverse(APFloat *inv) const {
3590 APFloat reciprocal(*semantics, 1ULL);