diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-03-02 16:47:54 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2016-03-02 16:47:54 +0000 |
commit | ec178b724946908657124eb246ef2801298cd234 (patch) | |
tree | 7f3e451d08895887c204d64907a5ac48bcccc850 /acinclude.m4 | |
parent | 1c8226849d3ea0e62d7b7aaeea56fdcb52a5b72b (diff) | |
download | mpfr-ec178b724946908657124eb246ef2801298cd234.tar.gz |
added a separate configure test for subnormals in the "float" format
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@10188 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'acinclude.m4')
-rw-r--r-- | acinclude.m4 | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/acinclude.m4 b/acinclude.m4 index 968352bc6..1d690d5ba 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -264,7 +264,10 @@ static double get_max (void) { static volatile double d = DBL_MAX; return d; } fi dnl Check if subnormal (denormalized) numbers are supported -AC_CACHE_CHECK([for subnormal numbers], mpfr_cv_have_denorms, [ +dnl for the binary64 format, the smallest normal number is 2^(-1022) +dnl for the binary32 format, the smallest normal number is 2^(-126) +AC_CACHE_CHECK([for subnormal double-precision numbers], +mpfr_cv_have_denorms, [ AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <stdio.h> int main (void) { @@ -278,7 +281,25 @@ int main (void) { [mpfr_cv_have_denorms="cannot test, assume no"]) ]) if test "$mpfr_cv_have_denorms" = "yes"; then - AC_DEFINE(HAVE_DENORMS,1,[Define if subnormal (denormalized) floats work.]) + AC_DEFINE(HAVE_DENORMS,1,[Define if subnormal (denormalized) doubles work.]) +fi +AC_CACHE_CHECK([for subnormal single-precision numbers], +mpfr_cv_have_denorms_flt, [ +AC_RUN_IFELSE([AC_LANG_SOURCE([[ +#include <stdio.h> +int main (void) { + float x = 1.17549435082229e-38; + fprintf (stderr, "%e\n", x / 2.0); + return 2.0 * (x / 2.0) != x; +} +]])], + [mpfr_cv_have_denorms_flt="yes"], + [mpfr_cv_have_denorms_flt="no"], + [mpfr_cv_have_denorms_flt="cannot test, assume no"]) +]) +if test "$mpfr_cv_have_denorms_flt" = "yes"; then + AC_DEFINE(HAVE_DENORMS_FLT,1, + [Define if subnormal (denormalized) floats work.]) fi dnl Check if signed zeros are supported. Note: the test will fail |