This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Effects of newly introduced -mpcX 80387 precision flag
- From: Uros Bizjak <ubizjak at gmail dot com>
- To: Bradley Lucier <lucier at math dot purdue dot edu>
- Cc: gcc mailing list <gcc at gcc dot gnu dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 04 May 2007 12:18:48 +0200
- Subject: Re: Effects of newly introduced -mpcX 80387 precision flag
- References: <D78A6CE9-4B67-46AC-9279-732C64E068C6@math.purdue.edu> <4639FB91.1050802@gmail.com> <821B0FDF-532D-4075-9D87-1D9172BE5AF8@math.purdue.edu> <463A2DE3.7070507@gmail.com> <298F071F-DC91-4903-AD72-F1472B4B9FF6@math.purdue.edu> <463A3828.5080204@gmail.com> <25F60716-EE60-4C83-A9D0-F923A01CA30B@math.purdue.edu>
Bradley Lucier wrote:
What about "significant loss of accuracy" as these options probably
won't cause a nuclear reactor meltdown ;)
Well, I did some googling, and the technical term I was thinking of
was "catastrophic cancellation". So how about
Note that some mathematical routines in such libraries could suffer
significant loss of accuracy, typically through so-called
"catastrophic cancellation", when this option is used to set the
precision to less than extended precision.
I think this is OK. So if nobody objects, this patch is OK for mainline.
I'm sorry, but I don't have checkin privileges.
I have committed following patch attached patch in your name:
2007-05-04 Bradley Lucier <lucier@math.purdue.edu>
* doc/invoke.texi (i386 and x86-64 Options) [-mpc32, -mpc64,
-mpc80]:
Add the note about a significant loss of accuracy of some
mathematical routines when these options are used.
Patch was tested by building the documentation.
Uros.
Index: doc/invoke.texi
===================================================================
--- doc/invoke.texi (revision 124412)
+++ doc/invoke.texi (working copy)
@@ -10129,13 +10129,22 @@
@opindex mpc80
Set 80387 floating-point precision to 32, 64 or 80 bits. When @option{-mpc32}
-is specified, the significand of floating-point operations is rounded to 24
-bits (single precision), @option{-mpc64} rounds the significand of
-floating-point operations to 53 bits (double precision) and @option{-mpc80}
-rounds the significand of floating-point operations to 64 bits (extended
-double precision). Note that a change of default precision control may
-affect the results returned by some of the mathematical functions.
+is specified, the significands of results of floating-point operations are
+rounded to 24 bits (single precision); @option{-mpc64} rounds the the
+significands of results of floating-point operations to 53 bits (double
+precision) and @option{-mpc80} rounds the significands of results of
+floating-point operations to 64 bits (extended double precision), which is
+the default. When this option is used, floating-point operations in higher
+precisions are not available to the programmer without setting the FPU
+control word explicitly.
+Setting the rounding of floating-point operations to less than the default
+80 bits can speed some programs by 2% or more. Note that some mathematical
+libraries assume that extended precision (80 bit) floating-point operations
+are enabled by default; routines in such libraries could suffer significant
+loss of accuracy, typically through so-called "catastrophic cancellation",
+when this option is used to set the precision to less than extended precision.
+
@item -mstackrealign
@opindex mstackrealign
Realign the stack at entry. On the Intel x86, the