Go to the documentation of this file.
15 #ifndef LLVM_ADT_APFLOAT_H
16 #define LLVM_ADT_APFLOAT_H
24 #define APFLOAT_DISPATCH_ON_SEMANTICS(METHOD_CALL) \
26 if (usesLayout<IEEEFloat>(getSemantics())) \
27 return U.IEEE.METHOD_CALL; \
28 if (usesLayout<DoubleAPFloat>(getSemantics())) \
29 return U.Double.METHOD_CALL; \
30 llvm_unreachable("Unexpected semantics"); \
450 unsigned FormatMaxPadding = 3,
bool TruncateZero =
true)
const;
477 void makeNaN(
bool SNaN =
false,
bool Neg =
false,
478 const APInt *fill =
nullptr);
479 void makeInf(
bool Neg =
false);
499 unsigned int partCount()
const;
512 void incrementSignificand();
514 void shiftSignificandLeft(
unsigned int);
516 unsigned int significandLSB()
const;
517 unsigned int significandMSB()
const;
518 void zeroSignificand();
520 bool isSignificandAllOnes()
const;
521 bool isSignificandAllOnesExceptLSB()
const;
523 bool isSignificandAllZeros()
const;
524 bool isSignificandAllZerosExceptMSB()
const;
542 bool convertFromStringSpecials(
StringRef str);
554 char *convertNormalToHexString(
char *,
unsigned int,
bool,
564 APInt convertHalfAPFloatToAPInt()
const;
565 APInt convertBFloatAPFloatToAPInt()
const;
566 APInt convertFloatAPFloatToAPInt()
const;
567 APInt convertDoubleAPFloatToAPInt()
const;
568 APInt convertQuadrupleAPFloatToAPInt()
const;
569 APInt convertF80LongDoubleAPFloatToAPInt()
const;
570 APInt convertPPCDoubleDoubleAPFloatToAPInt()
const;
571 APInt convertFloat8E5M2APFloatToAPInt()
const;
572 APInt convertFloat8E4M3FNAPFloatToAPInt()
const;
574 void initFromHalfAPInt(
const APInt &api);
575 void initFromBFloatAPInt(
const APInt &api);
576 void initFromFloatAPInt(
const APInt &api);
577 void initFromDoubleAPInt(
const APInt &api);
578 void initFromQuadrupleAPInt(
const APInt &api);
579 void initFromF80LongDoubleAPInt(
const APInt &api);
580 void initFromPPCDoubleDoubleAPInt(
const APInt &api);
581 void initFromFloat8E5M2APInt(
const APInt &api);
582 void initFromFloat8E4M3FNAPInt(
const APInt &api);
586 void freeSignificand();
610 unsigned int sign : 1;
625 std::unique_ptr<APFloat[]> Floats;
689 bool *IsExact)
const;
692 unsigned int InputSize,
bool IsSigned,
695 unsigned int InputSize,
bool IsSigned,
707 unsigned FormatMaxPadding,
bool TruncateZero =
true)
const;
726 static_assert(std::is_standard_layout<IEEEFloat>::value);
739 template <
typename... ArgTypes>
745 if (usesLayout<DoubleAPFloat>(
Semantics)) {
757 if (usesLayout<DoubleAPFloat>(*
semantics)) {
758 Double.~DoubleAPFloat();
764 Storage(
const Storage &
RHS) {
765 if (usesLayout<IEEEFloat>(*
RHS.semantics)) {
769 if (usesLayout<DoubleAPFloat>(*
RHS.semantics)) {
776 Storage(Storage &&
RHS) {
777 if (usesLayout<IEEEFloat>(*
RHS.semantics)) {
781 if (usesLayout<DoubleAPFloat>(*
RHS.semantics)) {
790 usesLayout<IEEEFloat>(*
RHS.semantics)) {
792 }
else if (usesLayout<DoubleAPFloat>(*
semantics) &&
793 usesLayout<DoubleAPFloat>(*
RHS.semantics)) {
795 }
else if (
this != &
RHS) {
797 new (
this) Storage(
RHS);
804 usesLayout<IEEEFloat>(*
RHS.semantics)) {
806 }
else if (usesLayout<DoubleAPFloat>(*
semantics) &&
807 usesLayout<DoubleAPFloat>(*
RHS.semantics)) {
809 }
else if (
this != &
RHS) {
818 static_assert(std::is_same<T, IEEEFloat>::value ||
819 std::is_same<T, DoubleAPFloat>::value);
820 if (std::is_same<T, DoubleAPFloat>::value) {
827 if (usesLayout<IEEEFloat>(*U.semantics))
829 if (usesLayout<DoubleAPFloat>(*U.semantics))
830 return U.Double.getFirst().U.IEEE;
835 if (usesLayout<IEEEFloat>(*U.semantics))
837 if (usesLayout<DoubleAPFloat>(*U.semantics))
838 return U.Double.getFirst().U.IEEE;
846 void makeNaN(
bool SNaN,
bool Neg,
const APInt *fill) {
850 void makeLargest(
bool Neg) {
854 void makeSmallest(
bool Neg) {
858 void makeSmallestNormalized(
bool Neg) {
868 "Should only compare APFloats with the same semantics");
870 return U.IEEE.compareAbsoluteValue(
RHS.U.IEEE);
872 return U.Double.compareAbsoluteValue(
RHS.U.Double);
880 template <
typename T,
881 typename = std::enable_if_t<std::is_floating_point<T>::value>>
901 Val.makeZero(Negative);
910 Val.makeInf(Negative);
922 APInt intPayload(64, payload);
923 return getQNaN(Sem, Negative, &intPayload);
925 return getQNaN(Sem, Negative,
nullptr);
931 const APInt *payload =
nullptr) {
933 Val.makeNaN(
false, Negative, payload);
939 const APInt *payload =
nullptr) {
941 Val.makeNaN(
true, Negative, payload);
950 Val.makeLargest(Negative);
960 Val.makeSmallest(Negative);
969 bool Negative =
false) {
971 Val.makeSmallestNormalized(Negative);
986 "Should only call on two APFloats with the same semantics");
988 return U.IEEE.add(
RHS.U.IEEE,
RM);
990 return U.Double.add(
RHS.U.Double,
RM);
995 "Should only call on two APFloats with the same semantics");
997 return U.IEEE.subtract(
RHS.U.IEEE,
RM);
999 return U.Double.subtract(
RHS.U.Double,
RM);
1004 "Should only call on two APFloats with the same semantics");
1006 return U.IEEE.multiply(
RHS.U.IEEE,
RM);
1008 return U.Double.multiply(
RHS.U.Double,
RM);
1013 "Should only call on two APFloats with the same semantics");
1015 return U.IEEE.divide(
RHS.U.IEEE,
RM);
1017 return U.Double.divide(
RHS.U.Double,
RM);
1022 "Should only call on two APFloats with the same semantics");
1024 return U.IEEE.remainder(
RHS.U.IEEE);
1026 return U.Double.remainder(
RHS.U.Double);
1031 "Should only call on two APFloats with the same semantics");
1033 return U.IEEE.mod(
RHS.U.IEEE);
1035 return U.Double.mod(
RHS.U.Double);
1041 "Should only call on APFloats with the same semantics");
1043 "Should only call on APFloats with the same semantics");
1045 return U.IEEE.fusedMultiplyAdd(Multiplicand.U.IEEE, Addend.U.IEEE,
RM);
1047 return U.Double.fusedMultiplyAdd(Multiplicand.U.Double, Addend.U.Double,
1064 Result.changeSign();
1113 Value.copySign(Sign);
1121 bool *IsExact)
const {
1126 bool *IsExact)
const;
1132 unsigned int InputSize,
bool IsSigned,
1138 unsigned int InputSize,
bool IsSigned,
1186 "Should only compare APFloats with the same semantics");
1188 return U.IEEE.compare(
RHS.U.IEEE);
1190 return U.Double.compare(
RHS.U.Double);
1198 return U.IEEE.bitwiseIsEqual(
RHS.U.IEEE);
1200 return U.Double.bitwiseIsEqual(
RHS.U.Double);
1257 unsigned FormatMaxPadding = 3,
bool TruncateZero =
true)
const {
1259 toString(Str, FormatPrecision, FormatMaxPadding, TruncateZero));
1283 if (APFloat::usesLayout<detail::IEEEFloat>(
X.getSemantics()))
1285 if (APFloat::usesLayout<detail::DoubleAPFloat>(
X.getSemantics()))
1295 if (APFloat::usesLayout<detail::IEEEFloat>(
X.getSemantics()))
1297 if (APFloat::usesLayout<detail::DoubleAPFloat>(
X.getSemantics()))
1321 return B < A ?
B : A;
1332 return A <
B ?
B : A;
1343 if (A.isZero() &&
B.isZero() && (A.isNegative() !=
B.isNegative()))
1344 return A.isNegative() ? A :
B;
1345 return B < A ?
B : A;
1356 if (A.isZero() &&
B.isZero() && (A.isNegative() !=
B.isNegative()))
1357 return A.isNegative() ?
B : A;
1358 return A <
B ?
B : A;
1363 #undef APFLOAT_DISPATCH_ON_SEMANTICS
1364 #endif // LLVM_ADT_APFLOAT_H
Expected< opStatus > convertFromString(StringRef, roundingMode)
opStatus add(const IEEEFloat &, roundingMode)
float convertToFloat() const
Converts this APFloat to host float value.
bool isInfinity() const
IEEE-754R isInfinite(): Returns true if and only if the float is infinity.
opStatus
IEEE-754R 7: Default exception handling.
bool isSmallestNormalized() const
Returns true if this is the smallest (by magnitude) normalized finite number in the given semantics.
bool getExactInverse(APFloat *inv) const
static unsigned int semanticsSizeInBits(const fltSemantics &)
opStatus add(const DoubleAPFloat &RHS, roundingMode RM)
This is an optimization pass for GlobalISel generic memory operations.
opStatus divide(const IEEEFloat &, roundingMode)
bool isSmallest() const
Returns true if and only if the number has the smallest possible non-zero magnitude in the current se...
friend DoubleAPFloat frexp(const DoubleAPFloat &X, int &Exp, roundingMode)
friend hash_code hash_value(const DoubleAPFloat &Arg)
bool operator==(const APFloat &RHS) const
opStatus add(const APFloat &RHS, roundingMode RM)
static const fltSemantics & IEEEsingle() LLVM_READNONE
opStatus next(bool nextDown)
opStatus roundToIntegral(roundingMode)
opStatus convertFromAPInt(const APInt &Input, bool IsSigned, roundingMode RM)
opStatus multiply(const IEEEFloat &, roundingMode)
bool needsCleanup() const
bool isLargest() const
Returns true if and only if the number has the largest possible finite magnitude in the current seman...
void makeLargest(bool Neg)
APInt::WordType integerPart
void makeSmallest(bool Neg=false)
Make this number the smallest magnitude denormal number in the given semantics.
bool bitwiseIsEqual(const IEEEFloat &) const
Bitwise comparison for equality (QNaNs compare equal, 0!=-0).
void makeNaN(bool SNaN=false, bool Neg=false, const APInt *fill=nullptr)
LLVM_READONLY APFloat minimum(const APFloat &A, const APFloat &B)
Implements IEEE 754-2018 minimum semantics.
static const fltSemantics & x87DoubleExtended() LLVM_READNONE
opStatus mod(const DoubleAPFloat &RHS)
friend APFloat frexp(const APFloat &X, int &Exp, roundingMode RM)
opStatus divide(const APFloat &RHS, roundingMode RM)
cmpResult compareAbsoluteValue(const IEEEFloat &) const
bool isFiniteNonZero() const
static const fltSemantics & BFloat() LLVM_READNONE
bool isInteger() const
Returns true if and only if the number is an exact integer.
const APFloat & getSecond() const
opStatus fusedMultiplyAdd(const APFloat &Multiplicand, const APFloat &Addend, roundingMode RM)
void toString(SmallVectorImpl< char > &Str, unsigned FormatPrecision, unsigned FormatMaxPadding, bool TruncateZero=true) const
friend DoubleAPFloat scalbn(const DoubleAPFloat &X, int Exp, roundingMode)
lostFraction
Enum that represents what fraction of the LSB truncated bits of an fp number represent.
static APFloat getSNaN(const fltSemantics &Sem, bool Negative=false, const APInt *payload=nullptr)
Factory for SNaN values.
Tagged union holding either a T or a Error.
int ilogb(const IEEEFloat &Arg)
APFloat operator+(const APFloat &RHS) const
Add two APFloats, rounding ties to the nearest even.
cmpResult compareAbsoluteValue(const DoubleAPFloat &RHS) const
opStatus mod(const APFloat &RHS)
const fltSemantics & getSemantics() const
static constexpr roundingMode rmTowardNegative
unsigned int convertToHexString(char *DST, unsigned int HexDigits, bool UpperCase, roundingMode RM) const
void makeLargest(bool Neg=false)
Make this number the largest magnitude normal number in the given semantics.
void makeZero(bool Neg=false)
DoubleAPFloat(const fltSemantics &S)
static const fltSemantics & IEEEquad() LLVM_READNONE
=0.0 ? 0.0 :(a > 0.0 ? 1.0 :-1.0) a
amdgpu Simplify well known AMD library false FunctionCallee Value * Arg
opStatus convert(const fltSemantics &, roundingMode, bool *)
IEEEFloat::convert - convert a value of one floating point type to another.
static APFloat getZero(const fltSemantics &Sem, bool Negative=false)
Factory for Positive and Negative Zero.
DoubleAPFloat & operator=(DoubleAPFloat &&RHS)
static unsigned getSizeInBits(const fltSemantics &Sem)
Returns the size of the floating point number (in bits) in the given semantics.
static const fltSemantics & Float8E5M2() LLVM_READNONE
opStatus convertToInteger(MutableArrayRef< integerPart > Input, unsigned int Width, bool IsSigned, roundingMode RM, bool *IsExact) const
MutableArrayRef - Represent a mutable reference to an array (0 or more elements consecutively in memo...
LLVM_READONLY APFloat maximum(const APFloat &A, const APFloat &B)
Implements IEEE 754-2018 maximum semantics.
Itanium Name Demangler i e convert the string _Z1fv into f()". You can also use the CRTP base ManglingParser to perform some simple analysis on the mangled name
static const fltSemantics & IEEEhalf() LLVM_READNONE
void makeNaN(bool SNaN, bool Neg, const APInt *fill)
RoundingMode
Rounding mode.
DoubleAPFloat & operator=(const DoubleAPFloat &RHS)
opStatus remainder(const IEEEFloat &)
IEEE remainder.
opStatus remainder(const DoubleAPFloat &RHS)
opStatus fusedMultiplyAdd(const IEEEFloat &, const IEEEFloat &, roundingMode)
static const fltSemantics & Bogus() LLVM_READNONE
A Pseudo fltsemantic used to construct APFloats that cannot conflict with anything real.
void makeSmallest(bool Neg)
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
into llvm powi allowing the code generator to produce balanced multiplication trees First
double convertToDouble() const
Converts this APFloat to host double value.
fltCategory
Category of internally-represented number.
bool bitwiseIsEqual(const APFloat &RHS) const
void makeInf(bool Neg=false)
An arbitrary precision integer that knows its signedness.
bool isDenormal() const
IEEE-754R isSubnormal(): Returns true if and only if the float is a denormal.
This class implements an extremely fast bulk output stream that can only output to a stream.
APInt bitcastToAPInt() const
bool isNegInfinity() const
APInt bitcastToAPInt() const
opStatus convertFromZeroExtendedInteger(const integerPart *, unsigned int, bool, roundingMode)
void makeSmallestNormalized(bool Neg)
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int int c
bool operator>(const APFloat &RHS) const
friend APFloat scalbn(APFloat X, int Exp, roundingMode RM)
bool isPosInfinity() const
static GCMetadataPrinterRegistry::Add< ErlangGCPrinter > X("erlang", "erlang-compatible garbage collector")
opStatus subtract(const APFloat &RHS, roundingMode RM)
fltCategory getCategory() const
LLVM_READONLY APFloat maxnum(const APFloat &A, const APFloat &B)
Implements IEEE maxNum semantics.
APFloat(const fltSemantics &Semantics, integerPart I)
friend IEEEFloat scalbn(IEEEFloat X, int Exp, roundingMode)
Returns: X * 2^Exp for integral exponents.
opStatus multiply(const APFloat &RHS, roundingMode RM)
static APFloat getQNaN(const fltSemantics &Sem, bool Negative=false, const APInt *payload=nullptr)
Factory for QNaN values.
opStatus divide(const DoubleAPFloat &RHS, roundingMode RM)
void copySign(const APFloat &RHS)
Expected< opStatus > convertFromString(StringRef, roundingMode)
friend int ilogb(const APFloat &Arg)
opStatus roundToIntegral(roundingMode RM)
cmpResult
IEEE-754R 5.11: Floating Point Comparison Relations.
APFloat operator-() const
Negate an APFloat.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
APFloat neg(APFloat X)
Returns the negated value of the argument.
bool operator!=(const APFloat &RHS) const
Vector Shift Left don t map to llvm shl and because they have different semantics
unsigned int convertToHexString(char *DST, unsigned int HexDigits, bool UpperCase, roundingMode RM) const
opStatus convertFromAPInt(const APInt &, bool, roundingMode)
void Profile(FoldingSetNodeID &NID) const
Used to insert APFloat objects, or objects that contain APFloat objects, into FoldingSets.
Expected< opStatus > convertFromString(StringRef, roundingMode)
opStatus fusedMultiplyAdd(const DoubleAPFloat &Multiplicand, const DoubleAPFloat &Addend, roundingMode RM)
static const fltSemantics & PPCDoubleDouble() LLVM_READNONE
bool getExactInverse(APFloat *inv) const
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
static const fltSemantics & Float8E4M3FN() LLVM_READNONE
opStatus convertFromSignExtendedInteger(const integerPart *Input, unsigned int InputSize, bool IsSigned, roundingMode RM)
fltCategory getCategory() const
APFloat operator-(const APFloat &RHS) const
Subtract two APFloats, rounding ties to the nearest even.
@ TowardNegative
roundTowardNegative.
void toString(SmallVectorImpl< char > &Str, unsigned FormatPrecision=0, unsigned FormatMaxPadding=3, bool TruncateZero=true) const
Converts this value into a decimal string.
opStatus roundToIntegral(roundingMode RM)
Class for arbitrary precision integers.
bool isFinite() const
Returns true if and only if the current value is zero, subnormal, or normal.
opStatus convertFromSignExtendedInteger(const integerPart *, unsigned int, bool, roundingMode)
APFloat scalbn(APFloat X, int Exp, APFloat::roundingMode RM)
APFloat operator/(const APFloat &RHS) const
Divide the first APFloat by the second, rounding ties to the nearest even.
static constexpr roundingMode rmNearestTiesToAway
bool isSmallestNormalized() const
static const fltSemantics & IEEEdouble() LLVM_READNONE
StringRef - Represent a constant reference to a string, i.e.
bool isZero() const
Returns true if and only if the float is plus or minus zero.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
static Semantics SemanticsToEnum(const llvm::fltSemantics &Sem)
opStatus convertFromZeroExtendedInteger(const integerPart *Input, unsigned int InputSize, bool IsSigned, roundingMode RM)
FoldingSetNodeID - This class is used to gather all the unique data bits of a node.
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
hash_code hash_value(const IEEEFloat &Arg)
bool bitwiseIsEqual(const DoubleAPFloat &RHS) const
bool operator==(const IEEEFloat &) const =delete
The definition of equality is not straightforward for floating point, so we won't use operator==.
bool needsCleanup() const
APFloat(const fltSemantics &Semantics, const APInt &I)
static const llvm::fltSemantics & EnumToSemantics(Semantics S)
A self-contained host- and target-independent arbitrary-precision floating-point software implementat...
opStatus mod(const IEEEFloat &)
C fmod, or llvm frem.
opStatus multiply(const DoubleAPFloat &RHS, roundingMode RM)
@ NearestTiesToAway
roundTiesToAway.
#define APFLOAT_DISPATCH_ON_SEMANTICS(METHOD_CALL)
opStatus convertFromSignExtendedInteger(const integerPart *Input, unsigned int InputSize, bool IsSigned, roundingMode RM)
@ TowardZero
roundTowardZero.
static APFloat copySign(APFloat Value, const APFloat &Sign)
A static helper to produce a copy of an APFloat value with its sign copied from some other APFloat.
opStatus subtract(const DoubleAPFloat &RHS, roundingMode RM)
static APFloat getSmallest(const fltSemantics &Sem, bool Negative=false)
Returns the smallest (by magnitude) finite number in the given semantics.
static constexpr roundingMode rmTowardPositive
opStatus next(bool nextDown)
IEEE-754R 5.3.1: nextUp/nextDown.
static constexpr roundingMode rmTowardZero
LLVM_READONLY APFloat minnum(const APFloat &A, const APFloat &B)
Implements IEEE minNum semantics.
friend hash_code hash_value(const APFloat &Arg)
See friend declarations above.
bool getExactInverse(APFloat *inv) const
If this value has an exact multiplicative inverse, store it in inv and return true.
void print(raw_ostream &) const
opStatus convertToInteger(MutableArrayRef< integerPart > Input, unsigned int Width, bool IsSigned, roundingMode RM, bool *IsExact) const
const APFloat & getFirst() const
bool isNegative() const
IEEE-754R isSignMinus: Returns true if and only if the current value is negative.
APFloat operator*(const APFloat &RHS) const
Multiply two APFloats, rounding ties to the nearest even.
APFloat & operator=(const APFloat &RHS)=default
bool isNormal() const
IEEE-754R isNormal: Returns true if and only if the current value is normal.
void makeSmallestNormalized(bool Negative=false)
Returns the smallest (by magnitude) normalized finite number in the given semantics.
double convertToDouble() const
opStatus remainder(const APFloat &RHS)
float convertToFloat() const
IEEEFloat frexp(const IEEEFloat &Val, int &Exp, IEEEFloat::roundingMode RM)
friend IEEEFloat frexp(const IEEEFloat &X, int &Exp, roundingMode)
static constexpr unsigned integerPartWidth
APFloat frexp(const APFloat &X, int &Exp, APFloat::roundingMode RM)
Equivalent of C standard library function.
bool isSignaling() const
Returns true if and only if the float is a signaling NaN.
bool isExactlyValue(double V) const
We don't rely on operator== working on double values, as it returns true for things that are clearly ...
hash_code hash_value(const FixedPointSemantics &Val)
static APFloat getAllOnesValue(const fltSemantics &Semantics)
Returns a float which is bitcasted from an all one value int.
bool operator>=(const APFloat &RHS) const
static constexpr roundingMode rmNearestTiesToEven
opStatus convert(const fltSemantics &ToSemantics, roundingMode RM, bool *losesInfo)
void toString(SmallVectorImpl< char > &Str, unsigned FormatPrecision=0, unsigned FormatMaxPadding=3, bool TruncateZero=true) const
@ APINT_BITS_PER_WORD
Bits in a word.
opStatus convertFromZeroExtendedInteger(const integerPart *Input, unsigned int InputSize, bool IsSigned, roundingMode RM)
@ TowardPositive
roundTowardPositive.
bool needsCleanup() const
Returns whether this instance allocated memory.
static unsigned int semanticsPrecision(const fltSemantics &)
cmpResult compare(const DoubleAPFloat &RHS) const
static APFloat getNaN(const fltSemantics &Sem, bool Negative=false, uint64_t payload=0)
Factory for NaN values.
friend hash_code hash_value(const IEEEFloat &Arg)
Overload to compute a hash code for an APFloat value.
const fltSemantics & getSemantics() const
APInt bitcastToAPInt() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
IEEEFloat(const fltSemantics &)
bool isFiniteNonZero() const
fltCategory getCategory() const
APFloat(const fltSemantics &Semantics, uninitializedTag)
int32_t ExponentType
A signed type to represent a floating point numbers unbiased exponent.
static APFloat getInf(const fltSemantics &Sem, bool Negative=false)
Factory for Positive and Negative Infinity.
opStatus next(bool nextDown)
cmpResult compare(const APFloat &RHS) const
opStatus convertFromAPInt(const APInt &Input, bool IsSigned, roundingMode RM)
cmpResult compare(const IEEEFloat &) const
IEEE comparison with another floating point number (NaNs compare unordered, 0==-0).
IlogbErrorKinds
Enumeration of ilogb error results.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
IEEEFloat scalbn(IEEEFloat X, int Exp, IEEEFloat::roundingMode)
opStatus subtract(const IEEEFloat &, roundingMode)
friend int ilogb(const IEEEFloat &Arg)
Returns the exponent of the internal representation of the APFloat.
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int int int d
uninitializedTag
Convenience enum used to construct an uninitialized APFloat.
bool operator<(const APFloat &RHS) const
APFloat abs(APFloat X)
Returns the absolute value of the argument.
llvm::RoundingMode roundingMode
IEEE-754R 4.3: Rounding-direction attributes.
@ NearestTiesToEven
roundTiesToEven.
bool isSmallestNormalized() const
static APFloat getLargest(const fltSemantics &Sem, bool Negative=false)
Returns the largest finite number in the given semantics.
LLVM Value Representation.
static APFloat getSmallestNormalized(const fltSemantics &Sem, bool Negative=false)
Returns the smallest (by magnitude) normalized finite number in the given semantics.
IEEEFloat & operator=(const IEEEFloat &)
static ExponentType semanticsMaxExponent(const fltSemantics &)
APFloat(const fltSemantics &Semantics)
unsigned int convertToHexString(char *dst, unsigned int hexDigits, bool upperCase, roundingMode) const
Write out a hexadecimal representation of the floating point value to DST, which must be of sufficien...
bool isNaN() const
Returns true if and only if the float is a quiet or signaling NaN.
An opaque object representing a hash code.
opStatus convertToInteger(MutableArrayRef< integerPart >, unsigned int, bool, roundingMode, bool *) const
static ExponentType semanticsMinExponent(const fltSemantics &)
bool operator<=(const APFloat &RHS) const