Parma_Polyhedra_Library::float_ieee754_quad 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
uint64_t msp

Static Public Attributes

static const uint64_t MSP_SGN_MASK = 0x8000000000000000ULL
static const uint64_t MSP_POS_INF = 0x7fff000000000000ULL
static const uint64_t MSP_NEG_INF = 0xffff000000000000ULL
static const uint64_t MSP_POS_ZERO = 0x0000000000000000ULL
static const uint64_t MSP_NEG_ZERO = 0x8000000000000000ULL
static const uint64_t LSP_INF = 0
static const uint64_t LSP_ZERO = 0
static const uint64_t LSP_MAX = 0xffffffffffffffffULL
static const unsigned int EXPONENT_BITS = 15
static const unsigned int MANTISSA_BITS = 112
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 154 of file Float.defs.hh.


Member Function Documentation

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

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

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

00259                                  {
00260   if (lsp != LSP_INF)
00261     return 0;
00262   if (msp == MSP_NEG_INF)
00263     return -1;
00264   if (msp == MSP_POS_INF)
00265     return 1;
00266   return 0;
00267 }

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

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

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

00270                                  {
00271   return (msp & ~MSP_SGN_MASK) == MSP_POS_INF
00272     && lsp != LSP_INF;
00273 }

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

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

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

00276                                   {
00277   if (lsp != LSP_ZERO)
00278     return 0;
00279   if (msp == MSP_NEG_ZERO)
00280     return -1;
00281   if (msp == MSP_POS_ZERO)
00282     return 1;
00283   return 0;
00284 }

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

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

References msp, and MSP_SGN_MASK.

00292                                    {
00293   return !!(msp & MSP_SGN_MASK);
00294 }

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

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

References msp, and MSP_SGN_MASK.

00287                            {
00288   msp ^= MSP_SGN_MASK;
00289 }

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

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

References lsp, LSP_MAX, and msp.

00297                         {
00298   if (lsp == 0) {
00299     msp--;
00300     lsp = LSP_MAX;
00301   }
00302   else
00303     lsp--;
00304 }

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

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

References lsp, LSP_MAX, and msp.

00307                         {
00308   if (lsp == LSP_MAX) {
00309     msp++;
00310     lsp = 0;
00311   }
00312   else
00313     lsp++;
00314 }

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

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

References lsp, msp, and MSP_SGN_MASK.

00317                                          {
00318   msp = 0x7ffeffffffffffffULL;
00319   lsp = 0xffffffffffffffffULL;
00320   if (negative)
00321     msp |= MSP_SGN_MASK;
00322 }

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

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

References EXPONENT_BIAS, lsp, MANTISSA_BITS, msp, and MSP_SGN_MASK.

00325                                                                      {
00326   uint64_t parts[2];
00327   mpz_export(parts, 0, -1, 8, 0, 0, mantissa);
00328   lsp = parts[0];
00329   msp = parts[1];
00330   msp &= ((1ULL << (MANTISSA_BITS - 64)) - 1);
00331   if (negative)
00332     msp |= MSP_SGN_MASK;
00333   msp |= static_cast<uint64_t>(exponent + EXPONENT_BIAS)
00334     << (MANTISSA_BITS - 64);
00335 }


Member Data Documentation

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

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

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

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

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_SGN_MASK = 0x8000000000000000ULL [static]

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

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

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_POS_INF = 0x7fff000000000000ULL [static]

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

Referenced by is_inf(), and is_nan().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_NEG_INF = 0xffff000000000000ULL [static]

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

Referenced by is_inf().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_POS_ZERO = 0x0000000000000000ULL [static]

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

Referenced by is_zero().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_NEG_ZERO = 0x8000000000000000ULL [static]

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

Referenced by is_zero().

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

Referenced by is_inf(), and is_nan().

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

Referenced by is_zero().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::LSP_MAX = 0xffffffffffffffffULL [static]

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

Referenced by dec(), and inc().

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

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

Referenced by build().

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

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

Referenced by build().

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

Initial value:

 EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS)

Definition at line 175 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