aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Support/APFloat.cpp
diff options
context:
space:
mode:
authorMichael Gottesman <mgottesman@apple.com>2013-06-24 09:58:02 +0000
committerMichael Gottesman <mgottesman@apple.com>2013-06-24 09:58:02 +0000
commitfdec0c7a7302702d08f1221609221018af8085ec (patch)
tree322c301ab9e6ba9963310adf2fd4df04d3f30602 /lib/Support/APFloat.cpp
parentfb25071a18ef24949f2f422c919b85340d6c6e2a (diff)
downloadexternal_llvm-fdec0c7a7302702d08f1221609221018af8085ec.tar.gz
external_llvm-fdec0c7a7302702d08f1221609221018af8085ec.tar.bz2
external_llvm-fdec0c7a7302702d08f1221609221018af8085ec.zip
[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
Diffstat (limited to 'lib/Support/APFloat.cpp')
-rw-r--r--lib/Support/APFloat.cpp16
1 files changed, 16 insertions, 0 deletions
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());
+}