LLVM: lib/Support/APFloat.cpp File Reference (original) (raw)

Go to the source code of this file.

Namespaces
namespace llvm
This is an optimization pass for GlobalISel generic memory operations.
namespace llvm::detail
A self-contained host- and target-independent arbitrary-precision floating-point software implementation.
Macros
#define APFLOAT_DISPATCH_ON_SEMANTICS(METHOD_CALL)
#define PackCategoriesIntoKey(_lhs, _rhs)
A macro used to combine two fcCategory enums into one key which can be used in a switch statement to classify how the interaction of two APFloat's categories affects an operation.
Functions
static constexpr APFloatBase::ExponentType llvm::exponentZero (const fltSemantics &semantics)
static constexpr APFloatBase::ExponentType llvm::exponentInf (const fltSemantics &semantics)
static constexpr APFloatBase::ExponentType llvm::exponentNaN (const fltSemantics &semantics)
static Error llvm::createError (const Twine &Err)
static constexpr unsigned int llvm::partCountForBits (unsigned int bits)
static unsigned int llvm::decDigitValue (unsigned int c)
static Expected< int > llvm::readExponent (StringRef::iterator begin, StringRef::iterator end)
static Expected< int > llvm::totalExponent (StringRef::iterator p, StringRef::iterator end, int exponentAdjustment)
static Expected< StringRef::iterator > llvm::skipLeadingZeroesAndAnyDot (StringRef::iterator begin, StringRef::iterator end, StringRef::iterator *dot)
static Error llvm::interpretDecimal (StringRef::iterator begin, StringRef::iterator end, decimalInfo *D)
static Expected< lostFraction > llvm::trailingHexadecimalFraction (StringRef::iterator p, StringRef::iterator end, unsigned int digitValue)
static lostFraction llvm::lostFractionThroughTruncation (const APFloatBase::integerPart *parts, unsigned int partCount, unsigned int bits)
static lostFraction llvm::shiftRight (APFloatBase::integerPart *dst, unsigned int parts, unsigned int bits)
static lostFraction llvm::combineLostFractions (lostFraction moreSignificant, lostFraction lessSignificant)
static unsigned int llvm::HUerrBound (bool inexactMultiply, unsigned int HUerr1, unsigned int HUerr2)
static APFloatBase::integerPart llvm::ulpsFromBoundary (const APFloatBase::integerPart *parts, unsigned int bits, bool isNearest)
static unsigned int llvm::powerOf5 (APFloatBase::integerPart *dst, unsigned int power)
static unsigned int llvm::partAsHex (char *dst, APFloatBase::integerPart part, unsigned int count, const char *hexDigitChars)
static char * llvm::writeUnsignedDecimal (char *dst, unsigned int n)
static char * llvm::writeSignedDecimal (char *dst, int value)
static APFloat llvm::harrisonUlp (const APFloat &X)
static void llvm::detail::tcSetLeastSignificantBits (APInt::WordType *dst, unsigned parts, unsigned bits)
LLVM_ABI hash_code llvm::detail::hash_value (const IEEEFloat &Arg)
LLVM_ABI int llvm::detail::ilogb (const IEEEFloat &Arg)
LLVM_ABI IEEEFloat llvm::detail::scalbn (IEEEFloat X, int Exp, roundingMode RoundingMode)
LLVM_ABI IEEEFloat llvm::detail::frexp (const IEEEFloat &Val, int &Exp, roundingMode RM)
static std::pair< APFloat, APFloat > llvm::detail::fastTwoSum (APFloat X, APFloat Y)
LLVM_ABI hash_code llvm::detail::hash_value (const DoubleAPFloat &Arg)
int llvm::detail::ilogb (const DoubleAPFloat &Arg)
DoubleAPFloat llvm::detail::scalbn (const DoubleAPFloat &Arg, int Exp, APFloat::roundingMode RM)
DoubleAPFloat llvm::detail::frexp (const DoubleAPFloat &Arg, int &Exp, APFloat::roundingMode RM)
LLVM_ABI hash_code llvm::hash_value (const APFloat &Arg)
See friend declarations above.
Variables
const unsigned int llvm::maxExponent = 16383
const unsigned int llvm::maxPrecision = 113
const unsigned int llvm::maxPowerOfFiveExponent = maxExponent + maxPrecision - 1
const unsigned int llvm::maxPowerOfFiveParts
static const char llvm::hexDigitsLower [] = "0123456789abcdef0"
static const char llvm::hexDigitsUpper [] = "0123456789ABCDEF0"
static const char llvm::infinityL [] = "infinity"
static const char llvm::infinityU [] = "INFINITY"
static const char llvm::NaNL [] = "nan"
static const char llvm::NaNU [] = "NAN"

APFLOAT_DISPATCH_ON_SEMANTICS

#define APFLOAT_DISPATCH_ON_SEMANTICS ( METHOD_CALL )

Value:

do { \

if (usesLayout(getSemantics())) \

return U.IEEE.METHOD_CALL; \

if (usesLayout(getSemantics())) \

return U.Double.METHOD_CALL; \

llvm_unreachable("Unexpected semantics"); \

} while (false)

Definition at line 31 of file APFloat.cpp.

PackCategoriesIntoKey

#define PackCategoriesIntoKey ( _lhs,
_rhs )

Value:

A macro used to combine two fcCategory enums into one key which can be used in a switch statement to classify how the interaction of two APFloat's categories affects an operation.

TODO: If clang source code is ever allowed to use constexpr in its own codebase, change this into a static inline function.

Definition at line 48 of file APFloat.cpp.

Referenced by llvm::detail::IEEEFloat::compare().