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 149 of file Float.defs.hh.


Member Function Documentation

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

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

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

00253                                  {
00254   if (lsp != LSP_INF)
00255     return 0;
00256   if (msp == MSP_NEG_INF)
00257     return -1;
00258   if (msp == MSP_POS_INF)
00259     return 1;
00260   return 0;
00261 }

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

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

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

00264                                  {
00265   return (msp & ~MSP_SGN_MASK) == MSP_POS_INF
00266     && lsp != LSP_INF;
00267 }

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

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

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

00270                                   {
00271   if (lsp != LSP_ZERO)
00272     return 0;
00273   if (msp == MSP_NEG_ZERO)
00274     return -1;
00275   if (msp == MSP_POS_ZERO)
00276     return 1;
00277   return 0;
00278 }

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

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

References msp, and MSP_SGN_MASK.

00286                                    {
00287   return !!(msp & MSP_SGN_MASK);
00288 }

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

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

References msp, and MSP_SGN_MASK.

00281                            {
00282   msp ^= MSP_SGN_MASK;
00283 }

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

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

References lsp, LSP_MAX, and msp.

00291                         {
00292   if (lsp == 0) {
00293     --msp;
00294     lsp = LSP_MAX;
00295   }
00296   else
00297     --lsp;
00298 }

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

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

References lsp, LSP_MAX, and msp.

00301                         {
00302   if (lsp == LSP_MAX) {
00303     ++msp;
00304     lsp = 0;
00305   }
00306   else
00307     ++lsp;
00308 }

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

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

References lsp, msp, and MSP_SGN_MASK.

00311                                          {
00312   msp = 0x7ffeffffffffffffULL;
00313   lsp = 0xffffffffffffffffULL;
00314   if (negative)
00315     msp |= MSP_SGN_MASK;
00316 }

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

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

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

00319                                                                      {
00320   uint64_t parts[2];
00321   mpz_export(parts, 0, -1, 8, 0, 0, mantissa);
00322   lsp = parts[0];
00323   msp = parts[1];
00324   msp &= ((1ULL << (MANTISSA_BITS - 64)) - 1);
00325   if (negative)
00326     msp |= MSP_SGN_MASK;
00327   msp |= static_cast<uint64_t>(exponent + EXPONENT_BIAS)
00328     << (MANTISSA_BITS - 64);
00329 }


Member Data Documentation

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

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

Definition at line 155 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 157 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 158 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 159 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 160 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 161 of file Float.defs.hh.

Referenced by is_zero().

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

Referenced by is_inf(), and is_nan().

Definition at line 163 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 164 of file Float.defs.hh.

Referenced by dec(), and inc().

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

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

Referenced by build().

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

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

Referenced by build().

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

Initial value:

 EXPONENT_MIN
                                        - static_cast<int>(MANTISSA_BITS)

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


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

Generated on Sat Oct 11 10:41:01 2008 for PPL by  doxygen 1.5.6