@@ -572,7 +572,7 @@ class IEEEFloat final {
572
572
// / emphasizes producing different codes for different inputs in order to
573
573
// / be used in canonicalization and memoization. As such, equality is
574
574
// / bitwiseIsEqual, and 0 != -0.
575
- friend hash_code hash_value (const IEEEFloat &Arg);
575
+ LLVM_ABI_FRIEND friend hash_code hash_value (const IEEEFloat &Arg);
576
576
577
577
// / Converts this value into a decimal string.
578
578
// /
@@ -629,12 +629,13 @@ class IEEEFloat final {
629
629
// / 0 -> \c IEK_Zero
630
630
// / Inf -> \c IEK_Inf
631
631
// /
632
- friend int ilogb (const IEEEFloat &Arg);
632
+ LLVM_ABI_FRIEND friend int ilogb (const IEEEFloat &Arg);
633
633
634
634
// / Returns: X * 2^Exp for integral exponents.
635
- friend IEEEFloat scalbn (IEEEFloat X, int Exp, roundingMode);
635
+ LLVM_ABI_FRIEND friend IEEEFloat scalbn (IEEEFloat X, int Exp, roundingMode);
636
636
637
- friend IEEEFloat frexp (const IEEEFloat &X, int &Exp, roundingMode);
637
+ LLVM_ABI_FRIEND friend IEEEFloat frexp (const IEEEFloat &X, int &Exp,
638
+ roundingMode);
638
639
639
640
// / \name Special value setters.
640
641
// / @{
@@ -661,120 +662,125 @@ class IEEEFloat final {
661
662
// / \name Simple Queries
662
663
// / @{
663
664
664
- integerPart *significandParts ();
665
- const integerPart *significandParts () const ;
666
- unsigned int partCount () const ;
665
+ LLVM_ABI integerPart *significandParts ();
666
+ LLVM_ABI const integerPart *significandParts () const ;
667
+ LLVM_ABI unsigned int partCount () const ;
667
668
668
669
// / @}
669
670
670
671
// / \name Significand operations.
671
672
// / @{
672
673
673
- integerPart addSignificand (const IEEEFloat &);
674
- integerPart subtractSignificand (const IEEEFloat &, integerPart);
675
- lostFraction addOrSubtractSignificand (const IEEEFloat &, bool subtract);
676
- lostFraction multiplySignificand (const IEEEFloat &, IEEEFloat,
677
- bool ignoreAddend = false );
678
- lostFraction multiplySignificand (const IEEEFloat&);
679
- lostFraction divideSignificand (const IEEEFloat &);
680
- void incrementSignificand ();
681
- void initialize (const fltSemantics *);
682
- void shiftSignificandLeft (unsigned int );
683
- lostFraction shiftSignificandRight (unsigned int );
684
- unsigned int significandLSB () const ;
685
- unsigned int significandMSB () const ;
686
- void zeroSignificand ();
687
- unsigned int getNumHighBits () const ;
674
+ LLVM_ABI integerPart addSignificand (const IEEEFloat &);
675
+ LLVM_ABI integerPart subtractSignificand (const IEEEFloat &, integerPart);
676
+ LLVM_ABI lostFraction addOrSubtractSignificand (const IEEEFloat &,
677
+ bool subtract);
678
+ LLVM_ABI lostFraction multiplySignificand (const IEEEFloat &, IEEEFloat,
679
+ bool ignoreAddend = false );
680
+ LLVM_ABI lostFraction multiplySignificand (const IEEEFloat &);
681
+ LLVM_ABI lostFraction divideSignificand (const IEEEFloat &);
682
+ LLVM_ABI void incrementSignificand ();
683
+ LLVM_ABI void initialize (const fltSemantics *);
684
+ LLVM_ABI void shiftSignificandLeft (unsigned int );
685
+ LLVM_ABI lostFraction shiftSignificandRight (unsigned int );
686
+ LLVM_ABI unsigned int significandLSB () const ;
687
+ LLVM_ABI unsigned int significandMSB () const ;
688
+ LLVM_ABI void zeroSignificand ();
689
+ LLVM_ABI unsigned int getNumHighBits () const ;
688
690
// / Return true if the significand excluding the integral bit is all ones.
689
- bool isSignificandAllOnes () const ;
690
- bool isSignificandAllOnesExceptLSB () const ;
691
+ LLVM_ABI bool isSignificandAllOnes () const ;
692
+ LLVM_ABI bool isSignificandAllOnesExceptLSB () const ;
691
693
// / Return true if the significand excluding the integral bit is all zeros.
692
- bool isSignificandAllZeros () const ;
693
- bool isSignificandAllZerosExceptMSB () const ;
694
+ LLVM_ABI bool isSignificandAllZeros () const ;
695
+ LLVM_ABI bool isSignificandAllZerosExceptMSB () const ;
694
696
695
697
// / @}
696
698
697
699
// / \name Arithmetic on special values.
698
700
// / @{
699
701
700
- opStatus addOrSubtractSpecials (const IEEEFloat &, bool subtract);
701
- opStatus divideSpecials (const IEEEFloat &);
702
- opStatus multiplySpecials (const IEEEFloat &);
703
- opStatus modSpecials (const IEEEFloat &);
704
- opStatus remainderSpecials (const IEEEFloat&);
702
+ LLVM_ABI opStatus addOrSubtractSpecials (const IEEEFloat &, bool subtract);
703
+ LLVM_ABI opStatus divideSpecials (const IEEEFloat &);
704
+ LLVM_ABI opStatus multiplySpecials (const IEEEFloat &);
705
+ LLVM_ABI opStatus modSpecials (const IEEEFloat &);
706
+ LLVM_ABI opStatus remainderSpecials (const IEEEFloat &);
705
707
706
708
// / @}
707
709
708
710
// / \name Miscellany
709
711
// / @{
710
712
711
- bool convertFromStringSpecials (StringRef str);
712
- opStatus normalize (roundingMode, lostFraction);
713
- opStatus addOrSubtract (const IEEEFloat &, roundingMode, bool subtract);
714
- opStatus handleOverflow (roundingMode);
715
- bool roundAwayFromZero (roundingMode, lostFraction, unsigned int ) const ;
716
- opStatus convertToSignExtendedInteger (MutableArrayRef<integerPart>,
717
- unsigned int , bool , roundingMode,
718
- bool *) const ;
719
- opStatus convertFromUnsignedParts (const integerPart *, unsigned int ,
720
- roundingMode);
721
- Expected<opStatus> convertFromHexadecimalString (StringRef, roundingMode);
722
- Expected<opStatus> convertFromDecimalString (StringRef, roundingMode);
723
- char *convertNormalToHexString (char *, unsigned int , bool ,
724
- roundingMode) const ;
725
- opStatus roundSignificandWithExponent (const integerPart *, unsigned int , int ,
726
- roundingMode);
727
- ExponentType exponentNaN () const ;
728
- ExponentType exponentInf () const ;
729
- ExponentType exponentZero () const ;
713
+ LLVM_ABI bool convertFromStringSpecials (StringRef str);
714
+ LLVM_ABI opStatus normalize (roundingMode, lostFraction);
715
+ LLVM_ABI opStatus addOrSubtract (const IEEEFloat &, roundingMode,
716
+ bool subtract);
717
+ LLVM_ABI opStatus handleOverflow (roundingMode);
718
+ LLVM_ABI bool roundAwayFromZero (roundingMode, lostFraction,
719
+ unsigned int ) const ;
720
+ LLVM_ABI opStatus convertToSignExtendedInteger (MutableArrayRef<integerPart>,
721
+ unsigned int , bool ,
722
+ roundingMode, bool *) const ;
723
+ LLVM_ABI opStatus convertFromUnsignedParts (const integerPart *, unsigned int ,
724
+ roundingMode);
725
+ LLVM_ABI Expected<opStatus> convertFromHexadecimalString (StringRef,
726
+ roundingMode);
727
+ LLVM_ABI Expected<opStatus> convertFromDecimalString (StringRef, roundingMode);
728
+ LLVM_ABI char *convertNormalToHexString (char *, unsigned int , bool ,
729
+ roundingMode) const ;
730
+ LLVM_ABI opStatus roundSignificandWithExponent (const integerPart *,
731
+ unsigned int , int ,
732
+ roundingMode);
733
+ LLVM_ABI ExponentType exponentNaN () const ;
734
+ LLVM_ABI ExponentType exponentInf () const ;
735
+ LLVM_ABI ExponentType exponentZero () const ;
730
736
731
737
// / @}
732
738
733
739
template <const fltSemantics &S> APInt convertIEEEFloatToAPInt () const ;
734
- APInt convertHalfAPFloatToAPInt () const ;
735
- APInt convertBFloatAPFloatToAPInt () const ;
736
- APInt convertFloatAPFloatToAPInt () const ;
737
- APInt convertDoubleAPFloatToAPInt () const ;
738
- APInt convertQuadrupleAPFloatToAPInt () const ;
739
- APInt convertF80LongDoubleAPFloatToAPInt () const ;
740
- APInt convertPPCDoubleDoubleLegacyAPFloatToAPInt () const ;
741
- APInt convertFloat8E5M2APFloatToAPInt () const ;
742
- APInt convertFloat8E5M2FNUZAPFloatToAPInt () const ;
743
- APInt convertFloat8E4M3APFloatToAPInt () const ;
744
- APInt convertFloat8E4M3FNAPFloatToAPInt () const ;
745
- APInt convertFloat8E4M3FNUZAPFloatToAPInt () const ;
746
- APInt convertFloat8E4M3B11FNUZAPFloatToAPInt () const ;
747
- APInt convertFloat8E3M4APFloatToAPInt () const ;
748
- APInt convertFloatTF32APFloatToAPInt () const ;
749
- APInt convertFloat8E8M0FNUAPFloatToAPInt () const ;
750
- APInt convertFloat6E3M2FNAPFloatToAPInt () const ;
751
- APInt convertFloat6E2M3FNAPFloatToAPInt () const ;
752
- APInt convertFloat4E2M1FNAPFloatToAPInt () const ;
753
- void initFromAPInt (const fltSemantics *Sem, const APInt &api);
740
+ LLVM_ABI APInt convertHalfAPFloatToAPInt () const ;
741
+ LLVM_ABI APInt convertBFloatAPFloatToAPInt () const ;
742
+ LLVM_ABI APInt convertFloatAPFloatToAPInt () const ;
743
+ LLVM_ABI APInt convertDoubleAPFloatToAPInt () const ;
744
+ LLVM_ABI APInt convertQuadrupleAPFloatToAPInt () const ;
745
+ LLVM_ABI APInt convertF80LongDoubleAPFloatToAPInt () const ;
746
+ LLVM_ABI APInt convertPPCDoubleDoubleLegacyAPFloatToAPInt () const ;
747
+ LLVM_ABI APInt convertFloat8E5M2APFloatToAPInt () const ;
748
+ LLVM_ABI APInt convertFloat8E5M2FNUZAPFloatToAPInt () const ;
749
+ LLVM_ABI APInt convertFloat8E4M3APFloatToAPInt () const ;
750
+ LLVM_ABI APInt convertFloat8E4M3FNAPFloatToAPInt () const ;
751
+ LLVM_ABI APInt convertFloat8E4M3FNUZAPFloatToAPInt () const ;
752
+ LLVM_ABI APInt convertFloat8E4M3B11FNUZAPFloatToAPInt () const ;
753
+ LLVM_ABI APInt convertFloat8E3M4APFloatToAPInt () const ;
754
+ LLVM_ABI APInt convertFloatTF32APFloatToAPInt () const ;
755
+ LLVM_ABI APInt convertFloat8E8M0FNUAPFloatToAPInt () const ;
756
+ LLVM_ABI APInt convertFloat6E3M2FNAPFloatToAPInt () const ;
757
+ LLVM_ABI APInt convertFloat6E2M3FNAPFloatToAPInt () const ;
758
+ LLVM_ABI APInt convertFloat4E2M1FNAPFloatToAPInt () const ;
759
+ LLVM_ABI void initFromAPInt (const fltSemantics *Sem, const APInt &api);
754
760
template <const fltSemantics &S> void initFromIEEEAPInt (const APInt &api);
755
- void initFromHalfAPInt (const APInt &api);
756
- void initFromBFloatAPInt (const APInt &api);
757
- void initFromFloatAPInt (const APInt &api);
758
- void initFromDoubleAPInt (const APInt &api);
759
- void initFromQuadrupleAPInt (const APInt &api);
760
- void initFromF80LongDoubleAPInt (const APInt &api);
761
- void initFromPPCDoubleDoubleLegacyAPInt (const APInt &api);
762
- void initFromFloat8E5M2APInt (const APInt &api);
763
- void initFromFloat8E5M2FNUZAPInt (const APInt &api);
764
- void initFromFloat8E4M3APInt (const APInt &api);
765
- void initFromFloat8E4M3FNAPInt (const APInt &api);
766
- void initFromFloat8E4M3FNUZAPInt (const APInt &api);
767
- void initFromFloat8E4M3B11FNUZAPInt (const APInt &api);
768
- void initFromFloat8E3M4APInt (const APInt &api);
769
- void initFromFloatTF32APInt (const APInt &api);
770
- void initFromFloat8E8M0FNUAPInt (const APInt &api);
771
- void initFromFloat6E3M2FNAPInt (const APInt &api);
772
- void initFromFloat6E2M3FNAPInt (const APInt &api);
773
- void initFromFloat4E2M1FNAPInt (const APInt &api);
774
-
775
- void assign (const IEEEFloat &);
776
- void copySignificand (const IEEEFloat &);
777
- void freeSignificand ();
761
+ LLVM_ABI void initFromHalfAPInt (const APInt &api);
762
+ LLVM_ABI void initFromBFloatAPInt (const APInt &api);
763
+ LLVM_ABI void initFromFloatAPInt (const APInt &api);
764
+ LLVM_ABI void initFromDoubleAPInt (const APInt &api);
765
+ LLVM_ABI void initFromQuadrupleAPInt (const APInt &api);
766
+ LLVM_ABI void initFromF80LongDoubleAPInt (const APInt &api);
767
+ LLVM_ABI void initFromPPCDoubleDoubleLegacyAPInt (const APInt &api);
768
+ LLVM_ABI void initFromFloat8E5M2APInt (const APInt &api);
769
+ LLVM_ABI void initFromFloat8E5M2FNUZAPInt (const APInt &api);
770
+ LLVM_ABI void initFromFloat8E4M3APInt (const APInt &api);
771
+ LLVM_ABI void initFromFloat8E4M3FNAPInt (const APInt &api);
772
+ LLVM_ABI void initFromFloat8E4M3FNUZAPInt (const APInt &api);
773
+ LLVM_ABI void initFromFloat8E4M3B11FNUZAPInt (const APInt &api);
774
+ LLVM_ABI void initFromFloat8E3M4APInt (const APInt &api);
775
+ LLVM_ABI void initFromFloatTF32APInt (const APInt &api);
776
+ LLVM_ABI void initFromFloat8E8M0FNUAPInt (const APInt &api);
777
+ LLVM_ABI void initFromFloat6E3M2FNAPInt (const APInt &api);
778
+ LLVM_ABI void initFromFloat6E2M3FNAPInt (const APInt &api);
779
+ LLVM_ABI void initFromFloat4E2M1FNAPInt (const APInt &api);
780
+
781
+ LLVM_ABI void assign (const IEEEFloat &);
782
+ LLVM_ABI void copySignificand (const IEEEFloat &);
783
+ LLVM_ABI void freeSignificand ();
778
784
779
785
// / Note: this must be the first data member.
780
786
// / The semantics that this value obeys.
@@ -817,11 +823,13 @@ class DoubleAPFloat final {
817
823
const fltSemantics *Semantics;
818
824
APFloat *Floats;
819
825
820
- opStatus addImpl (const APFloat &a, const APFloat &aa, const APFloat &c,
821
- const APFloat &cc, roundingMode RM);
826
+ LLVM_ABI opStatus addImpl (const APFloat &a, const APFloat &aa,
827
+ const APFloat &c, const APFloat &cc,
828
+ roundingMode RM);
822
829
823
- opStatus addWithSpecial (const DoubleAPFloat &LHS, const DoubleAPFloat &RHS,
824
- DoubleAPFloat &Out, roundingMode RM);
830
+ LLVM_ABI opStatus addWithSpecial (const DoubleAPFloat &LHS,
831
+ const DoubleAPFloat &RHS, DoubleAPFloat &Out,
832
+ roundingMode RM);
825
833
826
834
public:
827
835
LLVM_ABI DoubleAPFloat (const fltSemantics &S);
@@ -832,7 +840,7 @@ class DoubleAPFloat final {
832
840
APFloat &&Second);
833
841
LLVM_ABI DoubleAPFloat (const DoubleAPFloat &RHS);
834
842
LLVM_ABI DoubleAPFloat (DoubleAPFloat &&RHS);
835
- ~DoubleAPFloat ();
843
+ LLVM_ABI ~DoubleAPFloat ();
836
844
837
845
LLVM_ABI DoubleAPFloat &operator =(const DoubleAPFloat &RHS);
838
846
inline DoubleAPFloat &operator =(DoubleAPFloat &&RHS);
@@ -905,9 +913,11 @@ class DoubleAPFloat final {
905
913
LLVM_ABI LLVM_READONLY int getExactLog2 () const ;
906
914
LLVM_ABI LLVM_READONLY int getExactLog2Abs () const ;
907
915
908
- friend DoubleAPFloat scalbn (const DoubleAPFloat &X, int Exp, roundingMode);
909
- friend DoubleAPFloat frexp (const DoubleAPFloat &X, int &Exp, roundingMode);
910
- friend hash_code hash_value (const DoubleAPFloat &Arg);
916
+ LLVM_ABI_FRIEND friend DoubleAPFloat scalbn (const DoubleAPFloat &X, int Exp,
917
+ roundingMode);
918
+ LLVM_ABI_FRIEND friend DoubleAPFloat frexp (const DoubleAPFloat &X, int &Exp,
919
+ roundingMode);
920
+ LLVM_ABI_FRIEND friend hash_code hash_value (const DoubleAPFloat &Arg);
911
921
};
912
922
913
923
LLVM_ABI hash_code hash_value (const DoubleAPFloat &Arg);
@@ -1512,7 +1522,7 @@ class APFloat : public APFloatBase {
1512
1522
APFLOAT_DISPATCH_ON_SEMANTICS (getExactLog2 ());
1513
1523
}
1514
1524
1515
- friend hash_code hash_value (const APFloat &Arg);
1525
+ LLVM_ABI_FRIEND friend hash_code hash_value (const APFloat &Arg);
1516
1526
friend int ilogb (const APFloat &Arg) { return ilogb (Arg.getIEEE ()); }
1517
1527
friend APFloat scalbn (APFloat X, int Exp, roundingMode RM);
1518
1528
friend APFloat frexp (const APFloat &X, int &Exp, roundingMode RM);
0 commit comments