diff options
| author | JF Bastien <jfb@google.com> | 2015-08-26 02:32:45 +0000 |
|---|---|---|
| committer | JF Bastien <jfb@google.com> | 2015-08-26 02:32:45 +0000 |
| commit | a1d3c24ccfebef62abcf19e0f7eb1402707bd5da (patch) | |
| tree | ced27e195117e021a93a7a36fc2c6ccd7cc03a74 | |
| parent | ccfc9c8d6d4c69efb83825e9d384714736bbae72 (diff) | |
| download | bcm5719-llvm-a1d3c24ccfebef62abcf19e0f7eb1402707bd5da.tar.gz bcm5719-llvm-a1d3c24ccfebef62abcf19e0f7eb1402707bd5da.zip | |
Expose more properties of llvm::fltSemantics
Summary: Adds accessor functions for all the fields in llvm::fltSemantics. This will be used in MergeFunctions to order two APFloats with different semanatics.
Author: jrkoenig
Reviewers: jfb
Subscribers: dschuff, llvm-commits
Differential revision: http://reviews.llvm.org/D12253
llvm-svn: 245999
| -rw-r--r-- | llvm/include/llvm/ADT/APFloat.h | 3 | ||||
| -rw-r--r-- | llvm/lib/Support/APFloat.cpp | 15 |
2 files changed, 18 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/APFloat.h b/llvm/include/llvm/ADT/APFloat.h index 76615affb25..bc7335e5b73 100644 --- a/llvm/include/llvm/ADT/APFloat.h +++ b/llvm/include/llvm/ADT/APFloat.h @@ -142,6 +142,9 @@ public: /// @} static unsigned int semanticsPrecision(const fltSemantics &); + static ExponentType semanticsMinExponent(const fltSemantics &); + static ExponentType semanticsMaxExponent(const fltSemantics &); + static unsigned int semanticsSizeInBits(const fltSemantics &); /// IEEE-754R 5.11: Floating Point Comparison Relations. enum cmpResult { diff --git a/llvm/lib/Support/APFloat.cpp b/llvm/lib/Support/APFloat.cpp index 43d009976bd..6bcc053d467 100644 --- a/llvm/lib/Support/APFloat.cpp +++ b/llvm/lib/Support/APFloat.cpp @@ -841,6 +841,21 @@ APFloat::semanticsPrecision(const fltSemantics &semantics) { return semantics.precision; } +APFloat::ExponentType +APFloat::semanticsMaxExponent(const fltSemantics &semantics) +{ + return semantics.maxExponent; +} +APFloat::ExponentType +APFloat::semanticsMinExponent(const fltSemantics &semantics) +{ + return semantics.minExponent; +} +unsigned int +APFloat::semanticsSizeInBits(const fltSemantics &semantics) +{ + return semantics.sizeInBits; +} const integerPart * APFloat::significandParts() const |

