LLVM: include/llvm/ADT/FloatingPointMode.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15#ifndef LLVM_ADT_FLOATINGPOINTMODE_H
16#define LLVM_ADT_FLOATINGPOINTMODE_H
17
22
23namespace llvm {
24
25
26
27
28
29
30
31
32
33
34
35
36
37
50
51
53 switch (RM) {
60 default: return "invalid";
61 }
62}
63
68
69
70
72
73
76
77
79
80
82
83
85
86
88 };
89
90
91
93
94
95
96
98
103
105
109
110
114
118
123
128
132
136
138 return !(*this == Other);
139 }
140
144
149
150
155
156
161
162
163
164
171 return MergedMode;
172 }
173
175
176 inline std::string str() const {
177 std::string storage;
180 return storage;
181 }
182};
183
185 Mode.print(OS);
186 return OS;
187}
188
189
200
201
202
204 switch (Mode) {
206 return "ieee";
208 return "preserve-sign";
210 return "positive-zero";
212 return "dynamic";
213 default:
214 return "";
215 }
216}
217
218
221 std::tie(OutputStr, InputStr) = Str.split(',');
222
225
226
227
230
232}
233
237
238
239
267
269
270
272
273
275
276
277
279
280
282
283}
284
285#endif
#define LLVM_DECLARE_ENUM_AS_BITMASK(Enum, LargestValue)
LLVM_DECLARE_ENUM_AS_BITMASK can be used to declare an enum type as a bit set, so that bitwise operat...
static cl::opt< RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode > Mode("regalloc-enable-advisor", cl::Hidden, cl::init(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default), cl::desc("Enable regalloc advisor mode"), cl::values(clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Default, "default", "Default"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Release, "release", "precompiled"), clEnumValN(RegAllocEvictionAdvisorAnalysisLegacy::AdvisorMode::Development, "development", "for training")))
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.
std::pair< StringRef, StringRef > split(char Separator) const
Split into two substrings around the first occurrence of a separator character.
constexpr bool empty() const
empty - Check if the string is empty.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
StringSwitch & Cases(std::initializer_list< StringLiteral > CaseStrings, T Value)
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an std::string.
This is an optimization pass for GlobalISel generic memory operations.
DenormalMode::DenormalModeKind parseDenormalFPAttributeComponent(StringRef Str)
Parse the expected names from the denormal-fp-math attribute.
Definition FloatingPointMode.h:191
LLVM_ABI FPClassTest fneg(FPClassTest Mask)
Return the test mask which returns true if the value's sign bit is flipped.
FPClassTest
Floating-point class tests, supported by 'is_fpclass' intrinsic.
Definition FloatingPointMode.h:240
@ fcInf
Definition FloatingPointMode.h:255
@ fcNegSubnormal
Definition FloatingPointMode.h:247
@ fcPosNormal
Definition FloatingPointMode.h:251
@ fcQNan
Definition FloatingPointMode.h:244
@ fcNegZero
Definition FloatingPointMode.h:248
@ fcNegInf
Definition FloatingPointMode.h:245
@ fcFinite
Definition FloatingPointMode.h:261
@ fcSubnormal
Definition FloatingPointMode.h:257
@ fcNone
Definition FloatingPointMode.h:241
@ fcPositive
Definition FloatingPointMode.h:262
@ fcNegFinite
Definition FloatingPointMode.h:260
@ fcPosZero
Definition FloatingPointMode.h:249
@ fcSNan
Definition FloatingPointMode.h:243
@ fcPosFinite
Definition FloatingPointMode.h:259
@ fcNegNormal
Definition FloatingPointMode.h:246
@ fcZero
Definition FloatingPointMode.h:258
@ fcNegative
Definition FloatingPointMode.h:263
@ fcAllFlags
Definition FloatingPointMode.h:265
@ fcPosSubnormal
Definition FloatingPointMode.h:250
@ fcPosInf
Definition FloatingPointMode.h:252
@ fcNormal
Definition FloatingPointMode.h:256
@ fcNan
Definition FloatingPointMode.h:254
LLVM_ABI FPClassTest inverse_fabs(FPClassTest Mask)
Return the test mask which returns true after fabs is applied to the value.
LLVM_ABI FPClassTest unknown_sign(FPClassTest Mask)
Return the test mask which returns true if the value could have the same set of classes,...
RoundingMode
Rounding mode.
Definition FloatingPointMode.h:38
@ TowardZero
roundTowardZero.
Definition FloatingPointMode.h:40
@ NearestTiesToEven
roundTiesToEven.
Definition FloatingPointMode.h:41
@ Dynamic
Denotes mode unknown at compile time.
Definition FloatingPointMode.h:47
@ TowardPositive
roundTowardPositive.
Definition FloatingPointMode.h:42
@ NearestTiesToAway
roundTiesToAway.
Definition FloatingPointMode.h:44
@ TowardNegative
roundTowardNegative.
Definition FloatingPointMode.h:43
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
DenormalMode parseDenormalFPAttribute(StringRef Str)
Returns the denormal mode to use for inputs and outputs.
Definition FloatingPointMode.h:219
StringRef denormalModeKindName(DenormalMode::DenormalModeKind Mode)
Return the name used for the denormal handling mode used by the expected names from the denormal-fp-m...
Definition FloatingPointMode.h:203
StringRef spell(RoundingMode RM)
Returns text representation of the given rounding mode.
Definition FloatingPointMode.h:52
Represent subnormal handling kind for floating point instruction inputs and outputs.
Definition FloatingPointMode.h:71
DenormalModeKind Input
Denormal treatment kind for floating point instruction inputs in the default floating-point environme...
Definition FloatingPointMode.h:97
constexpr bool outputsAreZero() const
Return true if output denormals should be flushed to 0.
Definition FloatingPointMode.h:157
DenormalModeKind
Represent handled modes for denormal (aka subnormal) modes in the floating point environment.
Definition FloatingPointMode.h:74
@ PreserveSign
The sign of a flushed-to-zero number is preserved in the sign of 0.
Definition FloatingPointMode.h:81
@ Invalid
Definition FloatingPointMode.h:75
@ PositiveZero
Denormals are flushed to positive zero.
Definition FloatingPointMode.h:84
@ Dynamic
Denormals have unknown treatment.
Definition FloatingPointMode.h:87
@ IEEE
IEEE-754 denormal numbers preserved.
Definition FloatingPointMode.h:78
static constexpr DenormalMode getPositiveZero()
Definition FloatingPointMode.h:124
constexpr DenormalMode(const DenormalMode &)=default
void print(raw_ostream &OS) const
Definition FloatingPointMode.h:234
bool operator!=(DenormalMode Other) const
Definition FloatingPointMode.h:137
static constexpr DenormalMode getDefault()
Return the assumed default mode for a function without denormal-fp-math.
Definition FloatingPointMode.h:111
std::string str() const
Definition FloatingPointMode.h:176
bool isSimple() const
Definition FloatingPointMode.h:141
static constexpr DenormalMode getInvalid()
Definition FloatingPointMode.h:106
constexpr bool inputsAreZero() const
Return true if input denormals must be implicitly treated as 0.
Definition FloatingPointMode.h:151
static constexpr DenormalMode getPreserveSign()
Definition FloatingPointMode.h:119
DenormalModeKind Output
Denormal flushing mode for floating point instruction results in the default floating point environme...
Definition FloatingPointMode.h:92
bool operator==(DenormalMode Other) const
Definition FloatingPointMode.h:133
DenormalMode & operator=(const DenormalMode &)=default
constexpr DenormalMode(DenormalModeKind Out, DenormalModeKind In)
Definition FloatingPointMode.h:101
bool isValid() const
Definition FloatingPointMode.h:145
constexpr DenormalMode()=default
DenormalMode mergeCalleeMode(DenormalMode Callee) const
Get the effective denormal mode if the mode if this caller calls into a function with Callee.
Definition FloatingPointMode.h:165
static constexpr DenormalMode getDynamic()
Definition FloatingPointMode.h:129
static constexpr DenormalMode getIEEE()
Definition FloatingPointMode.h:115