Change x86 default arch for 4.5?
Richard Guenther
richard.guenther@gmail.com
Mon Feb 22 10:39:00 GMT 2010
On Mon, Feb 22, 2010 at 11:27 AM, Andrew Haley <aph@redhat.com> wrote:
> On 02/21/2010 12:13 PM, Richard Guenther wrote:
>> On Sun, Feb 21, 2010 at 1:06 PM, Geert Bosch <bosch@adacore.com> wrote:
>>>
>>> On Feb 21, 2010, at 06:18, Steven Bosscher wrote:
>>>> My point: gcc may fail to attract users (and/or may be losing users)
>>>> when it tries to tailor to the needs of minorities.
>>>>
>>>> IMHO it would be much more reasonable to change the defaults to
>>>> generate code that can run on, say, 95% of the computers still in use.
>>>> If a user want to use the latest-and-greatest gcc for a really old
>>>> machine, the burden of adding extra flags to change the default
>>>> behavior of the compiler should be on that user.
>>>>
>>>> In this case of the i386 back end, that probably means changing the
>>>> default to something like pentium3.
>>>
>>> The biggest change we need to make for x86 is to enable SSE2,
>>> so we can get proper rounding behavior for float and double,
>>> as well as significant performance increases.
>>
>> I think Joseph fixed the rounding behavior for 4.5. Also without an adjusted
>> ABI you'd introduce x87 <-> SSE register moves which are not helpful
>> for performance.
>
> Exactly. For example,
>
> double plus(double a, double b)
> {
> return a+b;
> }
>
> plus:
> pushl %ebp
> movl %esp, %ebp
> subl $8, %esp
> movsd 16(%ebp), %xmm0
> addsd 8(%ebp), %xmm0
> movsd %xmm0, -8(%ebp)
> fldl -8(%ebp)
> leave
> ret
Yep. As the issue only concerns return values we could start to
return in both %sp0 and %xmm0 for externally visible functions.
That would still have a spurios set of %sp0 and FP stack adjustment
but the caller could use %xmm0 and hope performance wouldn't
be affected too much. Of course that's an ABI change that is
only compatible in one direction.
Richard.
More information about the Gcc
mailing list