[llvm-commits] [llvm-gcc-4.0] r42134 - /llvm-gcc-4.0/trunk/gcc/llvm-convert.cpp

Chris Lattner clattner at apple.com
Wed Sep 26 10:32:51 PDT 2007


On Sep 26, 2007, at 9:28 AM, Duncan Sands wrote:

>> To elaborate a bit more: one of the nice features of APFloat is that
>> we never do FP constant folding with host arithmetic operations
>> (everything is done with 'softfloat').  This ensures we get
>> deterministic results, as powerpc long double and x86 long double are
>> very different.  We also do this for float and double since they have
>> similar problems (just not on any architectures we support now) so we
>> might as well handle them for uniformity and to make sure the code is
>> well tested.
>
> How about constant folding calls to functions such as sqrt?

Do you mean sqrt specifically or something more general?

In general, we can extend APFloat to do lots of different math  
functions, including sqrt etc.  In practice, APFloat doesn't do sqrt  
yet, so we use host float/double to do it.

-Chris



More information about the llvm-commits mailing list