summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2009-12-10 21:05:50 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2009-12-10 21:05:50 +0000
commit67c2285792643d35748a568fc8827ef0301ab146 (patch)
tree7986ef06fb1b19eb70c9b0875e7dece649d9de00
parent85686f88876c1efae72876d1160b176149d272ad (diff)
downloadmpfr-67c2285792643d35748a568fc8827ef0301ab146.tar.gz
patch to recognize IEEE quad, little endian format for "long double"
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6632 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--acinclude.m425
-rw-r--r--mpfr-impl.h21
2 files changed, 46 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index ed0b5221f..db7180ed5 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -544,6 +544,28 @@ BEGIN {
found = 1
exit
}
+
+ if (got[8] == "300" && \
+ got[9] == "031" && \
+ got[10] == "326" && \
+ got[11] == "363" && \
+ got[12] == "105" && \
+ got[13] == "100" && \
+ got[14] == "000" && \
+ got[15] == "000" && \
+ got[16] == "000" && \
+ got[17] == "000" && \
+ got[18] == "000" && \
+ got[19] == "000" && \
+ got[20] == "000" && \
+ got[21] == "000" && \
+ got[22] == "000" && \
+ got[23] == "000")
+ {
+ print "IEEE quad, little endian"
+ found = 1
+ exit
+ }
}
}
}
@@ -585,6 +607,9 @@ case $mpfr_cv_c_long_double_format in
"IEEE quad, big endian")
AC_DEFINE(HAVE_LDOUBLE_IEEE_QUAD_BIG, 1)
;;
+ "IEEE quad, little endian")
+ AC_DEFINE(HAVE_LDOUBLE_IEEE_QUAD_LITTLE, 1)
+ ;;
unknown* | "not available")
;;
*)
diff --git a/mpfr-impl.h b/mpfr-impl.h
index 50b59516a..577608293 100644
--- a/mpfr-impl.h
+++ b/mpfr-impl.h
@@ -485,6 +485,27 @@ static double double_zero = 0.0;
} while (0)
#endif
+#ifdef HAVE_LDOUBLE_IEEE_QUAD_LITTLE
+# define LONGDOUBLE_NAN_ACTION(x, action) \
+ do { \
+ union { \
+ long double ld; \
+ struct { \
+ unsigned int man0 : 32; \
+ unsigned int man1 : 32; \
+ unsigned int man2 : 32; \
+ unsigned int man3 : 16; \
+ unsigned int exp : 15; \
+ unsigned int sign : 1; \
+ } s; \
+ } u; \
+ u.ld = (x); \
+ if (u.s.exp == 0x7FFFL \
+ && (u.s.man0 | u.s.man1 | u.s.man2 | u.s.man3) != 0) \
+ { action; } \
+ } while (0)
+#endif
+
/* Under IEEE rules, NaN is not equal to anything, including itself.
"volatile" here stops "cc" on mips64-sgi-irix6.5 from optimizing away
x!=x. */