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: PATCH: Add --with-math=sse for x86


On Sun, Aug 10, 2008 at 10:50 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sun, Aug 10, 2008 at 1:40 PM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> 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.
>
> I didn't see any testsuite results which enable SSE math with
> BOOT_CFLAGS, CFLAGS and RUNTESTFLAGS.  Do
> BOOT_CFLAGS and CFLAGS cover run time libraries for
> Ada, Fortran and Java?

They do (if not it might be another option).  Of course you see
testsuite results
with these -- x86-darwin has SSE math by default.  But I don't expect
testresults with --with-math=sse either.

>>>>> 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
>
> I can provide a patch for 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
>
> SSE math is always enabled. My patch just turns it on by default.

This is what I mean.  With -march=core2 you suddenly get the effect of
-march=core2 -mfpmath=sse dependent on how gcc was configured.

>> see the number of "invalid" bugreports caused by this.
>>
>
> You can look at it the other way. If there are many reports against
> --with-math=sse,
> it indicates that users think it is very useful.

No - I say people usually do not know how the gcc they use was configured
(users don't usually build gcc), and the above situation makes it confusing
as to what to expect from the same command line options.

If you really want to improve the "default" situation with a 32bit ABI on
modern x86 CPUs then you should provide an alternate system-wide ABI.

Richard.


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