LLVM: llvm::APFloat Class Reference (original) (raw)
#include "[llvm/ADT/APFloat.h](APFloat%5F8h%5Fsource.html)"
| Public Attributes | |
|---|---|
| friend | IEEEFloat |
| friend | DoubleAPFloat |
| Friends | |
|---|---|
| LLVM_ABI friend hash_code | hash_value (const APFloat &Arg) |
| See friend declarations above. | |
| int | ilogb (const APFloat &Arg) |
| Returns the exponent of the internal representation of the APFloat. | |
| APFloat | scalbn (APFloat X, int Exp, roundingMode RM) |
| APFloat | frexp (const APFloat &X, int &Exp, roundingMode RM) |
Definition at line 940 of file APFloat.h.
◆ APFloat() [1/10]
◆ APFloat() [2/10]
◆ APFloat() [3/10]
◆ APFloat() [4/10]
template<typename T, typename = std::enable_if_t<std::is_floating_point::value>>
References T.
◆ APFloat() [5/10]
◆ APFloat() [6/10]
◆ APFloat() [7/10]
| llvm::APFloat::APFloat ( double d) | inlineexplicit |
|---|
◆ APFloat() [8/10]
| llvm::APFloat::APFloat ( float f) | inlineexplicit |
|---|
◆ APFloat() [9/10]
◆ APFloat() [10/10]
| llvm::APFloat::APFloat ( APFloat && RHS) | default |
|---|
References RHS.
| llvm::APFloat::~APFloat ( ) | default |
|---|
◆ add()
Definition at line 1163 of file APFloat.h.
References assert(), getSemantics(), llvm_unreachable, and RHS.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldFPBinOp(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::SelectionDAG::foldConstantFPMath(), llvm::ExecutionEngine::getConstantValue(), llvm::detail::DoubleAPFloat::multiply(), llvm::AMDGPUTargetLowering::PerformDAGCombine(), and llvm::detail::DoubleAPFloat::roundToIntegral().
◆ bitcastToAPInt()
| APInt llvm::APFloat::bitcastToAPInt ( ) const | inline |
|---|
Definition at line 1335 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS, and bitcastToAPInt().
Referenced by llvm::DwarfExpression::addConstantFP(), llvm::DwarfUnit::addConstantFPValue(), bitcastToAPInt(), llvm::detail::DoubleAPFloat::convertFromString(), convertIntToDoubleImm(), llvm::convertToNonDenormSingle(), llvm::SPIRVGlobalRegistry::createConstFP(), llvm::detail::DoubleAPFloat::divide(), emitGlobalConstantFP(), llvm::TargetLowering::expandIS_FPCLASS(), llvm::InstCombinerImpl::foldICmpAndConstConst(), foldLogOpOfMaskedICmps_NotAllZeros_BMask_Mixed(), llvm::detail::DoubleAPFloat::fusedMultiplyAdd(), llvm::generateSpecConstantInst(), llvm::ExecutionEngine::getConstantValue(), llvm::getExpressionForConstant(), llvm::AArch64_AM::getFP16Imm(), llvm::ARM_AM::getFP16Imm(), llvm::ARM_AM::getFP32FP16Imm(), llvm::AArch64_AM::getFP32Imm(), llvm::ARM_AM::getFP32Imm(), llvm::AArch64_AM::getFP64Imm(), llvm::ARM_AM::getFP64Imm(), llvm::RISCVLoadFPImm::getLoadFPImm(), llvm::HexagonLowerToMC(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::RISCVLegalizerInfo::legalizeCustom(), llvm::LegalizerHelper::lowerISFPCLASS(), llvm::CombinerHelper::matchCombineUnmergeConstant(), llvm::detail::DoubleAPFloat::mod(), llvm::NVPTXFloatMCExpr::printImpl(), Profile(), llvm::detail::DoubleAPFloat::remainder(), llvm::RISCVDAGToDAGISel::Select(), llvm::RISCVDAGToDAGISel::selectScalarFPAsInt(), llvm::stableHashValue(), llvm::LegalizerHelper::widenScalar(), and writeAPFloatInternal().
◆ bitwiseIsEqual()
◆ changeSign()
| void llvm::APFloat::changeSign ( ) | inline |
|---|
Definition at line 1279 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS, and changeSign().
Referenced by changeSign(), clearSign(), copySign(), llvm::PPCInstrInfo::finalizeInsInstrs(), llvm::TargetLowering::getNegatedExpression(), llvm::SelectionDAG::getNeutralElement(), getOne(), llvm::isNeutralConstant(), llvm::SPIRVCombinerHelper::matchSelectToFaceForward(), and llvm::X86TargetLowering::X86TargetLowering().
◆ classify()
Return the FPClassTest which will return true for the value.
Definition at line 5982 of file APFloat.cpp.
References assert(), llvm::fcNegInf, llvm::fcNegNormal, llvm::fcNegSubnormal, llvm::fcNegZero, llvm::fcPosInf, llvm::fcPosNormal, llvm::fcPosSubnormal, llvm::fcPosZero, llvm::fcQNan, llvm::fcSNan, isDenormal(), isInfinity(), isNaN(), isNegative(), isNormal(), isSignaling(), and isZero().
Referenced by llvm::GenericFloatingPointPredicateUtils< SSAContext >::fcmpImpliesClass(), and llvm::InstCombinerImpl::foldICmpBitCast().
◆ clearSign()
| void llvm::APFloat::clearSign ( ) | inline |
|---|
◆ compare()
◆ convert()
Definition at line 6053 of file APFloat.cpp.
References llvm::APFloatBase::APFloat, assert(), getSemantics(), llvm_unreachable, and llvm::APFloatBase::opOK.
Referenced by canLosslesslyConvertToFPType(), canSafelyConvertTo16Bit(), llvm::ConstantFPRange::cast(), llvm::checkConvertToNonDenormSingle(), llvm::ConstantFoldCastInstruction(), convertToDouble(), llvm::APFixedPoint::convertToFloat(), convertToFloat(), llvm::convertToNonDenormSingle(), emitDebugValueComment(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::SelectionDAG::foldConstantFPMath(), foldFCmpFpTrunc(), llvm::ConstantFP::get(), llvm::getAPFloatFromSize(), llvm::SelectionDAG::getConstantFP(), llvm::APFixedPoint::getFromFloatValue(), llvm::RISCVLoadFPImm::getLoadFPImm(), llvm::GCNTTIImpl::instCombineIntrinsic(), isExactlyValue(), llvm::ConstantFP::isExactlyValue(), isFPExtFromF16OrConst(), llvm::ConstantFP::isValueValidForType(), llvm::ConstantFPSDNode::isValueValidForType(), LLVMConstRealGetDouble(), LowerFROUND(), llvm::ARMAsmPrinter::lowerOperand(), matchFPExtFromF16(), llvm::NVPTXFloatMCExpr::printImpl(), strictFPExtFromF16(), llvm::InstCombinerImpl::visitFCmpInst(), writeAPFloatInternal(), and llvm::X86TargetLowering::X86TargetLowering().
◆ convertFromAPInt()
Definition at line 1329 of file APFloat.h.
References APFLOAT_DISPATCH_ON_SEMANTICS, and convertFromAPInt().
Referenced by llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldIntToFloat(), convertFromAPInt(), llvm::APFixedPoint::convertToFloat(), llvm::TargetLowering::expandFP_TO_INT_SAT(), llvm::TargetLowering::expandFP_TO_UINT(), llvm::SelectionDAG::FoldConstantArithmetic(), llvm::ExecutionEngine::getConstantValue(), llvm::LegalizerHelper::lowerFPTOINT_SAT(), llvm::LegalizerHelper::lowerFPTOUI(), lowerFTRUNC_FCEIL_FFLOOR_FROUND(), lowerVectorFTRUNC_FCEIL_FFLOOR_FROUND(), and lowerVectorStrictFTRUNC_FCEIL_FFLOOR_FROUND().
◆ convertFromString()
◆ convertToDouble()
| double llvm::APFloat::convertToDouble | ( | ) | const |
|---|
Converts this APFloat to host double value.
Precondition
The APFloat must be built using semantics, that can be represented by the host double type without loss of precision. It can be IEEEdouble and shorter semantics, like IEEEsingle and others.
Definition at line 6112 of file APFloat.cpp.
References assert(), convert(), llvm::detail::IEEEFloat::convertToDouble(), getSemantics(), llvm::APFloatBase::isRepresentableBy(), llvm::APFloatBase::opInexact, and llvm::APFloatBase::rmNearestTiesToEven.
Referenced by emitDebugValueComment(), LLVMConstRealGetDouble(), llvm::ARMAsmPrinter::lowerOperand(), and writeAPFloatInternal().
◆ convertToFloat()
| float llvm::APFloat::convertToFloat | ( | ) | const |
|---|
Converts this APFloat to host float value.
Precondition
The APFloat must be built using semantics, that can be represented by the host float type without loss of precision. It can be IEEEquad and shorter semantics, like IEEEdouble and others. Converts this APFloat to host float value.
The APFloat must be built using semantics, that can be represented by the host float type without loss of precision. It can be IEEEsingle and shorter semantics, like IEEEhalf.
Definition at line 6143 of file APFloat.cpp.
References assert(), convert(), llvm::detail::IEEEFloat::convertToFloat(), getSemantics(), llvm::APFloatBase::isRepresentableBy(), llvm::APFloatBase::opInexact, and llvm::APFloatBase::rmNearestTiesToEven.
Referenced by llvm::FPMathOperator::getFPAccuracy(), insertSpirvDecorations(), and llvm::SPIRVMCInstLower::lower().
◆ convertToHexString()
◆ convertToInteger() [1/2]
◆ convertToInteger() [2/2]
◆ copySign() [1/2]
A static helper to produce a copy of an APFloat value with its sign copied from some other APFloat.
Definition at line 1291 of file APFloat.h.
◆ copySign() [2/2]
◆ divide()
◆ dump()
◆ fusedMultiplyAdd()
◆ getAllOnesValue()
◆ getCategory()
| fltCategory llvm::APFloat::getCategory ( ) const | inline |
|---|
◆ getExactInverse()
| bool llvm::APFloat::getExactInverse | ( | APFloat * | Inv | ) | const |
|---|
If this value is normal and has an exact, normal, multiplicative inverse, store it in inv and return true.
Definition at line 5995 of file APFloat.cpp.
References assert(), getExactLog2Abs(), getOne(), getSemantics(), isDenormal(), isFiniteNonZero(), isNegative(), llvm::APFloatBase::rmTowardZero, and scalbn.
Referenced by checkCVTFixedPointOperandWithFBits(), and PerformVMulVCTPCombine().
◆ getExactLog2()
◆ getExactLog2Abs()
| LLVM_READONLY int llvm::APFloat::getExactLog2Abs ( ) const | inline |
|---|
◆ getInf()
Factory for Positive and Negative Infinity.
Parameters
| Negative | True iff the number should be negative. |
|---|
Definition at line 1080 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
Referenced by llvm::ConstantFPRange::add(), canonicalizeRange(), computeKnownBitsFromOperator(), computeKnownFPClass(), llvm::ConstantFPRange::div(), llvm::TargetLowering::expandIS_FPCLASS(), llvm::InstCombinerImpl::foldICmpAndConstConst(), foldLogOpOfMaskedICmps_NotAllZeros_BMask_Mixed(), llvm::ConstantFP::getInfinity(), llvm::AMDGPUTargetLowering::getIsFinite(), llvm::ConstantFPRange::getNaNOnly(), llvm::SelectionDAG::getNeutralElement(), llvm::ConstantFPRange::getNonNaN(), llvm::harrisonUlp(), llvm::isNeutralConstant(), llvm::AMDGPULegalizerInfo::legalizeFExp(), llvm::AMDGPULegalizerInfo::legalizeFFREXP(), llvm::AMDGPULegalizerInfo::legalizeFlogCommon(), llvm::AMDGPUTargetLowering::lowerFEXP(), lowerFREM(), llvm::LegalizerHelper::lowerISFPCLASS(), llvm::ConstantFPRange::makeAllowedFCmpRegion(), llvm::fuzzerop::makeConstantsWithType(), makeGreaterThan(), makeLessThan(), and llvm::ConstantFPRange::mul().
◆ getLargest()
Returns the largest finite number in the given semantics.
Parameters
| Negative | - True iff the number should be negative |
|---|
Definition at line 1120 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
Referenced by computeKnownFPClass(), llvm::TargetLowering::expandIS_FPCLASS(), llvm::InstCombinerImpl::foldFCmpIntToFPConst(), llvm::ConstantFPRange::getFinite(), llvm::SelectionDAG::getNeutralElement(), llvm::getReductionIdentity(), llvm::isNeutralConstant(), llvm::AMDGPULegalizerInfo::legalizeRsqClampIntrinsic(), llvm::LegalizerHelper::lowerISFPCLASS(), llvm::ConstantFPRange::makeAllowedFCmpRegion(), llvm::fuzzerop::makeConstantsWithType(), removeInf(), and SameSignRange::SameSignRange().
◆ getNaN()
◆ getOne()
◆ getQNaN()
◆ getSemantics()
Definition at line 1439 of file APFloat.h.
Referenced by add(), llvm::ConstantFPRange::add(), bitwiseIsEqual(), llvm::MachineIRBuilder::buildFConstant(), compare(), constantFoldFpUnary(), llvm::ConstantFPRange::contains(), convert(), convertToDouble(), convertToFloat(), divide(), flushDenormalConstant(), fusedMultiplyAdd(), getExactInverse(), llvm::RISCVLoadFPImm::getLoadFPImm(), hash_value, ilogb, llvm::GCNTTIImpl::instCombineIntrinsic(), isExactlyValue(), isRepresentableAsExactInteger(), llvm::ConstantFP::isValueValidForType(), mod(), multiply(), llvm::AMDGPUTargetLowering::performRcpCombine(), printConstant(), remainder(), subtract(), llvm::SystemZVectorConstantInfo::SystemZVectorConstantInfo(), and writeAPFloatInternal().
◆ getSmallest()
◆ getSmallestNormalized()
◆ getSNaN()
◆ getZero()
Factory for Positive and Negative Zero.
Parameters
| Negative | True iff the number should be negative. |
|---|
Definition at line 1061 of file APFloat.h.
References llvm::APFloatBase::uninitialized.
Referenced by llvm::ConstantFPRange::abs(), computeKnownFPClass(), llvm::ConstantFPRange::div(), extendZeroIfEqual(), llvm::detail::fastTwoSum(), fixFuncEntryCount(), flushDenormalConstant(), llvm::ConstantFPRange::flushDenormals(), llvm::generateReadImageInst(), llvm::ExecutionEngine::getConstantValue(), getIdentityValueForAtomicOp(), llvm::Constant::getNullValue(), llvm::ConstantFP::getZero(), getZeroFP(), llvm::GCNTTIImpl::instCombineIntrinsic(), llvm::fuzzerop::makeConstantsWithType(), printConstant(), splitPosNeg(), llvm::pdb::Variant::toAPFloat(), and llvm::X86TargetLowering::X86TargetLowering().
◆ hasSignificand()
◆ isDenormal()
| bool llvm::APFloat::isDenormal ( ) const | inline |
|---|
◆ isExactlyValue()
| bool llvm::APFloat::isExactlyValue ( double V) const | inline |
|---|
◆ isFinite()
| bool llvm::APFloat::isFinite ( ) const | inline |
|---|
◆ isFiniteNonZero()
| bool llvm::APFloat::isFiniteNonZero ( ) const | inline |
|---|
◆ isInfinity()
| bool llvm::APFloat::isInfinity ( ) const | inline |
|---|
Definition at line 1428 of file APFloat.h.
References llvm::APFloatBase::fcInfinity, and getCategory().
Referenced by classify(), foldFCmpFpTrunc(), llvm::GCNTTIImpl::instCombineIntrinsic(), isFinite(), llvm::isMathLibCallNoop(), isNegInfinity(), isPosInfinity(), llvm::detail::DoubleAPFloat::next(), OptimizeConstMinMax(), and writeAPFloatInternal().
◆ isInteger()
| bool llvm::APFloat::isInteger ( ) const | inline |
|---|
◆ isLargest()
| bool llvm::APFloat::isLargest ( ) const | inline |
|---|
◆ isNaN()
| bool llvm::APFloat::isNaN ( ) const | inline |
|---|
Definition at line 1429 of file APFloat.h.
References llvm::APFloatBase::fcNaN, and getCategory().
Referenced by llvm::ConstantFPRange::cast(), classify(), computeKnownFPClass(), llvm::ConstantFPRange::contains(), foldFCmpFpTrunc(), llvm::GCNTTIImpl::instCombineIntrinsic(), isFinite(), llvm::isMathLibCallNoop(), llvm::CombinerHelper::matchCombineFMinMaxNaN(), OptimizeConstMinMax(), and writeAPFloatInternal().
◆ isNegative()
| bool llvm::APFloat::isNegative ( ) const | inline |
|---|
Definition at line 1431 of file APFloat.h.
Referenced by classify(), clearSign(), copySign(), llvm::GenericFloatingPointPredicateUtils< SSAContext >::fcmpImpliesClass(), flushDenormalConstant(), llvm::detail::frexp(), getExactInverse(), getExactLog2(), llvm::RISCVLoadFPImm::getLoadFPImm(), isNegInfinity(), isNegZero(), isPosInfinity(), isPosZero(), OptimizeConstMinMax(), llvm::detail::DoubleAPFloat::roundToIntegral(), llvm::InstCombinerImpl::visitCallInst(), llvm::InstCombinerImpl::visitFMul(), and writeAPFloatInternal().
◆ isNegInfinity()
| bool llvm::APFloat::isNegInfinity ( ) const | inline |
|---|
◆ isNegZero()
| bool llvm::APFloat::isNegZero ( ) const | inline |
|---|
◆ isNonZero()
| bool llvm::APFloat::isNonZero ( ) const | inline |
|---|
◆ isNormal()
| bool llvm::APFloat::isNormal ( ) const | inline |
|---|
◆ isPosInfinity()
| bool llvm::APFloat::isPosInfinity ( ) const | inline |
|---|
◆ isPosZero()
| bool llvm::APFloat::isPosZero ( ) const | inline |
|---|
◆ isSignaling()
| bool llvm::APFloat::isSignaling ( ) const | inline |
|---|
◆ isSmallest()
| bool llvm::APFloat::isSmallest ( ) const | inline |
|---|
◆ isSmallestNormalized()
| bool llvm::APFloat::isSmallestNormalized ( ) const | inline |
|---|
◆ isZero()
| bool llvm::APFloat::isZero ( ) const | inline |
|---|
Definition at line 1427 of file APFloat.h.
References llvm::APFloatBase::fcZero, and getCategory().
Referenced by classify(), expandNormalizeIntrinsic(), llvm::detail::frexp(), isFiniteNonZero(), llvm::isMathLibCallNoop(), isNegZero(), isNonZero(), isPosZero(), llvm::detail::DoubleAPFloat::next(), llvm::RISCVDAGToDAGISel::Select(), llvm::SelectionDAG::simplifyFPBinop(), llvm::InstCombinerImpl::visitFCmpInst(), and llvm::InstCombinerImpl::visitFMul().
◆ makeQuiet()
| APFloat llvm::APFloat::makeQuiet ( ) const | inlinenodiscard |
|---|
◆ mod()
◆ multiply()
◆ needsCleanup()
| bool llvm::APFloat::needsCleanup ( ) const | inline |
|---|
◆ next()
◆ operator!=()
◆ operator*()
◆ operator+()
◆ operator-() [1/2]
| APFloat llvm::APFloat::operator- ( ) const | inline |
|---|
◆ operator-() [2/2]
◆ operator/()
◆ operator<()
◆ operator<=()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator==()
◆ operator>()
◆ operator>=()
◆ print()
◆ Profile()
◆ remainder()
◆ roundToIntegral()
◆ subtract()
◆ toString()
◆ frexp
◆ hash_value
◆ ilogb
◆ scalbn
◆ DoubleAPFloat
◆ IEEEFloat
The documentation for this class was generated from the following files:
- include/llvm/ADT/APFloat.h
- lib/Support/APFloat.cpp