This is the mail archive of the gcc-patches@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: [BENCHMARK]-mfpmath=sse should disable x387 intrinsics


On Fri, 26 Nov 2004, Uros Bizjak wrote:
> K8:
> 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.

Roger
--


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