Parma_Polyhedra_Library::float_intel_double_extended Struct Reference
[C++ Language Interface]

#include <Float.defs.hh>

List of all members.

Public Member Functions

int is_inf () const
int is_nan () const
int is_zero () const
int sign_bit () const
void negate ()
void dec ()
void inc ()
void set_max (bool negative)
void build (bool negative, mpz_t mantissa, int exponent)

Public Attributes

uint64_t lsp
uint32_t msp

Static Public Attributes

static const uint32_t MSP_SGN_MASK = 0x00008000
static const uint32_t MSP_POS_INF = 0x00007fff
static const uint32_t MSP_NEG_INF = 0x0000ffff
static const uint32_t MSP_POS_ZERO = 0x00000000
static const uint32_t MSP_NEG_ZERO = 0x00008000
static const uint64_t LSP_INF = 0x8000000000000000ULL
static const uint64_t LSP_ZERO = 0
static const uint64_t LSP_DMAX = 0x7fffffffffffffffULL
static const uint64_t LSP_NMAX = 0xffffffffffffffffULL
static const unsigned int EXPONENT_BITS = 15
static const unsigned int MANTISSA_BITS = 63
static const int EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1
static const int EXPONENT_BIAS = EXPONENT_MAX
static const int EXPONENT_MIN = -EXPONENT_MAX + 1
static const int EXPONENT_MIN_DENORM


Detailed Description

Definition at line 115 of file Float.defs.hh.


Member Function Documentation

int Parma_Polyhedra_Library::float_intel_double_extended::is_inf (  )  const [inline]

Definition at line 179 of file Float.inlines.hh.

References lsp, LSP_INF, msp, MSP_NEG_INF, and MSP_POS_INF.

00179                                           {
00180   if (lsp != LSP_INF)
00181     return 0;
00182   uint32_t a = msp & MSP_NEG_INF;
00183   if (a == MSP_NEG_INF)
00184     return -1;
00185   if (a == MSP_POS_INF)
00186     return 1;
00187   return 0;
00188 }

int Parma_Polyhedra_Library::float_intel_double_extended::is_nan (  )  const [inline]

Definition at line 191 of file Float.inlines.hh.

References lsp, LSP_INF, msp, and MSP_POS_INF.

00191                                           {
00192   return (msp & MSP_POS_INF) == MSP_POS_INF
00193     && lsp != LSP_INF;
00194 }

int Parma_Polyhedra_Library::float_intel_double_extended::is_zero (  )  const [inline]

Definition at line 197 of file Float.inlines.hh.

References lsp, LSP_ZERO, msp, MSP_NEG_INF, MSP_NEG_ZERO, and MSP_POS_ZERO.

00197                                            {
00198   if (lsp != LSP_ZERO)
00199     return 0;
00200   uint32_t a = msp & MSP_NEG_INF;
00201   if (a == MSP_NEG_ZERO)
00202     return -1;
00203   if (a == MSP_POS_ZERO)
00204     return 1;
00205   return 0;
00206 }

int Parma_Polyhedra_Library::float_intel_double_extended::sign_bit (  )  const [inline]

Definition at line 214 of file Float.inlines.hh.

References msp, and MSP_SGN_MASK.

00214                                             {
00215   return !!(msp & MSP_SGN_MASK);
00216 }

void Parma_Polyhedra_Library::float_intel_double_extended::negate (  )  [inline]

Definition at line 209 of file Float.inlines.hh.

References msp, and MSP_SGN_MASK.

00209                                     {
00210   msp ^= MSP_SGN_MASK;
00211 }

void Parma_Polyhedra_Library::float_intel_double_extended::dec (  )  [inline]

Definition at line 219 of file Float.inlines.hh.

References lsp, LSP_DMAX, LSP_NMAX, msp, and MSP_NEG_INF.

00219                                  {
00220   if ((lsp & LSP_DMAX) == 0) {
00221     msp--;
00222     lsp = (msp & MSP_NEG_INF) == 0 ? LSP_DMAX : LSP_NMAX;
00223   }
00224   else
00225     lsp--;
00226 }

void Parma_Polyhedra_Library::float_intel_double_extended::inc (  )  [inline]

Definition at line 229 of file Float.inlines.hh.

References lsp, LSP_DMAX, and msp.

00229                                  {
00230   if ((lsp & LSP_DMAX) == LSP_DMAX) {
00231     msp++;
00232     lsp = LSP_DMAX + 1;
00233   }
00234   else
00235     lsp++;
00236 }

void Parma_Polyhedra_Library::float_intel_double_extended::set_max ( bool  negative  )  [inline]

Definition at line 239 of file Float.inlines.hh.

References lsp, msp, and MSP_SGN_MASK.

00239                                                   {
00240   msp = 0x00007ffe;
00241   lsp = 0xffffffffffffffffULL;
00242   if (negative)
00243     msp |= MSP_SGN_MASK;
00244 }

void Parma_Polyhedra_Library::float_intel_double_extended::build ( bool  negative,
mpz_t  mantissa,
int  exponent 
) [inline]

Definition at line 247 of file Float.inlines.hh.

References EXPONENT_BIAS, lsp, msp, and MSP_SGN_MASK.

00248                                                                  {
00249 #if ULONG_MAX == 0xffffffffUL
00250   mpz_export(&lsp, 0, -1, 8, 0, 0, mantissa);
00251 #else
00252   lsp = mpz_get_ui(mantissa);
00253 #endif
00254   msp = (negative ? MSP_SGN_MASK : 0);
00255   msp |= static_cast<uint32_t>(exponent + EXPONENT_BIAS);
00256 }


Member Data Documentation

Definition at line 120 of file Float.defs.hh.

Referenced by build(), dec(), inc(), is_inf(), is_nan(), is_zero(), and set_max().

Definition at line 121 of file Float.defs.hh.

Referenced by build(), dec(), inc(), is_inf(), is_nan(), is_zero(), negate(), set_max(), and sign_bit().

Definition at line 123 of file Float.defs.hh.

Referenced by build(), negate(), set_max(), and sign_bit().

Definition at line 124 of file Float.defs.hh.

Referenced by is_inf(), and is_nan().

Definition at line 125 of file Float.defs.hh.

Referenced by dec(), is_inf(), and is_zero().

Definition at line 126 of file Float.defs.hh.

Referenced by is_zero().

Definition at line 127 of file Float.defs.hh.

Referenced by is_zero().

const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_INF = 0x8000000000000000ULL [static]

Definition at line 128 of file Float.defs.hh.

Referenced by is_inf(), and is_nan().

Definition at line 129 of file Float.defs.hh.

Referenced by is_zero().

const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_DMAX = 0x7fffffffffffffffULL [static]

Definition at line 130 of file Float.defs.hh.

Referenced by dec(), and inc().

const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_NMAX = 0xffffffffffffffffULL [static]

Definition at line 131 of file Float.defs.hh.

Referenced by dec().

Definition at line 132 of file Float.defs.hh.

Definition at line 133 of file Float.defs.hh.

Definition at line 134 of file Float.defs.hh.

Definition at line 135 of file Float.defs.hh.

Referenced by build().

Definition at line 136 of file Float.defs.hh.

Initial value:

 EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS)

Definition at line 137 of file Float.defs.hh.


The documentation for this struct was generated from the following files:

Generated on Wed Jul 16 22:55:44 2008 for PPL by  doxygen 1.5.6