LLVM API Documentation
#include <Constants.h>
Public Member Functions | |
| const APFloat & | getValueAPF () const |
| virtual bool | isNullValue () const |
| bool | isExactlyValue (const APFloat &V) const |
| bool | isExactlyValue (double V) const |
Static Public Member Functions | |
| static ConstantFP * | get (const APFloat &V) |
| get() - Static factory methods - Return objects of the specified value | |
| static ConstantFP * | get (const Type *Ty, double V) |
| static bool | isValueValidForType (const Type *Ty, const APFloat &V) |
| isValueValidForType - return true if Ty is big enough to represent V. | |
| static ConstantFP * | getNegativeZero (const Type *Ty) |
| static bool | classof (const ConstantFP *) |
| Methods for support type inquiry through isa, cast, and dyn_cast:. | |
| static bool | classof (const Value *V) |
Protected Member Functions | |
| ConstantFP (const Type *Ty, const APFloat &V) | |
| void * | operator new (size_t s) |
Definition at line 226 of file Constants.h.
Definition at line 293 of file Constants.cpp.
References llvm::APFloat::getSemantics(), and TypeToFloatSemantics().
| void* llvm::ConstantFP::operator new | ( | size_t | s | ) | [inline, protected] |
| ConstantFP * ConstantFP::get | ( | const APFloat & | V | ) | [static] |
get() - Static factory methods - Return objects of the specified value
Definition at line 349 of file Constants.cpp.
References llvm::Type::DoubleTy, llvm::Type::FloatTy, llvm::Type::FP128Ty, llvm::APFloat::getSemantics(), llvm::APFloat::IEEEdouble, llvm::APFloat::IEEEquad, llvm::APFloat::IEEEsingle, llvm::Type::PPC_FP128Ty, llvm::APFloat::PPCDoubleDouble, llvm::Type::X86_FP80Ty, and llvm::APFloat::x87DoubleExtended.
Referenced by ConstantFoldBinaryFP(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCall(), llvm::ConstantFoldCastInstruction(), ConstantFoldFP(), llvm::SelectionDAG::getConstantFP(), llvm::ScalarEvolution::getIntegerSCEV(), getNegativeZero(), llvm::Constant::getNullValue(), and llvm::JIT::runFunction().
| ConstantFP * ConstantFP::get | ( | const Type * | Ty, | |
| double | V | |||
| ) | [static] |
get() - This returns a constant fp for the specified value in the specified type. This should only be used for simple constant values like 2.0/1.0 etc, that are known-valid both as double and as the target format.
get() - This returns a constant fp for the specified value in the specified type. This should only be used for simple constant values like 2.0/1.0 etc, that are known-valid both as double and as the target format.
Definition at line 374 of file Constants.cpp.
References llvm::APFloat::convert(), llvm::APFloat::rmNearestTiesToEven, and TypeToFloatSemantics().
isValueValidForType - return true if Ty is big enough to represent V.
Definition at line 956 of file Constants.cpp.
References llvm::lltok::APFloat, llvm::APFloat::convert(), llvm::Type::DoubleTyID, llvm::Type::FloatTyID, llvm::Type::FP128TyID, llvm::APFloat::getSemantics(), llvm::Type::getTypeID(), llvm::APFloat::IEEEdouble, llvm::APFloat::IEEEquad, llvm::APFloat::IEEEsingle, llvm::Type::PPC_FP128TyID, llvm::APFloat::PPCDoubleDouble, llvm::APFloat::rmNearestTiesToEven, llvm::Type::X86_FP80TyID, and llvm::APFloat::x87DoubleExtended.
| const APFloat& llvm::ConstantFP::getValueAPF | ( | ) | const [inline] |
Definition at line 248 of file Constants.h.
Referenced by ExpandConstantFP(), llvm::FastISel::FastEmit_rf_(), FitsInFPType(), getNegativeZero(), isFPCSafeToPrint(), llvm::MachineOperand::print(), and useSIToFPInst().
| bool ConstantFP::isNullValue | ( | ) | const [virtual] |
isNullValue - Return true if this is the value that would be returned by getNullValue. Don't depend on == for doubles to tell us it's zero, it considers -0.0 to be null as well as 0.0. :(
Implements llvm::Constant.
Definition at line 299 of file Constants.cpp.
References llvm::APFloat::isNegative(), and llvm::APFloat::isZero().
| ConstantFP * ConstantFP::getNegativeZero | ( | const Type * | Ty | ) | [static] |
Definition at line 303 of file Constants.cpp.
References llvm::APFloat::changeSign(), get(), llvm::Constant::getNullValue(), and getValueAPF().
Referenced by llvm::ConstantExpr::getZeroValueForNegationExpr().
| bool ConstantFP::isExactlyValue | ( | const APFloat & | V | ) | const |
isExactlyValue - We don't rely on operator== working on double values, as it returns true for things that are clearly not equal, like -0.0 and 0.0. As such, this method can be used to do an exact bit-for-bit comparison of two floating point values. The version with a double operand is retained because it's so convenient to write isExactlyValue(2.0), but please use it only for simple constants.
Definition at line 309 of file Constants.cpp.
References llvm::APFloat::bitwiseIsEqual().
Referenced by isExactlyValue().
| bool llvm::ConstantFP::isExactlyValue | ( | double | V | ) | const [inline] |
Definition at line 266 of file Constants.h.
References llvm::APFloat::convert(), llvm::APFloat::getSemantics(), isExactlyValue(), llvm::APFloat::PPCDoubleDouble, and llvm::APFloat::rmNearestTiesToEven.
| static bool llvm::ConstantFP::classof | ( | const ConstantFP * | ) | [inline, static] |
Methods for support type inquiry through isa, cast, and dyn_cast:.
Definition at line 276 of file Constants.h.
| static bool llvm::ConstantFP::classof | ( | const Value * | V | ) | [inline, static] |
Reimplemented from llvm::Constant.
Definition at line 277 of file Constants.h.
References llvm::Value::ConstantFPVal, and llvm::Value::getValueID().