Go to the documentation of this file.
38 switch (UseRounding) {
40 RoundingStr =
"round.dynamic";
43 RoundingStr =
"round.tonearest";
46 RoundingStr =
"round.tonearestaway";
49 RoundingStr =
"round.downward";
52 RoundingStr =
"round.upward";
55 RoundingStr =
"round.towardzero";
63 Optional<fp::ExceptionBehavior>
77 ExceptStr =
"fpexcept.strict";
80 ExceptStr =
"fpexcept.ignore";
83 ExceptStr =
"fpexcept.maytrap";
92 case Instruction::FCmp:
95 IID = Intrinsic::experimental_constrained_fcmp;
99 #define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \
100 case Instruction::NAME: \
101 IID = Intrinsic::INTRINSIC; \
103 #define FUNCTION(NAME, NARG, ROUND_MODE, INTRINSIC)
104 #define CMP_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)
105 #include "llvm/IR/ConstrainedOps.def"
109 if (
auto *IntrinCall = dyn_cast<IntrinsicInst>(&Instr)) {
110 switch (IntrinCall->getIntrinsicID()) {
111 #define FUNCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \
112 case Intrinsic::NAME: \
113 IID = Intrinsic::INTRINSIC; \
115 #define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC)
116 #define CMP_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)
117 #include "llvm/IR/ConstrainedOps.def"
StringSwitch & Case(StringLiteral S, T Value)
This is an optimization pass for GlobalISel generic memory operations.
LLVM_NODISCARD R Default(T Value)
Optional< StringRef > convertRoundingModeToStr(RoundingMode)
For any RoundingMode enumerator, returns a string valid as input in constrained intrinsic rounding mo...
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
@ ebMayTrap
This corresponds to "fpexcept.maytrap".
Intrinsic::ID getConstrainedIntrinsicID(const Instruction &Instr)
Returns constrained intrinsic id to represent the given instruction in strictfp function.
RoundingMode
Rounding mode.
Optional< StringRef > convertExceptionBehaviorToStr(fp::ExceptionBehavior)
For any ExceptionBehavior enumerator, returns a string valid as input in constrained intrinsic except...
Optional< fp::ExceptionBehavior > convertStrToExceptionBehavior(StringRef)
Returns a valid ExceptionBehavior enumerator when given a string valid as input in constrained intrin...
@ TowardNegative
roundTowardNegative.
StringRef - Represent a constant reference to a string, i.e.
Optional< RoundingMode > convertStrToRoundingMode(StringRef)
Returns a valid RoundingMode enumerator when given a string that is valid as input in constrained int...
@ Dynamic
Denotes mode unknown at compile time.
@ NearestTiesToAway
roundTiesToAway.
@ TowardZero
roundTowardZero.
@ ebIgnore
This corresponds to "fpexcept.ignore".
ExceptionBehavior
Exception behavior used for floating point operations.
@ TowardPositive
roundTowardPositive.
A switch()-like statement whose cases are string literals.
@ ebStrict
This corresponds to "fpexcept.strict".
@ NearestTiesToEven
roundTiesToEven.