[PATCH,spu]: generate inline code for divdf3

Ulrich Weigand uweigand@de.ibm.com
Thu Jun 19 15:47:00 GMT 2008


Trevor Smigiel wrote:

> I've attached an alternate implementation for divdf3 (and divv2df3).
> This implementation properly handles Inf, zero, NaN and exponents that
> are out of the range [-126..128], except for 1023 and 1024. It doesn't
> do anything special for IEEE exceptions (DBZ, etc.)
> 
> The current implementation uses frds which doesn't deal well with
> doubles that don't fit in a single precision float.  So, I'm inclined to
> replace it with a call to the attached out-of-line version.  Do you have
> any objections to that?

Well, as Sa mentioned, we have use cases where just the fact that we make
an out-of-line call to implement division drastically affects the performance
of applications (due to unhinted branches etc).  Therefore we'd really like
to keep the ability to inline divdf ...   Maybe this could be made 
dependent on optimize_size?

Of course, replacing the inlined version by something that does not use
frds would be nice.  Also, inlined versions could be tuned according to
the various -ffast-math related switches.
 
> Also, what do you think about making the attached version the default
> even without -ffinite-math-only?   It is much faster and smaller than
> the default provided by libgcc.

Well, if it handles Inf/NaN correctly, there is no need to guard that
implementation by -ffinite-math-only.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com



More information about the Gcc-patches mailing list