The perennial i386 floating-point rounding issue...
Jan Hubicka
jh@suse.cz
Tue Jun 11 03:21:00 GMT 2002
> On Mon, Jun 10, 2002 at 08:03:26PM -0400, Stephen L Moshier wrote:
> > Or maybe we should offer a way to set it ourselves.
>
> This is (in theory) very easy to do. See optimize_mode_switching
> and NORMAL_MODE. It should be relatively easy to modify the
> existing optimize_mode_switching macros to add bits to control
> the rounding mode.
While implementing the mode switching, I had this extension in the mind,
so it is ready to implement it.
Problem is that the performance will rot once more then two modes will
cycle, since CPUs will lose their fast path. One mode counts the
"default" rounding mode, so even rounding to integers will become about
hounderd cycles slower, if I remember properly.
In case program is consistently using doubles, this should not be major
problem and even we should win a bit of performance on faster divides
some chips implements.
>
> I would be very open to a patch that optionally enabled setting
> the rounding precision bits for the computation.
>
> And on a related point, while I may have once argued against
> spilling in 80-bit mode (when not controling computation precision),
> I've been convinced that it's a mistake. So if someone wants to
> work on that as well, please do so. It'll be a bit harder though...
I was trying to hook this into reload, but eventually gave up.
Perhaps more sane way is to use existing promote machinery to promote
doubles/floats to long doubles at RTL generation time. Does this sound
more sane?
Honza
>
>
> r~
More information about the Gcc
mailing list