#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 | 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 110 of file Float.defs.hh.
int Parma_Polyhedra_Library::float_intel_double_extended::is_inf | ( | ) | const [inline] |
Definition at line 173 of file Float.inlines.hh.
References lsp, LSP_INF, msp, MSP_NEG_INF, and MSP_POS_INF.
00173 { 00174 if (lsp != LSP_INF) 00175 return 0; 00176 uint32_t a = msp & MSP_NEG_INF; 00177 if (a == MSP_NEG_INF) 00178 return -1; 00179 if (a == MSP_POS_INF) 00180 return 1; 00181 return 0; 00182 }
int Parma_Polyhedra_Library::float_intel_double_extended::is_nan | ( | ) | const [inline] |
Definition at line 185 of file Float.inlines.hh.
References lsp, LSP_INF, msp, and MSP_POS_INF.
00185 { 00186 return (msp & MSP_POS_INF) == MSP_POS_INF 00187 && lsp != LSP_INF; 00188 }
int Parma_Polyhedra_Library::float_intel_double_extended::is_zero | ( | ) | const [inline] |
Definition at line 191 of file Float.inlines.hh.
References lsp, LSP_ZERO, msp, MSP_NEG_INF, MSP_NEG_ZERO, and MSP_POS_ZERO.
00191 { 00192 if (lsp != LSP_ZERO) 00193 return 0; 00194 uint32_t a = msp & MSP_NEG_INF; 00195 if (a == MSP_NEG_ZERO) 00196 return -1; 00197 if (a == MSP_POS_ZERO) 00198 return 1; 00199 return 0; 00200 }
int Parma_Polyhedra_Library::float_intel_double_extended::sign_bit | ( | ) | const [inline] |
Definition at line 208 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
00208 { 00209 return !!(msp & MSP_SGN_MASK); 00210 }
void Parma_Polyhedra_Library::float_intel_double_extended::negate | ( | ) | [inline] |
Definition at line 203 of file Float.inlines.hh.
References msp, and MSP_SGN_MASK.
00203 { 00204 msp ^= MSP_SGN_MASK; 00205 }
void Parma_Polyhedra_Library::float_intel_double_extended::dec | ( | ) | [inline] |
Definition at line 213 of file Float.inlines.hh.
References lsp, LSP_DMAX, LSP_NMAX, msp, and MSP_NEG_INF.
00213 { 00214 if ((lsp & LSP_DMAX) == 0) { 00215 --msp; 00216 lsp = (msp & MSP_NEG_INF) == 0 ? LSP_DMAX : LSP_NMAX; 00217 } 00218 else 00219 --lsp; 00220 }
void Parma_Polyhedra_Library::float_intel_double_extended::inc | ( | ) | [inline] |
void Parma_Polyhedra_Library::float_intel_double_extended::set_max | ( | bool | negative | ) | [inline] |
Definition at line 233 of file Float.inlines.hh.
References lsp, msp, and MSP_SGN_MASK.
00233 { 00234 msp = 0x00007ffe; 00235 lsp = 0xffffffffffffffffULL; 00236 if (negative) 00237 msp |= MSP_SGN_MASK; 00238 }
void Parma_Polyhedra_Library::float_intel_double_extended::build | ( | bool | negative, | |
mpz_t | mantissa, | |||
int | exponent | |||
) | [inline] |
Definition at line 241 of file Float.inlines.hh.
References EXPONENT_BIAS, lsp, msp, and MSP_SGN_MASK.
00242 { 00243 #if ULONG_MAX == 0xffffffffUL 00244 mpz_export(&lsp, 0, -1, 8, 0, 0, mantissa); 00245 #else 00246 lsp = mpz_get_ui(mantissa); 00247 #endif 00248 msp = (negative ? MSP_SGN_MASK : 0); 00249 msp |= static_cast<uint32_t>(exponent + EXPONENT_BIAS); 00250 }
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_SGN_MASK = 0x00008000 [static] |
Definition at line 118 of file Float.defs.hh.
Referenced by build(), negate(), set_max(), and sign_bit().
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_POS_INF = 0x00007fff [static] |
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_NEG_INF = 0x0000ffff [static] |
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_POS_ZERO = 0x00000000 [static] |
const uint32_t Parma_Polyhedra_Library::float_intel_double_extended::MSP_NEG_ZERO = 0x00008000 [static] |
const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_INF = 0x8000000000000000ULL [static] |
const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_ZERO = 0 [static] |
const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_DMAX = 0x7fffffffffffffffULL [static] |
const uint64_t Parma_Polyhedra_Library::float_intel_double_extended::LSP_NMAX = 0xffffffffffffffffULL [static] |
const unsigned int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_BITS = 15 [static] |
Definition at line 127 of file Float.defs.hh.
const unsigned int Parma_Polyhedra_Library::float_intel_double_extended::MANTISSA_BITS = 63 [static] |
Definition at line 128 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 129 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_BIAS = EXPONENT_MAX [static] |
const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_MIN = -EXPONENT_MAX + 1 [static] |
Definition at line 131 of file Float.defs.hh.
const int Parma_Polyhedra_Library::float_intel_double_extended::EXPONENT_MIN_DENORM [static] |
Initial value:
EXPONENT_MIN - static_cast<int>(MANTISSA_BITS)
Definition at line 132 of file Float.defs.hh.