This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] pow and atan2 builtin functions (part 3)
> On Tue, Feb 11, 2003 at 11:28:12AM -0700, Roger Sayle wrote:
> > The constants listed above however cannot be represented exactly
> > in either SF and/or DF mode, requiring an XF mode load.
> Correct. I believe these constants should only be
> matched in XFmode.
> > In theory,
> > different x86 vendors are free to provide different levels of
> > precision for these constants (beyond 80 bits), or use additional
> > hardware to track their use in other x87 instructions, so the use
> > of "fldpi" is not guaranteed to be equivalent to any available
> > "fld st(0)" instruction on a processor.
> Hmm. Does this happen in practice? E.g.
> fst (%esp)
> fld (%esp)
It does not happen (I was checking it some time ago as such patch is
ages on my TODO list too), because all CPU implentations are bug
compatible to original i387. I think we can ignore the fact that
specification is more flexible just because the tradition of x87 makes
it very unlikely that someone will ever make CPU that does behave
differently in this scheme.
> > If you still think standard_80387_constant_p *should* be extended to
> > handle these constants via the usual mechanism, you might consider
> > something like Daniel Jungmann's patch from October 2001:
> > http://gcc.gnu.org/ml/gcc-patches/2001-10/msg01166.html
> > which is actually the third or fourth patch revision resulting
> > from a long thread back when this was last discussed.
> I thought I mentioned at least once on one of those threads
> that recognizing these for SF or DFmode was wrong. Which
> is why I ignored the nth patch that continued to do so.
Perhaps -funsafe-math can, but I am not sure it is good idea either.