PPL  0.12.1
Parma_Polyhedra_Library::float_ieee754_quad Struct Reference

#include <Float.defs.hh>

List of all members.

Public Member Functions

int inf_sign () const
bool is_nan () const
int zero_sign () const
bool 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 = static_cast<uint64_t>(0x8000000000000000ULL)
static const uint64_t MSP_POS_INF = static_cast<uint64_t>(0x7fff000000000000ULL)
static const uint64_t MSP_NEG_INF = static_cast<uint64_t>(0xffff000000000000ULL)
static const uint64_t MSP_POS_ZERO = static_cast<uint64_t>(0x0000000000000000ULL)
static const uint64_t MSP_NEG_ZERO = static_cast<uint64_t>(0x8000000000000000ULL)
static const uint64_t LSP_INF = 0
static const uint64_t LSP_ZERO = 0
static const uint64_t LSP_MAX = static_cast<uint64_t>(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 240 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 451 of file Float.inlines.hh.

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

                                                                     {
  uint64_t parts[2];
  mpz_export(parts, 0, -1, 8, 0, 0, mantissa);
  lsp = parts[0];
  msp = parts[1];
  msp &= ((static_cast<uint64_t>(1) << (MANTISSA_BITS - 64)) - 1);
  if (negative)
    msp |= MSP_SGN_MASK;
  int exponent_repr = exponent + EXPONENT_BIAS;
  PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS));
  msp |= static_cast<uint64_t>(exponent_repr) << (MANTISSA_BITS - 64);
}

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

References lsp, LSP_MAX, and msp.

                        {
  if (lsp == 0) {
    --msp;
    lsp = LSP_MAX;
  }
  else
    --lsp;
}

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

References lsp, LSP_MAX, and msp.

                        {
  if (lsp == LSP_MAX) {
    ++msp;
    lsp = 0;
  }
  else
    ++lsp;
}

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

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

                                   {
  if (lsp != LSP_INF)
    return 0;
  if (msp == MSP_NEG_INF)
    return -1;
  if (msp == MSP_POS_INF)
    return 1;
  return 0;
}

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

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

                                 {
  return (msp & ~MSP_SGN_MASK) == MSP_POS_INF
    && lsp != LSP_INF;
}

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

References msp, and MSP_SGN_MASK.

                           {
  msp ^= MSP_SGN_MASK;
}

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

References lsp, msp, and MSP_SGN_MASK.

                                         {
  msp = static_cast<uint64_t>(0x7ffeffffffffffffULL);
  lsp = static_cast<uint64_t>(0xffffffffffffffffULL);
  if (negative)
    msp |= MSP_SGN_MASK;
}

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

References msp, and MSP_SGN_MASK.

                                   {
  return (msp & MSP_SGN_MASK) != 0;
}

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

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

                                    {
  if (lsp != LSP_ZERO)
    return 0;
  if (msp == MSP_NEG_ZERO)
    return -1;
  if (msp == MSP_POS_ZERO)
    return 1;
  return 0;
}

Member Data Documentation

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

Referenced by build().

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

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

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

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

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

Referenced by inf_sign(), and is_nan().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::LSP_MAX = static_cast<uint64_t>(0xffffffffffffffffULL)
static

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

Referenced by dec(), and inc().

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

Referenced by zero_sign().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_NEG_INF = static_cast<uint64_t>(0xffff000000000000ULL)
static

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

Referenced by inf_sign().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_NEG_ZERO = static_cast<uint64_t>(0x8000000000000000ULL)
static

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

Referenced by zero_sign().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_POS_INF = static_cast<uint64_t>(0x7fff000000000000ULL)
static

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

Referenced by inf_sign(), and is_nan().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_POS_ZERO = static_cast<uint64_t>(0x0000000000000000ULL)
static

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

Referenced by zero_sign().

const uint64_t Parma_Polyhedra_Library::float_ieee754_quad::MSP_SGN_MASK = static_cast<uint64_t>(0x8000000000000000ULL)
static

Definition at line 248 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: