diff options
author | DJ Delorie <dj@redhat.com> | 2009-03-29 02:15:39 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2009-03-29 02:15:39 +0000 |
commit | 3481f392b0f0df40d3556b376322066086d577bf (patch) | |
tree | 10db2be9e96ce57aef9083cea47c58084e248365 /libdecnumber/decDouble.h | |
parent | 9259819687899b6c6d31a7b32c24bfadad4b73f0 (diff) | |
download | gdb-3481f392b0f0df40d3556b376322066086d577bf.zip gdb-3481f392b0f0df40d3556b376322066086d577bf.tar.gz gdb-3481f392b0f0df40d3556b376322066086d577bf.tar.bz2 |
merge from gcc
Diffstat (limited to 'libdecnumber/decDouble.h')
-rw-r--r-- | libdecnumber/decDouble.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/libdecnumber/decDouble.h b/libdecnumber/decDouble.h index 53fcf40..aa8d77d 100644 --- a/libdecnumber/decDouble.h +++ b/libdecnumber/decDouble.h @@ -31,24 +31,22 @@ /* ------------------------------------------------------------------ */ /* decDouble.h -- Decimal 64-bit format module header */ /* ------------------------------------------------------------------ */ -/* Please see decFloats.h for an overview and documentation details. */ -/* ------------------------------------------------------------------ */ #if !defined(DECDOUBLE) #define DECDOUBLE - #define DECDOUBLENAME "decimalDouble" /* Short name */ + #define DECDOUBLENAME "decimalDouble" /* Short name */ #define DECDOUBLETITLE "Decimal 64-bit datum" /* Verbose name */ #define DECDOUBLEAUTHOR "Mike Cowlishaw" /* Who to blame */ /* parameters for decDoubles */ #define DECDOUBLE_Bytes 8 /* length */ #define DECDOUBLE_Pmax 16 /* maximum precision (digits) */ - #define DECDOUBLE_Emin -383 /* minimum adjusted exponent */ - #define DECDOUBLE_Emax 384 /* maximum adjusted exponent */ + #define DECDOUBLE_Emin -383 /* minimum adjusted exponent */ + #define DECDOUBLE_Emax 384 /* maximum adjusted exponent */ #define DECDOUBLE_EmaxD 3 /* maximum exponent digits */ - #define DECDOUBLE_Bias 398 /* bias for the exponent */ - #define DECDOUBLE_String 25 /* maximum string length, +1 */ + #define DECDOUBLE_Bias 398 /* bias for the exponent */ + #define DECDOUBLE_String 25 /* maximum string length, +1 */ #define DECDOUBLE_EconL 8 /* exponent continuation length */ #define DECDOUBLE_Declets 5 /* count of declets */ /* highest biased exponent (Elimit-1) */ @@ -58,11 +56,14 @@ #include "decContext.h" #include "decQuad.h" - /* The decDouble decimal 64-bit type, accessible by various types */ + /* The decDouble decimal 64-bit type, accessible by all sizes */ typedef union { - uint8_t bytes[DECDOUBLE_Bytes]; /* fields: 1, 5, 8, 50 bits */ + uint8_t bytes[DECDOUBLE_Bytes]; /* fields: 1, 5, 8, 50 bits */ uint16_t shorts[DECDOUBLE_Bytes/2]; - uint32_t words[DECDOUBLE_Bytes/4]; + uint32_t words[DECDOUBLE_Bytes/4]; + #if DECUSE64 + uint64_t longs[DECDOUBLE_Bytes/8]; + #endif } decDouble; /* ---------------------------------------------------------------- */ @@ -75,6 +76,7 @@ extern decDouble * decDoubleFromBCD(decDouble *, int32_t, const uint8_t *, int32_t); extern decDouble * decDoubleFromInt32(decDouble *, int32_t); extern decDouble * decDoubleFromPacked(decDouble *, int32_t, const uint8_t *); + extern decDouble * decDoubleFromPackedChecked(decDouble *, int32_t, const uint8_t *); extern decDouble * decDoubleFromString(decDouble *, const char *, decContext *); extern decDouble * decDoubleFromUInt32(decDouble *, uint32_t); extern decDouble * decDoubleFromWider(decDouble *, const decQuad *, decContext *); @@ -160,7 +162,8 @@ /* decNumber conversions; these are implemented as macros so as not */ /* to force a dependency on decimal64 and decNumber in decDouble. */ + /* decDoubleFromNumber returns a decimal64 * to avoid warnings. */ #define decDoubleToNumber(dq, dn) decimal64ToNumber((decimal64 *)(dq), dn) - #define decDoubleFromNumber(dq, dn, set) (decDouble *)decimal64FromNumber((decimal64 *)(dq), dn, set) + #define decDoubleFromNumber(dq, dn, set) decimal64FromNumber((decimal64 *)(dq), dn, set) #endif |