Home
last modified time | relevance | path

Searched refs:APFloat (Results 1 – 25 of 214) sorted by relevance

123456789

/external/swiftshader/third_party/LLVM/unittests/ADT/
DAPFloatTest.cpp22 llvm::APFloat F(0.0); in convertToDoubleFromString()
23 F.convertFromString(Str, llvm::APFloat::rmNearestTiesToEven); in convertToDoubleFromString()
29 llvm::APFloat F(d); in convertToString()
37 EXPECT_EQ(0.0f, APFloat(0.0f).convertToFloat()); in TEST()
38 EXPECT_EQ(-0.0f, APFloat(-0.0f).convertToFloat()); in TEST()
39 EXPECT_TRUE(APFloat(-0.0f).isNegative()); in TEST()
41 EXPECT_EQ(0.0, APFloat(0.0).convertToDouble()); in TEST()
42 EXPECT_EQ(-0.0, APFloat(-0.0).convertToDouble()); in TEST()
43 EXPECT_TRUE(APFloat(-0.0).isNegative()); in TEST()
47 EXPECT_EQ( 0.0, APFloat(APFloat::IEEEdouble, "0").convertToDouble()); in TEST()
[all …]
/external/llvm/unittests/ADT/
DAPFloatTest.cpp22 llvm::APFloat F(0.0); in convertToDoubleFromString()
23 F.convertFromString(Str, llvm::APFloat::rmNearestTiesToEven); in convertToDoubleFromString()
29 llvm::APFloat F(d); in convertToString()
41 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, false).isSignaling()); in TEST()
42 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, true).isSignaling()); in TEST()
43 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, false, &payload).isSignaling()); in TEST()
44 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, true, &payload).isSignaling()); in TEST()
45 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, false).isSignaling()); in TEST()
46 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, true).isSignaling()); in TEST()
47 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, false, &payload).isSignaling()); in TEST()
[all …]
/external/llvm/include/llvm/ADT/
DAPFloat.h124 class APFloat {
196 APFloat(const fltSemantics &); // Default construct to 0.0
197 APFloat(const fltSemantics &, StringRef);
198 APFloat(const fltSemantics &, integerPart);
199 APFloat(const fltSemantics &, uninitializedTag);
200 APFloat(const fltSemantics &, const APInt &);
201 explicit APFloat(double d);
202 explicit APFloat(float f);
203 APFloat(const APFloat &);
204 APFloat(APFloat &&);
[all …]
/external/swiftshader/third_party/LLVM/include/llvm/ADT/
DAPFloat.h125 class APFloat {
182 APFloat(const fltSemantics &); // Default construct to 0.0
183 APFloat(const fltSemantics &, StringRef);
184 APFloat(const fltSemantics &, integerPart);
185 APFloat(const fltSemantics &, fltCategory, bool negative);
186 APFloat(const fltSemantics &, uninitializedTag);
187 explicit APFloat(double d);
188 explicit APFloat(float f);
189 explicit APFloat(const APInt &, bool isIEEE = false);
190 APFloat(const APFloat &);
[all …]
/external/swiftshader/third_party/llvm-subzero/include/llvm/ADT/
DAPFloat.h29 class APFloat; variable
603 std::unique_ptr<APFloat[]> Floats;
605 opStatus addImpl(const APFloat &a, const APFloat &aa, const APFloat &c,
606 const APFloat &cc, roundingMode RM);
616 DoubleAPFloat(const fltSemantics &S, APFloat &&First, APFloat &&Second);
632 APFloat &getFirst() { return Floats[0]; } in getFirst()
633 const APFloat &getFirst() const { return Floats[0]; } in getFirst()
634 APFloat &getSecond() { return Floats[1]; } in getSecond()
635 const APFloat &getSecond() const { return Floats[1]; } in getSecond()
653 class APFloat : public APFloatBase {
[all …]
/external/llvm/lib/Support/
DAPFloat.cpp47 APFloat::ExponentType maxExponent;
51 APFloat::ExponentType minExponent;
61 const fltSemantics APFloat::IEEEhalf = { 15, -14, 11, 16 };
62 const fltSemantics APFloat::IEEEsingle = { 127, -126, 24, 32 };
63 const fltSemantics APFloat::IEEEdouble = { 1023, -1022, 53, 64 };
64 const fltSemantics APFloat::IEEEquad = { 16383, -16382, 113, 128 };
65 const fltSemantics APFloat::x87DoubleExtended = { 16383, -16382, 64, 80 };
66 const fltSemantics APFloat::Bogus = { 0, 0, 0, 0 };
79 const fltSemantics APFloat::PPCDoubleDouble = { 1023, -1022 + 53, 53 + 53, 128 };
300 D->exponent += static_cast<APFloat::ExponentType>((dot - p) - (dot > p)); in interpretDecimal()
[all …]
/external/swiftshader/third_party/LLVM/lib/Support/
DAPFloat.cpp53 const fltSemantics APFloat::IEEEhalf = { 15, -14, 11, true };
54 const fltSemantics APFloat::IEEEsingle = { 127, -126, 24, true };
55 const fltSemantics APFloat::IEEEdouble = { 1023, -1022, 53, true };
56 const fltSemantics APFloat::IEEEquad = { 16383, -16382, 113, true };
57 const fltSemantics APFloat::x87DoubleExtended = { 16383, -16382, 64, true };
58 const fltSemantics APFloat::Bogus = { 0, 0, 0, true };
63 const fltSemantics APFloat::PPCDoubleDouble = { 1023, -1022, 106, false };
587 APFloat::initialize(const fltSemantics *ourSemantics) in initialize()
598 APFloat::freeSignificand() in freeSignificand()
605 APFloat::assign(const APFloat &rhs) in assign()
[all …]
/external/llvm/lib/Target/NVPTX/
DNVPTXMCExpr.cpp19 NVPTXFloatMCExpr::create(VariantKind Kind, const APFloat &Flt, MCContext &Ctx) { in create()
26 APFloat APF = getAPFloat(); in printImpl()
33 APF.convert(APFloat::IEEEsingle, APFloat::rmNearestTiesToEven, &Ignored); in printImpl()
38 APF.convert(APFloat::IEEEdouble, APFloat::rmNearestTiesToEven, &Ignored); in printImpl()
DNVPTXMCExpr.h31 const APFloat Flt;
33 explicit NVPTXFloatMCExpr(VariantKind Kind, APFloat Flt) in NVPTXFloatMCExpr()
40 static const NVPTXFloatMCExpr *create(VariantKind Kind, const APFloat &Flt,
43 static const NVPTXFloatMCExpr *createConstantFPSingle(const APFloat &Flt, in createConstantFPSingle()
48 static const NVPTXFloatMCExpr *createConstantFPDouble(const APFloat &Flt, in createConstantFPDouble()
61 APFloat getAPFloat() const { return Flt; } in getAPFloat()
/external/clang/include/clang/AST/
DAPValue.h40 typedef llvm::APFloat APFloat; typedef
76 APFloat Real, Imag;
112 typedef llvm::AlignedCharArrayUnion<void *, APSInt, APFloat, ComplexAPSInt,
124 explicit APValue(APFloat F) : Kind(Uninitialized) { in APValue()
133 APValue(APFloat R, APFloat I) : Kind(Uninitialized) { in APValue()
208 APFloat &getFloat() { in getFloat()
210 return *(APFloat*)(char*)Data.buffer; in getFloat()
212 const APFloat &getFloat() const { in getFloat()
232 APFloat &getComplexFloatReal() { in getComplexFloatReal()
236 const APFloat &getComplexFloatReal() const { in getComplexFloatReal()
[all …]
/external/clang/lib/Basic/
DTargetInfo.cpp73 HalfFormat = &llvm::APFloat::IEEEhalf; in TargetInfo()
74 FloatFormat = &llvm::APFloat::IEEEsingle; in TargetInfo()
75 DoubleFormat = &llvm::APFloat::IEEEdouble; in TargetInfo()
76 LongDoubleFormat = &llvm::APFloat::IEEEdouble; in TargetInfo()
77 Float128Format = &llvm::APFloat::IEEEquad; in TargetInfo()
223 if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended) in getRealTypeByWidth()
227 if (&getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble || in getRealTypeByWidth()
228 &getLongDoubleFormat() == &llvm::APFloat::IEEEquad) in getRealTypeByWidth()
305 DoubleFormat = &llvm::APFloat::IEEEdouble; in adjust()
318 HalfFormat = &llvm::APFloat::IEEEhalf; in adjust()
[all …]
/external/swiftshader/third_party/LLVM/test/CodeGen/X86/
Ddbg-inline.ll6 %class.APFloat = type { i32 }
8 define i32 @_ZNK7APFloat9partCountEv(%class.APFloat* nocapture %this) nounwind uwtable readonly opt…
10 tail call void @llvm.dbg.value(metadata !{%class.APFloat* %this}, i64 0, metadata !28), !dbg !41
11 %prec = getelementptr inbounds %class.APFloat* %this, i64 0, i32 0, !dbg !42
18 define zeroext i1 @_ZNK7APFloat14bitwiseIsEqualERKS_(%class.APFloat* %this, %class.APFloat* %rhs) u…
20 tail call void @llvm.dbg.value(metadata !{%class.APFloat* %this}, i64 0, metadata !29), !dbg !51
21 tail call void @llvm.dbg.value(metadata !{%class.APFloat* %rhs}, i64 0, metadata !30), !dbg !52
22 tail call void @llvm.dbg.value(metadata !{%class.APFloat* %this}, i64 0, metadata !53), !dbg !55
23 %prec.i = getelementptr inbounds %class.APFloat* %this, i64 0, i32 0, !dbg !56
31 %call2 = tail call i64* @_ZNK7APFloat16significandPartsEv(%class.APFloat* %this) optsize, !dbg !60
[all …]
/external/llvm/lib/Analysis/
DConstantFolding.cpp1365 APFloat APF(V); in GetConstantFoldFPValue()
1367 APF.convert(APFloat::IEEEhalf, APFloat::rmNearestTiesToEven, &unused); in GetConstantFoldFPValue()
1371 return ConstantFP::get(Ty->getContext(), APFloat((float)V)); in GetConstantFoldFPValue()
1373 return ConstantFP::get(Ty->getContext(), APFloat(V)); in GetConstantFoldFPValue()
1427 Constant *ConstantFoldConvertToInt(const APFloat &Val, bool roundTowardZero, in ConstantFoldConvertToInt()
1436 APFloat::roundingMode mode = roundTowardZero? APFloat::rmTowardZero in ConstantFoldConvertToInt()
1437 : APFloat::rmNearestTiesToEven; in ConstantFoldConvertToInt()
1438 APFloat::opStatus status = Val.convertToInteger(&UIntVal, ResultWidth, in ConstantFoldConvertToInt()
1441 if (status != APFloat::opOK && status != APFloat::opInexact) in ConstantFoldConvertToInt()
1456 APFloat APF = Op->getValueAPF(); in getValueAsDouble()
[all …]
/external/llvm/lib/AsmParser/
DLLLexer.cpp874 APFloatVal = APFloat(BitsToDouble(HexIntToVal(TokStart+2, CurPtr))); in Lex0x()
875 return lltok::APFloat; in Lex0x()
884 APFloatVal = APFloat(APFloat::x87DoubleExtended, APInt(80, Pair)); in Lex0x()
885 return lltok::APFloat; in Lex0x()
889 APFloatVal = APFloat(APFloat::IEEEquad, APInt(128, Pair)); in Lex0x()
890 return lltok::APFloat; in Lex0x()
894 APFloatVal = APFloat(APFloat::PPCDoubleDouble, APInt(128, Pair)); in Lex0x()
895 return lltok::APFloat; in Lex0x()
897 APFloatVal = APFloat(APFloat::IEEEhalf, in Lex0x()
899 return lltok::APFloat; in Lex0x()
[all …]
/external/llvm/lib/IR/
DConstants.cpp201 APFloat::getZero(APFloat::IEEEhalf)); in getNullValue()
204 APFloat::getZero(APFloat::IEEEsingle)); in getNullValue()
207 APFloat::getZero(APFloat::IEEEdouble)); in getNullValue()
210 APFloat::getZero(APFloat::x87DoubleExtended)); in getNullValue()
213 APFloat::getZero(APFloat::IEEEquad)); in getNullValue()
216 APFloat(APFloat::PPCDoubleDouble, in getNullValue()
255 APFloat FL = APFloat::getAllOnesValue(Ty->getPrimitiveSizeInBits(), in getAllOnesValue()
609 return &APFloat::IEEEhalf; in TypeToFloatSemantics()
611 return &APFloat::IEEEsingle; in TypeToFloatSemantics()
613 return &APFloat::IEEEdouble; in TypeToFloatSemantics()
[all …]
DConstantFold.cpp174 APFloat(DestTy->getFltSemantics(), in FoldBitCast()
590 APFloat Val = FPC->getValueAPF(); in ConstantFoldCastInstruction()
591 Val.convert(DestTy->isHalfTy() ? APFloat::IEEEhalf : in ConstantFoldCastInstruction()
592 DestTy->isFloatTy() ? APFloat::IEEEsingle : in ConstantFoldCastInstruction()
593 DestTy->isDoubleTy() ? APFloat::IEEEdouble : in ConstantFoldCastInstruction()
594 DestTy->isX86_FP80Ty() ? APFloat::x87DoubleExtended : in ConstantFoldCastInstruction()
595 DestTy->isFP128Ty() ? APFloat::IEEEquad : in ConstantFoldCastInstruction()
596 DestTy->isPPC_FP128Ty() ? APFloat::PPCDoubleDouble : in ConstantFoldCastInstruction()
597 APFloat::Bogus, in ConstantFoldCastInstruction()
598 APFloat::rmNearestTiesToEven, &ignored); in ConstantFoldCastInstruction()
[all …]
/external/clang/lib/AST/
DExprConstant.cpp54 using llvm::APFloat;
390 OptionalDiagnostic &operator<<(const APFloat &F) { in operator <<()
399 llvm::APFloat::semanticsPrecision(F.getSemantics()); in operator <<()
1034 APFloat FloatReal, FloatImag;
1036 ComplexValue() : FloatReal(APFloat::Bogus), FloatImag(APFloat::Bogus) {} in ComplexValue()
1040 APFloat &getComplexFloatReal() { return FloatReal; } in getComplexFloatReal()
1041 APFloat &getComplexFloatImag() { return FloatImag; } in getComplexFloatImag()
1262 static bool EvaluateFloat(const Expr *E, APFloat &Result, EvalInfo &Info);
1658 QualType SrcType, const APFloat &Value, in HandleFloatToIntCast()
1666 if (Value.convertToInteger(Result, llvm::APFloat::rmTowardZero, &ignored) in HandleFloatToIntCast()
[all …]
/external/swiftshader/third_party/LLVM/lib/VMCore/
DConstants.cpp87 APFloat::getZero(APFloat::IEEEsingle)); in getNullValue()
90 APFloat::getZero(APFloat::IEEEdouble)); in getNullValue()
93 APFloat::getZero(APFloat::x87DoubleExtended)); in getNullValue()
96 APFloat::getZero(APFloat::IEEEquad)); in getNullValue()
99 APFloat(APInt::getNullValue(128))); in getNullValue()
136 APFloat FL = APFloat::getAllOnesValue(Ty->getPrimitiveSizeInBits(), in getAllOnesValue()
470 return &APFloat::IEEEsingle; in TypeToFloatSemantics()
472 return &APFloat::IEEEdouble; in TypeToFloatSemantics()
474 return &APFloat::x87DoubleExtended; in TypeToFloatSemantics()
476 return &APFloat::IEEEquad; in TypeToFloatSemantics()
[all …]
DLLVMContextImpl.h68 APFloat val;
69 KeyTy(const APFloat& V) : val(V){} in KeyTy()
79 return KeyTy(APFloat(APFloat::Bogus,1)); in getEmptyKey()
82 return KeyTy(APFloat(APFloat::Bogus,2)); in getTombstoneKey()
DConstantFold.cpp169 APFloat(CI->getValue(), in FoldBitCast()
573 APFloat Val = FPC->getValueAPF(); in ConstantFoldCastInstruction()
574 Val.convert(DestTy->isFloatTy() ? APFloat::IEEEsingle : in ConstantFoldCastInstruction()
575 DestTy->isDoubleTy() ? APFloat::IEEEdouble : in ConstantFoldCastInstruction()
576 DestTy->isX86_FP80Ty() ? APFloat::x87DoubleExtended : in ConstantFoldCastInstruction()
577 DestTy->isFP128Ty() ? APFloat::IEEEquad : in ConstantFoldCastInstruction()
578 APFloat::Bogus, in ConstantFoldCastInstruction()
579 APFloat::rmNearestTiesToEven, &ignored); in ConstantFoldCastInstruction()
586 const APFloat &V = FPC->getValueAPF(); in ConstantFoldCastInstruction()
591 APFloat::rmTowardZero, &ignored); in ConstantFoldCastInstruction()
[all …]
/external/llvm/lib/Target/WebAssembly/InstPrinter/
DWebAssemblyInstPrinter.cpp112 static std::string toString(const APFloat &FP) { in toString()
115 !FP.bitwiseIsEqual(APFloat::getQNaN(FP.getSemantics())) && in toString()
116 !FP.bitwiseIsEqual(APFloat::getQNaN(FP.getSemantics(), /*Negative=*/true))) { in toString()
130 buf, /*hexDigits=*/0, /*upperCase=*/false, APFloat::rmNearestTiesToEven); in toString()
177 O << toString(APFloat(float(Op.getFPImm()))); in printOperand()
180 O << toString(APFloat(Op.getFPImm())); in printOperand()
/external/swiftshader/third_party/LLVM/lib/ExecutionEngine/
DExecutionEngine.cpp593 APFloat apf = APFloat::getZero(APFloat::x87DoubleExtended); in getConstantValue()
596 APFloat::rmNearestTiesToEven); in getConstantValue()
608 APFloat apf = APFloat::getZero(APFloat::x87DoubleExtended); in getConstantValue()
611 APFloat::rmNearestTiesToEven); in getConstantValue()
625 APFloat apf = APFloat(GV.IntVal); in getConstantValue()
630 APFloat::rmTowardZero, &ignored); in getConstantValue()
742 APFloat apfLHS = APFloat(LHS.IntVal); in getConstantValue()
746 apfLHS.add(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); in getConstantValue()
750 apfLHS.subtract(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); in getConstantValue()
754 apfLHS.multiply(APFloat(RHS.IntVal), APFloat::rmNearestTiesToEven); in getConstantValue()
[all …]
/external/llvm/lib/Transforms/InstCombine/
DInstCombineAddSub.cpp50 void set(const APFloat& C);
70 APFloat *getFpValPtr() in getFpValPtr()
71 { return reinterpret_cast<APFloat*>(&FpValBuf.buffer[0]); } in getFpValPtr()
72 const APFloat *getFpValPtr() const in getFpValPtr()
73 { return reinterpret_cast<const APFloat*>(&FpValBuf.buffer[0]); } in getFpValPtr()
75 const APFloat &getFpVal() const { in getFpVal()
80 APFloat &getFpVal() { in getFpVal()
94 APFloat createAPFloatFromInt(const fltSemantics &Sem, int Val);
108 AlignedCharArrayUnion<APFloat> FpValBuf;
129 void set(const APFloat &Coefficient, Value *V) { in set()
[all …]
/external/swiftshader/third_party/LLVM/lib/AsmParser/
DLLLexer.cpp719 APFloatVal = APFloat(BitsToDouble(HexIntToVal(TokStart+2, CurPtr))); in Lex0x()
720 return lltok::APFloat; in Lex0x()
729 APFloatVal = APFloat(APInt(80, Pair)); in Lex0x()
730 return lltok::APFloat; in Lex0x()
734 APFloatVal = APFloat(APInt(128, Pair), true); in Lex0x()
735 return lltok::APFloat; in Lex0x()
739 APFloatVal = APFloat(APInt(128, Pair)); in Lex0x()
740 return lltok::APFloat; in Lex0x()
816 APFloatVal = APFloat(std::atof(TokStart)); in LexDigitOrNegative()
817 return lltok::APFloat; in LexDigitOrNegative()
[all …]
/external/llvm/lib/Transforms/Scalar/
DFloat2Int.cpp309 const APFloat &F = CF->getValueAPF(); in walkForwards()
322 APFloat NewF = F; in walkForwards()
323 auto Res = NewF.roundToIntegral(APFloat::rmNearestTiesToEven); in walkForwards()
324 if (Res != APFloat::opOK || NewF.compare(F) != APFloat::cmpEqual) { in walkForwards()
333 APFloat::rmNearestTiesToEven, in walkForwards()
407 = APFloat::semanticsPrecision(ConvertedToTy->getFltSemantics()) - 1; in validateAndTransform()
447 APFloat::rmNearestTiesToEven, in convert()

123456789