LLVM: lib/IR/ConstantFPRange.cpp Source File (original) (raw)
1
2
3
4
5
6
7
8
14#include
15
16using namespace llvm;
17
18void ConstantFPRange::makeEmpty() {
19 auto &Sem = Lower.getSemantics();
22 MayBeQNaN = false;
23 MayBeSNaN = false;
24}
25
26void ConstantFPRange::makeFull() {
27 auto &Sem = Lower.getSemantics();
30 MayBeQNaN = true;
31 MayBeSNaN = true;
32}
33
35 return Lower.isPosInfinity() && Upper.isNegInfinity();
36}
37
38ConstantFPRange::ConstantFPRange(const fltSemantics &Sem, bool IsFullSet)
42 MayBeQNaN = IsFullSet;
43 MayBeSNaN = IsFullSet;
44}
45
49 if (Value.isNaN()) {
50 makeEmpty();
51 bool IsSNaN = Value.isSignaling();
52 MayBeQNaN = !IsSNaN;
53 MayBeSNaN = IsSNaN;
54 } else {
55 Lower = Upper = Value;
56 MayBeQNaN = MayBeSNaN = false;
57 }
58}
59
60
63 assert(.isNaN() &&
.isNaN() && "Unordered compare");
64 if (LHS.isZero() && RHS.isZero()) {
65 if (LHS.isNegative() == RHS.isNegative())
68 }
70}
71
74 !(Lower.isInfinity() && Upper.isInfinity());
75}
76
83
84ConstantFPRange::ConstantFPRange(APFloat LowerVal, APFloat UpperVal,
85 bool MayBeQNaNVal, bool MayBeSNaNVal)
86 : Lower(std::move(LowerVal)), Upper(std::move(UpperVal)),
87 MayBeQNaN(MayBeQNaNVal), MayBeSNaN(MayBeSNaNVal) {
88 assert(&Lower.getSemantics() == &Upper.getSemantics() &&
89 "Should only use the same semantics");
91}
92
98
100 bool MayBeQNaN, bool MayBeSNaN) {
101 return ConstantFPRange(APFloat::getInf(Sem, false),
103 MayBeSNaN);
104}
105
107 return ConstantFPRange(APFloat::getInf(Sem, true),
109 false, false);
110}
111
112
116
117
121 if (V.isNegInfinity())
122 return ConstantFPRange::getEmpty(Sem);
123 V.next(true);
124 }
126 std::move(V));
127}
128
129
133 if (V.isPosInfinity())
134 return ConstantFPRange::getEmpty(Sem);
135 V.next(false);
136 }
139}
140
141
145 return CR;
146
149 if (Lower.isPosZero())
151 if (Upper.isNegZero())
155}
156
161 ContainsNaN, ContainsNaN);
162}
163
166 const ConstantFPRange &Other) {
167 if (Other.isEmptySet())
170 return getFull(Other.getSemantics());
172 return getEmpty(Other.getSemantics());
173
174 switch (Pred) {
176 return getFull(Other.getSemantics());
178 return getEmpty(Other.getSemantics());
182 return getNaNOnly(Other.getSemantics(), true,
183 true);
189 if (const APFloat *SingleElement =
190 Other.getSingleElement(true)) {
191 const fltSemantics &Sem = SingleElement->getSemantics();
192 if (SingleElement->isPosInfinity())
196 Pred);
197 if (SingleElement->isNegInfinity())
201 Pred);
202 }
204 : getFull(Other.getSemantics());
217 default:
219 }
220}
221
224 const ConstantFPRange &Other) {
225 if (Other.isEmptySet())
226 return getFull(Other.getSemantics());
228 return getEmpty(Other.getSemantics());
230 return getFull(Other.getSemantics());
231
232 switch (Pred) {
234 return getFull(Other.getSemantics());
236 return getEmpty(Other.getSemantics());
240 return getNaNOnly(Other.getSemantics(), true,
241 true);
244 return setNaNField(Other.isSingleElement(true) ||
247 : getEmpty(Other.getSemantics()),
248 Pred);
251 return getEmpty(Other.getSemantics());
264 default:
266 }
267}
268
269std::optional
274 return std::nullopt;
276}
277
279 const ConstantFPRange &Other) const {
281}
282
284 return Lower.isNegInfinity() && Upper.isPosInfinity() && MayBeQNaN &&
285 MayBeSNaN;
286}
287
289 return Lower.isPosInfinity() && Upper.isNegInfinity() && !MayBeQNaN &&
290 !MayBeSNaN;
291}
292
295 "Should only use the same semantics");
296
298 return Val.isSignaling() ? MayBeSNaN : MayBeQNaN;
301}
302
305 "Should only use the same semantics");
306
307 if (CR.MayBeQNaN && !MayBeQNaN)
308 return false;
309
310 if (CR.MayBeSNaN && !MayBeSNaN)
311 return false;
312
315}
316
318 if (!ExcludesNaN && (MayBeSNaN || MayBeQNaN))
319 return nullptr;
320 return Lower.bitwiseIsEqual(Upper) ? &Lower : nullptr;
321}
322
324 if (!MayBeSNaN && !MayBeQNaN && Lower.isNegative() == Upper.isNegative())
325 return Lower.isNegative();
326 return std::nullopt;
327}
328
331 "Should only use the same semantics");
332 if (MayBeSNaN != CR.MayBeSNaN || MayBeQNaN != CR.MayBeQNaN)
333 return false;
334 return Lower.bitwiseIsEqual(CR.Lower) && Upper.bitwiseIsEqual(CR.Upper);
335}
336
339 if (MayBeSNaN)
341 if (MayBeQNaN)
344 FPClassTest LowerMask = Lower.classify();
345 FPClassTest UpperMask = Upper.classify();
346 assert(LowerMask <= UpperMask && "Range is nan-only.");
347
348 Mask |= (UpperMask << 1) - LowerMask;
349 }
351}
352
355 OS << "full-set";
357 OS << "empty-set";
358 else {
360 if (!NaNOnly)
361 OS << '[' << Lower << ", " << Upper << ']';
362
363 if (MayBeSNaN || MayBeQNaN) {
364 if (!NaNOnly)
365 OS << " with ";
366 if (MayBeSNaN && MayBeQNaN)
367 OS << "NaN";
368 else if (MayBeSNaN)
369 OS << "SNaN";
370 else if (MayBeQNaN)
371 OS << "QNaN";
372 }
373 }
374}
375
376#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
378#endif
379
383 "Should only use the same semantics");
387 return ConstantFPRange(std::move(NewLower), std::move(NewUpper),
388 MayBeQNaN & CR.MayBeQNaN, MayBeSNaN & CR.MayBeSNaN);
389}
390
393 "Should only use the same semantics");
394 return ConstantFPRange(minnum(Lower, CR.Lower), maxnum(Upper, CR.Upper),
395 MayBeQNaN | CR.MayBeQNaN, MayBeSNaN | CR.MayBeSNaN);
396}
397
400 return *this;
401
402 if (Lower.isNegative() == Upper.isNegative()) {
403 if (Lower.isNegative())
405 return *this;
406 }
407
410 return ConstantFPRange(std::move(NewLower), std::move(NewUpper), MayBeQNaN,
411 MayBeSNaN);
412}
413
415 return ConstantFPRange(-Upper, -Lower, MayBeQNaN, MayBeSNaN);
416}
417
418
420 bool &HasNegInf) {
422 "Non-NaN part is empty.");
423 auto &Sem = Lower.getSemantics();
424 if (Lower.isNegInfinity()) {
426 HasNegInf = true;
427 }
428 if (Upper.isPosInfinity()) {
430 HasPosInf = true;
431 }
433}
434
437 return *this;
438 APFloat NewLower = Lower;
439 APFloat NewUpper = Upper;
440 bool UnusedFlag;
441 removeInf(NewLower, NewUpper, UnusedFlag,
442 UnusedFlag);
444 return ConstantFPRange(std::move(NewLower), std::move(NewUpper), MayBeQNaN,
445 MayBeSNaN);
446}
447
450 bool LosesInfo;
451 APFloat NewLower = Lower;
452 APFloat NewUpper = Upper;
453
455 NewLower.isNaN())
456 return getFull(DstSem);
458 NewUpper.isNaN())
459 return getFull(DstSem);
460 return ConstantFPRange(std::move(NewLower), std::move(NewUpper),
461 MayBeQNaN || MayBeSNaN,
462 false);
463}
464
466 bool ResMayBeQNaN = ((MayBeQNaN || MayBeSNaN) && .isEmptySet()) ||
470 false);
471 bool LHSHasNegInf = false, LHSHasPosInf = false;
472 APFloat LHSLower = Lower, LHSUpper = Upper;
473 bool LHSFiniteIsNonEmpty =
474 removeInf(LHSLower, LHSUpper, LHSHasPosInf, LHSHasNegInf);
475 bool RHSHasNegInf = false, RHSHasPosInf = false;
477 bool RHSFiniteIsNonEmpty =
478 removeInf(RHSLower, RHSUpper, RHSHasPosInf, RHSHasNegInf);
479
480 ResMayBeQNaN |=
481 (LHSHasNegInf && RHSHasPosInf) || (LHSHasPosInf && RHSHasNegInf);
482
483 bool HasNegInf = (LHSHasNegInf && (RHSFiniteIsNonEmpty || RHSHasNegInf)) ||
484 (RHSHasNegInf && (LHSFiniteIsNonEmpty || LHSHasNegInf));
485 bool HasPosInf = (LHSHasPosInf && (RHSFiniteIsNonEmpty || RHSHasPosInf)) ||
486 (RHSHasPosInf && (LHSFiniteIsNonEmpty || LHSHasPosInf));
487 if (LHSFiniteIsNonEmpty && RHSFiniteIsNonEmpty) {
490 : LHSLower + RHSLower;
492 HasPosInf ? APFloat::getInf(LHSUpper.getSemantics(), false)
493 : LHSUpper + RHSUpper;
494 return ConstantFPRange(NewLower, NewUpper, ResMayBeQNaN,
495 false);
496 }
497
498
499 return ConstantFPRange(
500 APFloat::getInf(Lower.getSemantics(), HasNegInf),
501 APFloat::getInf(Upper.getSemantics(), !HasPosInf),
502 ResMayBeQNaN,
503 false);
504}
505
510
513 return;
516 return;
517
519
520
521
522 bool ZeroLowerNegative =
524 bool ZeroUpperNegative =
526 assert((ZeroLowerNegative || !ZeroUpperNegative) &&
527 "ZeroLower is greater than ZeroUpper.");
530}
531
532
537
538
539 std::optional<std::pair<APFloat, APFloat>> FinitePart;
540
545 "The sign should be dropped.");
547 "Empty set.");
548 if (.isInfinity())
551 }
552};
553
554
556 std::optional &NegPart,
557 std::optional &PosPart) {
559 "Non-NaN part is empty.");
560 if (Lower.isNegative() == Upper.isNegative()) {
561 if (Lower.isNegative())
563 else
565 return;
566 }
567 auto &Sem = Lower.getSemantics();
570}
571
574 bool ResMayBeQNaN = ((MayBeQNaN || MayBeSNaN) && .isEmptySet()) ||
577 return getNaNOnly(Sem, ResMayBeQNaN,
578 false);
579 std::optional LHSNeg, LHSPos, RHSNeg, RHSPos;
580 splitPosNeg(Lower, Upper, LHSNeg, LHSPos);
584 auto Update = [&](std::optional &LHS,
585 std::optional &RHS, bool Negative) {
586 if (!LHS || !RHS)
587 return;
588
589 ResMayBeQNaN |= LHS->HasZero && RHS->HasInf;
590 ResMayBeQNaN |= RHS->HasZero && LHS->HasInf;
591
592 if ((LHS->HasInf && RHS->HasNonZero) || (RHS->HasInf && LHS->HasNonZero))
593 (Negative ? ResLower : ResUpper) = APFloat::getInf(Sem, Negative);
594
595 if (LHS->FinitePart && RHS->FinitePart) {
596 APFloat NewLower = LHS->FinitePart->first * RHS->FinitePart->first;
597 APFloat NewUpper = LHS->FinitePart->second * RHS->FinitePart->second;
598 if (Negative) {
599 ResLower = minnum(ResLower, -NewUpper);
600 ResUpper = maxnum(ResUpper, -NewLower);
601 } else {
602 ResLower = minnum(ResLower, NewLower);
603 ResUpper = maxnum(ResUpper, NewUpper);
604 }
605 }
606 };
607 Update(LHSNeg, RHSNeg, false);
608 Update(LHSNeg, RHSPos, true);
609 Update(LHSPos, RHSNeg, true);
610 Update(LHSPos, RHSPos, false);
611 return ConstantFPRange(ResLower, ResUpper, ResMayBeQNaN, false);
612}
613
616 bool ResMayBeQNaN = ((MayBeQNaN || MayBeSNaN) && .isEmptySet()) ||
619 return getNaNOnly(Sem, ResMayBeQNaN,
620 false);
621 std::optional LHSNeg, LHSPos, RHSNeg, RHSPos;
622 splitPosNeg(Lower, Upper, LHSNeg, LHSPos);
626 auto Update = [&](std::optional &LHS,
627 std::optional &RHS, bool Negative) {
628 if (!LHS || !RHS)
629 return;
630
631 ResMayBeQNaN |= LHS->HasInf && RHS->HasInf;
632 ResMayBeQNaN |= LHS->HasZero && RHS->HasZero;
633
634
635
636
637
638
639 bool LHSHasNonZeroFinite = LHS->FinitePart && LHS->HasNonZero;
640 bool RHSHasNonZeroFinite = RHS->FinitePart && RHS->HasNonZero;
641
642 if ((LHS->HasInf && RHS->FinitePart) ||
643 (LHSHasNonZeroFinite && RHS->HasZero))
644 (Negative ? ResLower : ResUpper) = APFloat::getInf(Sem, Negative);
645
646 if (LHS->FinitePart && RHS->HasInf) {
648 ResLower = minnum(ResLower, Zero);
649 ResUpper = maxnum(ResUpper, Zero);
650 }
651
652 if (LHS->FinitePart && RHSHasNonZeroFinite) {
653 assert(!RHS->FinitePart->second.isZero() &&
654 "Divisor should be non-zero.");
655 APFloat NewLower = LHS->FinitePart->first / RHS->FinitePart->second;
656 APFloat NewUpper = LHS->FinitePart->second /
657 (RHS->FinitePart->first.isZero()
659 : RHS->FinitePart->first);
660 if (Negative) {
661 ResLower = minnum(ResLower, -NewUpper);
662 ResUpper = maxnum(ResUpper, -NewLower);
663 } else {
664 ResLower = minnum(ResLower, NewLower);
665 ResUpper = maxnum(ResUpper, NewUpper);
666 }
667 }
668 };
669 Update(LHSNeg, RHSNeg, false);
670 Update(LHSNeg, RHSPos, true);
671 Update(LHSPos, RHSNeg, true);
672 Update(LHSPos, RHSPos, false);
673 return ConstantFPRange(ResLower, ResUpper, ResMayBeQNaN, false);
674}
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file declares a class to represent arbitrary precision floating point values and provide a varie...
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
static APFloat::cmpResult strictCompare(const APFloat &LHS, const APFloat &RHS)
Definition ConstantFPRange.cpp:61
static ConstantFPRange extendZeroIfEqual(const ConstantFPRange &CR, FCmpInst::Predicate Pred)
Make sure that +0/-0 are both included in the range.
Definition ConstantFPRange.cpp:142
static bool fcmpPredExcludesEqual(FCmpInst::Predicate Pred)
Return true for ULT/UGT/OLT/OGT.
Definition ConstantFPRange.cpp:113
static void splitPosNeg(const APFloat &Lower, const APFloat &Upper, std::optional< SameSignRange > &NegPart, std::optional< SameSignRange > &PosPart)
Split the range into positive and negative components.
Definition ConstantFPRange.cpp:555
static bool removeInf(APFloat &Lower, APFloat &Upper, bool &HasPosInf, bool &HasNegInf)
Return true if the finite part is not empty after removing infinities.
Definition ConstantFPRange.cpp:419
static ConstantFPRange makeLessThan(APFloat V, FCmpInst::Predicate Pred)
Return [-inf, V) or [-inf, V].
Definition ConstantFPRange.cpp:118
static void canonicalizeRange(APFloat &Lower, APFloat &Upper)
Definition ConstantFPRange.cpp:77
static ConstantFPRange makeGreaterThan(APFloat V, FCmpInst::Predicate Pred)
Return (V, +inf] or [V, +inf].
Definition ConstantFPRange.cpp:130
static bool isNonCanonicalEmptySet(const APFloat &Lower, const APFloat &Upper)
Definition ConstantFPRange.cpp:72
static ConstantFPRange setNaNField(const ConstantFPRange &CR, FCmpInst::Predicate Pred)
Definition ConstantFPRange.cpp:157
Utilities for dealing with flags related to floating point properties and mode controls.
static bool isZero(Value *V, const DataLayout &DL, DominatorTree *DT, AssumptionCache *AC)
cmpResult
IEEE-754R 5.11: Floating Point Comparison Relations.
llvm::RoundingMode roundingMode
IEEE-754R 4.3: Rounding-direction attributes.
LLVM_ABI opStatus convert(const fltSemantics &ToSemantics, roundingMode RM, bool *losesInfo)
bool bitwiseIsEqual(const APFloat &RHS) const
const fltSemantics & getSemantics() const
static APFloat getLargest(const fltSemantics &Sem, bool Negative=false)
Returns the largest finite number in the given semantics.
static APFloat getInf(const fltSemantics &Sem, bool Negative=false)
Factory for Positive and Negative Infinity.
static APFloat getSmallest(const fltSemantics &Sem, bool Negative=false)
Returns the smallest (by magnitude) finite number in the given semantics.
static APFloat getZero(const fltSemantics &Sem, bool Negative=false)
Factory for Positive and Negative Zero.
Predicate
This enumeration lists the possible predicates for CmpInst subclasses.
@ FCMP_OEQ
0 0 0 1 True if ordered and equal
@ FCMP_TRUE
1 1 1 1 Always true (always folded)
@ FCMP_OLT
0 1 0 0 True if ordered and less than
@ FCMP_ULE
1 1 0 1 True if unordered, less than, or equal
@ FCMP_OGT
0 0 1 0 True if ordered and greater than
@ FCMP_OGE
0 0 1 1 True if ordered and greater than or equal
@ FCMP_ULT
1 1 0 0 True if unordered or less than
@ FCMP_ONE
0 1 1 0 True if ordered and operands are unequal
@ FCMP_UEQ
1 0 0 1 True if unordered or equal
@ FCMP_UGT
1 0 1 0 True if unordered or greater than
@ FCMP_OLE
0 1 0 1 True if ordered and less than or equal
@ FCMP_ORD
0 1 1 1 True if ordered (no nans)
@ FCMP_UNE
1 1 1 0 True if unordered or not equal
@ FCMP_UGE
1 0 1 1 True if unordered, greater than, or equal
@ FCMP_FALSE
0 0 0 0 Always false (always folded)
@ FCMP_UNO
1 0 0 0 True if unordered: isnan(X) | isnan(Y)
static LLVM_ABI bool isUnordered(Predicate predicate)
Determine if the predicate is an unordered operation.
static LLVM_ABI bool isOrdered(Predicate predicate)
Determine if the predicate is an ordered operation.
This class represents a range of floating-point values.
LLVM_ABI ConstantFPRange add(const ConstantFPRange &Other) const
Return a new range representing the possible values resulting from an addition of a value in this ran...
Definition ConstantFPRange.cpp:465
LLVM_ABI ConstantFPRange abs() const
Calculate absolute value range.
Definition ConstantFPRange.cpp:398
LLVM_ABI bool isFullSet() const
Return true if this set contains all of the elements possible for this data-type.
Definition ConstantFPRange.cpp:283
bool containsQNaN() const
static LLVM_ABI ConstantFPRange getNonNaN(const fltSemantics &Sem)
Helper for [-inf, inf] to represent all non-NaN values.
Definition ConstantFPRange.cpp:106
bool containsSNaN() const
LLVM_ABI const APFloat * getSingleElement(bool ExcludesNaN=false) const
If this set contains a single element, return it, otherwise return null.
Definition ConstantFPRange.cpp:317
static LLVM_ABI ConstantFPRange makeSatisfyingFCmpRegion(FCmpInst::Predicate Pred, const ConstantFPRange &Other)
Produce the largest range such that all values in the returned range satisfy the given predicate with...
Definition ConstantFPRange.cpp:223
LLVM_ABI bool operator==(const ConstantFPRange &CR) const
Return true if this range is equal to another range.
Definition ConstantFPRange.cpp:329
static LLVM_ABI ConstantFPRange getNaNOnly(const fltSemantics &Sem, bool MayBeQNaN, bool MayBeSNaN)
Create a range which only contains NaNs.
Definition ConstantFPRange.cpp:99
LLVM_ABI ConstantFPRange unionWith(const ConstantFPRange &CR) const
Return the smallest range that results from the union of this range with another range.
Definition ConstantFPRange.cpp:391
LLVM_ABI void flushDenormals(DenormalMode::DenormalModeKind Mode)
Flush denormal values to zero according to the specified mode.
Definition ConstantFPRange.cpp:511
LLVM_ABI ConstantFPRange sub(const ConstantFPRange &Other) const
Return a new range representing the possible values resulting from a subtraction of a value in this r...
Definition ConstantFPRange.cpp:506
LLVM_ABI std::optional< bool > getSignBit() const
Return true if the sign bit of all values in this range is 1.
Definition ConstantFPRange.cpp:323
static LLVM_ABI ConstantFPRange makeAllowedFCmpRegion(FCmpInst::Predicate Pred, const ConstantFPRange &Other)
Produce the smallest range such that all values that may satisfy the given predicate with any value c...
Definition ConstantFPRange.cpp:165
LLVM_ABI bool isNaNOnly() const
Definition ConstantFPRange.cpp:34
LLVM_ABI bool isEmptySet() const
Return true if this set contains no members.
Definition ConstantFPRange.cpp:288
LLVM_ABI ConstantFPRange mul(const ConstantFPRange &Other) const
Return a new range representing the possible values resulting from a multiplication of a value in thi...
Definition ConstantFPRange.cpp:572
static LLVM_ABI ConstantFPRange getFinite(const fltSemantics &Sem)
Helper for (-inf, inf) to represent all finite values.
Definition ConstantFPRange.cpp:93
LLVM_ABI void print(raw_ostream &OS) const
Print out the bounds to a stream.
Definition ConstantFPRange.cpp:353
LLVM_ABI ConstantFPRange cast(const fltSemantics &DstSem, APFloat::roundingMode RM=APFloat::rmNearestTiesToEven) const
Return a new range in the specified format with the specified rounding mode.
Definition ConstantFPRange.cpp:448
LLVM_ABI ConstantFPRange intersectWith(const ConstantFPRange &CR) const
Return the range that results from the intersection of this range with another range.
Definition ConstantFPRange.cpp:381
LLVM_ABI ConstantFPRange div(const ConstantFPRange &Other) const
Return a new range representing the possible values resulting from a division of a value in this rang...
Definition ConstantFPRange.cpp:614
LLVM_ABI void dump() const
Allow printing from a debugger easily.
Definition ConstantFPRange.cpp:377
LLVM_ABI ConstantFPRange negate() const
Calculate range of negated values.
Definition ConstantFPRange.cpp:414
LLVM_ABI FPClassTest classify() const
Return the FPClassTest which will return true for the value.
Definition ConstantFPRange.cpp:337
LLVM_ABI ConstantFPRange getWithoutInf() const
Get the range without infinities.
Definition ConstantFPRange.cpp:435
LLVM_ABI bool fcmp(FCmpInst::Predicate Pred, const ConstantFPRange &Other) const
Does the predicate Pred hold between ranges this and Other?
Definition ConstantFPRange.cpp:278
LLVM_ABI bool contains(const APFloat &Val) const
Return true if the specified value is in the set.
Definition ConstantFPRange.cpp:293
const APFloat & getUpper() const
Return the upper value for this range.
const APFloat & getLower() const
Return the lower value for this range.
static LLVM_ABI std::optional< ConstantFPRange > makeExactFCmpRegion(FCmpInst::Predicate Pred, const APFloat &Other)
Produce the exact range such that all values in the returned range satisfy the given predicate with a...
Definition ConstantFPRange.cpp:270
const fltSemantics & getSemantics() const
Get the semantics of this ConstantFPRange.
LLVM Value Representation.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
APFloat abs(APFloat X)
Returns the absolute value of the argument.
LLVM_READONLY APFloat maxnum(const APFloat &A, const APFloat &B)
Implements IEEE-754 2008 maxNum semantics.
FPClassTest
Floating-point class tests, supported by 'is_fpclass' intrinsic.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
LLVM_READONLY APFloat minnum(const APFloat &A, const APFloat &B)
Implements IEEE-754 2008 minNum semantics.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Implement std::hash so that hash_code can be used in STL containers.
Represent a contiguous range of values sharing the same sign.
Definition ConstantFPRange.cpp:533
SameSignRange(const APFloat &Lower, const APFloat &Upper)
Definition ConstantFPRange.cpp:541
bool HasNonZero
Definition ConstantFPRange.cpp:535
bool HasInf
Definition ConstantFPRange.cpp:536
bool HasZero
Definition ConstantFPRange.cpp:534
std::optional< std::pair< APFloat, APFloat > > FinitePart
Definition ConstantFPRange.cpp:539
DenormalModeKind
Represent handled modes for denormal (aka subnormal) modes in the floating point environment.
@ PreserveSign
The sign of a flushed-to-zero number is preserved in the sign of 0.
@ PositiveZero
Denormals are flushed to positive zero.
@ IEEE
IEEE-754 denormal numbers preserved.