This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Perform constant folding of math builtins

On Mon, Aug 26, 2002 at 12:33:46PM -0400, Paul Koning wrote:
> >>>>> "Kaveh" == Kaveh R Ghazi <> writes:
>  >> From: Roger Sayle
>  >> The second is that these values need to be calculated in the
>  >> precision required for the target, so shouldn't use the host
>  >> functions anyway.
>  Kaveh> Why not?  Aren't we talking about "unsafe" math opts?
> The description of that option isn't clear.  But I would read it to
> allow things like optimizations that make the rounding be different,
> or the LSB of the result.  I wouldn't expect it to mean "you can do
> the operation in a precision different from what I asked".  In other
> words, I wouldn't expect the compiler to replace, say, a sqrt of a
> double argument by a sqrt of a float argument.
> Doing constant folding with the host float library could be just as
> drastic.

Also, I went to a fair bit of trouble to get rid of all the places
where we used the host floating point format for target float
operations.  I would prefer that this not get un-done in the name of
constant folding of elementary functions.

This does not have to be efficient.  Why not grab the libm
generic implementation of these functions and adapt it to use the
existing arithmetic emulator?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]