This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: The state of glibc libm


On 03/14/2012 06:08 PM, Joseph S. Myers wrote:
> On Wed, 14 Mar 2012, Marc Glisse wrote:
>
>> On Wed, 14 Mar 2012, Joseph S. Myers wrote:
>>
>>> I'd say that "better performance with the potential loss of accuracy"
>>> should be covered by -ffast-math - that GCC should generate direct use of
>>> fsin/fcos instructions for sin/cos for -O2 -funsafe-math-optimizations on
>>> x86_64, as it does on x86, unless there is some reason to think they would
>>> perform worse than the out-of-line implementation.
>> Last time I did some timings (maybe 4 years ago), for double, fsin was slower
>> than the libm software implementation compiled for x87, which was itself
>> slower than the same implementation compiled for sse. And the software
>> implementation was more precise than fsin. My conclusion was to ignore fsin
>> from then on.
> Interesting - hopefully that means the glibc changes Andreas Jaeger and I 
> have been working on to stop using fsin etc. (in the interests of accuracy 
> and fixing the sincos issues discussed lately) won't actually make 
> performance worse.
>
For PowerPC I observed that both sin/cos/tan from double implementation is way
faster than the float one (at least for newer PPC chips). I'm not sure if this is
true for Intel chips too, but in future maybe a good idea try to use the 
IBM Accurate Mathematical Library instead of the old Sun implementation for floats.


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