This is the mail archive of the
mailing list for the GCC project.
Re: [BENCHMARK]-mfpmath=sse should disable x387 intrinsics
- From: Roger Sayle <roger at eyesopen dot com>
- To: Uros Bizjak <uros at kss-loka dot si>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 26 Nov 2004 07:08:11 -0700 (MST)
- Subject: Re: [BENCHMARK]-mfpmath=sse should disable x387 intrinsics
On Fri, 26 Nov 2004, Uros Bizjak wrote:
> The default libm uses sse instructions, and the default is -mfpmath=sse.
> Because (as Roger said) the default sse library is faster and more
> accurate than i387 intrinsics, even -mfpmath=i387 should _not_ generate
> i387 intrinsics, but should call sse math library.
It might not be that the SSE library routines themselves are faster,
but it's certainly the case that overhead of the library call and its
operation are less than the inefficiencies of shuffling registers
between SSE and x387 registers just to use the x87 builtins.
For -mfpmath=sse,387 and -mfpmath=387 there's a reasonable expectation
(OK, wild hope) that the arguments required by the builtins will already
be in suitable x87 registers in which case much if not all of the benfit
of calling libm may be lost. Intrinsics are only ever used with
-ffast-math, so the improved accuracy of the library implementations
shouldn't be a factor in these scenarios.
I think we'd need even more benchmarking to support some of your table's
proposals. The current scheme seems reasonable and an improvement on what
was done before. But I am working on a few refinements, such as getting
the -m[no]fancy-math-387 command line option working again of P4 and K8
to provide users more control.