Home
last modified time | relevance | path

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

123456

/external/llvm/unittests/ADT/
DAPFloatTest.cpp23 llvm::APFloat F(0.0); in convertToDoubleFromString()
24 F.convertFromString(Str, llvm::APFloat::rmNearestTiesToEven); in convertToDoubleFromString()
30 llvm::APFloat F(d); in convertToString()
42 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, false).isSignaling()); in TEST()
43 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, true).isSignaling()); in TEST()
44 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, false, &payload).isSignaling()); in TEST()
45 EXPECT_FALSE(APFloat::getQNaN(APFloat::IEEEsingle, true, &payload).isSignaling()); in TEST()
46 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, false).isSignaling()); in TEST()
47 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, true).isSignaling()); in TEST()
48 EXPECT_TRUE(APFloat::getSNaN(APFloat::IEEEsingle, false, &payload).isSignaling()); in TEST()
[all …]
/external/llvm/include/llvm/ADT/
DAPFloat.h122 class APFloat {
191 APFloat(const fltSemantics &); // Default construct to 0.0
192 APFloat(const fltSemantics &, StringRef);
193 APFloat(const fltSemantics &, integerPart);
194 APFloat(const fltSemantics &, uninitializedTag);
195 APFloat(const fltSemantics &, const APInt &);
196 explicit APFloat(double d);
197 explicit APFloat(float f);
198 APFloat(const APFloat &);
199 APFloat(APFloat &&);
[all …]
/external/llvm/lib/Support/
DAPFloat.cpp46 APFloat::ExponentType maxExponent;
50 APFloat::ExponentType minExponent;
57 const fltSemantics APFloat::IEEEhalf = { 15, -14, 11 };
58 const fltSemantics APFloat::IEEEsingle = { 127, -126, 24 };
59 const fltSemantics APFloat::IEEEdouble = { 1023, -1022, 53 };
60 const fltSemantics APFloat::IEEEquad = { 16383, -16382, 113 };
61 const fltSemantics APFloat::x87DoubleExtended = { 16383, -16382, 64 };
62 const fltSemantics APFloat::Bogus = { 0, 0, 0 };
75 const fltSemantics APFloat::PPCDoubleDouble = { 1023, -1022 + 53, 53 + 53 };
296 D->exponent += static_cast<APFloat::ExponentType>((dot - p) - (dot > p)); in interpretDecimal()
[all …]
/external/llvm/lib/Target/NVPTX/
DNVPTXMCExpr.cpp19 NVPTXFloatMCExpr::Create(VariantKind Kind, 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.h30 const APFloat Flt;
32 explicit NVPTXFloatMCExpr(VariantKind Kind, APFloat Flt) in NVPTXFloatMCExpr()
39 static const NVPTXFloatMCExpr *Create(VariantKind Kind, APFloat Flt,
42 static const NVPTXFloatMCExpr *CreateConstantFPSingle(APFloat Flt, in CreateConstantFPSingle()
47 static const NVPTXFloatMCExpr *CreateConstantFPDouble(APFloat Flt, in CreateConstantFPDouble()
60 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.cpp67 HalfFormat = &llvm::APFloat::IEEEhalf; in TargetInfo()
68 FloatFormat = &llvm::APFloat::IEEEsingle; in TargetInfo()
69 DoubleFormat = &llvm::APFloat::IEEEdouble; in TargetInfo()
70 LongDoubleFormat = &llvm::APFloat::IEEEdouble; in TargetInfo()
216 if (&getLongDoubleFormat() == &llvm::APFloat::x87DoubleExtended) in getRealTypeByWidth()
220 if (&getLongDoubleFormat() == &llvm::APFloat::PPCDoubleDouble || in getRealTypeByWidth()
221 &getLongDoubleFormat() == &llvm::APFloat::IEEEquad) in getRealTypeByWidth()
292 DoubleFormat = &llvm::APFloat::IEEEdouble; in adjust()
305 HalfFormat = &llvm::APFloat::IEEEhalf; in adjust()
306 FloatFormat = &llvm::APFloat::IEEEsingle; in adjust()
[all …]
/external/llvm/lib/Analysis/
DConstantFolding.cpp1301 APFloat APF(V); in GetConstantFoldFPValue()
1303 APF.convert(APFloat::IEEEhalf, APFloat::rmNearestTiesToEven, &unused); in GetConstantFoldFPValue()
1307 return ConstantFP::get(Ty->getContext(), APFloat((float)V)); in GetConstantFoldFPValue()
1309 return ConstantFP::get(Ty->getContext(), APFloat(V)); in GetConstantFoldFPValue()
1367 static Constant *ConstantFoldConvertToInt(const APFloat &Val, in ConstantFoldConvertToInt()
1376 APFloat::roundingMode mode = roundTowardZero? APFloat::rmTowardZero in ConstantFoldConvertToInt()
1377 : APFloat::rmNearestTiesToEven; in ConstantFoldConvertToInt()
1378 APFloat::opStatus status = Val.convertToInteger(&UIntVal, ResultWidth, in ConstantFoldConvertToInt()
1381 if (status != APFloat::opOK && status != APFloat::opInexact) in ConstantFoldConvertToInt()
1396 APFloat APF = Op->getValueAPF(); in getValueAsDouble()
[all …]
/external/llvm/lib/AsmParser/
DLLLexer.cpp833 APFloatVal = APFloat(BitsToDouble(HexIntToVal(TokStart+2, CurPtr))); in Lex0x()
834 return lltok::APFloat; in Lex0x()
843 APFloatVal = APFloat(APFloat::x87DoubleExtended, APInt(80, Pair)); in Lex0x()
844 return lltok::APFloat; in Lex0x()
848 APFloatVal = APFloat(APFloat::IEEEquad, APInt(128, Pair)); in Lex0x()
849 return lltok::APFloat; in Lex0x()
853 APFloatVal = APFloat(APFloat::PPCDoubleDouble, APInt(128, Pair)); in Lex0x()
854 return lltok::APFloat; in Lex0x()
856 APFloatVal = APFloat(APFloat::IEEEhalf, in Lex0x()
858 return lltok::APFloat; in Lex0x()
[all …]
DLLLexer.h42 APFloat APFloatVal;
60 const APFloat &getAPFloatVal() const { return APFloatVal; } in getAPFloatVal()
/external/llvm/lib/Transforms/InstCombine/
DInstCombineAddSub.cpp49 void set(const APFloat& C);
70 APFloat *getFpValPtr(void) in getFpValPtr()
71 { return reinterpret_cast<APFloat*>(&FpValBuf.buffer[0]); } in getFpValPtr()
72 const APFloat *getFpValPtr(void) const in getFpValPtr()
73 { return reinterpret_cast<const APFloat*>(&FpValBuf.buffer[0]); } in getFpValPtr()
75 const APFloat &getFpVal(void) const { in getFpVal()
80 APFloat &getFpVal(void) { in getFpVal()
94 APFloat createAPFloatFromInt(const fltSemantics &Sem, int Val);
108 AlignedCharArrayUnion<APFloat> FpValBuf;
126 void set(const APFloat& Coefficient, Value *V) in set()
[all …]
/external/clang/lib/AST/
DExprConstant.cpp53 using llvm::APFloat;
370 OptionalDiagnostic &operator<<(const APFloat &F) { in operator <<()
379 llvm::APFloat::semanticsPrecision(F.getSemantics()); in operator <<()
883 APFloat FloatReal, FloatImag;
885 ComplexValue() : FloatReal(APFloat::Bogus), FloatImag(APFloat::Bogus) {} in ComplexValue()
889 APFloat &getComplexFloatReal() { return FloatReal; } in getComplexFloatReal()
890 APFloat &getComplexFloatImag() { return FloatImag; } in getComplexFloatImag()
1108 static bool EvaluateFloat(const Expr *E, APFloat &Result, EvalInfo &Info);
1502 QualType SrcType, const APFloat &Value, in HandleFloatToIntCast()
1510 if (Value.convertToInteger(Result, llvm::APFloat::rmTowardZero, &ignored) in HandleFloatToIntCast()
[all …]
DAPValue.cpp193 ((APFloat*)(char*)Data.buffer)->~APFloat(); in DestroyDataAndMakeUninit()
263 static double GetApproxValue(const llvm::APFloat &F) { in GetApproxValue()
264 llvm::APFloat V = F; in GetApproxValue()
266 V.convert(llvm::APFloat::IEEEdouble, llvm::APFloat::rmNearestTiesToEven, in GetApproxValue()
/external/llvm/lib/IR/
DConstantFold.cpp176 APFloat(DestTy->getFltSemantics(), in FoldBitCast()
591 APFloat Val = FPC->getValueAPF(); in ConstantFoldCastInstruction()
592 Val.convert(DestTy->isHalfTy() ? APFloat::IEEEhalf : in ConstantFoldCastInstruction()
593 DestTy->isFloatTy() ? APFloat::IEEEsingle : in ConstantFoldCastInstruction()
594 DestTy->isDoubleTy() ? APFloat::IEEEdouble : in ConstantFoldCastInstruction()
595 DestTy->isX86_FP80Ty() ? APFloat::x87DoubleExtended : in ConstantFoldCastInstruction()
596 DestTy->isFP128Ty() ? APFloat::IEEEquad : in ConstantFoldCastInstruction()
597 DestTy->isPPC_FP128Ty() ? APFloat::PPCDoubleDouble : in ConstantFoldCastInstruction()
598 APFloat::Bogus, in ConstantFoldCastInstruction()
599 APFloat::rmNearestTiesToEven, &ignored); in ConstantFoldCastInstruction()
[all …]
DConstants.cpp184 APFloat::getZero(APFloat::IEEEhalf)); in getNullValue()
187 APFloat::getZero(APFloat::IEEEsingle)); in getNullValue()
190 APFloat::getZero(APFloat::IEEEdouble)); in getNullValue()
193 APFloat::getZero(APFloat::x87DoubleExtended)); in getNullValue()
196 APFloat::getZero(APFloat::IEEEquad)); in getNullValue()
199 APFloat(APFloat::PPCDoubleDouble, in getNullValue()
236 APFloat FL = APFloat::getAllOnesValue(Ty->getPrimitiveSizeInBits(), in getAllOnesValue()
617 return &APFloat::IEEEhalf; in TypeToFloatSemantics()
619 return &APFloat::IEEEsingle; in TypeToFloatSemantics()
621 return &APFloat::IEEEdouble; in TypeToFloatSemantics()
[all …]
DLLVMContextImpl.h69 static inline APFloat getEmptyKey() { return APFloat(APFloat::Bogus, 1); } in getEmptyKey()
70 static inline APFloat getTombstoneKey() { return APFloat(APFloat::Bogus, 2); } in getTombstoneKey()
71 static unsigned getHashValue(const APFloat &Key) { in getHashValue()
74 static bool isEqual(const APFloat &LHS, const APFloat &RHS) { in isEqual()
874 typedef DenseMap<APFloat, ConstantFP *, DenseMapAPFloatKeyInfo> FPMapTy;
/external/llvm/lib/ExecutionEngine/
DExecutionEngine.cpp673 APFloat apf = APFloat::getZero(APFloat::x87DoubleExtended); in getConstantValue()
676 APFloat::rmNearestTiesToEven); in getConstantValue()
688 APFloat apf = APFloat::getZero(APFloat::x87DoubleExtended); in getConstantValue()
691 APFloat::rmNearestTiesToEven); in getConstantValue()
705 APFloat apf = APFloat(APFloat::x87DoubleExtended, GV.IntVal); in getConstantValue()
710 APFloat::rmTowardZero, &ignored); in getConstantValue()
825 APFloat apfLHS = APFloat(Sem, LHS.IntVal); in getConstantValue()
829 apfLHS.add(APFloat(Sem, RHS.IntVal), APFloat::rmNearestTiesToEven); in getConstantValue()
833 apfLHS.subtract(APFloat(Sem, RHS.IntVal), in getConstantValue()
834 APFloat::rmNearestTiesToEven); in getConstantValue()
[all …]
/external/llvm/include/llvm/IR/
DType.h168 case HalfTyID: return APFloat::IEEEhalf; in getFltSemantics()
169 case FloatTyID: return APFloat::IEEEsingle; in getFltSemantics()
170 case DoubleTyID: return APFloat::IEEEdouble; in getFltSemantics()
171 case X86_FP80TyID: return APFloat::x87DoubleExtended; in getFltSemantics()
172 case FP128TyID: return APFloat::IEEEquad; in getFltSemantics()
173 case PPC_FP128TyID: return APFloat::PPCDoubleDouble; in getFltSemantics()
DConstants.h229 APFloat Val;
235 ConstantFP(Type *Ty, const APFloat& V);
253 static ConstantFP *get(LLVMContext &Context, const APFloat &V);
258 static bool isValueValidForType(Type *Ty, const APFloat &V);
259 inline const APFloat &getValueAPF() const { return Val; } in getValueAPF()
279 bool isExactlyValue(const APFloat &V) const;
283 APFloat FV(V); in isExactlyValue()
284 FV.convert(Val.getSemantics(), APFloat::rmNearestTiesToEven, &ignored); in isExactlyValue()
573 APFloat getElementAsAPFloat(unsigned i) const;
/external/llvm/lib/Transforms/Scalar/
DFloat2Int.cpp314 APFloat F = CF->getValueAPF(); in walkForwards()
327 APFloat NewF = F; in walkForwards()
328 auto Res = NewF.roundToIntegral(APFloat::rmNearestTiesToEven); in walkForwards()
329 if (Res != APFloat::opOK || NewF.compare(F) != APFloat::cmpEqual) { in walkForwards()
338 APFloat::rmNearestTiesToEven, in walkForwards()
412 = APFloat::semanticsPrecision(ConvertedToTy->getFltSemantics()) - 1; in validateAndTransform()
452 APFloat::rmNearestTiesToEven, in convert()
/external/llvm/lib/Target/ARM/
DARMMCInstLower.cpp105 APFloat Val = MO.getFPImm()->getValueAPF(); in lowerOperand()
107 Val.convert(APFloat::IEEEdouble, APFloat::rmTowardZero, &ignored); in lowerOperand()
/external/mesa3d/src/gallium/drivers/radeon/
DAMDGPUMCInstLower.cpp41 const APFloat &FloatValue = MO.getFPImm()->getValueAPF(); in lower()
42 assert(&FloatValue.getSemantics() == &APFloat::IEEEsingle && in lower()
/external/llvm/lib/CodeGen/SelectionDAG/
DSelectionDAG.cpp74 bool ConstantFPSDNode::isExactlyValue(const APFloat& V) const { in isExactlyValue()
79 const APFloat& Val) { in isValueValidForType()
83 APFloat Val2 = APFloat(Val); in isValueValidForType()
86 APFloat::rmNearestTiesToEven, in isValueValidForType()
1203 SDValue SelectionDAG::getConstantFP(const APFloat& V, EVT VT, bool isTarget) { in getConstantFP()
1244 return getConstantFP(APFloat((float)Val), VT, isTarget); in getConstantFP()
1246 return getConstantFP(APFloat(Val), VT, isTarget); in getConstantFP()
1250 APFloat apf = APFloat(Val); in getConstantFP()
1251 apf.convert(EVTToAPFloatSemantics(EltVT), APFloat::rmNearestTiesToEven, in getConstantFP()
1884 APFloat::cmpResult R = N1C->getValueAPF().compare(N2C->getValueAPF()); in FoldSetCC()
[all …]
/external/clang/lib/CodeGen/
DCodeGenTypes.cpp277 if (&format == &llvm::APFloat::IEEEhalf) { in getTypeForFormat()
283 if (&format == &llvm::APFloat::IEEEsingle) in getTypeForFormat()
285 if (&format == &llvm::APFloat::IEEEdouble) in getTypeForFormat()
287 if (&format == &llvm::APFloat::IEEEquad) in getTypeForFormat()
289 if (&format == &llvm::APFloat::PPCDoubleDouble) in getTypeForFormat()
291 if (&format == &llvm::APFloat::x87DoubleExtended) in getTypeForFormat()
/external/llvm/lib/Target/Hexagon/
DHexagonSplitConst32AndConst64.cpp120 APFloat Val = MI->getOperand(1).getFPImm()->getValueAPF(); in runOnMachineFunction()
139 APFloat Val = MI->getOperand(1).getFPImm()->getValueAPF(); in runOnMachineFunction()

123456