LLVM API Documentation
#include <APFloat.h>

Public Types | |
| enum | cmpResult { cmpLessThan, cmpEqual, cmpGreaterThan, cmpUnordered } |
| enum | roundingMode { rmNearestTiesToEven, rmTowardPositive, rmTowardNegative, rmTowardZero, rmNearestTiesToAway } |
| enum | opStatus { opOK = 0x00, opInvalidOp = 0x01, opDivByZero = 0x02, opOverflow = 0x04, opUnderflow = 0x08, opInexact = 0x10 } |
| enum | fltCategory { fcInfinity, fcNaN, fcNormal, fcZero } |
Public Member Functions | |
| APFloat (const fltSemantics &, const char *) | |
| APFloat (const fltSemantics &, integerPart) | |
| APFloat (const fltSemantics &, fltCategory, bool negative) | |
| APFloat (double d) | |
| APFloat (float f) | |
| APFloat (const APInt &, bool isIEEE=false) | |
| APFloat (const APFloat &) | |
| ~APFloat () | |
| void | Profile (FoldingSetNodeID &NID) const |
| void | Emit (Serializer &S) const |
| Used by the Bitcode serializer to emit APInts to Bitcode. | |
| opStatus | add (const APFloat &, roundingMode) |
| opStatus | subtract (const APFloat &, roundingMode) |
| opStatus | multiply (const APFloat &, roundingMode) |
| opStatus | divide (const APFloat &, roundingMode) |
| opStatus | mod (const APFloat &, roundingMode) |
| opStatus | fusedMultiplyAdd (const APFloat &, const APFloat &, roundingMode) |
| void | changeSign () |
| void | clearSign () |
| void | copySign (const APFloat &) |
| opStatus | convert (const fltSemantics &, roundingMode, bool *) |
| opStatus | convertToInteger (integerPart *, unsigned int, bool, roundingMode, bool *) const |
| opStatus | convertFromAPInt (const APInt &, bool, roundingMode) |
| opStatus | convertFromSignExtendedInteger (const integerPart *, unsigned int, bool, roundingMode) |
| opStatus | convertFromZeroExtendedInteger (const integerPart *, unsigned int, bool, roundingMode) |
| opStatus | convertFromString (const char *, roundingMode) |
| APInt | bitcastToAPInt () const |
| double | convertToDouble () const |
| float | convertToFloat () const |
| cmpResult | compare (const APFloat &) const |
| bool | bitwiseIsEqual (const APFloat &) const |
| unsigned int | convertToHexString (char *dst, unsigned int hexDigits, bool upperCase, roundingMode) const |
| fltCategory | getCategory () const |
| const fltSemantics & | getSemantics () const |
| bool | isZero () const |
| bool | isNonZero () const |
| bool | isNaN () const |
| bool | isInfinity () const |
| bool | isNegative () const |
| bool | isPosZero () const |
| bool | isNegZero () const |
| APFloat & | operator= (const APFloat &) |
| uint32_t | getHashValue () const |
Static Public Member Functions | |
| static unsigned int | semanticsPrecision (const fltSemantics &) |
| static APFloat | getZero (const fltSemantics &Sem, bool Negative=false) |
| static APFloat | getInf (const fltSemantics &Sem, bool Negative=false) |
| static APFloat | getNaN (const fltSemantics &Sem, bool Negative=false) |
| static APFloat | ReadVal (Deserializer &D) |
| Used by the Bitcode deserializer to deserialize APInts. | |
Static Public Attributes | |
| static const fltSemantics | IEEEsingle = { 127, -126, 24, true } |
| static const fltSemantics | IEEEdouble = { 1023, -1022, 53, true } |
| static const fltSemantics | IEEEquad = { 16383, -16382, 113, true } |
| static const fltSemantics | PPCDoubleDouble = { 1023, -1022, 106, false } |
| static const fltSemantics | x87DoubleExtended = { 16383, -16382, 64, true } |
| static const fltSemantics | Bogus = { 0, 0, 0, true } |
Classes | |
| union | Significand |
Definition at line 123 of file APFloat.h.
| APFloat::APFloat | ( | const fltSemantics & | ourSemantics, | |
| const char * | text | |||
| ) |
Definition at line 678 of file APFloat.cpp.
References assertArithmeticOK(), convertFromString(), and rmNearestTiesToEven.
| APFloat::APFloat | ( | const fltSemantics & | ourSemantics, | |
| integerPart | value | |||
| ) |
Definition at line 654 of file APFloat.cpp.
References assertArithmeticOK(), llvm::lfExactlyZero, llvm::fltSemantics::precision, and rmNearestTiesToEven.
| APFloat::APFloat | ( | const fltSemantics & | ourSemantics, | |
| fltCategory | ourCategory, | |||
| bool | negative | |||
| ) |
Definition at line 665 of file APFloat.cpp.
References assertArithmeticOK(), fcNaN, fcNormal, and fcZero.
| APFloat::APFloat | ( | double | d | ) | [explicit] |
| APFloat::APFloat | ( | float | f | ) | [explicit] |
| APFloat::APFloat | ( | const APInt & | api, | |
| bool | isIEEE = false | |||
| ) | [explicit] |
Definition at line 2852 of file APFloat.cpp.
| APFloat::APFloat | ( | const APFloat & | rhs | ) |
| APFloat::~APFloat | ( | ) |
Definition at line 691 of file APFloat.cpp.
| unsigned int APFloat::semanticsPrecision | ( | const fltSemantics & | semantics | ) | [static] |
| static APFloat llvm::APFloat::getZero | ( | const fltSemantics & | Sem, | |
| bool | Negative = false | |||
| ) | [inline, static] |
| static APFloat llvm::APFloat::getInf | ( | const fltSemantics & | Sem, | |
| bool | Negative = false | |||
| ) | [inline, static] |
| static APFloat llvm::APFloat::getNaN | ( | const fltSemantics & | Sem, | |
| bool | Negative = false | |||
| ) | [inline, static] |
| void APFloat::Profile | ( | FoldingSetNodeID & | NID | ) | const |
Profile - Used to insert APFloat objects, or objects that contain APFloat objects, into FoldingSets.
Definition at line 697 of file APFloat.cpp.
References llvm::FoldingSetNodeID::Add(), and bitcastToAPInt().
| void APFloat::Emit | ( | Serializer & | S | ) | const |
Used by the Bitcode serializer to emit APInts to Bitcode.
Definition at line 19 of file SerializeAPFloat.cpp.
References bitcastToAPInt(), and llvm::Serializer::Emit().
| APFloat APFloat::ReadVal | ( | Deserializer & | D | ) | [static] |
Used by the Bitcode deserializer to deserialize APInts.
Definition at line 19 of file DeserializeAPFloat.cpp.
References APFloat(), and llvm::Deserializer::Read().
| APFloat::opStatus APFloat::add | ( | const APFloat & | rhs, | |
| roundingMode | rounding_mode | |||
| ) |
Definition at line 1465 of file APFloat.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ExecutionEngine::getConstantValue(), and llvm::SelectionDAG::getNode().
| APFloat::opStatus APFloat::subtract | ( | const APFloat & | rhs, | |
| roundingMode | rounding_mode | |||
| ) |
Definition at line 1472 of file APFloat.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), and mod().
| APFloat::opStatus APFloat::multiply | ( | const APFloat & | rhs, | |
| roundingMode | rounding_mode | |||
| ) |
Definition at line 1479 of file APFloat.cpp.
References assertArithmeticOK(), fcNormal, llvm::lfExactlyZero, opInexact, and sign.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), and mod().
| APFloat::opStatus APFloat::divide | ( | const APFloat & | rhs, | |
| roundingMode | rounding_mode | |||
| ) |
Definition at line 1499 of file APFloat.cpp.
References assertArithmeticOK(), fcNormal, llvm::lfExactlyZero, opInexact, and sign.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), and mod().
| APFloat::opStatus APFloat::mod | ( | const APFloat & | rhs, | |
| roundingMode | rounding_mode | |||
| ) |
Definition at line 1519 of file APFloat.cpp.
References assertArithmeticOK(), convertFromZeroExtendedInteger(), convertToInteger(), divide(), llvm::integerPartWidth, isZero(), multiply(), opDivByZero, opInexact, opInvalidOp, opOK, rmNearestTiesToEven, subtract(), and V.
Referenced by llvm::ConstantFoldBinaryInstruction(), llvm::ExecutionEngine::getConstantValue(), and llvm::SelectionDAG::getNode().
| APFloat::opStatus APFloat::fusedMultiplyAdd | ( | const APFloat & | multiplicand, | |
| const APFloat & | addend, | |||
| roundingMode | rounding_mode | |||
| ) |
Definition at line 1556 of file APFloat.cpp.
References assertArithmeticOK(), category, fcNormal, fcZero, llvm::lfExactlyZero, opInexact, opOK, rmTowardNegative, and sign.
| void APFloat::changeSign | ( | ) |
Definition at line 1410 of file APFloat.cpp.
Referenced by GetNegatedExpression(), llvm::ConstantFP::getNegativeZero(), llvm::SelectionDAG::getNode(), and llvm::X86TargetLowering::X86TargetLowering().
| void APFloat::clearSign | ( | ) |
| void APFloat::copySign | ( | const APFloat & | rhs | ) |
Definition at line 1424 of file APFloat.cpp.
References sign.
Referenced by llvm::SelectionDAG::getNode().
| APFloat::opStatus APFloat::convert | ( | const fltSemantics & | toSemantics, | |
| roundingMode | rounding_mode, | |||
| bool * | losesInfo | |||
| ) |
APFloat::convert - convert a value of one floating point type to another. The return value corresponds to the IEEE754 exceptions. *losesInfo records whether the transformation lost information, i.e. whether converting the result back to the original type will produce the original value (this is almost the same as return value==fsOK, but there are edge cases where this is not so).
Definition at line 1683 of file APFloat.cpp.
References assertArithmeticOK(), fcNaN, fcNormal, llvm::lfExactlyZero, lostFractionThroughTruncation(), opOK, partCountForBits(), llvm::fltSemantics::precision, llvm::APInt::tcAssign(), llvm::APInt::tcLSB(), llvm::APInt::tcSet(), llvm::APInt::tcShiftLeft(), llvm::APInt::tcShiftRight(), and x87DoubleExtended.
Referenced by llvm::ConstantFoldCastInstruction(), llvm::AsmPrinter::EmitGlobalConstant(), FitsInFPType(), llvm::ConstantFP::get(), llvm::SelectionDAG::getNode(), llvm::ConstantFPSDNode::isExactlyValue(), llvm::ConstantFP::isExactlyValue(), isFPCSafeToPrint(), llvm::ConstantFPSDNode::isValueValidForType(), llvm::ConstantFP::isValueValidForType(), LLVMConstReal(), and llvm::X86TargetLowering::X86TargetLowering().
| APFloat::opStatus APFloat::convertToInteger | ( | integerPart * | parts, | |
| unsigned int | width, | |||
| bool | isSigned, | |||
| roundingMode | rounding_mode, | |||
| bool * | isExact | |||
| ) | const |
Definition at line 1893 of file APFloat.cpp.
References fcNaN, opInvalidOp, partCountForBits(), llvm::APInt::tcSetLeastSignificantBits(), and llvm::APInt::tcShiftLeft().
Referenced by llvm::ConstantFoldCastInstruction(), llvm::FastISel::FastEmit_rf_(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), llvm::FastISel::getRegForValue(), and mod().
| APFloat::opStatus APFloat::convertFromAPInt | ( | const APInt & | Val, | |
| bool | isSigned, | |||
| roundingMode | rounding_mode | |||
| ) |
Definition at line 1958 of file APFloat.cpp.
References llvm::APInt::getNumWords(), llvm::APInt::getRawData(), and llvm::APInt::isNegative().
Referenced by llvm::ConstantFoldCastInstruction(), llvm::ExecutionEngine::getConstantValue(), and llvm::SelectionDAG::getNode().
| APFloat::opStatus APFloat::convertFromSignExtendedInteger | ( | const integerPart * | src, | |
| unsigned int | srcCount, | |||
| bool | isSigned, | |||
| roundingMode | rounding_mode | |||
| ) |
Definition at line 1978 of file APFloat.cpp.
References assertArithmeticOK(), llvm::integerPartWidth, llvm::APInt::tcAssign(), llvm::APInt::tcExtractBit(), and llvm::APInt::tcNegate().
| APFloat::opStatus APFloat::convertFromZeroExtendedInteger | ( | const integerPart * | parts, | |
| unsigned int | width, | |||
| bool | isSigned, | |||
| roundingMode | rounding_mode | |||
| ) |
Definition at line 2007 of file APFloat.cpp.
References llvm::APInt::getRawData(), partCountForBits(), and llvm::APInt::tcExtractBit().
Referenced by mod().
| APFloat::opStatus APFloat::convertFromString | ( | const char * | p, | |
| roundingMode | rounding_mode | |||
| ) |
Definition at line 2281 of file APFloat.cpp.
References assertArithmeticOK().
Referenced by APFloat().
| APInt APFloat::bitcastToAPInt | ( | ) | const |
Definition at line 2643 of file APFloat.cpp.
References IEEEdouble, IEEEsingle, PPCDoubleDouble, and x87DoubleExtended.
Referenced by convertToDouble(), convertToFloat(), Emit(), ExpandConstantFP(), llvm::ExecutionEngine::getConstantValue(), llvm::SelectionDAG::getNode(), and Profile().
| double APFloat::convertToDouble | ( | ) | const |
Definition at line 2668 of file APFloat.cpp.
References bitcastToAPInt(), llvm::APInt::bitsToDouble(), and IEEEdouble.
Referenced by llvm::AsmPrinter::EmitGlobalConstant(), llvm::ftostr(), GetConstantBuildVectorBits(), isFPCSafeToPrint(), LowerConstantFP(), and llvm::MachineOperand::print().
| float APFloat::convertToFloat | ( | ) | const |
Definition at line 2660 of file APFloat.cpp.
References bitcastToAPInt(), llvm::APInt::bitsToFloat(), and IEEEsingle.
Referenced by llvm::ftostr(), GetConstantBuildVectorBits(), isFPS16Immediate(), and llvm::MachineOperand::print().
| APFloat::cmpResult APFloat::compare | ( | const APFloat & | rhs | ) | const |
Definition at line 1603 of file APFloat.cpp.
References assertArithmeticOK(), category, cmpEqual, cmpGreaterThan, cmpLessThan, cmpUnordered, convolve, fcInfinity, fcNaN, fcNormal, fcZero, semantics, and sign.
Referenced by llvm::ConstantFoldCompareInstruction(), llvm::ValID::operator<(), and llvm::ValID::operator==().
| bool APFloat::bitwiseIsEqual | ( | const APFloat & | rhs | ) | const |
Definition at line 625 of file APFloat.cpp.
References category, exponent, exponent2, fcInfinity, fcNormal, fcZero, PPCDoubleDouble, semantics, sign, sign2, and significandParts().
Referenced by llvm::ConstantFPSDNode::isExactlyValue(), llvm::ConstantFP::isExactlyValue(), and isFPCSafeToPrint().
| unsigned int APFloat::convertToHexString | ( | char * | dst, | |
| unsigned int | hexDigits, | |||
| bool | upperCase, | |||
| roundingMode | rounding_mode | |||
| ) | const |
Definition at line 2322 of file APFloat.cpp.
References assertArithmeticOK(), fcInfinity, fcNaN, fcNormal, fcZero, infinityL, infinityU, NaNL, and NaNU.
| fltCategory llvm::APFloat::getCategory | ( | ) | const [inline] |
| const fltSemantics& llvm::APFloat::getSemantics | ( | ) | const [inline] |
Definition at line 254 of file APFloat.h.
Referenced by llvm::ConstantFP::ConstantFP(), llvm::ftostr(), llvm::ConstantFP::get(), llvm::ConstantFP::isExactlyValue(), llvm::ConstantFPSDNode::isValueValidForType(), and llvm::ConstantFP::isValueValidForType().
| bool llvm::APFloat::isZero | ( | ) | const [inline] |
Definition at line 255 of file APFloat.h.
References fcZero.
Referenced by llvm::ConstantFoldBinaryInstruction(), isNegZero(), llvm::ConstantFP::isNullValue(), isPosZero(), and mod().
| bool llvm::APFloat::isNonZero | ( | ) | const [inline] |
| bool llvm::APFloat::isNaN | ( | ) | const [inline] |
| bool llvm::APFloat::isInfinity | ( | ) | const [inline] |
| bool llvm::APFloat::isNegative | ( | ) | const [inline] |
Definition at line 259 of file APFloat.h.
Referenced by isNegZero(), llvm::ConstantFP::isNullValue(), and isPosZero().
| bool llvm::APFloat::isPosZero | ( | ) | const [inline] |
| bool llvm::APFloat::isNegZero | ( | ) | const [inline] |
| uint32_t APFloat::getHashValue | ( | ) | const |
Definition at line 2478 of file APFloat.cpp.
References fcInfinity, fcNaN, fcZero, and llvm::fltSemantics::precision.
const fltSemantics llvm::APFloat::IEEEsingle = { 127, -126, 24, true } [static] |
Definition at line 127 of file APFloat.h.
Referenced by bitcastToAPInt(), llvm::ConstantFoldCastInstruction(), convertToFloat(), llvm::ftostr(), llvm::ConstantFP::get(), llvm::ScalarEvolution::getIntegerSCEV(), llvm::ConstantFP::isValueValidForType(), llvm::SDNode::print(), TypeToFloatSemantics(), and WriteConstantInt().
const fltSemantics llvm::APFloat::IEEEdouble = { 1023, -1022, 53, true } [static] |
Definition at line 128 of file APFloat.h.
Referenced by bitcastToAPInt(), llvm::ConstantFoldCastInstruction(), convertToDouble(), llvm::AsmPrinter::EmitGlobalConstant(), llvm::ftostr(), llvm::ConstantFP::get(), llvm::ScalarEvolution::getIntegerSCEV(), llvm::ConstantFP::isValueValidForType(), llvm::SDNode::print(), TypeToFloatSemantics(), and WriteConstantInt().
const fltSemantics llvm::APFloat::IEEEquad = { 16383, -16382, 113, true } [static] |
Definition at line 129 of file APFloat.h.
Referenced by llvm::ConstantFoldCastInstruction(), llvm::ConstantFP::get(), llvm::ConstantFP::isValueValidForType(), TypeToFloatSemantics(), and WriteConstantInt().
const fltSemantics llvm::APFloat::PPCDoubleDouble = { 1023, -1022, 106, false } [static] |
Definition at line 130 of file APFloat.h.
Referenced by bitcastToAPInt(), bitwiseIsEqual(), llvm::ConstantFP::get(), llvm::ConstantFPSDNode::isExactlyValue(), llvm::ConstantFP::isExactlyValue(), llvm::ConstantFPSDNode::isValueValidForType(), llvm::ConstantFP::isValueValidForType(), TypeToFloatSemantics(), and WriteConstantInt().
const fltSemantics llvm::APFloat::x87DoubleExtended = { 16383, -16382, 64, true } [static] |
Definition at line 131 of file APFloat.h.
Referenced by bitcastToAPInt(), llvm::ConstantFoldCastInstruction(), convert(), llvm::ConstantFP::get(), llvm::ConstantFP::isValueValidForType(), TypeToFloatSemantics(), WriteConstantInt(), and llvm::X86TargetLowering::X86TargetLowering().
const fltSemantics llvm::APFloat::Bogus = { 0, 0, 0, true } [static] |