24std::optional<RoundingMode>
38std::optional<StringRef>
40 switch (UseRounding) {
42 return "round.dynamic";
44 return "round.tonearest";
46 return "round.tonearestaway";
48 return "round.downward";
50 return "round.upward";
52 return "round.towardzero";
58std::optional<fp::ExceptionBehavior>
67std::optional<StringRef>
71 return "fpexcept.strict";
73 return "fpexcept.ignore";
75 return "fpexcept.maytrap";
82 switch (Instr.getOpcode()) {
83 case Instruction::FCmp:
86 IID = Intrinsic::experimental_constrained_fcmp;
90#define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \
91 case Instruction::NAME: \
92 IID = Intrinsic::INTRINSIC; \
94#define FUNCTION(NAME, NARG, ROUND_MODE, INTRINSIC)
95#define CMP_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)
96#include "llvm/IR/ConstrainedOps.def"
99 case Instruction::Call:
101 switch (IntrinCall->getIntrinsicID()) {
102#define FUNCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \
103 case Intrinsic::NAME: \
104 IID = Intrinsic::INTRINSIC; \
106#define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC)
107#define CMP_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)
108#include "llvm/IR/ConstrainedOps.def"
This file contains the declarations of entities that describe floating point environment and related ...
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
ExceptionBehavior
Exception behavior used for floating point operations.
@ ebStrict
This corresponds to "fpexcept.strict".
@ ebMayTrap
This corresponds to "fpexcept.maytrap".
@ ebIgnore
This corresponds to "fpexcept.ignore".
This is an optimization pass for GlobalISel generic memory operations.
decltype(auto) dyn_cast(const From &Val)
dyn_cast<X> - Return the argument parameter cast to the specified type.
LLVM_ABI std::optional< StringRef > convertRoundingModeToStr(RoundingMode)
For any RoundingMode enumerator, returns a string valid as input in constrained intrinsic rounding mo...
LLVM_ABI std::optional< StringRef > convertExceptionBehaviorToStr(fp::ExceptionBehavior)
For any ExceptionBehavior enumerator, returns a string valid as input in constrained intrinsic except...
LLVM_ABI Intrinsic::ID getConstrainedIntrinsicID(const Instruction &Instr)
Returns constrained intrinsic id to represent the given instruction in strictfp function.
LLVM_ABI std::optional< fp::ExceptionBehavior > convertStrToExceptionBehavior(StringRef)
Returns a valid ExceptionBehavior enumerator when given a string valid as input in constrained intrin...
RoundingMode
Rounding mode.
@ TowardZero
roundTowardZero.
@ NearestTiesToEven
roundTiesToEven.
@ Dynamic
Denotes mode unknown at compile time.
@ TowardPositive
roundTowardPositive.
@ NearestTiesToAway
roundTiesToAway.
@ TowardNegative
roundTowardNegative.
LLVM_ABI std::optional< RoundingMode > convertStrToRoundingMode(StringRef)
Returns a valid RoundingMode enumerator when given a string that is valid as input in constrained int...