LLVM: include/llvm/IR/ConstantFPRange.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23#ifndef LLVM_IR_CONSTANTFPRANGE_H

24#define LLVM_IR_CONSTANTFPRANGE_H

25

29#include

30

31namespace llvm {

32

35

36

37class [[nodiscard]] ConstantFPRange {

39 bool MayBeQNaN : 1;

40 bool MayBeSNaN : 1;

41

42

43 ConstantFPRange getEmpty() const {

44 return ConstantFPRange(getSemantics(), false);

45 }

46

47

48 ConstantFPRange getFull() const {

49 return ConstantFPRange(getSemantics(), true);

50 }

51

52 void makeEmpty();

53 void makeFull();

54

55

57

58public:

59

61

62

63

64

66 bool MayBeSNaN);

67

68

70 return ConstantFPRange(Sem, false);

71 }

72

73

75 return ConstantFPRange(Sem, true);

76 }

77

78

80

81

83

84

86 return ConstantFPRange(std::move(LowerVal), std::move(UpperVal),

87 false, false);

88 }

89

90

92 return ConstantFPRange(std::move(LowerVal), std::move(UpperVal),

93 true, true);

94 }

95

96

98 bool MayBeQNaN, bool MayBeSNaN);

99

100

101

102

103

104

105

106

107

110

111

112

113

114

115

116

117

118

122

123

124

125

126

127

128

129

130 LLVM_ABI static std::optional

132

133

134

137

138

140

141

143

144 bool containsNaN() const { return MayBeQNaN || MayBeSNaN; }

147 LLVM_ABI bool isNaNOnly() const;

148

149

151

152

153

154 LLVM_ABI bool isFullSet() const;

155

156

157 LLVM_ABI bool isEmptySet() const;

158

159

161

162

164

165

166

168

169

170

171

175

176

177

178

179 LLVM_ABI std::optional getSignBit() const;

180

181

183

185

186

188

189

191

192

194

195

196

198

199

200

201

203

204

206

207

209

210

211

213 return ConstantFPRange(Lower, Upper, false, false);

214 }

215

216

217

219

220

221

225

226

227

229

230

231

233

234

235

237

238

239

240

242

243

244

246};

247

252

253}

254

255#endif

This file declares a class to represent arbitrary precision floating point values and provide a varie...

static void print(raw_ostream &Out, object::Archive::Kind Kind, T Val)

bool operator==(const MergedFunctionsInfo &LHS, const MergedFunctionsInfo &RHS)

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")))

static bool contains(SmallPtrSetImpl< ConstantExpr * > &Cache, ConstantExpr *Expr, Constant *C)

llvm::RoundingMode roundingMode

IEEE-754R 4.3: Rounding-direction attributes.

static constexpr roundingMode rmNearestTiesToEven

Predicate

This enumeration lists the possible predicates for CmpInst subclasses.

This class represents a range of floating-point values.

Definition ConstantFPRange.h:37

static ConstantFPRange getMayBeNaN(APFloat LowerVal, APFloat UpperVal)

Create a range which may contain NaNs.

Definition ConstantFPRange.h:91

static ConstantFPRange getFull(const fltSemantics &Sem)

Create full constant range with the given semantics.

Definition ConstantFPRange.h:74

bool containsQNaN() const

Definition ConstantFPRange.h:145

bool containsSNaN() const

Definition ConstantFPRange.h:146

ConstantFPRange getWithoutNaN() const

Get the range without NaNs.

Definition ConstantFPRange.h:212

LLVM_ABI const APFloat * getSingleElement(bool ExcludesNaN=false) const

If this set contains a single element, return it, otherwise return null.

bool containsNaN() const

Definition ConstantFPRange.h:144

bool isSingleElement(bool ExcludesNaN=false) const

Return true if this set contains exactly one member.

Definition ConstantFPRange.h:172

LLVM_ABI void print(raw_ostream &OS) const

Print out the bounds to a stream.

bool operator!=(const ConstantFPRange &CR) const

Return true if this range is not equal to another range.

Definition ConstantFPRange.h:184

static ConstantFPRange getEmpty(const fltSemantics &Sem)

Create empty constant range with the given semantics.

Definition ConstantFPRange.h:69

static ConstantFPRange getNonNaN(APFloat LowerVal, APFloat UpperVal)

Create a range which doesn't contain NaNs.

Definition ConstantFPRange.h:85

const APFloat & getUpper() const

Return the upper value for this range.

Definition ConstantFPRange.h:142

const APFloat & getLower() const

Return the lower value for this range.

Definition ConstantFPRange.h:139

const fltSemantics & getSemantics() const

Get the semantics of this ConstantFPRange.

Definition ConstantFPRange.h:150

LLVM Value Representation.

This class implements an extremely fast bulk output stream that can only output to a stream.

This is an optimization pass for GlobalISel generic memory operations.

void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)

APFloat abs(APFloat X)

Returns the absolute value of the argument.

decltype(auto) getSingleElement(ContainerTy &&C)

Asserts that the given container has a single element and returns that element.

FPClassTest

Floating-point class tests, supported by 'is_fpclass' intrinsic.

raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)

decltype(auto) cast(const From &Val)

cast - Return the argument parameter cast to the specified type.

DenormalModeKind

Represent handled modes for denormal (aka subnormal) modes in the floating point environment.