1515#ifndef LLVM_ADT_APFLOAT_H
1616#define LLVM_ADT_APFLOAT_H
1717
18- #include " llvm/Support/Compiler.h"
1918#include " llvm/ADT/APInt.h"
2019#include " llvm/ADT/ArrayRef.h"
2120#include " llvm/ADT/FloatingPointMode.h"
21+ #include " llvm/Support/Compiler.h"
2222#include " llvm/Support/ErrorHandling.h"
2323#include " llvm/Support/float128.h"
2424#include < memory>
@@ -285,7 +285,8 @@ struct APFloatBase {
285285 // Returns true if any number described by this semantics can be precisely
286286 // represented by the specified semantics. Does not take into account
287287 // the value of fltNonfiniteBehavior, hasZero, hasSignedRepr.
288- LLVM_ABI static bool isRepresentableBy (const fltSemantics &A, const fltSemantics &B);
288+ LLVM_ABI static bool isRepresentableBy (const fltSemantics &A,
289+ const fltSemantics &B);
289290
290291 // / @}
291292
@@ -349,7 +350,8 @@ struct APFloatBase {
349350 LLVM_ABI static ExponentType semanticsMinExponent (const fltSemantics &);
350351 LLVM_ABI static ExponentType semanticsMaxExponent (const fltSemantics &);
351352 LLVM_ABI static unsigned int semanticsSizeInBits (const fltSemantics &);
352- LLVM_ABI static unsigned int semanticsIntSizeInBits (const fltSemantics&, bool );
353+ LLVM_ABI static unsigned int semanticsIntSizeInBits (const fltSemantics &,
354+ bool );
353355 LLVM_ABI static bool semanticsHasZero (const fltSemantics &);
354356 LLVM_ABI static bool semanticsHasSignedRepr (const fltSemantics &);
355357 LLVM_ABI static bool semanticsHasInf (const fltSemantics &);
@@ -360,7 +362,7 @@ struct APFloatBase {
360362 // Returns true if any number described by \p Src can be precisely represented
361363 // by a normal (not subnormal) value in \p Dst.
362364 LLVM_ABI static bool isRepresentableAsNormalIn (const fltSemantics &Src,
363- const fltSemantics &Dst);
365+ const fltSemantics &Dst);
364366
365367 // / Returns the size of the floating point number (in bits) in the given
366368 // / semantics.
@@ -436,7 +438,8 @@ class IEEEFloat final {
436438 LLVM_ABI opStatus remainder (const IEEEFloat &);
437439 // / C fmod, or llvm frem.
438440 LLVM_ABI opStatus mod (const IEEEFloat &);
439- LLVM_ABI opStatus fusedMultiplyAdd (const IEEEFloat &, const IEEEFloat &, roundingMode);
441+ LLVM_ABI opStatus fusedMultiplyAdd (const IEEEFloat &, const IEEEFloat &,
442+ roundingMode);
440443 LLVM_ABI opStatus roundToIntegral (roundingMode);
441444 // / IEEE-754R 5.3.1: nextUp/nextDown.
442445 LLVM_ABI opStatus next (bool nextDown);
@@ -454,13 +457,15 @@ class IEEEFloat final {
454457 // / @{
455458
456459 LLVM_ABI opStatus convert (const fltSemantics &, roundingMode, bool *);
457- LLVM_ABI opStatus convertToInteger (MutableArrayRef<integerPart>, unsigned int , bool ,
458- roundingMode, bool *) const ;
460+ LLVM_ABI opStatus convertToInteger (MutableArrayRef<integerPart>, unsigned int ,
461+ bool , roundingMode, bool *) const ;
459462 LLVM_ABI opStatus convertFromAPInt (const APInt &, bool , roundingMode);
460- LLVM_ABI opStatus convertFromSignExtendedInteger (const integerPart *, unsigned int ,
461- bool , roundingMode);
462- LLVM_ABI opStatus convertFromZeroExtendedInteger (const integerPart *, unsigned int ,
463- bool , roundingMode);
463+ LLVM_ABI opStatus convertFromSignExtendedInteger (const integerPart *,
464+ unsigned int , bool ,
465+ roundingMode);
466+ LLVM_ABI opStatus convertFromZeroExtendedInteger (const integerPart *,
467+ unsigned int , bool ,
468+ roundingMode);
464469 LLVM_ABI Expected<opStatus> convertFromString (StringRef, roundingMode);
465470 LLVM_ABI APInt bitcastToAPInt () const ;
466471 LLVM_ABI double convertToDouble () const ;
@@ -487,7 +492,7 @@ class IEEEFloat final {
487492 // / which must be of sufficient size, in the C99 form [-]0xh.hhhhp[+-]d.
488493 // / Return the number of characters written, excluding the terminating NUL.
489494 LLVM_ABI unsigned int convertToHexString (char *dst, unsigned int hexDigits,
490- bool upperCase, roundingMode) const ;
495+ bool upperCase, roundingMode) const ;
491496
492497 // / \name IEEE-754R 5.7.2 General operations.
493498 // / @{
@@ -595,17 +600,18 @@ class IEEEFloat final {
595600 // / 1.01E-2 5 2 0.0101
596601 // / 1.01E-2 4 2 0.0101
597602 // / 1.01E-2 4 1 1.01E-2
598- LLVM_ABI void toString (SmallVectorImpl<char > &Str, unsigned FormatPrecision = 0 ,
599- unsigned FormatMaxPadding = 3 , bool TruncateZero = true ) const ;
603+ LLVM_ABI void toString (SmallVectorImpl<char > &Str,
604+ unsigned FormatPrecision = 0 ,
605+ unsigned FormatMaxPadding = 3 ,
606+ bool TruncateZero = true ) const ;
600607
601608 // / If this value has an exact multiplicative inverse, store it in inv and
602609 // / return true.
603610 LLVM_ABI bool getExactInverse (APFloat *inv) const ;
604611
605612 // If this is an exact power of two, return the exponent while ignoring the
606613 // sign bit. If it's not an exact power of 2, return INT_MIN
607- LLVM_ABI LLVM_READONLY
608- int getExactLog2Abs () const ;
614+ LLVM_ABI LLVM_READONLY int getExactLog2Abs () const ;
609615
610616 // If this is an exact power of two, return the exponent. If it's not an exact
611617 // power of 2, return INT_MIN
@@ -636,7 +642,7 @@ class IEEEFloat final {
636642 LLVM_ABI void makeLargest (bool Neg = false );
637643 LLVM_ABI void makeSmallest (bool Neg = false );
638644 LLVM_ABI void makeNaN (bool SNaN = false , bool Neg = false ,
639- const APInt *fill = nullptr );
645+ const APInt *fill = nullptr );
640646 LLVM_ABI void makeInf (bool Neg = false );
641647 LLVM_ABI void makeZero (bool Neg = false );
642648 LLVM_ABI void makeQuiet ();
@@ -822,7 +828,8 @@ class DoubleAPFloat final {
822828 LLVM_ABI DoubleAPFloat (const fltSemantics &S, uninitializedTag);
823829 LLVM_ABI DoubleAPFloat (const fltSemantics &S, integerPart);
824830 LLVM_ABI DoubleAPFloat (const fltSemantics &S, const APInt &I);
825- LLVM_ABI DoubleAPFloat (const fltSemantics &S, APFloat &&First, APFloat &&Second);
831+ LLVM_ABI DoubleAPFloat (const fltSemantics &S, APFloat &&First,
832+ APFloat &&Second);
826833 LLVM_ABI DoubleAPFloat (const DoubleAPFloat &RHS);
827834 LLVM_ABI DoubleAPFloat (DoubleAPFloat &&RHS);
828835 ~DoubleAPFloat ();
@@ -844,7 +851,8 @@ class DoubleAPFloat final {
844851 LLVM_ABI opStatus remainder (const DoubleAPFloat &RHS);
845852 LLVM_ABI opStatus mod (const DoubleAPFloat &RHS);
846853 LLVM_ABI opStatus fusedMultiplyAdd (const DoubleAPFloat &Multiplicand,
847- const DoubleAPFloat &Addend, roundingMode RM);
854+ const DoubleAPFloat &Addend,
855+ roundingMode RM);
848856 LLVM_ABI opStatus roundToIntegral (roundingMode RM);
849857 LLVM_ABI void changeSign ();
850858 LLVM_ABI cmpResult compareAbsoluteValue (const DoubleAPFloat &RHS) const ;
@@ -866,17 +874,21 @@ class DoubleAPFloat final {
866874 LLVM_ABI opStatus next (bool nextDown);
867875
868876 LLVM_ABI opStatus convertToInteger (MutableArrayRef<integerPart> Input,
869- unsigned int Width, bool IsSigned, roundingMode RM,
870- bool *IsExact) const ;
871- LLVM_ABI opStatus convertFromAPInt (const APInt &Input, bool IsSigned, roundingMode RM);
877+ unsigned int Width, bool IsSigned,
878+ roundingMode RM, bool *IsExact) const ;
879+ LLVM_ABI opStatus convertFromAPInt (const APInt &Input, bool IsSigned,
880+ roundingMode RM);
872881 LLVM_ABI opStatus convertFromSignExtendedInteger (const integerPart *Input,
873- unsigned int InputSize, bool IsSigned,
874- roundingMode RM);
882+ unsigned int InputSize,
883+ bool IsSigned,
884+ roundingMode RM);
875885 LLVM_ABI opStatus convertFromZeroExtendedInteger (const integerPart *Input,
876- unsigned int InputSize, bool IsSigned,
877- roundingMode RM);
886+ unsigned int InputSize,
887+ bool IsSigned,
888+ roundingMode RM);
878889 LLVM_ABI unsigned int convertToHexString (char *DST, unsigned int HexDigits,
879- bool UpperCase, roundingMode RM) const ;
890+ bool UpperCase,
891+ roundingMode RM) const ;
880892
881893 LLVM_ABI bool isDenormal () const ;
882894 LLVM_ABI bool isSmallest () const ;
@@ -885,22 +897,22 @@ class DoubleAPFloat final {
885897 LLVM_ABI bool isInteger () const ;
886898
887899 LLVM_ABI void toString (SmallVectorImpl<char > &Str, unsigned FormatPrecision,
888- unsigned FormatMaxPadding, bool TruncateZero = true ) const ;
900+ unsigned FormatMaxPadding,
901+ bool TruncateZero = true ) const ;
889902
890903 LLVM_ABI bool getExactInverse (APFloat *inv) const ;
891904
892- LLVM_ABI LLVM_READONLY
893- int getExactLog2 () const ;
894- LLVM_ABI LLVM_READONLY
895- int getExactLog2Abs () const ;
905+ LLVM_ABI LLVM_READONLY int getExactLog2 () const ;
906+ LLVM_ABI LLVM_READONLY int getExactLog2Abs () const ;
896907
897908 friend DoubleAPFloat scalbn (const DoubleAPFloat &X, int Exp, roundingMode);
898909 friend DoubleAPFloat frexp (const DoubleAPFloat &X, int &Exp, roundingMode);
899910 friend hash_code hash_value (const DoubleAPFloat &Arg);
900911};
901912
902913LLVM_ABI hash_code hash_value (const DoubleAPFloat &Arg);
903- LLVM_ABI DoubleAPFloat scalbn (const DoubleAPFloat &Arg, int Exp, roundingMode RM);
914+ LLVM_ABI DoubleAPFloat scalbn (const DoubleAPFloat &Arg, int Exp,
915+ roundingMode RM);
904916LLVM_ABI DoubleAPFloat frexp (const DoubleAPFloat &X, int &Exp, roundingMode);
905917
906918} // End detail namespace
@@ -1328,15 +1340,15 @@ class APFloat : public APFloatBase {
13281340 }
13291341
13301342 LLVM_ABI opStatus convert (const fltSemantics &ToSemantics, roundingMode RM,
1331- bool *losesInfo);
1343+ bool *losesInfo);
13321344 opStatus convertToInteger (MutableArrayRef<integerPart> Input,
13331345 unsigned int Width, bool IsSigned, roundingMode RM,
13341346 bool *IsExact) const {
13351347 APFLOAT_DISPATCH_ON_SEMANTICS (
13361348 convertToInteger (Input, Width, IsSigned, RM, IsExact));
13371349 }
13381350 LLVM_ABI opStatus convertToInteger (APSInt &Result, roundingMode RM,
1339- bool *IsExact) const ;
1351+ bool *IsExact) const ;
13401352 opStatus convertFromAPInt (const APInt &Input, bool IsSigned,
13411353 roundingMode RM) {
13421354 APFLOAT_DISPATCH_ON_SEMANTICS (convertFromAPInt (Input, IsSigned, RM));
0 commit comments