PPL  1.2
Parma_Polyhedra_Library::float_intel_double_extended Struct Reference

#include <Float_defs.hh>

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
 
uint32_t msp
 

Static Public Attributes

static const uint32_t MSP_SGN_MASK = 0x00008000U
 
static const uint32_t MSP_POS_INF = 0x00007fffU
 
static const uint32_t MSP_NEG_INF = 0x0000ffffU
 
static const uint32_t MSP_POS_ZERO = 0x00000000U
 
static const uint32_t MSP_NEG_ZERO = 0x00008000U
 
static const uint64_t LSP_INF = static_cast<uint64_t>(0x8000000000000000ULL)
 
static const uint64_t LSP_ZERO = 0
 
static const uint32_t MSP_MAX = 0x00007ffeU
 
static const uint64_t LSP_DMAX = static_cast<uint64_t>(0x7fffffffffffffffULL)
 
static const uint64_t LSP_NMAX = static_cast<uint64_t>(0xffffffffffffffffULL)
 
static const unsigned int BASE = 2
 
static const unsigned int EXPONENT_BITS = 15
 
static const unsigned int MANTISSA_BITS = 63
 
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
 
static const Floating_Point_Format floating_point_format
 

Detailed Description

Definition at line 202 of file Float_defs.hh.

Member Function Documentation

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

Definition at line 409 of file Float_inlines.hh.

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

410  {
411 #if ULONG_MAX == 0xffffffffUL
412  mpz_export(&lsp, 0, -1, sizeof(lsp), 0, 0, mantissa);
413 #else
414  lsp = mpz_get_ui(mantissa);
415 #endif
416  msp = (negative ? MSP_SGN_MASK : 0);
417  const int exponent_repr = exponent + EXPONENT_BIAS;
418  PPL_ASSERT(exponent_repr >= 0 && exponent_repr < (1 << EXPONENT_BITS));
419  msp |= static_cast<uint32_t>(exponent_repr);
420 }
void Parma_Polyhedra_Library::float_intel_double_extended::dec ( )
inline

Definition at line 378 of file Float_inlines.hh.

References lsp, LSP_DMAX, LSP_NMAX, msp, and MSP_NEG_INF.

378  {
379  if ((lsp & LSP_DMAX) == 0) {
380  --msp;
381  lsp = ((msp & MSP_NEG_INF) == 0) ? LSP_DMAX : LSP_NMAX;
382  }
383  else {
384  --lsp;
385  }
386 }
void Parma_Polyhedra_Library::float_intel_double_extended::inc ( )
inline

Definition at line 389 of file Float_inlines.hh.

References lsp, LSP_DMAX, and msp.

389  {
390  if ((lsp & LSP_DMAX) == LSP_DMAX) {
391  ++msp;
392  lsp = LSP_DMAX + 1;
393  }
394  else {
395  ++lsp;
396  }
397 }
int Parma_Polyhedra_Library::float_intel_double_extended::inf_sign ( ) const
inline

Definition at line 332 of file Float_inlines.hh.

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

332  {
333  if (lsp != LSP_INF) {
334  return 0;
335  }
336  const uint32_t a = msp & MSP_NEG_INF;
337  if (a == MSP_NEG_INF) {
338  return -1;
339  }
340  if (a == MSP_POS_INF) {
341  return 1;
342  }
343  return 0;
344 }
bool Parma_Polyhedra_Library::float_intel_double_extended::is_nan ( ) const
inline

Definition at line 347 of file Float_inlines.hh.

References lsp, LSP_INF, msp, and MSP_POS_INF.

void Parma_Polyhedra_Library::float_intel_double_extended::negate ( )
inline

Definition at line 368 of file Float_inlines.hh.

References msp, and MSP_SGN_MASK.

void Parma_Polyhedra_Library::float_intel_double_extended::set_max ( bool  negative)
inline
bool Parma_Polyhedra_Library::float_intel_double_extended::sign_bit ( ) const
inline

Definition at line 373 of file Float_inlines.hh.

References msp, and MSP_SGN_MASK.

int Parma_Polyhedra_Library::float_intel_double_extended::zero_sign ( ) const
inline

Definition at line 353 of file Float_inlines.hh.

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

353  {
354  if (lsp != LSP_ZERO) {
355  return 0;
356  }
357  const uint32_t a = msp & MSP_NEG_INF;
358  if (a == MSP_NEG_ZERO) {
359  return -1;
360  }
361  if (a == MSP_POS_ZERO) {
362  return 1;
363  }
364  return 0;
365 }

Member Data Documentation

const unsigned int Parma_Polyhedra_Library::float_intel_double_extended::BASE = 2
static
const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_BIAS = EXPONENT_MAX
static

Definition at line 224 of file Float_defs.hh.

Referenced by build(), and Parma_Polyhedra_Library::compute_absolute_error().

const unsigned int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_BITS = 15
static

Definition at line 221 of file Float_defs.hh.

Referenced by build().

const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1
static

Definition at line 223 of file Float_defs.hh.

const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_MIN = -EXPONENT_MAX + 1
static

Definition at line 225 of file Float_defs.hh.

const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_MIN_DENORM
static
Initial value:
- static_cast<int>(MANTISSA_BITS)

Definition at line 226 of file Float_defs.hh.

const Floating_Point_Format Parma_Polyhedra_Library::float_intel_double_extended::floating_point_format
static
Initial value:

Definition at line 228 of file Float_defs.hh.

uint64_t Parma_Polyhedra_Library::float_intel_double_extended::lsp

Definition at line 207 of file Float_defs.hh.

Referenced by build(), dec(), inc(), inf_sign(), is_nan(), set_max(), and zero_sign().

const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_DMAX = static_cast<uint64_t>(0x7fffffffffffffffULL)
static

Definition at line 218 of file Float_defs.hh.

Referenced by dec(), and inc().

const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_INF = static_cast<uint64_t>(0x8000000000000000ULL)
static

Definition at line 215 of file Float_defs.hh.

Referenced by inf_sign(), and is_nan().

const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_NMAX = static_cast<uint64_t>(0xffffffffffffffffULL)
static

Definition at line 219 of file Float_defs.hh.

Referenced by dec(), and set_max().

const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_ZERO = 0
static

Definition at line 216 of file Float_defs.hh.

Referenced by zero_sign().

const unsigned int Parma_Polyhedra_Library::float_intel_double_extended::MANTISSA_BITS = 63
static
uint32_t Parma_Polyhedra_Library::float_intel_double_extended::msp

Definition at line 208 of file Float_defs.hh.

Referenced by build(), dec(), inc(), inf_sign(), is_nan(), negate(), set_max(), sign_bit(), and zero_sign().

const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_MAX = 0x00007ffeU
static

Definition at line 217 of file Float_defs.hh.

Referenced by set_max().

const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_NEG_INF = 0x0000ffffU
static

Definition at line 212 of file Float_defs.hh.

Referenced by dec(), inf_sign(), and zero_sign().

const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_NEG_ZERO = 0x00008000U
static

Definition at line 214 of file Float_defs.hh.

Referenced by zero_sign().

const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_POS_INF = 0x00007fffU
static

Definition at line 211 of file Float_defs.hh.

Referenced by inf_sign(), and is_nan().

const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_POS_ZERO = 0x00000000U
static

Definition at line 213 of file Float_defs.hh.

Referenced by zero_sign().

const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_SGN_MASK = 0x00008000U
static

Definition at line 210 of file Float_defs.hh.

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


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