#include <Float.defs.hh>
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 |
| uint32_t | msp |
Static Public Attributes | |
| static const uint32_t | MSP_SGN_MASK = 0x00008000 |
| static const uint32_t | MSP_POS_INF = 0x00007fff |
| static const uint32_t | MSP_NEG_INF = 0x0000ffff |
| static const uint32_t | MSP_POS_ZERO = 0x00000000 |
| static const uint32_t | MSP_NEG_ZERO = 0x00008000 |
| static const uint64_t | LSP_INF = 0x8000000000000000ULL |
| static const uint64_t | LSP_ZERO = 0 |
| static const uint64_t | LSP_DMAX = 0x7fffffffffffffffULL |
| static const uint64_t | LSP_NMAX = 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 |
Definition at line 195 of file Float.defs.hh.
| void Parma_Polyhedra_Library::float_intel_double_extended::build | ( | bool | negative, | |
| mpz_t | mantissa, | |||
| int | exponent | |||
| ) | [inline] |
Definition at line 358 of file Float.inlines.hh.
References EXPONENT_BIAS, lsp, msp, and MSP_SGN_MASK.
00359 { 00360 #if ULONG_MAX == 0xffffffffUL 00361 mpz_export(&lsp, 0, -1, 8, 0, 0, mantissa); 00362 #else 00363 lsp = mpz_get_ui(mantissa); 00364 #endif 00365 msp = (negative ? MSP_SGN_MASK : 0); 00366 msp |= static_cast<uint32_t>(exponent + EXPONENT_BIAS); 00367 }
| void Parma_Polyhedra_Library::float_intel_double_extended::dec | ( | ) | [inline] |
Definition at line 330 of file Float.inlines.hh.
References lsp, LSP_DMAX, LSP_NMAX, msp, and MSP_NEG_INF.
| void Parma_Polyhedra_Library::float_intel_double_extended::inc | ( | ) | [inline] |
| int Parma_Polyhedra_Library::float_intel_double_extended::is_inf | ( | ) | const [inline] |
Definition at line 290 of file Float.inlines.hh.
References lsp, LSP_INF, msp, MSP_NEG_INF, and MSP_POS_INF.
00290 { 00291 if (lsp != LSP_INF) 00292 return 0; 00293 uint32_t a = msp & MSP_NEG_INF; 00294 if (a == MSP_NEG_INF) 00295 return -1; 00296 if (a == MSP_POS_INF) 00297 return 1; 00298 return 0; 00299 }
| int Parma_Polyhedra_Library::float_intel_double_extended::is_nan | ( | ) | const [inline] |
Definition at line 302 of file Float.inlines.hh.
References lsp, LSP_INF, msp, and MSP_POS_INF.
00302 { 00303 return (msp & MSP_POS_INF) == MSP_POS_INF 00304 && lsp != LSP_INF; 00305 }
| int Parma_Polyhedra_Library::float_intel_double_extended::is_zero | ( | ) | const [inline] |
Definition at line 308 of file Float.inlines.hh.
References lsp, LSP_ZERO, msp, MSP_NEG_INF, MSP_NEG_ZERO, and MSP_POS_ZERO.
00308 { 00309 if (lsp != LSP_ZERO) 00310 return 0; 00311 uint32_t a = msp & MSP_NEG_INF; 00312 if (a == MSP_NEG_ZERO) 00313 return -1; 00314 if (a == MSP_POS_ZERO) 00315 return 1; 00316 return 0; 00317 }
| void Parma_Polyhedra_Library::float_intel_double_extended::negate | ( | ) | [inline] |
Definition at line 320 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
00320 { 00321 msp ^= MSP_SGN_MASK; 00322 }
| void Parma_Polyhedra_Library::float_intel_double_extended::set_max | ( | bool | negative | ) | [inline] |
Definition at line 350 of file Float.inlines.hh.
References lsp, msp, and MSP_SGN_MASK.
00350 { 00351 msp = 0x00007ffe; 00352 lsp = 0xffffffffffffffffULL; 00353 if (negative) 00354 msp |= MSP_SGN_MASK; 00355 }
| int Parma_Polyhedra_Library::float_intel_double_extended::sign_bit | ( | ) | const [inline] |
Definition at line 325 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
00325 { 00326 return !!(msp & MSP_SGN_MASK); 00327 }
const unsigned int Parma_Polyhedra_Library::float_intel_double_extended::BASE = 2 [static] |
Definition at line 212 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_BIAS = EXPONENT_MAX [static] |
Definition at line 216 of file Float.defs.hh.
Referenced by build().
const unsigned int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_BITS = 15 [static] |
Definition at line 213 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_MAX = (1 << (EXPONENT_BITS - 1)) - 1 [static] |
Definition at line 215 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_MIN = -EXPONENT_MAX + 1 [static] |
Definition at line 217 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_MIN_DENORM [static] |
EXPONENT_MIN - static_cast<int>(MANTISSA_BITS)
Definition at line 218 of file Float.defs.hh.
const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_DMAX = 0x7fffffffffffffffULL [static] |
Definition at line 210 of file Float.defs.hh.
const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_INF = 0x8000000000000000ULL [static] |
Definition at line 208 of file Float.defs.hh.
const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_NMAX = 0xffffffffffffffffULL [static] |
Definition at line 211 of file Float.defs.hh.
Referenced by dec().
const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_ZERO = 0 [static] |
Definition at line 209 of file Float.defs.hh.
Referenced by is_zero().
const unsigned int Parma_Polyhedra_Library::float_intel_double_extended::MANTISSA_BITS = 63 [static] |
Definition at line 214 of file Float.defs.hh.
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_NEG_INF = 0x0000ffff [static] |
Definition at line 205 of file Float.defs.hh.
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_NEG_ZERO = 0x00008000 [static] |
Definition at line 207 of file Float.defs.hh.
Referenced by is_zero().
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_POS_INF = 0x00007fff [static] |
Definition at line 204 of file Float.defs.hh.
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_POS_ZERO = 0x00000000 [static] |
Definition at line 206 of file Float.defs.hh.
Referenced by is_zero().
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_SGN_MASK = 0x00008000 [static] |
Definition at line 203 of file Float.defs.hh.
Referenced by build(), negate(), set_max(), and sign_bit().
1.6.3