diff options
-rw-r--r-- | BUGS | 7 | ||||
-rw-r--r-- | README.dev | 8 | ||||
-rw-r--r-- | tests/tests.c | 36 |
3 files changed, 46 insertions, 5 deletions
@@ -1,4 +1,4 @@ -Copyright 1999, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by the Spaces project, INRIA Lorraine. This file is part of the MPFR Library. @@ -29,6 +29,11 @@ Known bugs: exceeds the hardware limit (2^30 for a 32 bits CPU, and 2^62 for a 64 bits CPU). +* Under Linux/x86 with the traditional FPU, some functions do not work + if the FPU rounding precision has been changed to single (this is a + bad practice and should be useless, but one never knows what other + software will do). + Potential bugs: * Possible integer overflows on some machines. diff --git a/README.dev b/README.dev index 00e4388c4..511b08630 100644 --- a/README.dev +++ b/README.dev @@ -76,9 +76,11 @@ To make a release (for the MPFR team): objdir (../mpfr/configure --srcdir=/users/spaces/pelissip/mpfr/), with and without "-std=c99 -O3 -D_XOPEN_SOURCE=500", with and without "-ansi" (which allows to turn off features that are - incompatible with ISO C90), with and without --enable-thread-safe - and in various locales (LC_ALL=tr_TR in particular, if installed). - Test with both "make check" and the worst cases. + incompatible with ISO C90), with and without --enable-thread-safe, + in various FPU precisions (double, double extended and single) if + the platform supports that (e.g. under Linux/x86), and in various + locales (LC_ALL=tr_TR in particular, if installed). Test with both + "make check" and the worst cases. 7) For the release itself (not the release candidates), if there are no problems, create a tag with: svn cp .../mpfr/branches/x.y .../mpfr/tags/x.y.z diff --git a/tests/tests.c b/tests/tests.c index 1a828d326..f9a3ebd28 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -1,6 +1,6 @@ /* Miscellaneous support for test programs. -Copyright 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of the MPFR Library. @@ -53,6 +53,36 @@ MA 02110-1301, USA. */ #include "mpfr-test.h" +#ifdef MPFR_FPU_PREC +/* This option allows to test MPFR on x86 processors when the FPU + * rounding precision has been changed. As MPFR is a library, this can + * occur in practice, either by the calling software or by some other + * library or plug-in used by the calling software. This option is + * mainly for developers. If it is used, then the <fpu_control.h> + * header is assumed to exist and work like under Linux/x86. MPFR does + * not need to be recompiled. So, a possible usage is the following: + * + * cd tests + * make clean + * make check CFLAGS="-g -O2 -ffloat-store -DMPFR_FPU_PREC=_FPU_SINGLE" + * + * i.e. just add -DMPFR_FPU_PREC=... to the CFLAGS found in Makefile. + */ + +#include <fpu_control.h> + +static void set_fpu_prec (void) +{ + fpu_control_t cw; + + _FPU_GETCW(cw); + cw &= ~(_FPU_EXTENDED|_FPU_DOUBLE|_FPU_SINGLE); + cw |= (MPFR_FPU_PREC); + _FPU_SETCW(cw); +} + +#endif + static void tests_rand_start (void); static void tests_rand_end (void); static void tests_limit_start (void); @@ -78,6 +108,10 @@ tests_start_mpfr (void) setlocale (LC_ALL, ""); #endif +#ifdef MPFR_FPU_PREC + set_fpu_prec (); +#endif + tests_memory_start (); tests_rand_start (); tests_limit_start (); |