Changeset View
Changeset View
Standalone View
Standalone View
llvm/trunk/include/llvm/IR/IntrinsicInst.h
Show First 20 Lines • Show All 202 Lines • ▼ Show 20 Lines | static bool classof(const Value *V) { | ||||
return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); | return isa<IntrinsicInst>(V) && classof(cast<IntrinsicInst>(V)); | ||||
} | } | ||||
/// @} | /// @} | ||||
}; | }; | ||||
/// This is the common base class for constrained floating point intrinsics. | /// This is the common base class for constrained floating point intrinsics. | ||||
class ConstrainedFPIntrinsic : public IntrinsicInst { | class ConstrainedFPIntrinsic : public IntrinsicInst { | ||||
public: | public: | ||||
enum RoundingMode { | /// Specifies the rounding mode to be assumed. This is only used when | ||||
rmInvalid, | /// when constrained floating point is enabled. See the LLVM Language | ||||
rmDynamic, | /// Reference Manual for details. | ||||
rmToNearest, | enum RoundingMode : uint8_t { | ||||
rmDownward, | rmDynamic, ///< This corresponds to "fpround.dynamic". | ||||
rmUpward, | rmToNearest, ///< This corresponds to "fpround.tonearest". | ||||
rmTowardZero | rmDownward, ///< This corresponds to "fpround.downward". | ||||
}; | rmUpward, ///< This corresponds to "fpround.upward". | ||||
rmTowardZero ///< This corresponds to "fpround.tozero". | |||||
enum ExceptionBehavior { | }; | ||||
ebInvalid, | |||||
ebIgnore, | /// Specifies the required exception behavior. This is only used when | ||||
ebMayTrap, | /// when constrained floating point is used. See the LLVM Language | ||||
ebStrict | /// Reference Manual for details. | ||||
enum ExceptionBehavior : uint8_t { | |||||
ebIgnore, ///< This corresponds to "fpexcept.ignore". | |||||
ebMayTrap, ///< This corresponds to "fpexcept.maytrap". | |||||
ebStrict ///< This corresponds to "fpexcept.strict". | |||||
}; | }; | ||||
bool isUnaryOp() const; | bool isUnaryOp() const; | ||||
bool isTernaryOp() const; | bool isTernaryOp() const; | ||||
RoundingMode getRoundingMode() const; | Optional<RoundingMode> getRoundingMode() const; | ||||
ExceptionBehavior getExceptionBehavior() const; | Optional<ExceptionBehavior> getExceptionBehavior() const; | ||||
/// Returns a valid RoundingMode enumerator when given a string | |||||
/// that is valid as input in constrained intrinsic rounding mode | |||||
/// metadata. | |||||
static Optional<RoundingMode> StrToRoundingMode(StringRef); | |||||
/// For any RoundingMode enumerator, returns a string valid as input in | |||||
/// constrained intrinsic rounding mode metadata. | |||||
static Optional<StringRef> RoundingModeToStr(RoundingMode); | |||||
/// Returns a valid ExceptionBehavior enumerator when given a string | |||||
/// valid as input in constrained intrinsic exception behavior metadata. | |||||
static Optional<ExceptionBehavior> StrToExceptionBehavior(StringRef); | |||||
/// For any ExceptionBehavior enumerator, returns a string valid as | |||||
/// input in constrained intrinsic exception behavior metadata. | |||||
static Optional<StringRef> ExceptionBehaviorToStr(ExceptionBehavior); | |||||
// Methods for support type inquiry through isa, cast, and dyn_cast: | // Methods for support type inquiry through isa, cast, and dyn_cast: | ||||
static bool classof(const IntrinsicInst *I) { | static bool classof(const IntrinsicInst *I) { | ||||
switch (I->getIntrinsicID()) { | switch (I->getIntrinsicID()) { | ||||
case Intrinsic::experimental_constrained_fadd: | case Intrinsic::experimental_constrained_fadd: | ||||
case Intrinsic::experimental_constrained_fsub: | case Intrinsic::experimental_constrained_fsub: | ||||
case Intrinsic::experimental_constrained_fmul: | case Intrinsic::experimental_constrained_fmul: | ||||
case Intrinsic::experimental_constrained_fdiv: | case Intrinsic::experimental_constrained_fdiv: | ||||
▲ Show 20 Lines • Show All 627 Lines • Show Last 20 Lines |