From 091d6ba2757d2db7f5db28e3b87a0c87dd0a3360 Mon Sep 17 00:00:00 2001 From: JF Bastien Date: Wed, 26 Aug 2015 02:32:45 +0000 Subject: [PATCH] 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245999 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/APFloat.h | 3 +++ lib/Support/APFloat.cpp | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/include/llvm/ADT/APFloat.h b/include/llvm/ADT/APFloat.h index 76615affb25..bc7335e5b73 100644 --- a/include/llvm/ADT/APFloat.h +++ b/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/lib/Support/APFloat.cpp b/lib/Support/APFloat.cpp index 43d009976bd..6bcc053d467 100644 --- a/lib/Support/APFloat.cpp +++ b/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 -- 2.34.1