PPL  0.12.1
Parma_Polyhedra_Library::float_ibm_single 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

uint32_t word

Static Public Attributes

static const uint32_t SGN_MASK = 0x80000000U
static const uint32_t EXP_MASK = 0x7f000000U
static const uint32_t POS_INF = 0x7f000000U
static const uint32_t NEG_INF = 0xff000000U
static const uint32_t POS_ZERO = 0x00000000U
static const uint32_t NEG_ZERO = 0x80000000U
static const unsigned int BASE = 16
static const unsigned int EXPONENT_BITS = 7
static const unsigned int MANTISSA_BITS = 24
static const int EXPONENT_BIAS = 64
static const int EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1
static const int EXPONENT_MIN = -EXPONENT_MAX + 1
static const int EXPONENT_MIN_DENORM
static const Floating_Point_Format floating_point_format = IBM_SINGLE

Detailed Description

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


Member Function Documentation

void Parma_Polyhedra_Library::float_ibm_single::build ( bool  negative,
mpz_t  mantissa,
int  exponent 
)
inline

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

References EXPONENT_BIAS, EXPONENT_BITS, MANTISSA_BITS, PPL_ASSERT, SGN_MASK, and word.

                                                                   {
  word = static_cast<uint32_t>(mpz_get_ui(mantissa)
                               & ((1UL << MANTISSA_BITS) - 1));
  if (negative)
    word |= SGN_MASK;
  int exponent_repr = exponent + EXPONENT_BIAS;
  PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS));
  word |= static_cast<uint32_t>(exponent_repr) << MANTISSA_BITS;
}

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

References word.

                      {
  --word;
}

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

References word.

                      {
  ++word;
}

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

References NEG_INF, POS_INF, and word.

                                 {
  if (word == NEG_INF)
    return -1;
  if (word == POS_INF)
    return 1;
  return 0;
}

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

References POS_INF, SGN_MASK, and word.

                               {
  return (word & ~SGN_MASK) > POS_INF;
}

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

References SGN_MASK, and word.

                         {
  word ^= SGN_MASK;
}

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

References SGN_MASK, and word.

                                       {
  word = 0x7f000000U;
  if (negative)
    word |= SGN_MASK;
}

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

References SGN_MASK, and word.

                                 {
  return (word & SGN_MASK) != 0;
}

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

References NEG_ZERO, POS_ZERO, and word.

                                  {
  if (word == NEG_ZERO)
    return -1;
  if (word == POS_ZERO)
    return 1;
  return 0;
}

Member Data Documentation

const uint32_t Parma_Polyhedra_Library::float_ibm_single::EXP_MASK = 0x7f000000U
static

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

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

Referenced by build().

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

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

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

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

const uint32_t Parma_Polyhedra_Library::float_ibm_single::NEG_INF = 0xff000000U
static

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

Referenced by inf_sign().

const uint32_t Parma_Polyhedra_Library::float_ibm_single::NEG_ZERO = 0x80000000U
static

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

Referenced by zero_sign().

const uint32_t Parma_Polyhedra_Library::float_ibm_single::POS_INF = 0x7f000000U
static

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

Referenced by inf_sign(), and is_nan().

const uint32_t Parma_Polyhedra_Library::float_ibm_single::POS_ZERO = 0x00000000U
static

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

Referenced by zero_sign().

const uint32_t Parma_Polyhedra_Library::float_ibm_single::SGN_MASK = 0x80000000U
static

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