This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
FP arithmetic in the compiler (Was: Re: gcc compile-time performance)
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: Jan Hubicka <jh at suse dot cz>
- Cc: Richard dot Earnshaw at arm dot com, gcc at gcc dot gnu dot org
- Date: Tue, 21 May 2002 19:58:49 +0100
- Subject: FP arithmetic in the compiler (Was: Re: gcc compile-time performance)
- Organization: SuperH UK Ltd.
> We need to get the big number high. Unforutnately if we propagate them
> we often build them for small numbers, so the roundoff error propagates
> as well.
> Of course my first version was 32bit integer and it overflowed all them time,
> unfortunately. My second version was floating point and I was asked to rewrite
> it into emulated fp because of the bootstrap misscomparisons happening from
> time to time with the broken FP on i386....
> I am open to the suggestinos, just mentioning what has been already tried.
This is just the kind of scenario for which -ffloat-store has been made. If
we knew that we'd always bootstrap with gcc, we could just build gcc with
-ffloat-store and be done with it.
Now, since we still want to support bootstraps with other compilers, we can
use a native floating-point library instead. In fact, we can implement all
the functions in a herder file as macros or inline functions. The esential
part that gets us the effect of -ffloat-store is to assign the result to a
volatile variable, and read it back from there.
--
--------------------------
SuperH
2430 Aztec West / Almondsbury / BRISTOL / BS32 4AQ
T:+44 1454 462330