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 2:29 PM, Richard Guenther
<richard.guenther@gmail.com> wrote:
>>> 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.

x86-darwin isn't the same as --with-math=sse since it uses a different
ABI. For

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37055

i686-darwin only failed with a few testcase, but
--with-math=sse failed to build one of run-time
libraries.

You will see  --with-math=sse results on a regular basis from
me if my patch is accepted.

>>>>>> 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.

You will turn on -mfpmath=sse by default only if you configure gcc with
--with-math=sse. It has nothing to do with -march=core2. Of cause,
-march=i686 will turn off SSE math automatically.

--with-math=sse is the same as adding -msse2 -mfpmath=sse to
gcc command line.

>>> 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.

It has already happened when you configure gcc with --with-arch and
--with-cpu. It is a good thing for "gcc -v" to report configure option.

> 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.
>

It is very unlikely to happen since it isn't binary compatible with
existing binaries.


-- 
H.J.


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