diff options
Diffstat (limited to 'generic/tclStrToD.c')
-rwxr-xr-x | generic/tclStrToD.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c index 5db3d66..fbe4105 100755 --- a/generic/tclStrToD.c +++ b/generic/tclStrToD.c @@ -14,7 +14,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStrToD.c,v 1.37 2009/01/09 11:21:46 dkf Exp $ + * RCS: @(#) $Id: tclStrToD.c,v 1.38 2009/07/16 21:24:40 dgp Exp $ * *---------------------------------------------------------------------- */ @@ -68,6 +68,14 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__))); #if defined(__sun) && defined(__i386) && !defined(__GNUC__) #include <sunmath.h> #endif + +/* + * MIPS floating-point units need special settings in control registers + * to use gradual underflow as we expect. + */ +#if defined(__mips) +#include <sys/fpu.h> +#endif /* * HP's PA_RISC architecture uses 7ff4000000000000 to represent a quiet NaN. * Everyone else uses 7ff8000000000000. (Why, HP, why?) @@ -2166,6 +2174,14 @@ TclInitDoubleConversion(void) } bitwhack; #endif +#if defined(__mips) + union fpc_csr mipsCR; + + mipsCR.fc_word = get_fpc_csr(); + mipsCR.fc_struct.flush = 0; + set_fpc_csr(mipsCR.fc_word); +#endif + /* * Initialize table of powers of 10 expressed as wide integers. */ |