24std::optional<RoundingMode>
38std::optional<StringRef>
40 std::optional<StringRef> RoundingStr;
41 switch (UseRounding) {
43 RoundingStr =
"round.dynamic";
46 RoundingStr =
"round.tonearest";
49 RoundingStr =
"round.tonearestaway";
52 RoundingStr =
"round.downward";
55 RoundingStr =
"round.upward";
58 RoundingStr =
"round.towardzero";
66std::optional<fp::ExceptionBehavior>
75std::optional<StringRef>
77 std::optional<StringRef> ExceptStr;
80 ExceptStr =
"fpexcept.strict";
83 ExceptStr =
"fpexcept.ignore";
86 ExceptStr =
"fpexcept.maytrap";
94 switch (Instr.getOpcode()) {
95 case Instruction::FCmp:
98 IID = Intrinsic::experimental_constrained_fcmp;
102#define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \
103 case Instruction::NAME: \
104 IID = Intrinsic::INTRINSIC; \
106#define FUNCTION(NAME, NARG, ROUND_MODE, INTRINSIC)
107#define CMP_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)
108#include "llvm/IR/ConstrainedOps.def"
111 case Instruction::Call:
113 switch (IntrinCall->getIntrinsicID()) {
114#define FUNCTION(NAME, NARG, ROUND_MODE, INTRINSIC) \
115 case Intrinsic::NAME: \
116 IID = Intrinsic::INTRINSIC; \
118#define INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC)
119#define CMP_INSTRUCTION(NAME, NARG, ROUND_MODE, INTRINSIC, DAGN)
120#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.
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...