|
LLVM
5.0.0
|
#include "llvm/ADT/APFloat.h"
Static Public Member Functions | |
| static APFloat | getZero (const fltSemantics &Sem, bool Negative=false) |
| Factory for Positive and Negative Zero. More... | |
| static APFloat | getInf (const fltSemantics &Sem, bool Negative=false) |
| Factory for Positive and Negative Infinity. More... | |
| static APFloat | getNaN (const fltSemantics &Sem, bool Negative=false, unsigned type=0) |
| Factory for NaN values. More... | |
| static APFloat | getQNaN (const fltSemantics &Sem, bool Negative=false, const APInt *payload=nullptr) |
| Factory for QNaN values. More... | |
| static APFloat | getSNaN (const fltSemantics &Sem, bool Negative=false, const APInt *payload=nullptr) |
| Factory for SNaN values. More... | |
| static APFloat | getLargest (const fltSemantics &Sem, bool Negative=false) |
| Returns the largest finite number in the given semantics. More... | |
| static APFloat | getSmallest (const fltSemantics &Sem, bool Negative=false) |
| Returns the smallest (by magnitude) finite number in the given semantics. More... | |
| static APFloat | getSmallestNormalized (const fltSemantics &Sem, bool Negative=false) |
| Returns the smallest (by magnitude) normalized finite number in the given semantics. More... | |
| static APFloat | getAllOnesValue (unsigned BitWidth, bool isIEEE=false) |
| Returns a float which is bitcasted from an all one value int. More... | |
| static APFloat | copySign (APFloat Value, const APFloat &Sign) |
| A static helper to produce a copy of an APFloat value with its sign copied from some other APFloat. More... | |
Static Public Member Functions inherited from llvm::APFloatBase | |
| static unsigned int | semanticsPrecision (const fltSemantics &) |
| static ExponentType | semanticsMinExponent (const fltSemantics &) |
| static ExponentType | semanticsMaxExponent (const fltSemantics &) |
| static unsigned int | semanticsSizeInBits (const fltSemantics &) |
| static unsigned | getSizeInBits (const fltSemantics &Sem) |
| Returns the size of the floating point number (in bits) in the given semantics. More... | |
| static const fltSemantics & | IEEEhalf () LLVM_READNONE |
| static const fltSemantics & | IEEEsingle () LLVM_READNONE |
| static const fltSemantics & | IEEEdouble () LLVM_READNONE |
| static const fltSemantics & | IEEEquad () LLVM_READNONE |
| static const fltSemantics & | PPCDoubleDouble () LLVM_READNONE |
| static const fltSemantics & | x87DoubleExtended () LLVM_READNONE |
| static const fltSemantics & | Bogus () LLVM_READNONE |
| A Pseudo fltsemantic used to construct APFloats that cannot conflict with anything real. More... | |
Public Attributes | |
| friend | IEEEFloat |
| friend | DoubleAPFloat |
Friends | |
| hash_code | hash_value (const APFloat &Arg) |
| See friend declarations above. More... | |
| int | ilogb (const APFloat &Arg) |
| APFloat | scalbn (APFloat X, int Exp, roundingMode RM) |
| APFloat | frexp (const APFloat &X, int &Exp, roundingMode RM) |
Additional Inherited Members | |
Public Types inherited from llvm::APFloatBase | |
| enum | cmpResult { cmpLessThan, cmpEqual, cmpGreaterThan, cmpUnordered } |
| IEEE-754R 5.11: Floating Point Comparison Relations. More... | |
| enum | roundingMode { rmNearestTiesToEven, rmTowardPositive, rmTowardNegative, rmTowardZero, rmNearestTiesToAway } |
| IEEE-754R 4.3: Rounding-direction attributes. More... | |
| enum | opStatus { opOK = 0x00, opInvalidOp = 0x01, opDivByZero = 0x02, opOverflow = 0x04, opUnderflow = 0x08, opInexact = 0x10 } |
| IEEE-754R 7: Default exception handling. More... | |
| enum | fltCategory { fcInfinity, fcNaN, fcNormal, fcZero } |
| Category of internally-represented number. More... | |
| enum | uninitializedTag { uninitialized } |
| Convenience enum used to construct an uninitialized APFloat. More... | |
| enum | IlogbErrorKinds { IEK_Zero = INT_MIN + 1, IEK_NaN = INT_MIN, IEK_Inf = INT_MAX } |
Enumeration of ilogb error results. More... | |
| typedef APInt::WordType | integerPart |
| typedef signed short | ExponentType |
| A signed type to represent a floating point numbers unbiased exponent. More... | |
Static Public Attributes inherited from llvm::APFloatBase | |
| static const unsigned | integerPartWidth = APInt::APINT_BITS_PER_WORD |
|
inline |
| llvm::APFloat::APFloat | ( | const fltSemantics & | Semantics, |
| StringRef | S | ||
| ) |
Definition at line 4436 of file APFloat.cpp.
References convertFromString(), and llvm::APFloatBase::rmNearestTiesToEven.
|
inline |
|
inline |
|
inline |
|
default |
|
default |
|
inline |
Definition at line 941 of file APFloat.h.
References assert(), getSemantics(), and llvm_unreachable().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), llvm::detail::DoubleAPFloat::isInteger(), llvm::detail::DoubleAPFloat::multiply(), and operator+().
|
inline |
Definition at line 1094 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by llvm::DwarfUnit::addConstantFPValue(), llvm::FunctionComparator::cmpAPFloats(), llvm::detail::DoubleAPFloat::convertFromAPInt(), llvm::detail::DoubleAPFloat::convertFromSignExtendedInteger(), llvm::detail::DoubleAPFloat::convertFromString(), llvm::detail::DoubleAPFloat::convertFromZeroExtendedInteger(), llvm::detail::DoubleAPFloat::divide(), emitDebugLocValue(), emitGlobalConstantFP(), llvm::R600TargetLowering::EmitInstrWithCustomInserter(), llvm::detail::DoubleAPFloat::fusedMultiplyAdd(), llvm::ExecutionEngine::getConstantValue(), llvm::detail::DoubleAPFloat::getExactInverse(), llvm::AArch64_AM::getFP16Imm(), llvm::ARM_AM::getFP16Imm(), llvm::AArch64_AM::getFP32Imm(), llvm::ARM_AM::getFP32Imm(), llvm::AArch64_AM::getFP64Imm(), llvm::ARM_AM::getFP64Imm(), llvm::SelectionDAG::getNode(), llvm::HexagonLowerToMC(), llvm::detail::DoubleAPFloat::mod(), llvm::detail::DoubleAPFloat::next(), llvm::NVPTXFloatMCExpr::printImpl(), Profile(), llvm::detail::DoubleAPFloat::remainder(), llvm::detail::DoubleAPFloat::roundToIntegral(), toString(), and WriteConstantInternal().
Definition at line 1112 of file APFloat.h.
References getSemantics(), and llvm_unreachable().
Referenced by llvm::DenseMapAPFloatKeyInfo::isEqual(), llvm::ConstantFP::isExactlyValue(), llvm::X86TargetLowering::isFPImmLegal(), and toString().
|
inline |
Definition at line 1050 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS, and changeSign().
Referenced by changeSign(), clearSign(), copySign(), GetNegatedExpression(), llvm::SelectionDAG::getNode(), llvm::detail::DoubleAPFloat::multiply(), llvm::neg(), and llvm::X86TargetLowering::X86TargetLowering().
|
inline |
Definition at line 1051 of file APFloat.h.
References changeSign(), and isNegative().
Referenced by llvm::abs(), llvm::SelectionDAG::getNode(), LowerFCOPYSIGN(), and llvm::InstCombiner::visitFCmpInst().
Definition at line 1102 of file APFloat.h.
References assert(), getSemantics(), and llvm_unreachable().
Referenced by llvm::ConstantFoldCompareInstruction(), fmed3AMDGCN(), llvm::MDNode::getMostGenericFPMath(), llvm::isMathLibCallNoop(), llvm::maxnum(), llvm::minnum(), llvm::AMDGPUTargetLowering::performClampCombine(), and llvm::InstCombiner::visitFCmpInst().
| APFloat::opStatus llvm::APFloat::convert | ( | const fltSemantics & | ToSemantics, |
| roundingMode | RM, | ||
| bool * | losesInfo | ||
| ) |
Definition at line 4441 of file APFloat.cpp.
References assert(), llvm::detail::IEEEFloat::convert(), getSemantics(), llvm_unreachable(), llvm::APFloatBase::opOK, llvm::MipsISD::Ret, llvm::semPPCDoubleDouble, and llvm::semPPCDoubleDoubleLegacy.
Referenced by llvm::ConstantFoldCastInstruction(), emitDebugValueComment(), fitsInFPType(), llvm::ConstantFP::get(), llvm::SelectionDAG::getConstantFP(), llvm::SelectionDAG::getNode(), llvm::ConstantFP::isExactlyValue(), llvm::ConstantFPSDNode::isExactlyValue(), llvm::ConstantFP::isValueValidForType(), LLVMConstRealGetDouble(), llvm::ARMAsmPrinter::lowerOperand(), llvm::NVPTXFloatMCExpr::printImpl(), valueHasFloatPrecision(), llvm::InstCombiner::visitCallInst(), llvm::InstCombiner::visitFCmpInst(), WriteConstantInternal(), and llvm::X86TargetLowering::X86TargetLowering().
|
inline |
Definition at line 1077 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by llvm::ConstantFoldCastInstruction(), llvm::detail::DoubleAPFloat::convertFromAPInt(), llvm::ExecutionEngine::getConstantValue(), and llvm::SelectionDAG::getNode().
|
inline |
Definition at line 1081 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by llvm::detail::DoubleAPFloat::convertFromSignExtendedInteger().
| APFloat::opStatus llvm::APFloat::convertFromString | ( | StringRef | Str, |
| roundingMode | RM | ||
| ) |
Definition at line 4424 of file APFloat.cpp.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by APFloat(), llvm::detail::DoubleAPFloat::convertFromString(), and llvm::StringRef::getAsDouble().
|
inline |
Definition at line 1087 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by llvm::detail::DoubleAPFloat::convertFromZeroExtendedInteger().
|
inline |
Definition at line 1097 of file APFloat.h.
References llvm::detail::IEEEFloat::convertToDouble().
Referenced by emitDebugValueComment(), llvm::StringRef::getAsDouble(), LLVMConstRealGetDouble(), llvm::WebAssemblyMCInstLower::Lower(), llvm::ARMAsmPrinter::lowerOperand(), and WriteConstantInternal().
|
inline |
Definition at line 1098 of file APFloat.h.
References llvm::detail::IEEEFloat::convertToFloat().
Referenced by emitDebugValueComment(), llvm::FPMathOperator::getFPAccuracy(), LLVMConstRealGetDouble(), llvm::WebAssemblyMCInstLower::Lower(), and WriteConstantInternal().
|
inline |
Definition at line 1122 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by toString().
|
inline |
Definition at line 1069 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by llvm::ConstantFoldCastInstruction(), convertToInteger(), ConvertToSInt(), llvm::BuildVectorSDNode::getConstantFPSplatPow2ToLog2Int(), llvm::ExecutionEngine::getConstantValue(), and llvm::SelectionDAG::getNode().
| APFloat::opStatus llvm::APFloat::convertToInteger | ( | APSInt & | Result, |
| roundingMode | RM, | ||
| bool * | IsExact | ||
| ) | const |
Definition at line 4504 of file APFloat.cpp.
References convertToInteger(), llvm::APInt::getBitWidth(), llvm::APInt::getNumWords(), llvm::APSInt::isSigned(), and llvm::sys::fs::status().
Definition at line 1055 of file APFloat.h.
References changeSign(), and isNegative().
Referenced by copySign(), and llvm::SelectionDAG::getNode().
A static helper to produce a copy of an APFloat value with its sign copied from some other APFloat.
Definition at line 1062 of file APFloat.h.
References copySign().
|
inline |
Definition at line 968 of file APFloat.h.
References assert(), getSemantics(), and llvm_unreachable().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::detail::DoubleAPFloat::divide(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), operator/(), and llvm::InstCombiner::visitCallInst().
| LLVM_DUMP_METHOD void llvm::APFloat::dump | ( | ) | const |
Definition at line 4493 of file APFloat.cpp.
References llvm::dbgs(), and print().
|
inline |
Definition at line 995 of file APFloat.h.
References assert(), getSemantics(), and llvm_unreachable().
Referenced by llvm::detail::DoubleAPFloat::fusedMultiplyAdd(), llvm::SelectionDAG::getNode(), and llvm::detail::DoubleAPFloat::multiply().
Returns a float which is bitcasted from an all one value int.
| BitWidth | - Select float type |
| isIEEE | - If 128 bit number, select between PPC and IEEE |
Definition at line 4464 of file APFloat.cpp.
References assert(), llvm::APInt::getAllOnesValue(), llvm_unreachable(), llvm::semIEEEdouble, llvm::semIEEEhalf, llvm::semIEEEquad, llvm::semIEEEsingle, llvm::semPPCDoubleDouble, and llvm::semX87DoubleExtended.
Referenced by llvm::Constant::getAllOnesValue().
|
inline |
Definition at line 1139 of file APFloat.h.
References llvm::detail::IEEEFloat::getCategory().
Referenced by isInfinity(), isNaN(), and isZero().
Definition at line 1161 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by CvtFDivConstToReciprocal(), and llvm::detail::DoubleAPFloat::getExactInverse().
|
inlinestatic |
Factory for Positive and Negative Infinity.
| Negative | True iff the number should be negative. |
Definition at line 864 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
Referenced by llvm::ConstantFP::getInfinity().
|
inlinestatic |
Returns the largest finite number in the given semantics.
| Negative | - True iff the number should be negative |
Definition at line 904 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
|
inlinestatic |
Factory for NaN values.
| Negative | - True iff the NaN generated should be negative. |
| type | - The unspecified fill bits for creating the NaN, 0 by default. The value is truncated as necessary. |
Definition at line 875 of file APFloat.h.
References getQNaN().
Referenced by llvm::ConstantFP::getNaN().
|
inlinestatic |
Factory for QNaN values.
Definition at line 886 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
Referenced by getNaN(), and toString().
|
inline |
Definition at line 1140 of file APFloat.h.
Referenced by add(), bitwiseIsEqual(), llvm::FunctionComparator::cmpAPFloats(), compare(), convert(), CvtFDivConstToReciprocal(), divide(), llvm::frexp(), fusedMultiplyAdd(), llvm::ConstantFP::get(), llvm::hash_value(), llvm::ConstantFP::isExactlyValue(), llvm::isMathLibCallNoop(), llvm::ConstantFP::isValueValidForType(), mod(), multiply(), llvm::AMDGPUTargetLowering::performClampCombine(), llvm::AMDGPUTargetLowering::PerformDAGCombine(), remainder(), llvm::scalbn(), subtract(), toString(), llvm::InstCombiner::visitCallInst(), and WriteConstantInternal().
|
inlinestatic |
Returns the smallest (by magnitude) finite number in the given semantics.
Might be denormalized, which implies a relative loss of precision.
| Negative | - True iff the number should be negative |
Definition at line 914 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
|
inlinestatic |
Returns the smallest (by magnitude) normalized finite number in the given semantics.
| Negative | - True iff the number should be negative |
Definition at line 924 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
Referenced by llvm::InstCombiner::visitFCmpInst().
|
inlinestatic |
Factory for SNaN values.
Definition at line 894 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
|
inlinestatic |
Factory for Positive and Negative Zero.
| Negative | True iff the number should be negative. |
Definition at line 855 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
Referenced by llvm::ExecutionEngine::getConstantValue(), llvm::ConstantFP::getNegativeZero(), llvm::Constant::getNullValue(), llvm::AMDGPUTargetLowering::performClampCombine(), and llvm::X86TargetLowering::X86TargetLowering().
|
inline |
Definition at line 1133 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS, and isDenormal().
Referenced by isDenormal(), isNormal(), and llvm::InstCombiner::visitCallInst().
|
inline |
Definition at line 1137 of file APFloat.h.
References isInfinity(), and isNaN().
Referenced by isFiniteNonZero(), and llvm::detail::DoubleAPFloat::multiply().
|
inline |
Definition at line 1142 of file APFloat.h.
References isFinite(), and isZero().
Referenced by CvtFDivConstToReciprocal(), isFiniteNonZeroFp(), isNormal(), and llvm::detail::DoubleAPFloat::multiply().
|
inline |
Definition at line 1129 of file APFloat.h.
References llvm::APFloatBase::fcInfinity, and getCategory().
Referenced by isFinite(), llvm::ConstantFP::isInfinity(), llvm::isMathLibCallNoop(), SimplifyFCmpInst(), llvm::InstCombiner::visitCallInst(), and WriteConstantInternal().
|
inline |
Definition at line 1147 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS, and isInteger().
Referenced by llvm::detail::DoubleAPFloat::isInteger(), and isInteger().
|
inline |
Definition at line 1146 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS, and isLargest().
Referenced by isLargest().
|
inline |
Definition at line 1130 of file APFloat.h.
References llvm::APFloatBase::fcNaN, and getCategory().
Referenced by isFinite(), llvm::isMathLibCallNoop(), llvm::ConstantFP::isNaN(), llvm::maxnum(), llvm::minnum(), SimplifyFCmpInst(), toString(), llvm::InstCombiner::visitCallInst(), and WriteConstantInternal().
|
inline |
Definition at line 1132 of file APFloat.h.
References llvm::detail::IEEEFloat::isNegative().
Referenced by clearSign(), copySign(), llvm::isMathLibCallNoop(), llvm::ConstantFP::isNegative(), isNegZero(), isPosZero(), SimplifyFCmpInst(), and llvm::InstCombiner::visitCallInst().
|
inline |
Definition at line 1144 of file APFloat.h.
References isNegative(), and isZero().
Referenced by llvm::SystemZTargetLowering::isFPImmLegal().
|
inline |
|
inline |
Definition at line 1136 of file APFloat.h.
References isDenormal(), and isFiniteNonZero().
Referenced by isNormalFp(), and llvm::InstCombiner::visitCallInst().
|
inline |
Definition at line 1143 of file APFloat.h.
References isNegative(), and isZero().
Referenced by llvm::AArch64TargetLowering::isFPImmLegal(), and llvm::PPCTargetLowering::isFPImmLegal().
|
inline |
Definition at line 1134 of file APFloat.h.
References llvm::detail::IEEEFloat::isSignaling().
Referenced by llvm::InstCombiner::visitCallInst().
|
inline |
Definition at line 1145 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS, and isSmallest().
Referenced by isSmallest().
|
inline |
Definition at line 1128 of file APFloat.h.
References llvm::APFloatBase::fcZero, and getCategory().
Referenced by isFiniteNonZero(), llvm::SystemZTargetLowering::isFPImmLegal(), llvm::isMathLibCallNoop(), isNegZero(), isNonZero(), isPosZero(), llvm::ConstantFP::isZero(), SimplifyFCmpInst(), llvm::InstCombiner::visitCallInst(), and llvm::InstCombiner::visitFCmpInst().
Definition at line 986 of file APFloat.h.
References assert(), getSemantics(), and llvm_unreachable().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), and llvm::detail::DoubleAPFloat::mod().
|
inline |
Definition at line 959 of file APFloat.h.
References assert(), getSemantics(), and llvm_unreachable().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), llvm::detail::DoubleAPFloat::multiply(), and operator*().
|
inline |
Definition at line 850 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS, and needsCleanup().
Referenced by needsCleanup().
Definition at line 1014 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by llvm::detail::DoubleAPFloat::next().
Multiply two APFloats, rounding ties to the nearest even.
No error checking.
Definition at line 1036 of file APFloat.h.
References multiply(), and llvm::APFloatBase::rmNearestTiesToEven.
Add two APFloats, rounding ties to the nearest even.
No error checking.
Definition at line 1020 of file APFloat.h.
References add(), and llvm::APFloatBase::rmNearestTiesToEven.
Subtract two APFloats, rounding ties to the nearest even.
No error checking.
Definition at line 1028 of file APFloat.h.
References llvm::APFloatBase::rmNearestTiesToEven, and subtract().
Divide the first APFloat by the second, rounding ties to the nearest even.
No error checking.
Definition at line 1044 of file APFloat.h.
References divide(), and llvm::APFloatBase::rmNearestTiesToEven.
| void llvm::APFloat::print | ( | raw_ostream & | OS | ) | const |
| void llvm::APFloat::Profile | ( | FoldingSetNodeID & | NID | ) | const |
Used to insert APFloat objects, or objects that contain APFloat objects, into FoldingSets.
Definition at line 4496 of file APFloat.cpp.
References llvm::FoldingSetNodeID::Add(), and bitcastToAPInt().
Definition at line 977 of file APFloat.h.
References assert(), getSemantics(), and llvm_unreachable().
Referenced by llvm::detail::DoubleAPFloat::remainder().
|
inline |
Definition at line 1008 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by llvm::SelectionDAG::getNode(), and llvm::detail::DoubleAPFloat::roundToIntegral().
|
inline |
Definition at line 950 of file APFloat.h.
References assert(), getSemantics(), and llvm_unreachable().
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), llvm::detail::DoubleAPFloat::multiply(), and operator-().
|
inline |
Definition at line 1152 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS.
Referenced by emitGlobalConstantFP(), print(), toStringAPFloat(), and WriteConstantInternal().
|
friend |
See friend declarations above.
These additional declarations are required in order to compile LLVM with IBM xlC compiler.
Definition at line 4428 of file APFloat.cpp.
|
friend |
| friend llvm::APFloat::DoubleAPFloat |
| friend llvm::APFloat::IEEEFloat |
1.8.6