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
These are wrappers over isa* function that allow them to be used in generic algorithms such as llvm:all_of, llvm::none_of, etc.
Macros
#define APFLOAT_DISPATCH_ON_SEMANTICS(METHOD_CALL)
#define PackCategoriesIntoKey(_lhs, _rhs) ((_lhs) * 4 + (_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 void llvm::detail::tcSetLeastSignificantBits (APInt::WordType *dst, unsigned parts, unsigned bits)
hash_code llvm::detail::hash_value (const IEEEFloat &Arg)
int llvm::detail::ilogb (const IEEEFloat &Arg)
IEEEFloat llvm::detail::scalbn (IEEEFloat X, int Exp, roundingMode)
IEEEFloat llvm::detail::frexp (const IEEEFloat &Val, int &Exp, roundingMode RM)
hash_code llvm::detail::hash_value (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)
hash_code llvm::hash_value (const APFloat &Arg)
See friend declarations above.
Variables
static constexpr fltSemantics llvm::semIEEEhalf = {15, -14, 11, 16}
static constexpr fltSemantics llvm::semBFloat = {127, -126, 8, 16}
static constexpr fltSemantics llvm::semIEEEsingle = {127, -126, 24, 32}
static constexpr fltSemantics llvm::semIEEEdouble = {1023, -1022, 53, 64}
static constexpr fltSemantics llvm::semIEEEquad = {16383, -16382, 113, 128}
static constexpr fltSemantics llvm::semFloat8E5M2 = {15, -14, 3, 8}
static constexpr fltSemantics llvm::semFloat8E5M2FNUZ
static constexpr fltSemantics llvm::semFloat8E4M3 = {7, -6, 4, 8}
static constexpr fltSemantics llvm::semFloat8E4M3FN
static constexpr fltSemantics llvm::semFloat8E4M3FNUZ
static constexpr fltSemantics llvm::semFloat8E4M3B11FNUZ
static constexpr fltSemantics llvm::semFloat8E3M4 = {3, -2, 5, 8}
static constexpr fltSemantics llvm::semFloatTF32 = {127, -126, 11, 19}
static constexpr fltSemantics llvm::semFloat8E8M0FNU
static constexpr fltSemantics llvm::semFloat6E3M2FN
static constexpr fltSemantics llvm::semFloat6E2M3FN
static constexpr fltSemantics llvm::semFloat4E2M1FN
static constexpr fltSemantics llvm::semX87DoubleExtended = {16383, -16382, 64, 80}
static constexpr fltSemantics llvm::semBogus = {0, 0, 0, 0}
static constexpr fltSemantics llvm::semPPCDoubleDouble = {-1, 0, 0, 128}
static constexpr fltSemantics llvm::semPPCDoubleDoubleLegacy
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 | | | | | ) | ((_lhs) * 4 + (_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.

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.