From 7aa1c321f00d29fdc84e9a03080853aa25dd06fc Mon Sep 17 00:00:00 2001 From: Shuxin Yang Date: Mon, 7 Jan 2013 18:59:35 +0000 Subject: Implement APFloat::isDenormal() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171764 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/APFloat.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/Support/APFloat.cpp') diff --git a/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index 17f38918b3..0e3c619170 100644 --- a/lib/Support/APFloat.cpp +++ b/lib/Support/APFloat.cpp @@ -696,6 +696,13 @@ APFloat::operator=(const APFloat &rhs) return *this; } +bool +APFloat::isDenormal() const { + return isNormal() && (exponent == semantics->minExponent) && + (APInt::tcExtractBit(significandParts(), + semantics->precision - 1) == 0); +} + bool APFloat::bitwiseIsEqual(const APFloat &rhs) const { if (this == &rhs) -- cgit v1.2.3-18-g5258