LLVM 17.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
llvm::DenormalMode Struct Reference

Represent subnormal handling kind for floating point instruction inputs and outputs. More...

#include "llvm/ADT/FloatingPointMode.h"

Public Types

enum  DenormalModeKind : int8_t {
  Invalid = -1 , IEEE , PreserveSign , PositiveZero ,
  Dynamic
}
 Represent handled modes for denormal (aka subnormal) modes in the floating point environment. More...
 

Public Member Functions

constexpr DenormalMode ()=default
 
constexpr DenormalMode (DenormalModeKind Out, DenormalModeKind In)
 
bool operator== (DenormalMode Other) const
 
bool operator!= (DenormalMode Other) const
 
bool isSimple () const
 
bool isValid () const
 
constexpr bool inputsAreZero () const
 Return true if input denormals must be implicitly treated as 0.
 
constexpr bool outputsAreZero () const
 Return true if output denormals should be flushed to 0.
 
DenormalMode mergeCalleeMode (DenormalMode Callee) const
 Get the effective denormal mode if the mode if this caller calls into a function with Callee.
 
void print (raw_ostream &OS) const
 
std::string str () const
 

Static Public Member Functions

static constexpr DenormalMode getInvalid ()
 
static constexpr DenormalMode getDefault ()
 Return the assumed default mode for a function without denormal-fp-math.
 
static constexpr DenormalMode getIEEE ()
 
static constexpr DenormalMode getPreserveSign ()
 
static constexpr DenormalMode getPositiveZero ()
 
static constexpr DenormalMode getDynamic ()
 

Public Attributes

DenormalModeKind Output = DenormalModeKind::Invalid
 Denormal flushing mode for floating point instruction results in the default floating point environment.
 
DenormalModeKind Input = DenormalModeKind::Invalid
 Denormal treatment kind for floating point instruction inputs in the default floating-point environment.
 

Detailed Description

Represent subnormal handling kind for floating point instruction inputs and outputs.

Definition at line 70 of file FloatingPointMode.h.

Member Enumeration Documentation

◆ DenormalModeKind

Represent handled modes for denormal (aka subnormal) modes in the floating point environment.

Enumerator
Invalid 
IEEE 

IEEE-754 denormal numbers preserved.

PreserveSign 

The sign of a flushed-to-zero number is preserved in the sign of 0.

PositiveZero 

Denormals are flushed to positive zero.

Dynamic 

Denormals have unknown treatment.

Definition at line 73 of file FloatingPointMode.h.

Constructor & Destructor Documentation

◆ DenormalMode() [1/2]

constexpr llvm::DenormalMode::DenormalMode ( )
constexprdefault

◆ DenormalMode() [2/2]

constexpr llvm::DenormalMode::DenormalMode ( DenormalModeKind  Out,
DenormalModeKind  In 
)
inlineconstexpr

Definition at line 99 of file FloatingPointMode.h.

Member Function Documentation

◆ getDefault()

static constexpr DenormalMode llvm::DenormalMode::getDefault ( )
inlinestaticconstexpr

Return the assumed default mode for a function without denormal-fp-math.

Definition at line 108 of file FloatingPointMode.h.

References getIEEE().

◆ getDynamic()

static constexpr DenormalMode llvm::DenormalMode::getDynamic ( )
inlinestaticconstexpr

Definition at line 126 of file FloatingPointMode.h.

References DenormalMode(), and Dynamic.

Referenced by denormModeCompatible().

◆ getIEEE()

static constexpr DenormalMode llvm::DenormalMode::getIEEE ( )
inlinestaticconstexpr

◆ getInvalid()

static constexpr DenormalMode llvm::DenormalMode::getInvalid ( )
inlinestaticconstexpr

Definition at line 103 of file FloatingPointMode.h.

References DenormalMode(), and Invalid.

Referenced by llvm::Function::getDenormalModeF32Raw().

◆ getPositiveZero()

static constexpr DenormalMode llvm::DenormalMode::getPositiveZero ( )
inlinestaticconstexpr

Definition at line 121 of file FloatingPointMode.h.

References DenormalMode(), and PositiveZero.

◆ getPreserveSign()

static constexpr DenormalMode llvm::DenormalMode::getPreserveSign ( )
inlinestaticconstexpr

◆ inputsAreZero()

constexpr bool llvm::DenormalMode::inputsAreZero ( ) const
inlineconstexpr

Return true if input denormals must be implicitly treated as 0.

Definition at line 148 of file FloatingPointMode.h.

References Input, PositiveZero, and PreserveSign.

Referenced by computeKnownFPClass().

◆ isSimple()

bool llvm::DenormalMode::isSimple ( ) const
inline

Definition at line 138 of file FloatingPointMode.h.

References Input, and Output.

◆ isValid()

bool llvm::DenormalMode::isValid ( ) const
inline

Definition at line 142 of file FloatingPointMode.h.

References Input, Invalid, and Output.

◆ mergeCalleeMode()

DenormalMode llvm::DenormalMode::mergeCalleeMode ( DenormalMode  Callee) const
inline

Get the effective denormal mode if the mode if this caller calls into a function with Callee.

This promotes dynamic modes to the mode of the caller.

Definition at line 162 of file FloatingPointMode.h.

References Callee, Dynamic, Input, and Output.

◆ operator!=()

bool llvm::DenormalMode::operator!= ( DenormalMode  Other) const
inline

Definition at line 134 of file FloatingPointMode.h.

References llvm::Other.

◆ operator==()

bool llvm::DenormalMode::operator== ( DenormalMode  Other) const
inline

Definition at line 130 of file FloatingPointMode.h.

References Input, llvm::Other, and Output.

◆ outputsAreZero()

constexpr bool llvm::DenormalMode::outputsAreZero ( ) const
inlineconstexpr

Return true if output denormals should be flushed to 0.

Definition at line 154 of file FloatingPointMode.h.

References Output, PositiveZero, and PreserveSign.

Referenced by computeKnownFPClass().

◆ print()

void llvm::DenormalMode::print ( raw_ostream OS) const
inline

Definition at line 231 of file FloatingPointMode.h.

References llvm::denormalModeKindName(), Input, OS, and Output.

Referenced by str().

◆ str()

std::string llvm::DenormalMode::str ( ) const
inline

Definition at line 173 of file FloatingPointMode.h.

References OS, and print().

Member Data Documentation

◆ Input

DenormalModeKind llvm::DenormalMode::Input = DenormalModeKind::Invalid

Denormal treatment kind for floating point instruction inputs in the default floating-point environment.

If this is not DenormalModeKind::IEEE, floating-point instructions implicitly treat the input value as 0.

Definition at line 96 of file FloatingPointMode.h.

Referenced by computeKnownFPClass(), denormModeCompatible(), llvm::FlushFPConstant(), llvm::SIModeRegisterDefaults::fpDenormModeDPValue(), llvm::SIModeRegisterDefaults::fpDenormModeSPValue(), inputsAreZero(), isSimple(), isValid(), mergeCalleeMode(), operator==(), llvm::GCNTargetMachine::parseMachineFunctionInfo(), and print().

◆ Output

DenormalModeKind llvm::DenormalMode::Output = DenormalModeKind::Invalid

The documentation for this struct was generated from the following file: