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 BASE = 2
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 235 of file Float.defs.hh.


Member Function Documentation

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

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

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

00436                                                                      {
00437   uint64_t parts[2];
00438   mpz_export(parts, 0, -1, 8, 0, 0, mantissa);
00439   lsp = parts[0];
00440   msp = parts[1];
00441   msp &= ((1ULL << (MANTISSA_BITS - 64)) - 1);
00442   if (negative)
00443     msp |= MSP_SGN_MASK;
00444   msp |= static_cast<uint64_t>(exponent + EXPONENT_BIAS)
00445     << (MANTISSA_BITS - 64);
00446 }

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

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

References lsp, LSP_MAX, and msp.

00408                         {
00409   if (lsp == 0) {
00410     --msp;
00411     lsp = LSP_MAX;
00412   }
00413   else
00414     --lsp;
00415 }

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

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

References lsp, LSP_MAX, and msp.

00418                         {
00419   if (lsp == LSP_MAX) {
00420     ++msp;
00421     lsp = 0;
00422   }
00423   else
00424     ++lsp;
00425 }

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

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

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

00370                                  {
00371   if (lsp != LSP_INF)
00372     return 0;
00373   if (msp == MSP_NEG_INF)
00374     return -1;
00375   if (msp == MSP_POS_INF)
00376     return 1;
00377   return 0;
00378 }

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

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

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

00381                                  {
00382   return (msp & ~MSP_SGN_MASK) == MSP_POS_INF
00383     && lsp != LSP_INF;
00384 }

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

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

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

00387                                   {
00388   if (lsp != LSP_ZERO)
00389     return 0;
00390   if (msp == MSP_NEG_ZERO)
00391     return -1;
00392   if (msp == MSP_POS_ZERO)
00393     return 1;
00394   return 0;
00395 }

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

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

References msp, and MSP_SGN_MASK.

00398                            {
00399   msp ^= MSP_SGN_MASK;
00400 }

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

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

References lsp, msp, and MSP_SGN_MASK.

00428                                          {
00429   msp = 0x7ffeffffffffffffULL;
00430   lsp = 0xffffffffffffffffULL;
00431   if (negative)
00432     msp |= MSP_SGN_MASK;
00433 }

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

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

References msp, and MSP_SGN_MASK.

00403                                    {
00404   return !!(msp & MSP_SGN_MASK);
00405 }


Member Data Documentation

const unsigned int Parma_Polyhedra_Library::float_ieee754_quad::BASE = 2 [static]

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

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

Referenced by build().

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

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

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

Initial value:
 EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS)

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

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

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

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

Referenced by is_inf(), and is_nan().

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

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

Referenced by dec(), and inc().

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

Referenced by is_zero().

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

Referenced by build().

Definition at line 241 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_NEG_INF = 0xffff000000000000ULL [static]

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

Referenced by is_inf().

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

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

Referenced by is_zero().

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

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

Referenced by is_inf(), and is_nan().

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

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

Referenced by is_zero().

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

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

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


The documentation for this struct was generated from the following files:
Generated on Sun Feb 27 16:20:19 2011 for PPL by  doxygen 1.6.3