This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: why not consfold sin(const)
- From: Luchezar Belev <l_belev at yahoo dot com>
- To: Robert Dewar <dewar at gnat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Sun, 19 Sep 2004 12:31:07 -0700 (PDT)
- Subject: Re: why not consfold sin(const)
Robert Dewar wrote:
> Luchezar Belev wrote:
>
> > OK, but in our concrete case we already have some optimizing logic in place
> > which looks if the argument of sin() is zero or if the argument of log() is one,
> > and in the case of sqrt always replaces with const. So if this already present
> > logic is worth enough to be there in the compiler, i fail to see why a full consfolder
> > is not worth enough. It's definitely not the case that it's something too complex
> > for implementing. In fact it's exactly as complex as the currently present logic.
>
> Not at all, it is far more complex to implement, since you need a very
> accurate set of target independent elementary function routines (you
> can't just go calling these routines from the compiler and using the
> host functions!)
>
> > Surely the precision is not much of an issue either, since -ffast-math
> > implies possible non-strict copliance with standards, precision requirements, etc.
>
> Yes, but it does not stretch as far as giving complete junk results,
> which is what would happen in some cases if you used host functions.
I see. I'm surprised that in the compiler there is no sin/cos/log/etc. funcs
already implemented for other reasons.
What are the requirements for possible implementation of such functions?
- precision of somewhere about the long double (64-bit mantissa)
- the speed doesn't matter too much
is this right?
Lucho
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com