This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FP arithmetic in the compiler (Was: Re: gcc compile-time performance)


> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]