This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: floating point fwaits for i386
- From: Robert Dewar <dewar at adacore dot com>
- To: knott at civilized dot com
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 04 Apr 2006 18:08:41 -0400
- Subject: Re: floating point fwaits for i386
- References: <4432E4C2.1070608@civilized.com>
Gary Knott wrote:
Dear Gnu gcc person,
We have written our own FP exception handler for our
use (because we want 1e155*1e155 to return 1.797...e308 (maxpos),
and not a NaN!, and so on.)
^^^^
I assume you mean plus infinity?
For this to work in our gcc-compiled code, we need gcc to generate
fwaits where needed (after all non-interrupting FP instructions)
so that we can catch the exception at the right time and handle it
appropriately.
For the old gcc 2.91 - 2.96 compilers on i386 architecture, this worked!
For the gcc 3.2 compiler we are trying to use, this no longer works.
(If we put an asm fwait in our test code, good behavior is restored
- but of course we don't want to sprinkle hundreds or thousands of
fwaits everywhere.)
There seems to be no compiler switch to ask for these fwaits
we have tried -ftrapv and many other options.
Not too surprising, the effect on performance should be drastically
horrible, so it is not something you want to encourage.
Could you possibly add a switch -mfwait to the i386 batch of switches
to get us back the capability we need.
Thanks.