This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Add --with-math=sse for x86
On Sun, Aug 10, 2008 at 10:07 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Aug 10, 2008 at 12:29 PM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>
>>>> 1. Provide a way to configure gcc to generate faster 32bit FP code, which
>>>> can run on majority of today's processors.
>>>> 2. Provide a way to test SSE math in 32bit with existing gcc testsuite.
>>
>> Oh, and 2. is possible with RUNTESTFLAGS="--target_board=unix/-mfpmath=sse".
>
> RUNTESTFLAGS="--target_board=unix/-mfpmath=sse" won't catch bootstrap
> issues, which I ran into with --with-math=sse. One of run-time
> libraries failed to
> build.
We have BOOT_CFLAGS and CFLAGS for this. I don't think this should be an
argument for or against this option.
>> Are you concerned about the SPEC rules limit for the number of compiler options
>> for base numbers??
>
> Not really.
>
>>> 3. With the current x86 ABI it pessimizes -Os due to extra moves between
>>> the x87 stack and SSE registers. This also pessimizes interfacing to all
>>> system libraries.
>
>>> I think the user is better advised to choose -mfpmath=sse only for carefully
>>> selected cases.
>>>
>
> I think it should be up to gcc users to decide.
Which is why we have the -mfpmath option. The possibility of enabling that by
default only increases confusion. Your patch misses updates to
user-level documentation
that now choosing -march=X with X being an SSE2 capable CPU may enable
using SSE math, but only dependent on the way gcc was configured. I can already
see the number of "invalid" bugreports caused by this.
Richard.