This is the mail archive of the gcc@gcc.gnu.org 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: The state of glibc libm


Jeff Law <law@redhat.com> writes:

> On 03/14/2012 10:30 AM, 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.
> The better performance with potential loss of accuracy is an across
> the board request, it's not just a sin/cos issue.  All the trig, exp,
> pow, log, etc, which I don't think are necessarily covered by using
> the old x87 fp unit.

Note that various interesting CPUs (like Atom) have a very slow x87
units and it's generally deprecated and discouraged.

So if you go for a new libm it's better to be SSE only (ideally 
AVX too) and avoid any usage of x87.

One big win alone on 32bit x86 would be to use a SSE ABI for libm
by default.

You may still need some fallback for old CPUs, but this doesn't
need to be terrible optimized.

-Andi
-- 
ak@linux.intel.com -- Speaking for myself only


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