38 std::optional<StringRef> RoundingStr;
39 switch (UseRounding) {
41 RoundingStr =
"round.dynamic";
44 RoundingStr =
"round.tonearest";
47 RoundingStr =
"round.tonearestaway";
50 RoundingStr =
"round.downward";
53 RoundingStr =
"round.upward";
56 RoundingStr =
"round.towardzero";
64std::optional<fp::ExceptionBehavior>
73std::optional<StringRef>
75 std::optional<StringRef> ExceptStr;
78 ExceptStr =
"fpexcept.strict";
81 ExceptStr =
"fpexcept.ignore";
84 ExceptStr =
"fpexcept.maytrap";
92 switch (Instr.getOpcode()) {
93 case Instruction::FCmp:
96 IID = Intrinsic::experimental_constrained_fcmp;
100#define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \
101 case Instruction::NAME: \
102 IID = Intrinsic::INTRINSIC; \
104#define FUNCTION(NAME, NARG, ROUND_MODE, INTRINSIC)
105#define CMP_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)
106#include "llvm/IR/ConstrainedOps.def"
109 case Instruction::Call:
110 if (
auto *IntrinCall = dyn_cast<IntrinsicInst>(&Instr)) {
111 switch (IntrinCall->getIntrinsicID()) {
112#define FUNCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \
113 case Intrinsic::NAME: \
114 IID = Intrinsic::INTRINSIC; \
116#define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC)
117#define CMP_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)
118#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...
StringRef - 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.
std::optional< StringRef > convertRoundingModeToStr(RoundingMode)
For any RoundingMode enumerator, returns a string valid as input in constrained intrinsic rounding mo...
std::optional< StringRef > convertExceptionBehaviorToStr(fp::ExceptionBehavior)
For any ExceptionBehavior enumerator, returns a string valid as input in constrained intrinsic except...
Intrinsic::ID getConstrainedIntrinsicID(const Instruction &Instr)
Returns constrained intrinsic id to represent the given instruction in strictfp function.
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.
std::optional< RoundingMode > convertStrToRoundingMode(StringRef)
Returns a valid RoundingMode enumerator when given a string that is valid as input in constrained int...