class ConstantFP

Declaration

class ConstantFP : public ConstantData { /* full declaration omitted */ };

Declared at: llvm/include/llvm/IR/Constants.h:263

Inherits from: ConstantData

Member Variables

Inherited from Value:

protected SubclassOptionalData
protected NumUserOperands
protected IsUsedByMD
protected HasName
protected HasHungOffUses
protected HasDescriptor
public static MaxAlignmentExponent = 29
public static MaximumAlignment = 1U << MaxAlignmentExponent

Method Overview

  • public ConstantFP(const llvm::ConstantFP &)
  • public static bool classof(const llvm::Value * V)
  • public static llvm::Constant * get(llvm::Type * Ty, double V)
  • public static llvm::Constant * get(llvm::Type * Ty, const llvm::APFloat & V)
  • public static llvm::Constant * get(llvm::Type * Ty, llvm::StringRef Str)
  • public static llvm::ConstantFP * get(llvm::LLVMContext & Context, const llvm::APFloat & V)
  • public static llvm::Constant * getInfinity(llvm::Type * Ty, bool Negative = false)
  • public static llvm::Constant * getNaN(llvm::Type * Ty, bool Negative = false, uint64_t Payload = 0)
  • public static llvm::Constant * getNegativeZero(llvm::Type * Ty)
  • public static llvm::Constant * getQNaN(llvm::Type * Ty, bool Negative = false, llvm::APInt * Payload = nullptr)
  • public static llvm::Constant * getSNaN(llvm::Type * Ty, bool Negative = false, llvm::APInt * Payload = nullptr)
  • public inline const llvm::APFloat & getValueAPF() const
  • public static llvm::Constant * getZeroValueForNegation(llvm::Type * Ty)
  • public bool isExactlyValue(const llvm::APFloat & V) const
  • public bool isExactlyValue(double V) const
  • public bool isInfinity() const
  • public bool isNaN() const
  • public bool isNegative() const
  • public static bool isValueValidForType(llvm::Type * Ty, const llvm::APFloat & V)
  • public bool isZero() const

Inherited from ConstantData:

Inherited from Constant:

Inherited from User:

Inherited from Value:

Methods

ConstantFP(const llvm::ConstantFP&)

Declared at: llvm/include/llvm/IR/Constants.h:273

Parameters

const llvm::ConstantFP&

static bool classof(const llvm::Value* V)

Description

Methods for support type inquiry through isa, cast, and dyn_cast:

Declared at: llvm/include/llvm/IR/Constants.h:332

Parameters

const llvm::Value* V

static llvm::Constant* get(llvm::Type* Ty,
                           double V)

Description

This returns a ConstantFP, or a vector containing a splat of a ConstantFP, 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 host double and as the target format.

Declared at: llvm/include/llvm/IR/Constants.h:284

Parameters

llvm::Type* Ty
double V

static llvm::Constant* get(llvm::Type* Ty,
                           const llvm::APFloat& V)

Description

If Ty is a vector type, return a Constant with a splat of the given value. Otherwise return a ConstantFP for the given value.

Declared at: llvm/include/llvm/IR/Constants.h:288

Parameters

llvm::Type* Ty
const llvm::APFloat& V

static llvm::Constant* get(llvm::Type* Ty,
                           llvm::StringRef Str)

Declared at: llvm/include/llvm/IR/Constants.h:290

Parameters

llvm::Type* Ty
llvm::StringRef Str

static llvm::ConstantFP* get(
    llvm::LLVMContext& Context,
    const llvm::APFloat& V)

Declared at: llvm/include/llvm/IR/Constants.h:291

Parameters

llvm::LLVMContext& Context
const llvm::APFloat& V

static llvm::Constant* getInfinity(
    llvm::Type* Ty,
    bool Negative = false)

Declared at: llvm/include/llvm/IR/Constants.h:298

Parameters

llvm::Type* Ty
bool Negative = false

static llvm::Constant* getNaN(
    llvm::Type* Ty,
    bool Negative = false,
    uint64_t Payload = 0)

Declared at: llvm/include/llvm/IR/Constants.h:292

Parameters

llvm::Type* Ty
bool Negative = false
uint64_t Payload = 0

static llvm::Constant* getNegativeZero(
    llvm::Type* Ty)

Declared at: llvm/include/llvm/IR/Constants.h:297

Parameters

llvm::Type* Ty

static llvm::Constant* getQNaN(
    llvm::Type* Ty,
    bool Negative = false,
    llvm::APInt* Payload = nullptr)

Declared at: llvm/include/llvm/IR/Constants.h:293

Parameters

llvm::Type* Ty
bool Negative = false
llvm::APInt* Payload = nullptr

static llvm::Constant* getSNaN(
    llvm::Type* Ty,
    bool Negative = false,
    llvm::APInt* Payload = nullptr)

Declared at: llvm/include/llvm/IR/Constants.h:295

Parameters

llvm::Type* Ty
bool Negative = false
llvm::APInt* Payload = nullptr

inline const llvm::APFloat& getValueAPF() const

Declared at: llvm/include/llvm/IR/Constants.h:302

static llvm::Constant* getZeroValueForNegation(
    llvm::Type* Ty)

Description

Floating point negation must be implemented with f(x) = -0.0 - x. This method returns the negative zero constant for floating point or vector floating point types; for all other types, it returns the null value.

Declared at: llvm/include/llvm/IR/Constants.h:278

Parameters

llvm::Type* Ty

bool isExactlyValue(const llvm::APFloat& V) const

Description

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.

Declared at: llvm/include/llvm/IR/Constants.h:322

Parameters

const llvm::APFloat& V

bool isExactlyValue(double V) const

Declared at: llvm/include/llvm/IR/Constants.h:324

Parameters

double V

bool isInfinity() const

Description

Return true if the value is infinity

Declared at: llvm/include/llvm/IR/Constants.h:311

bool isNaN() const

Description

Return true if the value is a NaN.

Declared at: llvm/include/llvm/IR/Constants.h:314

bool isNegative() const

Description

Return true if the sign bit is set.

Declared at: llvm/include/llvm/IR/Constants.h:308

static bool isValueValidForType(
    llvm::Type* Ty,
    const llvm::APFloat& V)

Description

Return true if Ty is big enough to represent V.

Declared at: llvm/include/llvm/IR/Constants.h:301

Parameters

llvm::Type* Ty
const llvm::APFloat& V

bool isZero() const

Description

Return true if the value is positive or negative zero.

Declared at: llvm/include/llvm/IR/Constants.h:305