[PATCH] D12253: Expose more properties of llvm::fltSemantics

Jason Koenig via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 21 16:05:58 PDT 2015


jrkoenig created this revision.
jrkoenig added a reviewer: jfb.
jrkoenig added a subscriber: llvm-commits.

Adds accessor functions for all the fields in llvm::fltSemantics. This will be used in MergeFunctions to order two APFloats with different semanatics.

http://reviews.llvm.org/D12253

Files:
  include/llvm/ADT/APFloat.h
  lib/Support/APFloat.cpp

Index: lib/Support/APFloat.cpp
===================================================================
--- lib/Support/APFloat.cpp
+++ lib/Support/APFloat.cpp
@@ -841,6 +841,21 @@
 {
   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
Index: include/llvm/ADT/APFloat.h
===================================================================
--- include/llvm/ADT/APFloat.h
+++ include/llvm/ADT/APFloat.h
@@ -142,6 +142,9 @@
   /// @}
 
   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 {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12253.32878.patch
Type: text/x-patch
Size: 1175 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150821/f14cdbfb/attachment.bin>


More information about the llvm-commits mailing list