Re: vc8 floating point failure
- From: wade@xxxxxxxxxx
- Date: 11 May 2006 14:02:32 -0700
Phil Frisbie, Jr. wrote:
wade@xxxxxxxxxx wrote:
Compiling http://www.netlib.org/paranoia/paranoia.c with /fp:precise
/O2, /Ot and it shows failures and defects on my machine (P4, 3.4 Ghz).
It isn't at all obvious why that should be. With /fp:strict, or with
optimization turned off, it says the math is fine.
Does anyone know what optimization is causing the problem (and is the
problem consistent with MS's description of :precise)?
Did you read the documentation on /fp:precise?
My interpretation is that /fp:precise leaves intermediate results in extended
x86 precision and only rounds to a 32 bit float or 64 bit double for an
assignment, cast, or when passing to a function.
agreed.
But /fp:strict rounds to float/double precision after EACH calculation, which
slows down x86 code.
I don't think so.
From
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/floapoint.asp:
fp:strict rounding semantics:
"Explicit rounding at assignments, typecasts, and function calls
Intermediate expressions will be evaluated at register precision.
Same as fp:precise."
AFAICT, compared to precise, fp:strict:
- disables contractions (should not matter here)
- will not reorder evaluations (should not matter here, for paranoia,
fp:precise should only reorder when its assumptions are correct, and
the reorder will not change the result).
- allows access to the FPU environment, but paranoia does not make that
access.
- Checks for exceptions earlier, but no paranoia result is dependent on
when an exception occurs.
My simplistic view is that fp:strict is the thing to use when you are
playing with the fp environment, and when you want floating point
exceptions (signalling overflow, divide by zero, etc) to be reported
promptly. paranoia doesn't play with the fp environment, and it
doesn't enable exception semantics.
.
- References:
- vc8 floating point failure
- From: wade
- Re: vc8 floating point failure
- From: Phil Frisbie, Jr.
- vc8 floating point failure
- Prev by Date: unpredictable level 4 warnings on implicit narrowing conversions in STL
- Next by Date: Re: How to this is the best way to implement?
- Previous by thread: Re: vc8 floating point failure
- Next by thread: unpredictable level 4 warnings on implicit narrowing conversions in STL
- Index(es):
Relevant Pages
|