summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2008-04-01 20:08:20 (GMT)
committerandreas_kupries <akupries@shaw.ca>2008-04-01 20:08:20 (GMT)
commitcd8055c7353838a9624308ed822c450b18d15d4a (patch)
tree1bd55d927a9ce487de1ddf46035603d5dc5e6721 /generic
parent00989310d72fd83734600742be9a06dae2ebe48b (diff)
downloadtcl-cd8055c7353838a9624308ed822c450b18d15d4a.zip
tcl-cd8055c7353838a9624308ed822c450b18d15d4a.tar.gz
tcl-cd8055c7353838a9624308ed822c450b18d15d4a.tar.bz2
* generic/tclStrToD.c: Applied patch for [Bug 1839067] (fp
* unix/tcl.m4: rounding setup on solaris x86, native cc), provided by Michael Schlenker.
Diffstat (limited to 'generic')
-rwxr-xr-xgeneric/tclStrToD.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/generic/tclStrToD.c b/generic/tclStrToD.c
index e5e863b..2b4cde7 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 2008/03/13 17:14:19 dgp Exp $
+ * RCS: @(#) $Id: tclStrToD.c,v 1.34 2008/04/01 20:08:22 andreas_kupries Exp $
*
*----------------------------------------------------------------------
*/
@@ -61,6 +61,13 @@ typedef unsigned int fpu_control_t __attribute__ ((__mode__ (__HI__)));
# define ADJUST_FPU_CONTROL_WORD
#endif
+/* Sun ProC needs sunmath for rounding control on x86 like gcc above.
+ *
+ *
+ */
+#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
+#include <sunmath.h>
+#endif
/*
* HP's PA_RISC architecture uses 7ff4000000000000 to represent a quiet NaN.
* Everyone else uses 7ff8000000000000. (Why, HP, why?)
@@ -1309,6 +1316,9 @@ MakeLowPrecisionDouble(
_FPU_GETCW(oldRoundingMode);
_FPU_SETCW(roundTo53Bits);
#endif
+#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
+ ieee_flags("set","precision","double",NULL);
+#endif
/*
* Test for the easy cases.
@@ -1381,6 +1391,9 @@ MakeLowPrecisionDouble(
#if defined(__GNUC__) && defined(__i386)
_FPU_SETCW(oldRoundingMode);
#endif
+#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
+ ieee_flags("clear","precision",NULL,NULL);
+#endif
return retval;
}
@@ -1427,6 +1440,9 @@ MakeHighPrecisionDouble(
_FPU_GETCW(oldRoundingMode);
_FPU_SETCW(roundTo53Bits);
#endif
+#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
+ ieee_flags("set","precision","double",NULL);
+#endif
/*
* Quick checks for over/underflow.
@@ -1485,6 +1501,9 @@ MakeHighPrecisionDouble(
#if defined(__GNUC__) && defined(__i386)
_FPU_SETCW(oldRoundingMode);
#endif
+#if defined(__sun) && defined(__i386) && !defined(__GNUC__)
+ ieee_flags("clear","precision",NULL,NULL);
+#endif
return retval;
}