From fdec0c7a7302702d08f1221609221018af8085ec Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Mon, 24 Jun 2013 09:58:02 +0000 Subject: [APFloat] Added make{Zero,Inf} methods and implemented get{Zero,Inf} on top of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184712 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/APFloat.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/Support/APFloat.cpp') diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index db1d61c281..ec50064f42 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -3827,3 +3827,19 @@ APFloat::opStatus APFloat::next(bool nextDown) { return result; } + +void +APFloat::makeInf(bool Negative) { + category = fcInfinity; + sign = Negative; + exponent = semantics->maxExponent + 1; + APInt::tcSet(significandParts(), 0, partCount()); +} + +void +APFloat::makeZero(bool Negative) { + category = fcZero; + sign = Negative; + exponent = semantics->minExponent-1; + APInt::tcSet(significandParts(), 0, partCount()); +} -- cgit v1.2.3