Is SSE FP ABI breaking on i386?
Jan Hubicka
jh@suse.cz
Fri Feb 16 03:41:00 GMT 2001
> This is really not true. It just is a GCC bug that we cut off precision
> when spilling floating point registers containing doubles. Cutting of
> FP registers to double is *only* allowed when the rounding mode is set
> to round at 53 bits. In any other case one would get in effect double
> rounding for the addition, subtraction, division, multiplication and
> square root, and the final accurracy is *worse* than for regular IEEE
> double arithmetic.
This is interesting point too. I've already tried to teach reload to use
XFmode for spilling doubles but didn't know that it is needed for ABI.
This also means that the -ffloat-store gives worse results than IEEE?
Can you explain me in more detail why the double rounding cause troubles?
>
> The issue is of course that GCC currently does not implement correct
> IEEE double operation due to the extra precision internally, but at least
> having this extended precision for entire expressions helps with knowing
> that you'll have at most one double rounding.
OK, so we should make gcc use XFmode spilling for doubles and keep SFmode
spilling for floats for performance reasons.
But this is unrelated to the original problem. Do you have comments for that
one?
At least gcc is still allowed to do the spill after each float instruction. I
really don't believe that the C99 standard is trying to introduce that constant
to allow application to gain benefit from extra precisity - if you need long
double precisity, you should use long double. Instead I believe it is targeted
to avoid application from requiring the particular rounding for corect
operation - such as newtonian approximation that don't terminate if the
spilling occour on "good" places.
Thanks,
Honza
>
> Geert
>
More information about the Gcc
mailing list