summaryrefslogtreecommitdiffstats
path: root/generic/tclStrToD.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2009-07-16 20:50:53 (GMT)
committerdgp <dgp@users.sourceforge.net>2009-07-16 20:50:53 (GMT)
commit5c9038b30eadc53a06bd92249b583ab15f71c1c7 (patch)
treeb5b2733030e6c8eea0ea745246839c42469ecc7c /generic/tclStrToD.c
parent4ddce8d6445b7a711133a230e5c070aeb22f95de (diff)
downloadtcl-5c9038b30eadc53a06bd92249b583ab15f71c1c7.zip
tcl-5c9038b30eadc53a06bd92249b583ab15f71c1c7.tar.gz
tcl-5c9038b30eadc53a06bd92249b583ab15f71c1c7.tar.bz2
* generic/tclCmdIL.c: Removed unused variables.
* generic/tclCompile.c: * generic/tclVar.c: * unix/tclUnixChan.c: * generic/tclScan.c: Typo in ACCEPT_NAN configuration. * generic/tclStrToD.c: Set floating point control register on MIPS systems so that the gradual underflow expected by Tcl is in effect. [Bug 2819200]
Diffstat (limited to 'generic/tclStrToD.c')
-rwxr-xr-xgeneric/tclStrToD.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index c47c5f8..453a34c 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.33.2.1 2008/04/01 20:12:01 andreas_kupries Exp $
+ * RCS: @(#) $Id: tclStrToD.c,v 1.33.2.2 2009/07/16 20:50:54 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?)
@@ -2158,6 +2166,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.
*/