summaryrefslogtreecommitdiff
path: root/src/mpfr-impl.h
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2018-06-21 19:13:17 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2018-06-21 19:13:17 +0000
commit3f7120243ac34c1422426fb73b975ae820c31967 (patch)
tree5c5ed9fd5a3dbb59d407505f46a4b17889e19e02 /src/mpfr-impl.h
parent5795050dcdd0c9bd627e85ec38f1f5b3c7cdd854 (diff)
downloadmpfr-3f7120243ac34c1422426fb73b975ae820c31967.tar.gz
[src/mpfr-impl.h] assume little-endian double implies little-endian decimal128
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@12803 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'src/mpfr-impl.h')
-rw-r--r--src/mpfr-impl.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/mpfr-impl.h b/src/mpfr-impl.h
index 907becfbc..b1c17d2ee 100644
--- a/src/mpfr-impl.h
+++ b/src/mpfr-impl.h
@@ -810,6 +810,8 @@ typedef union {
union ieee_double_decimal64 { double d; _Decimal64 d64; };
/* FIXME: This should be checked with a configure test as
this is implementation-defined (endianness...). */
+#ifdef HAVE_DOUBLE_IEEE_LITTLE_ENDIAN
+/* assume little-endian double implies little-endian decimal128 */
union ieee_double_decimal128
{
struct
@@ -823,6 +825,21 @@ union ieee_double_decimal128
} s;
_Decimal128 d128;
};
+#else /* big endian */
+union ieee_double_decimal128
+{
+ struct
+ {
+ unsigned int sig:1;
+ unsigned int comb:17;
+ unsigned int t0:14;
+ unsigned int t1:32;
+ unsigned int t2:32;
+ unsigned int t3:32;
+ } s;
+ _Decimal128 d128;
+};
+#endif
#endif /* MPFR_WANT_DECIMAL_FLOATS */