[PATCH] Support Cell SPU floating point

Ian Lance Taylor iant@google.com
Wed Sep 5 17:52:00 GMT 2007


Mark Mitchell <mark@codesourcery.com> writes:

> Ian Lance Taylor wrote:
> 
> > If we do change this it's going to change for everybody, which would
> > seem to be an unexpected silent change.  Are we confident that it is
> > the right choice?  For people writing casual floating point code, it
> > seems to me that it will be the wrong choice, just as most people
> > prefer the compiler to generate fused multiply-add instructions.
> 
> Why will it be the wrong choice?  I'd expect that what most people want
> >From the compiler is to fold floating-point constants exactly as the
> hardware would.  (In some cases, that might even mean having options to
> say things like what rounding mode you want at compile-time, just as can
> at run-time.)  Who would be upset for the compiler to behave that way?

Think about fused multiply-add.  Folding constants exactly as the
hardware would is rather complicated, since it depends on just which
instructions are used to perform the floating point computations.

You're right that I was too strong in saying that using the hardware
floating point precision will generally be the wrong choice.  I think
typical programmers would prefer that their floating point
computations be done in infinite precision.  But I also think that
typical programmers won't notice one way or the other.

Ian



More information about the Gcc-patches mailing list