aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/ADT/APFloat.h
diff options
context:
space:
mode:
authorDale Johannesen <dalej@apple.com>2007-08-24 00:56:33 +0000
committerDale Johannesen <dalej@apple.com>2007-08-24 00:56:33 +0000
commit96ec39d5ec31d28be092d2e343773eee1fa30e14 (patch)
tree7a47d5e48fde4a3990a915df06776a2122625610 /include/llvm/ADT/APFloat.h
parent8c556616241ed32e39ffe1b91850483d69d43346 (diff)
downloadexternal_llvm-96ec39d5ec31d28be092d2e343773eee1fa30e14.zip
external_llvm-96ec39d5ec31d28be092d2e343773eee1fa30e14.tar.gz
external_llvm-96ec39d5ec31d28be092d2e343773eee1fa30e14.tar.bz2
Change internal representation of ConstantFP to use APFloat.
Interface to rest of the compiler unchanged, as yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41348 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/ADT/APFloat.h')
-rw-r--r--include/llvm/ADT/APFloat.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/llvm/ADT/APFloat.h b/include/llvm/ADT/APFloat.h
index 89614d5..5387b48 100644
--- a/include/llvm/ADT/APFloat.h
+++ b/include/llvm/ADT/APFloat.h
@@ -118,6 +118,9 @@ namespace llvm {
static const fltSemantics IEEEdouble;
static const fltSemantics IEEEquad;
static const fltSemantics x87DoubleExtended;
+ /* And this psuedo, used to construct APFloats that cannot
+ conflict with anything real. */
+ static const fltSemantics Bogus;
static unsigned int semanticsPrecision(const fltSemantics &);
@@ -161,6 +164,8 @@ namespace llvm {
APFloat(const fltSemantics &, const char *);
APFloat(const fltSemantics &, integerPart);
APFloat(const fltSemantics &, fltCategory, bool negative);
+ APFloat(double d);
+ APFloat(float f);
APFloat(const APFloat &);
~APFloat();
@@ -179,10 +184,16 @@ namespace llvm {
opStatus convertFromInteger(const integerPart *, unsigned int, bool,
roundingMode);
opStatus convertFromString(const char *, roundingMode);
+ double convertToDouble() const;
+ float convertToFloat() const;
- /* Comparison with another floating point number. */
+ /* IEEE comparison with another floating point number (QNaNs
+ compare unordered, 0==-0). */
cmpResult compare(const APFloat &) const;
+ /* Bitwise comparison for equality (QNaNs compare equal, 0!=-0). */
+ bool operator==(const APFloat &) const;
+
/* Simple queries. */
fltCategory getCategory() const { return category; }
const fltSemantics &getSemantics() const { return *semantics; }
@@ -192,6 +203,9 @@ namespace llvm {
APFloat& operator=(const APFloat &);
+ /* Return an arbitrary integer value usable for hashing. */
+ uint32_t getHashValue() const;
+
private:
/* Trivial queries. */